Sending e-mails alerts with rsyslog

centos7loggingrsyslog

I was requested to enrich our current alerting system on rsyslog by adding mailing capabilities for some specific use cases.
The plug-in ommail seems to be the one to use with rsyslog to do so. However, after failing at many attemps, I still can't send a single mail from rsyslog.
Here is what my /etc/rsyslog.conf ommail looks like at the moment (for the ommail part):

# Send output as a mail
$ModLoad ommail
$ActionMailSMTPServer [THE SMTP SERVER]
$ActionMailFrom [SOME RANDOM SENDING EMAIL]
$ActionMailTo [MY EMAIL]
$template mailSubject,"TEST"
$template mailBody,"RSYSLOG"
$ActionMailSubject mailSubject
$ActionExecOnlyOnceEveryInterval 5
:msg, contains, "a" :ommail:;mailBody
$ActionExecOnlyOnceEveryInterval 0

Basically for testing purposes I wanted this script to get triggered everytime a "a" is detected in a log, which is very likely to happen. To this day I still have received nothing. I made sample mails testing with mailx (with a symlink on mail) and I can confirmed that I received the mails, so it does not come from a SMTP issue.

I'm running low on alternatives for ommail documentations, which probably mean few people face issues with this plug-in. Do you have an idea of what I could have done wrong or not think about ?

**Config:**
rsyslogd 8.24.0-34.el7
CentOS Linux 7 (Core)

Best Answer

Related Topic