[Nagiosplug-devel] check_icmp query

Andreas Ericsson ae at op5.se
Tue Sep 23 23:23:05 CEST 2008

Duncan Ferguson wrote:
> Hiya,
> I am trying to use check_icmp as a host check for monitoring a server  
> in a different continent over a network that has the occasional  
> glitch, but I cannot get the options right.
> Basically, what I am trying to achieve is to get check_icmp to send  
> say 5 packets, with a delay of a second between each packet and if it  
> gets 1 packet back then the host is up and happy -  99% of the time  
> there is 0% packet loss with an rta of 44ms or less, but 0.75% of the  
> time there is 10% loss  and 0.25% of the time there is 100% loss.   
> When there is loss the next moment everything is ok again so i want  
> the hsst check to be a little more resilient.
> What is the correct way of specifying this?  Using the '-i' and '-I'  
> switches doesnt seem to affect sending the packets (all the packets  
> seem to be sent at once or with no delay between them rather that have  
> a one second delay that i specify).
> check_icmp -H <hostaddr> -n 10 -m 1 -w 1000.0,80% -c 5000.0,100% -i 1s  
> -I 1s -l 128
> I don't understand networking well enough to go through the code and  
> work out whether what I am trying to do is unreasonable, its missing  
> functionality or its a bug.

What you're trying is not unreasonable at all, and check_icmp has special
support for it, if you call it as a program named "check_host" instead
of check_icmp.

cd /your/plugin/path
ln -s check_icmp check_host
./check_host -n 5 -i 1s -H <host>

will do exactly what you want, and when you get a response within 44ms it
will take roughly 47ms of runtime to complete. Note that the output is
slightly different when it's running in host check mode, as it will stop
sending ICMP packets (or even listening for them) after having received
one, so there's no packet loss value, only an RTT (round trip time, as
opposed to round trip average).

Turning the above instructions into a nagios command and then utilizing
that for host checks is left as an exercise to the reader ;-)

Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

More information about the Devel mailing list