用电子邮件监测“检查程序”?

我有一个monit脚本(11-13行):

check program foo with path "/usr/local/bin/foo.sh" with timeout 300 seconds if status != 0 then alert [email protected] 

monit reload说:

 /etc/monit/conf.d/example:13: Error: syntax error '[email protected]' 

这些例子都没有显示一个电子邮件警报,但我需要一个。 为什么我不能在这里?

我正在使用Monit 5.5。

在您的监控configuration文件中取消注释/添加这些行:

 set mailserver localhost set alert [email protected] 

然后做下面的事情。 请注意,“alert”后没有任何内容。

 check program list-files with path "/bin/ls -lrt /tmp/" if status != 0 then alert 

检查文档http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement它有以下的例子

 check process mybar with pidfile /var/run/mybar.pid alert foo@bar only on { timeout }