Code

check_ping's timeout interval is only +1 if ping command has a timeout value.
[nagiosplug.git] / plugins / check_ping.c
index 9ddc2529d071a980e10175fabab6c3a49ad38c7b..211f74ef74c279742b64ea4077165b3ccd013d88 100644 (file)
@@ -103,8 +103,13 @@ main (int argc, char **argv)
                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++) {