Stopping on a failed ping should be configurable

Issue #667 closed
Former user created an issue

Right now the port checks are not performed if the ping test fails. This should be optional as a failed ping does not necessarily mean the server is down. A firewall could just be blocking the ICMP request yet the server and ports are still available. It could be a global setting or section specific option:

set port-check-on-failed-ping false

check host dns.host.com with address dns.host.com
        set port-check-on-failed-ping true
        if failed host dns.host.com port 53 type udp protocol dns for 4 cycles then alert
        if failed ping4 for 4 cycles then alert

Comments (2)

  1. Tildeslash repo owner

    I see the point, but it would be bad practice for two reasons:

    1. Monit tries to detect exceptions and send alert + fix the problem to bring the system back to normal ... in the case that ping is ALWAYS dropped by firewall, there will be ALWAYS error flag on the given service - the admin will then just learn to ignore the "red" alert for service which has always error => if the ping is known to fail, this test should be disabled for this host

    2. performing ping that is known to always fail will waste resources and slow down testing ... monit will send echo requests, wait for response and if nothing comes back, retry 3 times by default

  2. Greg Robertson

    I understand what you are saying...but the point is...ping is not ALWAYS dropped by the firewall. In a very large environment all it takes is a mistake in a fw rule to break stuff..and just because a rule broke the ping does not mean other services are broken. I guess I will just have to hack up the code myself....it seems it's a simple "if" statement that needs to be removed.

  3. Log in to comment