I'm trying to monitor java memory usage using nagios nrpe features. So I download and install check_jstat and install the plugin on the remote server. And when I ran it below is the result:
OK: jstat process 819 alive|pid=819 heap=344409;3072000;11;-1;-1 perm=156121;1198080;13;-1;-1
When I run it from the nagios server I'm getting :
root@ip-xx-xx-xx-xx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.5.84 -c check_jstat
NRPE: Unable to read output
root@ip-xx-xx-xx-xx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.5.84 -c check_jstat -w 80 -c 90
NRPE: Unable to read output
Below is my config:
On the remote server :
command[check_jstat]=sudo /usr/lib/nagios/plugins/check_jstat -p `pgrep java` -w 85 -c 95
On the Nagios Server:
define service{
use generic-service ; Name of service template to use
host_name JA_Staging
service_description Java Mem Usage
check_command check_nrpe!check_jstat!
notifications_enabled 1;
}
I'm pretty sure the Nagios is unable to handle the output or doesn't understand the format... Please help.