NRPE: Unable to read output - Custom Plugin Script

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
bolson

Re: NRPE: Unable to read output - Custom Plugin Script

Post by bolson »

And please remember to issue:

Code: Select all

service xinetd restart
Then run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
From the nrpe host and post the result.

Thank you!
pmoradiya
Posts: 26
Joined: Fri Oct 06, 2017 9:48 am

Re: NRPE: Unable to read output - Custom Plugin Script

Post by pmoradiya »

bolson wrote:The correct syntax differs between nrpe.cfg (comma delimited) and /etc/xinetd.d/nrpe (space delimited)

Are the hosts delimited by a space in /etc/xinetd.d/nrpe?
Yes. hosts are delimited by space in /etc/xinetd.d/nrpe

Code: Select all

only_from       = 127.0.0.1 10.0.0.208
and by comma in nrpe.cfg

Code: Select all

allowed_hosts=127.0.0.1,10.0.0.208
bolson

Re: NRPE: Unable to read output - Custom Plugin Script

Post by bolson »

Have you restarted the xinetd service and are you still experiencing the same issue?
pmoradiya
Posts: 26
Joined: Fri Oct 06, 2017 9:48 am

Re: NRPE: Unable to read output - Custom Plugin Script

Post by pmoradiya »

bolson wrote:Have you restarted the xinetd service and are you still experiencing the same issue?
That is correct.

I have also tried directly using check_jvm plugin and updated my NRPE command as below:

Code: Select all

command[check_tomcat_heap]=/usr/bin/sudo -u tomcat7 /usr/local/nagios/libexec/check_jvm -n org.apache.catalina.startup.Bootstrap -p heap -w 1466538393 -c 1780796620

root@prod-server-1:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_tomcat_heap
NRPE: Unable to read output
pmoradiya
Posts: 26
Joined: Fri Oct 06, 2017 9:48 am

Re: NRPE: Unable to read output - Custom Plugin Script

Post by pmoradiya »

Quick update..

It got resolved by adding the following line for nagios in sudoers file.

Code: Select all

nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/
in place of..

Code: Select all

nagios ALL= NOPASSWD: /usr/local/nagios/libexec/

Code: Select all

root@prod-server-1:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_tomcat_heap
OK 882M |max=4151836672;;; commited=2028941312;;; used=924281928;;;
Thank you so much for your support and prompt responses.

-
PM
bolson

Re: NRPE: Unable to read output - Custom Plugin Script

Post by bolson »

Glad to hear it. Thank you for using the Nagios Support Forum!
Locked