我希望Monit提醒我,如果有任何东西出现在系统日志中 – 因为任何东西都会出现exception。
我已经尝试了以下操作,并且在手动向syslog echo testing >> /var/log/syslog添加内容时,我没有收到任何警报电子邮件。 我已经validation了警报电子邮件正在工作。
check file syslogd_file with path /var/log/syslog if match ".*" then alert if match .* then alert if changed timestamp then alert
你不关心内容,所以testing时间戳或文件大小。 这在Monit文档示例中得到了很好的说明 。
对于你的情况,像这样的东西:
check file syslogd_file with path /var/log/syslog if changed timestamp then alert
然后确保您重新加载或重新启动守护进程。