[Nagiosplug-devel] Check_ping question

Robert Nelson rnelson at windchannel.com
Wed Nov 10 05:38:06 CET 2004


On line 340 of check_ping.c from v1.3.1 of the nagios-plugins package:

=============================
        if (max_packets == -1)
                max_packets = DEFAULT_MAX_PACKETS;

        max_seconds = crta / 1000.0 * max_packets + max_packets;
        if (max_seconds > timeout_interval)
                timeout_interval = (int)max_seconds;
=============================

For my check-host-alive command, I use the following:

=============================
# 'check-host-alive' command definition
define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w
4999.0,99% -c 5000.0,100% -p 3 -t 5
        }
=============================

I use the warning/crit settings of 4999 and 5000ms because if I get to
this point, I just care if the host is there, let the service checks
(which are often pings themselves) tell me what's wrong. I send three
packets and want the hostcheck to end after 5 seconds, because of how
nagios serializes the hostchecks.

Here's my question - what good is a timeout value, if it will be
overridden by the Critical time? I end up with an *effective* timeout
value of (5000.0 / 1000.0 * 3 + 3 =) 18 seconds. This seems "broken" to
me.

I ended up commenting out the last three lines quoted from check_ping.c
and recompiling it. I'm just curious whether this is behavior by design
or by error, and whether I need to make notes about it for when
plugins-1.3.2 comes out. Thanks!


Rob Nelson
Network Engineer
Windchannel Communications
919-538-6326 




More information about the Devel mailing list