Last active
June 25, 2016 08:11
-
-
Save pichuang/3295dda2df83e2a4e7a7e0d87a7686b7 to your computer and use it in GitHub Desktop.
jmx + karaf + logstash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jmx { | |
path => "/etc/logstash/jmx.conf" | |
polling_frequency => 15 | |
type => "jmx" | |
nb_thread => 4 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//Required, JMX listening host/ip | |
"host" : "192.168.1.2", | |
//Required, JMX listening port | |
"port" : 1335, | |
//Optional, the username to connect to JMX | |
"username" : "user", | |
//Optional, the password to connect to JMX | |
"password": "pass", | |
//Optional, use this alias as a prefix in the metric name. If not set use <host>_<port> | |
"alias" : "test.homeserver.elasticsearch", | |
//Required, list of JMX metrics to retrieve | |
"queries" : [ | |
{ | |
//Required, the object name of Mbean to request | |
"object_name" : "java.lang:type=Memory", | |
//Optional, use this alias in the metrics value instead of the object_name | |
"object_alias" : "Memory" | |
}, { | |
"object_name" : "java.lang:type=Runtime", | |
//Optional, set of attributes to retrieve. If not set retrieve | |
//all metrics available on the configured object_name. | |
"attributes" : [ "Uptime", "StartTime" ], | |
"object_alias" : "Runtime" | |
}, { | |
//object_name can be configured with * to retrieve all matching Mbeans | |
"object_name" : "java.lang:type=GarbageCollector,name=*", | |
"attributes" : [ "CollectionCount", "CollectionTime" ], | |
//object_alias can be based on specific value from the object_name thanks to ${<varname>}. | |
//In this case ${type} will be replaced by GarbageCollector... | |
"object_alias" : "${type}.${name}" | |
}, { | |
"object_name" : "java.nio:type=BufferPool,name=*", | |
"object_alias" : "${type}.${name}" | |
} ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment