[Nagiosplug-devel] Check_ping

wasik wasik at broumovska.lbcfree.net
Sat Jun 19 09:38:01 CEST 2004


Hello,
I am using Nagios on Slackware 9.1 and Mandrake 10.0 and I found that
check_ping plugin does not correctly recognize ping statistics under certain
conditions (when there are errors present). I have made a simple patch for that.

I have also noticed that ping on these systems does not write anything to STDERR where check_ping expects to have error messages, so check_ping does not detect "Host unreachable" and similar.

Thanks for help,
Jan Wasserbauer

-------------- next part --------------
--- nagios-plugins-1.3.1/plugins/check_ping.c	2003-01-13 13:15:16.000000000 +0100
+++ nagios-plugins-1.3.1.mod/plugins/check_ping.c	2004-06-19 18:06:19.121931182 +0200
@@ -386,6 +386,8 @@
 		if (sscanf
 					(input_buffer, "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",
 						 &pl) == 1
+				|| sscanf
+                                        (input_buffer, "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss, time", &pl) == 1
 				|| sscanf 
 					(input_buffer, "%*d packets transmitted, %*d packets received, %d%% packet loss",
 						&pl) == 1


More information about the Devel mailing list