Check_jmx

Using Nagios Core 3.2.1
Ubuntu Server 8.10 -i386

check_jmx works directly, no problem, java version 1.6.0_19 installed and in the profile set for all users.

root@monitor:/usr/local/nagios/libexec# ./check_jmx -U service:jmx:rmi:///jndi/rmi://redflag-app2:8686/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsag
e -K used -w 853645722 -c 960351437 --username admin --password nr2p2n6e -u B
JMX OK - HeapMemoryUsage.used = 595087896B | ‘HeapMemoryUsage used’=595087896B;853645722;960351437;

Getting this error on the Nagios web interface ???
check_jmx CRITICAL 05-21-2010 09:51:54 0d 13h 53m 2s 1/1 JMX CRITICAL - java not found.

Does anyone have any ideas, bugging the hell out of me.

Thx

try running it as user nagios instead of user root. if that works check that the plugin works if run in a script in crontab as user nagios.