aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ping.c
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2007-03-12 10:51:06 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2007-03-12 10:51:06 +0000
commit76cc1b75dd2e9a0f2e9c4a047429cb1acd733272 (patch)
treecec0b70e2ddfebadc08ce167637bf1865d181404 /plugins/check_ping.c
parent3f93ecd17188ff142ecad71bceec9c19d51c7811 (diff)
downloadmonitoring-plugins-76cc1b75dd2e9a0f2e9c4a047429cb1acd733272.tar.gz
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 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1639 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r--plugins/check_ping.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 9ddc2529..211f74ef 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -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++) {