Page 1 of 1

Nagios web interface shows Warning for services that are OK

Posted: Mon Nov 04, 2013 12:43 pm
by garrywong
I'm using NRPE to run commands on remote hosts. If I run the command on the terminal of the monitoring host, I get returned an OK result, like this:

Code: Select all

]# /usr/local/nagios/libexec/check_nrpe -H <remote_ip> -c check_load
OK - load average: 0.01, 0.05, 0.06|load1=0.010;15.000;30.000;0; load5=0.050;10.000;25.000;0; load15=0.060;5.000;20.000;0;
But then when I go onto the web interface, for this same service, it says under status "Warning", and I'm wrecking my head here trying to figure out why this is happening. Anyone have some ideas?

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 2:05 pm
by abrist
Can you post the command and check definitions for this service check?

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 2:11 pm
by garrywong
commands.cfg:

Code: Select all

# 'check_nrpe' command definition
define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADRESS$ -c $ARG1$
        }
localhost.cfg:

Code: Select all

# Define CPU load check on remote host
define service{
        use                             generic-service
        host_name                       myhost
        service_description             CPU Load
        check_command                   check_nrpe!check_load
        }
nrpe.cfg on remote host (this is unchanged since I installed it):

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 2:15 pm
by garrywong
I have a typo in "Address" :oops: :oops: :oops: :oops: :oops:
/stupid
/facedesk

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 2:27 pm
by slansing
Well sometimes it's something simple! Did that resolve it?

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 3:49 pm
by garrywong
Yes, I can get nagios plugins running on remote hosts now, and they show up "OK" on the web interface. But now I'm having a hard time figuring out how to execute arbitrary commands (i.e, not just plugins) on the remote host and read the return code into nagios.

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 3:56 pm
by slansing
What specifically do you mean by execute arbitrary commands?

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 5:01 pm
by garrywong
Specifically scripts that I have in init.d, which are used to check status of applications on the remote host.

I kept getting "NRPE: Unable to read output" as the return when I used NRPE to execute the scripts from the nagios server on the remote server.
For example, on nagios server:

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H <remote_host> -c check_script
NRPE: Unable to read output
And on the remote host in nrpe.cfg I had:

Code: Select all

command[check_script]=/etc/init.d/myscript status
But then I realised that $? is still 0 from the command on the nagios server, so it all works out. Yeah... I know, I'm a dummy today...
But thanks guys, you've been awesome! :D

Re: Nagios web interface shows Warning for services that are

Posted: Mon Nov 04, 2013 5:55 pm
by abrist
Do you need any further assistance with this issue? Or are we lock-ready?

Re: Nagios web interface shows Warning for services that are

Posted: Tue Nov 05, 2013 9:02 am
by garrywong
I'm good now, you can lock, thanks!