Re: succeeded keyword leads to unexpected behavior and wrong status/summary

Lutz Mader <[email protected]> Mon, 28 Jul 2025 21:30:24 +0200
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
Hello Juergen,
based on your sample snipped,
you should have a look to NETWORK PING TEST,
https://mmonit.com/monit/documentation/monit.html#NETWORK-PING-TEST

> check host somehost.exmaple.org with address 10.11.12.13
>   if failed ping then alert
>   if failed ping then exec /root/bin/notify.sh
>   if succeeded ping then exec /root/bin/notify.sh

From my point of view, the proper test should look like this.

check host somehost.exmaple.org with address 10.11.12.13
  if failed ping then alert
  if failed ping then exec /root/bin/notify.sh
    else if succeeded then exec /root/bin/notify.sh

"if failed ..." will send an alert if the ping failed and "else if
succeeded ..." will send a recovery alert.

The test icmp was changed to ping a long time ago (with 5.9.0), I get
"ICMP failed" if ping failed (with 5.35.0).

A suggestion only,
Lutz