Page 2 of 4

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Tue May 12, 2015 7:46 am
by xerez

Code: Select all

nagios@localhost:/usr/local/nagios/libexec$ sudo su nagios
[sudo] password for nagios:
Sorry, user nagios is not allowed to execute '/bin/su nagios' as root on localhost.

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Tue May 12, 2015 9:01 am
by jdalrymple
You're already the nagios user - just execute /usr/local/nagios/libexec/check_uptime

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Wed May 13, 2015 2:20 am
by xerez
Sorry.

Code: Select all

nagios@localhost:/usr/local/nagios/libexec$ ./check_uptime
Uptime OK: 15 day(s) 21 hour(s) 54 minute(s) | uptime=22914.000000;;;

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Wed May 13, 2015 2:28 am
by Box293
In your original post:
In the Linux host:
In my "nrpe.cfg" I added:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime -w 5 -c 10
A couple of posts ago:
xerez wrote:nrpe.cfg in Nagios:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime
Have you restarted xinetd on the remote host since making these changes?

Code: Select all

service xinetd restart

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Wed May 13, 2015 3:46 am
by xerez
The nrpe.cfg on Nagios, never it changed, only I omitted the unnecessary part.

nrpe.cfg on Nagios:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime -w 5 -c 10
At this moment in the nrpe.cfg on the Linux host, I have:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime -w 5 -c 10
However, I don't have installed xinetd in the Linux host. It is necessary?

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Wed May 13, 2015 9:47 am
by jdalrymple
Sounds like we need to do some regrouping:
xerez wrote:nrpe.cfg on Nagios:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime -w 5 -c 10
On the nagios server nrpe.cfg is irrelevant. You do not need to modify it for any reason.

Let's get a clean run and please post your command and the output in code blocks here for our review. Before doing that though lets change nrpe.cfg on the linux server.

Code: Select all

# DEBUGGING OPTION
# This option determines whether or not debugging messages are logged to the
# syslog facility.
# Values: 0=debugging off, 1=debugging on

debug=1
Change debug to 1 (if it's not already) so that we're logging. You'll also need to restart nrpe - which brings me to your question:
xerez wrote:However, I don't have installed xinetd in the Linux host. It is necessary?
Not if this:
xerez wrote:

Code: Select all

nagios@localhost:~$ /usr/local/nagios/libexec/check_nrpe -H <host ip>
NRPE v2.13
is accurate. Let's verify - when you did this you used the the remote Linux server's IP in <host ip> right?

That said - to restart nrpe if it's daemonized you can HUP it, or maybe you have an init script?

Code: Select all

/etc/init.d/nrpe restart
If none of that makes sense, post the output of

Code: Select all

ps -ef | grep nrpe
and we'll figure it out for you.

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Thu May 14, 2015 3:42 am
by xerez
Well, when I execute this:

Code: Select all

nagios@localhost:~$ /usr/local/nagios/libexec/check_nrpe -H <host ip>
NRPE v2.13
I use the IP of remote Linux host. It's more, other checks like CPU load, memory usage, ping and SSH work.

Moreover, when I installed nrpe in this host, I used this:

Code: Select all

apt-get install nagios-nrpe-server nagios-plugins-basic nagios-plugins
So when I want restart nrpe, I use:

Code: Select all

usuario@linux:/etc/nagios$ /etc/init.d/nagios-nrpe-server restart
[....] Stopping nagios-nrpe: nagios-nrpestart-stop-daemon: warning: failed to kill 8794: No such process
. ok
[ ok ] Starting nagios-nrpe: nagios-nrpe.
Now I see that warning, sorry.

Anyway:

Code: Select all

usuario@linux:/etc/nagios$ ps -ef | grep nrpe
nagios   15067     1  0 may08 ?        00:01:15 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
usuario  16261 15868  0 09:32 pts/0    00:00:00 grep nrpe

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Thu May 14, 2015 9:21 am
by jdalrymple
Did you change the debug level? If so, re-run your check_nrpe -c check_uptime and post the tail of /var/log/messages for us to review please.

Thanks.

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Mon May 18, 2015 3:44 am
by xerez
It doesn't shows nothing...

nrpe.cfg on Linux host:

Code: Select all

usuario@linux:~$ cat /etc/nagios/nrpe.cfg
....
# DEBUGGING OPTION
# This option determines whether or not debugging messages are logged to the
# syslog facility.
# Values: 0=debugging off, 1=debugging on

debug=1
....
And also I restart NRPE with:

Code: Select all

usuario@linux:~$ su -c "/etc/init.d/nagios-nrpe-server restart" 
I run this in Nagios:

Code: Select all

nagios@localhost:/usr/local/nagios/libexec$ check_nrpe -H <host ip> -c check_uptime
NRPE: Unable to read output
After, I read /var/log/messages and nothing:

Code: Select all

usuario@linux:~$ su -c "tail /var/log/messages"                                
ContraseƱa:
May 18 07:48:43 debian mpt-statusd: detected non-optimal RAID status
May 18 07:58:43 debian mpt-statusd: detected non-optimal RAID status
May 18 08:08:43 debian mpt-statusd: detected non-optimal RAID status
May 18 08:18:53 debian mpt-statusd: detected non-optimal RAID status
May 18 08:28:53 debian mpt-statusd: detected non-optimal RAID status
May 18 08:38:53 debian mpt-statusd: detected non-optimal RAID status
May 18 08:48:53 debian mpt-statusd: detected non-optimal RAID status
May 18 08:58:53 debian mpt-statusd: detected non-optimal RAID status
May 18 09:08:53 debian mpt-statusd: detected non-optimal RAID status
May 18 09:18:53 debian mpt-statusd: detected non-optimal RAID status

Re: Error with check_uptime: NRPE: Unable to read output

Posted: Mon May 18, 2015 10:59 am
by jdalrymple
What are you other logging options, particularly "log_facility"?

NRPE will always log something, especially when restarting, and especially if debug is on.

Code: Select all

May 18 05:29:30 localhost nrpe[10348]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
May 18 05:29:30 localhost nrpe[10349]: Starting up daemon