Hi Everyone,
im using Logstash's JMX Plugin to get JVM metrics of server, where i enabled JMX port and Remote connection access. i created JVM-Monoitoring.conf config file as follows:
input
{
jmx{
path => "C:\Users\nakn\Downloads\logstash-6.1.1\config\jmx"
polling_frequency => 60
nb_thread => 4
type => jmx
}
}
filter
{
it [type] == "jmx" {
if ("Memory.HeapMemoryUsage" in [metric_path] or "Memory.NonHeapMemoryUsage" in [metric_path]) {
ruby {
code => "event['memoryUsage'] = event['metric_value_number'] * 100"
add_tag => [ "memoryUsage" ]
}
}
}
}
output
{
stdout { codec => rubydebug }
elasticsearch
{
hosts => "localhost:9200"
index => "jmxanalysis"
}
}
within specified path of input section, i have json config to specify which host,port and metrics to retrieve as follows:
{
"host":"service:jmx:rmi://localhost/jndi/rmi://localhost:8075/jmxrmi",
"port":8075,
"alias":"defaultJmx",
"queries":[
{
"object_name":"java.lang:type=Memory",
"object_alias":"Memory"
},
{
"object_name":"java.lang:type=Runtime",
"attributes":[
"Uptime",
"StartTime"
],
"object_alias":"Runtime"
}
]
}//end of file
i dont know why JMX is not able to get data from JMX port?? i tried running logstash from command prompt as " logstash -f JVM-Monitoring.conf ", logstash is getting started but at the end it is terminating without displaying data!!
Thanks and regards,
NAveena K N