NRPE: Unable to read output
-
- Posts: 8
- Joined: Sat Apr 20, 2013 12:30 am
NRPE: Unable to read output
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
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
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
-
- Posts: 8
- Joined: Sat Apr 20, 2013 12:30 am
Re: NRPE: Unable to read output
Yes I am running NRPE through xinetd ; I am having other plugins there like check_load every one is working fine.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?
Re: NRPE: Unable to read output
Can you run your script locally on the remote host? If so, run the following command afterwards to check the exit code:
Can you post the custom script and the command/service configuration from core?
Code: Select all
echo $?
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.
"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.
-
- Posts: 8
- Joined: Sat Apr 20, 2013 12:30 am
Re: NRPE: Unable to read output
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
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
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.
"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.
-
- Posts: 8
- Joined: Sat Apr 20, 2013 12:30 am
Re: NRPE: Unable to read output
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
This error is usually due to path issues, or sudo issues. Lets check the sudoer tty settings:
Additionally, lets run the check through nrpe, but from the remote host:
Code: Select all
cat /etc/sudoers | grep tty
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.
"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.
-
- Posts: 8
- Joined: Sat Apr 20, 2013 12:30 am
Re: NRPE: Unable to read output
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
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
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: NRPE: Unable to read output
What plugin are you actually trying to run?