Hi
In my case, I use a custom script to alert and Notify at the same time like below
if does not exist then exec "/var/lib/monit/scripts/notifyAndExecute.sh /bin/mount /path/to/remount" else if succeeded then exec "/var/lib/monit/scripts/notifySuccess.sh"
This way I can alert by using what ever channel (email;,sms, webhook etc...) and run command at the same time.
I did this because in the the past monit didn't supported several rules but Monit evolved and you can now defined several rules for one event like below (in the past it was overwriting/ignored)
if does not exist for 3 cycles then alert
if does not exist for 5 cycles then start
if failed port 8080 for 3 times within 4 cycles then alert
if failed port 8080 for 6 times within 8 cycles then restart
if failed port 8443 for 3 times within 4 cycles then alert
if failed port 8443 for 6 times within 8 cycles then restart
if failed port 9990 for 3 times within 4 cycles then alert
if failed port 9990 for 6 times within 8 cycles then restart
if does not exist for 10 cycles then alert
if does not exist for 5 cycles then exec "/bin/mount /mnt/nfs"
I don't have samples, but from my memory, you can also define several actions for the same "event" several times with newer version like below
if does not exist for 5 cycles then alert repeat every 2 cycles
if does not exist for 5 cycles then exec "/bin/mount /mnt/nfs" repeat every 3 cycles
if does not exist for 5 cycles then exec "/some/script/notify" repeat every 3 cycles
In your case it would be something like (not tested)
if status != 0 then exec "/usr/local/monit/conf/dummy.sh" repeat every 10 cycles
if status != 0 then alert repeat every 10 cycles
Hope this help.