在monit中采取两个行动

我的monit脚本用于检测进程中断,并告诉我规则是什么时候:

IF DOES NOT EXIST THEN ALERT 

我的监控脚本可以检测到中断,并在规则为时自动修复:

  IF DOES NOT EXIST THEN START 

但是,我想要它做的是通知我并修复它

连续两条规则似乎使它忽略了最后的一切:

  IF DOES NOT EXIST THEN ALERT IF DOES NOT EXIST THEN START # No alert given. 

我可以使用一个自定义的脚本来执行这两个操作

  IF DOES NOT EXIST THEN EXEC "my_handwritten_script" 

但是我试图从一堆手写脚本转向一个干净的Monitconfiguration。

我可以configurationMonit采取两个行动?

Monit在采取行动时应该默认发送一封电子邮件给你。

 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 

我的Monitconfiguration这个服务:

 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