Page 1 of 2

NRPE: Unable to read output

Posted: Thu Feb 20, 2014 12:09 am
by nagendra verma
Hi!

when I am calling from server /usr/local/nagios/libexec/check_nrpe -H ip address -c myplugin

I am getting NRPE: Unable to read output

I have added in /etc/sudoers file
nagios ALL = NOPASSWD:/usr/local/nagios/libexec/myplugin
and added in nrpe.cfg file
command[myplugin]=sudo /usr/local/nagios/libexec/myplugin

now from server machine /usr/local/nagios/libexec/check_nrpe -H ip address -c myplugin
Again I am getting NRPE: Unable to read output

As a nagios user on client I am running sudo myplugin its giving desired output

What is the problem I am not getting could any one please help me.


Thanks

Re: NRPE: Unable to read output

Posted: Thu Feb 20, 2014 10:31 am
by tmcdonald
Are you running NRPE through xinetd or stand-alone? If the second, did you allow it through the firewall? Did you add the server's IP into your allowed_from in your nrpe.cfg?

Re: NRPE: Unable to read output

Posted: Fri Feb 21, 2014 6:14 am
by nagendra verma
tmcdonald wrote:Are you running NRPE through xinetd or stand-alone? If the second, did you allow it through the firewall? Did you add the server's IP into your allowed_from in your nrpe.cfg?
Yes I am running NRPE through xinetd ; I am having other plugins there like check_load every one is working fine.

Re: NRPE: Unable to read output

Posted: Fri Feb 21, 2014 1:24 pm
by abrist
Can you run your script locally on the remote host? If so, run the following command afterwards to check the exit code:

Code: Select all

echo $?
Can you post the custom script and the command/service configuration from core?

Re: NRPE: Unable to read output

Posted: Sun Feb 23, 2014 11:19 pm
by nagendra verma
With nagios login on remote host I am able to rum myplugin only with sudo permission
like sudo myplugin now I am getting desired output without sudo I am getting nothing.
on local machine myplugin is working now command echo $? giving output 0

I have added nagios ALL=(ALL) NOPASSWD: ALL on sudoers file then in nrpe.cfg

command[myplugin]=sudo /usr/local/nagios/libexec/myplugin

Re: NRPE: Unable to read output

Posted: Mon Feb 24, 2014 11:15 am
by abrist
Have you restarted nrpe on the remote system since the command name change?

Re: NRPE: Unable to read output

Posted: Wed Feb 26, 2014 1:18 am
by nagendra verma
abrist wrote:Have you restarted nrpe on the remote system since the command name change?

Yes I have restarted my nrpe using sudo /etc/init.d/xinetd restrat its sucessfully restarted ,but the problem did not solve.

Re: NRPE: Unable to read output

Posted: Wed Feb 26, 2014 11:37 am
by abrist
This error is usually due to path issues, or sudo issues. Lets check the sudoer tty settings:

Code: Select all

cat /etc/sudoers | grep tty
Additionally, lets run the check through nrpe, but from the remote host:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost -c myplugin

Re: NRPE: Unable to read output

Posted: Thu Feb 27, 2014 2:15 am
by nagendra verma
checking these commands on nagios login
cat /etc/sudoers | grep tty
its giving
cat: /etc/sudoers: Permission denied

now running sudo cat /etc/sudoers | grep tty
its giving
Defaults requiretty

on running /usr/local/nagios/libexec/check_nrpe -H remote host ip -c myplugin
its giving.
NRPE: Unable to read output

Re: NRPE: Unable to read output

Posted: Thu Feb 27, 2014 10:32 am
by slansing
What plugin are you actually trying to run?