[Nagiosplug-checkins] nagiosplug/plugins check_ping.c,1.59,1.60

Ton Voon tonvoon at users.sourceforge.net
Mon Mar 12 11:51:08 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7232/plugins

Modified Files:
	check_ping.c 
Log Message:
check_ping's timeout interval is only +1 if ping command has a timeout value.
Tests updated to check for 100% packet loss (always if ping has timeout), otherwise
will check for "timed out" string


Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- check_ping.c	11 Mar 2007 01:57:52 -0000	1.59
+++ check_ping.c	12 Mar 2007 10:51:05 -0000	1.60
@@ -103,8 +103,13 @@
 		usage4 (_("Cannot catch SIGALRM"));
 	}
 
-	/* handle timeouts gracefully */
+	/* If ./configure finds ping has timeout values, set plugin alarm slightly
+	 * higher so that we can use response from command line ping */
+#ifdef PING_PACKETS_FIRST && PING_HAS_TIMEOUT
 	alarm (timeout_interval + 1);
+#else
+	alarm (timeout_interval);
+#endif
 
 	for (i = 0 ; i < n_addresses ; i++) {
 		





More information about the Commits mailing list