From 76cc1b75dd2e9a0f2e9c4a047429cb1acd733272 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Mon, 12 Mar 2007 10:51:06 +0000 Subject: 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 --- plugins/check_ping.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/check_ping.c') 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++) { -- cgit v1.2.3