We are trying to monitor JMX with Nagios XI and using check_jmx Plugin. Its working fine for Heap memory, thread count etc..We re facing issue on while using the following:
obj": "java.lang:type=MemoryPool,name=Par Eden Space",
"attr": [
"Usage"] ],
"obj": "java.lang:type=GarbageCollector,name=PS MarkSweep",
attributes: [CollectionCount,
CollectionTime]
We tried varios options but as there is space in name its no getting. SO can anyon ehelp how we can specify name with spaces.
check_jmx -U service:jmx:rmi:///jndi/rmi://localhost:9199/jmxrmi -O java.lang:type=GarbageCollector,name='PS MarkSweep' -A CollectionCount -K duration -u ms -vvvv -w 10 -c 10
JMX CRITICAL java.lang:type=GarbageCollector,name=PS connecting to java.lang:type=GarbageCollector,name=PS by URL service:jmx:rmi:///jndi/rmi://localhost:9199/jmxrmijavax.management.InstanceNotFoundException: java.lang:type=GarbageCollector,name=PS
Can any one please help us.
Fixed it by applying the following patch in which we added quotes for $@ on file check_jmx