ping timeout is in milliseconds, not seconds
Hi, when defining a test like this:
if failed ping4 count 3 with timeout 5 seconds then alert
The units are actually milliseconds, not seconds. If I change the test to read "5000 seconds" and use an offline IP, I can time the interval between ping failed messages written to the log and see that they come every 5 seconds. I verified the issue on 5.18, 5.20, and a pull from git. I'm running on OpenBSD 6.0.
Thanks, Brian
Comments (6)
-
repo owner -
reporter I'll test that shortly and get back to you.
Interesting, here's what I am seeing with "5000 seconds":
[EST Jan 26 15:23:23] error : Ping response for 192.168.170.111 1/3 timed out -- no response within 83.333 m [EST Jan 26 15:23:29] error : Ping response for 192.168.170.111 2/3 timed out -- no response within 83.333 m [EST Jan 26 15:23:35] error : Ping response for 192.168.170.111 3/3 timed out -- no response within 83.333 m
monitrc:
check host 192.168.170.111 with address 192.168.170.111 if failed ping4 count 3 with timeout 5000 seconds 1 cycles then alert
-
reporter Even on this version I'm seeing the shorter times:
check host 192.168.170.111 with address 192.168.170.111 if failed ping4 count 3 with timeout 5 seconds 1 cycles then alert [EST Jan 26 17:23:27] info : 'firefly.landy.cx' Monit 5.21.0 started [EST Jan 26 17:23:28] error : Ping response for 192.168.170.111 1/3 timed out -- no response within 5 s [EST Jan 26 17:23:29] error : Ping response for 192.168.170.111 2/3 timed out -- no response within 5 s [EST Jan 26 17:23:30] error : Ping response for 192.168.170.111 3/3 timed out -- no response within 5 s check host 192.168.170.111 with address 192.168.170.111 if failed ping4 count 3 with timeout 5000 seconds 1 cycles then alert [EST Jan 26 17:24:41] info : 'firefly.landy.cx' Monit 5.21.0 started [EST Jan 26 17:24:47] error : Ping response for 192.168.170.111 1/3 timed out -- no response within 83.333 m [EST Jan 26 17:24:53] error : Ping response for 192.168.170.111 2/3 timed out -- no response within 83.333 m [EST Jan 26 17:24:58] error : Ping response for 192.168.170.111 3/3 timed out -- no response within 83.333 m [EST Jan 26 17:24:58] error : '192.168.170.111' ping test failed
Brian
-
repo owner - changed status to resolved
Fixed: Issue
#543: Ping test may timeout prematurely on machine with heavy ICMP traffic.→ <<cset 055bb736431b>>
-
repo owner It should be fixed now ... please can you fetch the development snapshot again? (wget https://bitbucket.org/tildeslash/monit/get/master.tar.gz)
The problem was in timeout handling, where delta in microseconds was subtracted from timeout in milliseconds.
-
reporter Yes, that fixed it for me. Thank you!
- Log in to comment
Hi,
i'm unable to reproduce the issue using development version on OpenBSD 6.0 amd64 ... added unix timestamp to the debug message, it shows there are 5 seconds between attempts:
Monit configuration:
There was one ping related issue (
#488) fixed in the development version, please can you test it?:To compile: