[Nagiosplug-devel] [ nagiosplug-Bugs-3535140 ] check_ping yields warning on a single lost package

SourceForge.net noreply at sourceforge.net
Thu Jun 14 13:05:16 CEST 2012


Bugs item #3535140, was opened at 2012-06-14 02:45
Message generated for change (Comment added) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3535140&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tobias Brox ()
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ping yields warning on a single lost package

Initial Comment:
check_ping gives WARNING if a single packet is lost, regardless of what warning threshold is set.

The reason is that the ping exit status is used, and ref the manual page of ping a single lost packet will cause ping to exit with 1 instead of 0:

"If a packet count and deadline  are  both  specified,  and  fewer  than  count  packets are received by the time the deadline has arrived, it will also exit with code 1."

Tested with those versions of ping installed:

$ ping -V
ping utility, iputils-sss20071127
$ ping -V
ping utility, iputils-sss20101006

The attached patch will cause check_ping to ignore the exit code from ping.
Version 1.4.15 affected (even v1.4.15.61.g4d527)

----------------------------------------------------------------------

>Comment By: Tobias Brox ()
Date: 2012-06-14 04:05

Message:
For the reference, this is what the bug looks like:

$ ./plugins/check_ping  -H otherbox -w 90,60% -c 100,100% -p 4 -t 1
PING WARNING - Packet loss = 25%, RTA = 0.24
ms|rta=0.242000ms;90.000000;100.000000;0.000000 pl=25%;60;100;0

If I run it without "-t 1", check_ping will not send the "deadline"
parameter to ping, and the bug will not be triggered:


$ ./plugins/check_ping  -H otherbox -w 90,60% -c 100,100% -p 4
PING OK - Packet loss = 20%, RTA = 0.19
ms|rta=0.193000ms;90.000000;100.000000;0.000000 pl=20%;60;100;0

... but it will hang for 9 extra seconds waiting for a timeout if the
network is down.

FWIW, I used this crud to reproduce the bug:

$ this=`hostname`
$ other=someotherbox.in.the.universe
$ ./plugins/check_ping -H $other -w 90,60% -c 100,100% -p 4 -t 1 & ssh
$other sudo iptables -A INPUT -p icmp -s $this -j DROP ; sleep 1 ; ssh
$other sudo iptables -D INPUT -p icmp -s $this -j DROP


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3535140&group_id=29880




More information about the Devel mailing list