Page 1 of 3

NRPE: Unable to read output check_load

Posted: Tue Jul 22, 2014 3:39 am
by pianunix
Hi,

Today i had the same problem when trying to check_load using this command :

/usr/lib/nagios/plugins/check_nrpe -H server43012x -c check_load
NRPE: Unable to read output

After reproduce in every post that i;m search still can't solve this. Does anyone know how to fix this ?

Thanks.

Mod Edit: Also mentioned here - http://support.nagios.com/forum/viewtop ... 05#p106405

Re: NRPE: Unable to read output check_load

Posted: Tue Jul 22, 2014 10:33 am
by slansing
Can you attach your nrpe.cfg from that remote host here so we can see your command definition? Thanks!

Re: NRPE: Unable to read output check_load

Posted: Tue Jul 22, 2014 8:32 pm
by pianunix
Hi,

The command from the remote host looks good

# /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
CRITICAL - load average: 23.66, 23.07, 22.93|load1=23.660;15.000;30.000;0; load5=23.070;10.000;25.000;0; load15=22.930;5.000;20.000;0;

Thx.

Re: NRPE: Unable to read output check_load

Posted: Wed Jul 23, 2014 1:27 am
by Box293
What happens when you test if NRPE is listening?

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H server43012x

Re: NRPE: Unable to read output check_load

Posted: Wed Jul 23, 2014 1:42 am
by pianunix
^ Ithinkg looks good

~# /usr/lib/nagios/plugins/check_nrpe -H server43012x
NRPE v2.15

Any solution ?

Thanks.

Re: NRPE: Unable to read output check_load

Posted: Wed Jul 23, 2014 2:03 am
by Box293
We know that NRPE is listening so thats good.

I noticed in your nrpe.cfg file that the nrpe_user is defined as "nrpe".
pianunix wrote:The command from the remote host looks good

# /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
CRITICAL - load average: 23.66, 23.07, 22.93|load1=23.660;15.000;30.000;0; load5=23.070;10.000;25.000;0; load15=22.930;5.000;20.000;0;
When executing this command on the remote host, are you doing it as the nrpe user?

Code: Select all

su nrpe
/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
Also, lets check some file permissions:

Code: Select all

ls -al /usr/lib/nagios/plugins/

Re: NRPE: Unable to read output check_load

Posted: Wed Jul 23, 2014 2:29 am
by pianunix
Hi,

No i didn't.

Code: Select all

# su nrpe
This account is currently not available.

Code: Select all

# id nagios
uid=496(nagios) gid=497(nagios) groups=497(nagios)
Should i use nrpe user for this ?

Fyi: on the debian machine i was sucessfull doing this, by adding this line into /etc/sudoers on the remote host.

Code: Select all

nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/check_load
But when i trying on centos machine this trick didn't work at all.

Thanks.

Re: NRPE: Unable to read output check_load

Posted: Wed Jul 23, 2014 3:18 pm
by lmiltchev
Is there any reason why you changed the defalt nrpe user/group from nagios to nrpe?

Have you tried changing the following two lines from this:

Code: Select all

nrpe_user=nrpe
nrpe_group=nrpe
to this:

Code: Select all

nrpe_user=nagios
nrpe_group=nagios
and restarting the daemon?

Re: NRPE: Unable to read output check_load

Posted: Thu Jul 31, 2014 2:46 am
by pianunix
Hi,

Still wont work at all.

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H server43012x -c check_load
NRPE: Unable to read output

Re: NRPE: Unable to read output check_load

Posted: Thu Jul 31, 2014 3:23 am
by turboscrew
One way to check further is to set "debug=1" in your nrpe.cfg.
Then you can check the last lines of "journalctl --system" (works like 'less')
It should output something like:

Code: Select all

Jul 25 23:07:29 nrpecomputer nrpe[9645]: Connection from 127.0.0.1 port 44715
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Host address is in allowed_hosts
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Handling the connection...
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Host is asking for command 'check_all_disks' to be run...
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Running command: /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vda
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Command completed with return code 0 and output: DISK OK - free space: / 8139 MB (85% inode=92%);| /=1373MB;7960;8955;0;9951
Jul 25 23:07:29 nrpecomputer nrpe[9645]: Return Code: 0, Output: DISK OK - free space: / 8139 MB (85% inode=92%);| /=1373MB;7960;8955;0;9951
Jul 25 23:07:29 nrpecomputer nrpe[9645]: [30B blob data]