Hi,
I am using monit to monitor some machines.
Before I only got notifications via email, this worked without problems.
The configuration I used to check a host was simple:
check host somehost.exmaple.org with address 10.11.12.13
if failed ping then alert
set alert [email protected]
set mailserver localhost port 25
set mail-format {
from: [email protected]
subject: Monit-Alert
}
Now I added a script to send me notifications to my iPhone too and added one
line
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
even this is working ok, when I am ignoring that I now getting two mails for
each event.
Now the issue: the script was only executed on host failure, but not on host
recovery,
so I added one more line:
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
superficially this works fine, I am getting up and down notifications via email
and
on my iPhone via script which sends push messages.
Later I recognized that some details are now wrong:
monit status and monit summary are now reporting the host status as ‚ICMP
failed‘
and the monit.log show errors where there are successful ping checks:
[2025-07-26T21:25:22+0000] error : 'host.example.com' ping test succeeded
[response time 15.623 ms]
[email protected]:~# monit summary
Monit 5.33.0 uptime: 3h 49m
┌─────────────────────────────────┬────────────────────────────┬───────────────┐
│ Service Name │ Status │ Type │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ my.server.com │ OK │ System │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ host.exmaple.com │ ICMP failed │ Remote Host │
└─────────────────────────────────┴────────────────────────────┴───────────────┘
I assume this is a bug, or is there any configuration which can change the
behavior to the correct one?
thnx in advance,
Jürgen