ping timeout is in milliseconds, not seconds

Issue #543 resolved
Brian Landy
created an issue

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)

  1. Tildeslash repo owner

    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:

    1485457391: Ping response for 192.168.50.250 1/3 timed out -- no response within 5 s
    1485457396: Ping response for 192.168.50.250 2/3 timed out -- no response within 5 s
    1485457401: Ping response for 192.168.50.250 3/3 timed out -- no response within 5 s
    'nohost' ping test failed
    'nohost' icmp ping failed, skipping any port connection tests
    

    Monit configuration:

    set daemon 5
    
    set httpd port 2812 allow localhost
    
    check host nohost with address 10.2.3.250
            if failed ping4 count 3 with timeout 5 seconds then alert
    

    There was one ping related issue (#488) fixed in the development version, please can you test it?:

    wget https://bitbucket.org/tildeslash/monit/get/master.tar.gz
    

    To compile:

    ./bootstrap
    ./configure
    make
    
  2. Brian Landy 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
    
  3. Brian Landy 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

  4. Log in to comment