我正在尝试使用nagios nrpefunction来监视Java内存使用情况。 所以我下载并安装check_jstat并在远程服务器上安装插件。 当我跑下面是结果:
OK: jstat process 819 alive|pid=819 heap=344409;3072000;11;-1;-1 perm=156121;1198080;13;-1;-1
当我从nagios服务器运行它时,我得到:
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
以下是我的configuration:
在远程服务器上:
command[check_jstat]=sudo /usr/lib/nagios/plugins/check_jstat -p `pgrep java` -w 85 -c 95
在Nagios服务器上:
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; }
我很确定Nagios无法处理输出或不理解格式…请帮助。