diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2007-01-06 04:52:58 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2007-01-06 04:52:58 +0000 |
commit | a61a5ead01afeb3eeaf49cfe57978298bd2b9aa6 (patch) | |
tree | 5ed4afafd33fa5667b796d11861a8965dcf12f96 | |
parent | 818b440444d57a2058fc15f4d75ffb7a3552c441 (diff) | |
download | monitoring-plugins-a61a5ead01afeb3eeaf49cfe57978298bd2b9aa6.tar.gz |
Fix the way check_ping calculate the maximum run time
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1561 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_ping.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index eb3a6dbf..a4efc6c1 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -399,7 +399,11 @@ validate_arguments () | |||
399 | if (max_packets == -1) | 399 | if (max_packets == -1) |
400 | max_packets = DEFAULT_MAX_PACKETS; | 400 | max_packets = DEFAULT_MAX_PACKETS; |
401 | 401 | ||
402 | max_seconds = crta / 1000.0 * max_packets + max_packets; | 402 | max_seconds = crta * max_packets; |
403 | /* Round up max_seconds because we use only the int part */ | ||
404 | if (max_seconds != (int)max_seconds) | ||
405 | max_seconds = (int)max_seconds + 1; | ||
406 | |||
403 | if (max_seconds > timeout_interval) | 407 | if (max_seconds > timeout_interval) |
404 | timeout_interval = (int)max_seconds; | 408 | timeout_interval = (int)max_seconds; |
405 | 409 | ||