Taking two actions in 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?


Monit should send you an email by default when it takes an action.

Does not exist Service atd

    Date:        Thu, 03 May 2012 14:37:19 -0400
    Action:      restart
    Host:        abc.xyzgroup.com
    Description: process is not running

Your faithful employee,
Monit

My Monit config for this service:

check process atd
        with pidfile "/var/run/atd.pid"
        start program = "/sbin/service atd start"
        stop program = "/sbin/service atd stop"
        if 10 restarts within 11 cycles then timeout
        if cpu usage > 95% for 11 cycles then restart