Can't get check_ping to work


I inherited a nagios install so I’m new to it but have found it to be pretty straightforward to setup and get working. I’m attempting to move to a new server with the latest greatest version of nagios on it (running on RedHat Linux). I have absolutely everything working EXCEPT check_ping - the interface shows UNKNOWN status regardless of what I do (Status Information has: check_ping: %s: Warning threshold must be integer or percentage! ). However when I do a “ps” and capture the command that is running and run it by hand from the command line, it runs fine and returns “PING OK”. Here is the command and result (ip masked):

/usr/local/nagios/libexec/check_ping -H MY_IP_ADDR -w 3000.0,80% -c 5000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 0.60 ms|rta=0.601000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0

The command looks just fine in the config files but every single check_ping against every single server I’m monitoring shows UNKNOWN.

I’m at my wits end on this. Please provide some direction.


I REALLY need to get this working, can I please get some help on this?

Much appreciated.


ping may require some extra permissions… so possibly when the nagios user runs without a console some sudo stuff isn’t running correctly? not even sure if this can happen…

did you get any warnings while compiling the plugins?


No errors whatsoever on compile. I’ve even recompiled just to make sure. Not sure why ping would require permissions that other commands don’t, but assuming you are correct what is the remedy? Everything is owned by nagios.


nothing in the logs? (not only the nagios log)


Nothing that I’ve found. I’ve turned up debugging and haven’t seen anything in any log - direct nagios logs or anything in /var/log. Even compiled check_ping with debug set. Nothing that I can find other than the message posted previously.

I’ll be glad to send anything config/log related, just let me know what you need and I’ll post it.


could you post the command configuraiton and service configuration for one of the ping services?

Not sure what we can find… :confused:


This is from checkcommands.cfg:

‘check-host-alive’ command definition

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 5000,80% -c 5000,100% -p 1

This is from command.cfg:

command[check_ping]=/usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 5000,20% -c 10000,100% -p 5

This command checks to see if a host is “alive” by pinging it.

command[check-host-alive]=/usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1

This is services.cfg:

##== All defined servers
define service{
use critical-service ; Name of service template to use

    host_name                       *
    service_description             PING
    check_command                   check_ping


I can’t find or remeber such a command definition in any of my files, where does this come from? is the file even used by nagios.cfg?
but that would create other sorts of problems…

an idea to see if it’s something with permissions…
create a small shell script which just runs some pings (no nagios involved) and have the output sent to a file.
put it in crontab and see th eresults when run as root or nagios user…