I've written a script which sends me an sms notification. I call with exec action in monit test. It works, but I'm getting overwhelmed by messages. Is there a way to suppress sending subsequent messages if check fails until it succeeds?
Here is the monit config file:
check system my_host if loadavg (1min) > 3 then alert if loadavg (1min) > 3 then exec "/usr/local/sms_notifier/sms_notifier.php all cpu load average exceeds 3" as uid nobody and gid sms if loadavg (5min) > 2 then alert if memory usage > 90% then alert if memory usage > 90% then exec "/usr/local/sms_notifier/sms_notifier.php all memory usage exceeds 90%" as uid nobody and gid sms if cpu usage (user) > 70% then alert if cpu usage (system) > 30% then alert if cpu usage (wait) > 30% then alert