Taking two actions in monit
Posted
by
Oddthinking
on Server Fault
See other posts from Server Fault
or by Oddthinking
Published on 2012-08-30T03:09:26Z
Indexed on
2012/08/30
3:39 UTC
Read the original article
Hit count: 215
monit
My monit script works to detect an outage with a process and inform me when the rule is:
IF DOES NOT EXIST THEN ALERT
My monit script works to detect an outage and automatically fix it when the rule is:
IF DOES NOT EXIST THEN START
But, what I want it to do is inform me AND fix it.
Two rules in a row seems to make it ignore all but the last:
IF DOES NOT EXIST THEN ALERT
IF DOES NOT EXIST THEN START
# No alert given.
I could use a custom script that does both, and
IF DOES NOT EXIST THEN EXEC "my_handwritten_script"
but I was trying to move away from a mess of hand-written scripts towards a clean Monit configuration.
Can I configure Monit to take two actions?
© Server Fault or respective owner