How to configure Monit to alert me when anything appears in syslog

monitmonitoringrsyslogsyslog

I want Monit to alert me if ANYTHING shows up in syslog – as anything in there would be abnormal.

I've tried the following and I'm not receiving any alert emails when I manually add something to syslog echo testing >> /var/log/syslog. I've verified that alert emails are working.

check file syslogd_file with path /var/log/syslog
    if match ".*" then alert
    if match .* then alert
    if changed timestamp then alert

Best Answer

You don't care about the content, so test on timestamp or file size. This is covered very well in the Monit Documentation examples.

For your situation, something like:

check file syslogd_file with path /var/log/syslog
        if changed timestamp then alert

Then ensure you reload or restart the monit daemon.