Adjusting ping times

I have installed Nagios 2-0b3 on RH9 and all seeems to be working fine. Notifications work, info received from Windows and novell systems etc. I would like to change the ping times so that normal network usage which varies from <10ms to > 50 ms depending on location and network speed. I have read the doco but cannot seem to get it to change the notifications so I do not get a yellow warning if the ping time is greater than the standard which seems to be 10ms or greater. I have changed the values but seem to get no where. Basically I do not understand the doco for the check_ping command and its variable.


in checkcommands how is check_ping defined?
you should have a couple of Args passed to it… (critical and warning values)
In this way you can define different times for each host you are going to ping… simply passing the % and ms values you like.


‘check_ping’ command definition

define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

ARG1 is the warning threshold, ARG2 the critical threshold…


service_description ping
check_command check_ping!1000,21%!2000,41%

this way we want a critical over 1000 ms or loosing 2 packets (out of 5 we are sending) and a critical if the return time is over 2000 ms or we loose 3 packets.

Edited Wed Aug 10 2005, 11:26PM ]

Thanks for the update. I did check the checkcommands.cfg for the ping command format and it is
’check_ping’ command definition
define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

and the services.cfg is

Service definition

define service{
use generic-service ; Name of service template to use

    host_name                       HO_CORE_SW2
    service_description             PING
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  router-admins
    notification_interval           240
    notification_period             24x7
    notification_options            c,r
    check_command                   check_ping!100.0,20%!500.0,60%

which I believe is the standard as to how the product installs. I changed the valuses to as you stated and still get a warning if the ping time is > 10ms.

might sound stupid… did you restart nagios?
Try checking the command which is being used in the view config menu…
eventually test if you have multiple nagios instances running.


Also, you may want to run it by hand on the command line, and see if you can make it go critical by using -w 5,5% -c 6,6% or something like that.

I have changed the services.cfg config to match Luca’s suggestion. When I run it as a commandline it works but the command that Nagios uses is

/usr/local/nagios/libexec/check_ping -H -w 10:20% -c 60:100%

I got this by doing a ps -ef command repeatedly. I have restarted Nagios, looked for multiple instances and have rebooted the machine.

You stated that your services.cfg file was this:
" check_command check_ping!100.0,20%!500.0,60%"

But then you state by doing a ps -ef that nagio is running this:
" /usr/local/nagios/libexec/check_ping -H -w 10:20% -c 60:100%"

What’s wrong with this picture? Where did 10:20% come from? Shouldn’t it be 100.0,20% What’s the : for? Double check your configs, paste your command definition for check_ping, your services.cfg definition for check_command and the output that you get when nagios runs the check.

my check ping command running looks different.

/export/nagios2/libexec/check_ping -H -w 1000,21% -c 2000,41% -p 5

which is exactly the command which should be issued by command line… as jakkedup said check your configs.


Apologies for not getting back to you earlier as I had a couple of days off. I found the problem in the commands-plugin.cfg the line is
command[check_ping]=/usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 10:20% -c 60:100%

I have modified the line to its correct format and hey presto all seems to work.

Thank you for your assistance.