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.
nagendra verma
Posts: 8
Joined: Sat Apr 20, 2013 12:30 am

NRPE: Unable to read output

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRPE: Unable to read output

Post 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?
Former Nagios employee
nagendra verma
Posts: 8
Joined: Sat Apr 20, 2013 12:30 am

Re: NRPE: Unable to read output

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

Re: NRPE: Unable to read output

Post 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?
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.
nagendra verma
Posts: 8
Joined: Sat Apr 20, 2013 12:30 am

Re: NRPE: Unable to read output

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

Re: NRPE: Unable to read output

Post by abrist »

Have you restarted nrpe on the remote system since the command name change?
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.
nagendra verma
Posts: 8
Joined: Sat Apr 20, 2013 12:30 am

Re: NRPE: Unable to read output

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

Re: NRPE: Unable to read output

Post 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
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.
nagendra verma
Posts: 8
Joined: Sat Apr 20, 2013 12:30 am

Re: NRPE: Unable to read output

Post 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
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 »

What plugin are you actually trying to run?
Locked