Nagios web interface shows Warning for services that are OK

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.
Locked
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Nagios web interface shows Warning for services that are OK

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

Re: Nagios web interface shows Warning for services that are

Post by abrist »

Can you post the command and check definitions for this service check?
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.
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Re: Nagios web interface shows Warning for services that are

Post 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
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Re: Nagios web interface shows Warning for services that are

Post by garrywong »

I have a typo in "Address" :oops: :oops: :oops: :oops: :oops:
/stupid
/facedesk
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios web interface shows Warning for services that are

Post by slansing »

Well sometimes it's something simple! Did that resolve it?
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Re: Nagios web interface shows Warning for services that are

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios web interface shows Warning for services that are

Post by slansing »

What specifically do you mean by execute arbitrary commands?
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Re: Nagios web interface shows Warning for services that are

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

Re: Nagios web interface shows Warning for services that are

Post by abrist »

Do you need any further assistance with this issue? Or are we lock-ready?
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.
garrywong
Posts: 6
Joined: Mon Nov 04, 2013 12:36 pm

Re: Nagios web interface shows Warning for services that are

Post by garrywong »

I'm good now, you can lock, thanks!
Locked