Ping seems to not check all available IPs

Issue #763 closed
Henning Bopp created an issue

The Ping test seems to only use the first seen IP address. If there is a failure on an AAAA Record, the A Record will not be checked.

Changelog (and documentation) states:

From Changelog, 5.12.1:

New: [...] If a host name is used [...], Monit will try to connect to the first available address (be it IPv4 or IPv6). If the connection fails, Monit will try the next address and so on until a connection succeed or until there are no more addresses left to try. [...]

I created a test domain with a IPv6 that will not respond, but additionally with an IPv4 address that responds. You'll find it at - feel free to use this domain for testing proposes.

Will not work (but should):

check host IPv6Fail with address
    if failed ping then alert

Will work:

check host IPv6Fail with address
    if failed ping4 then alert

If testing on bash it works out "fine", saying ping -4 -c2 is responding while ping -6 -c2 is not.

Comments (5)

  1. Tildeslash repo owner

    Fixed: Issue #763: if the ping test target is a hostname which resolved to multiple IPs, Monit didn't try the next IP if the first one failed and returned error.

    → <<cset f4fb3001f964>>

  2. Tildeslash repo owner

    fixed checked in, please can you test?:

    tar -xzf master.tar.gz
    cd tildeslash*
  3. Log in to comment