Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
The problem is most likely permissions. To check what was going on, I executed the script as the nagios user on the remote machine:
bash /usr/lib/nagios/plugins/contrib/check_jmx -U service:jmx:rmi:///jndi/rmi://localhost:8997/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 10000000 -c 100000000 /usr/lib/nagios/plugins/contrib Exception in thread “main” java.lang.NoClassDefFoundError: org/nagios/JMXQuery Caused by: java.lang.ClassNotFoundException: org.nagios.JMXQuery at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Was the output. the issue was the permissions of the jmxquery.jar file:
root@dvl_app-1:/usr/lib/nagios/plugins/contrib# ls -al total 56 drwxrwxr-x 2 root root 4096 2011-09-19 10:47 . drwxrwxr-x 3 root root 4096 2011-09-16 17:04 .. -r-xr-xr-x 1 root root 28423 2011-09-16 17:04 check_diskio -rwxr-xr-x 1 nagios nagios 177 2011-09-19 10:52 check_jmx -rwx—— 1 root root 13225 2011-09-19 09:55 jmxquery.jar
Was what I had. To fix I ran: chown nagios.nagios /usr/lib/nagios/plugins/contrib/jmxquery.jar
and from my nagios monitoring machine I ran:
/usr/local/nagios/libexec/check_nrpe -H 184.73.5.19 -c check_jmx JMX CRITICAL HeapMemoryUsage.used=233372176{committed=266797056;init=0;max=266797056;used=233372176}