NRPE: Unable to read output

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.
Locked
Mooash
Posts: 3
Joined: Tue Mar 19, 2013 11:59 pm

NRPE: Unable to read output

Post 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.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: NRPE: Unable to read output

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NRPE: Unable to read output

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE: Unable to read output

Post 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!
Locked