Page 1 of 1

NRPE: Unable to read output

Posted: Fri Jun 07, 2013 2:00 am
by Mooash
Hi guys,

I'm trying to get Nagios to check that some procs are running on a CentOS 5 server however when I get NRPE to check it, I get the output below:

Code: Select all

NRPE: Unable to read output
The query in question is below:

Code: Select all

command[check_local_lfd]=sudo /usr/local/nagios/libexec/check_procs -c 1: -C lfd
When I run the command locally on the machine NRPE is querying I get the output below:

Code: Select all

[root@root ~]# sudo /usr/local/nagios/libexec/check_procs -c 1: -C lfd
PROCS OK: 2 processes with command name 'lfd'
My sudoers file contains the following:

Code: Select all

nagios  ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_procs
And NRPE is running as the user nagios and the group nagios

I'm hoping I've supplied enough information!

Any help would be greatly appreciated.

Re: NRPE: Unable to read output

Posted: Fri Jun 07, 2013 3:34 am
by gshergill
Hi Mooash,

From your Nagios server, can you run from the plugins folder;

Code: Select all

./check_nrpe -H <remote host>
Also, can you post the NRPE command you are using from the Nagios server?

Although by the looks of it, I'm pretty sure the issue is that your nrpe.cfg has "sudo" in it.

Thank you.

Kind Regards,

Gary Shergill

Re: NRPE: Unable to read output

Posted: Fri Jun 07, 2013 9:34 am
by abrist
gshergill is right, as usual.

@Mooash, if you have not seen the nrpe troubleshooting doc, it is worth a download and peruse if you are implementing multiple nrpe checks:
http://library.nagios.com/library/produ ... -solutions

Re: NRPE: Unable to read output

Posted: Fri Jun 07, 2013 9:35 am
by slansing
Yes that sudo can cause issues, there is no way to sudo into running a command from within the nrpe.cfg, please share the info Gshergill requested as well! Thanks!