Logwatch
Install postfix as mail client
_$: apt-get install postfix
Configuration style -> Satellite
System mail name -> default.domain.com
SMTP relay host -> mail.domain.com
Root and postmaster mail recipient -> <user>
Other destinations to accept mail for (blank for none): -> Default values
Force synchronous updates on mail queue? -> No
Local networks: -> Default values
Mailbox size limit (bytes): -> 0
Local address extension character: -> +
Internet protocols to use: -> all
Installation
_$: apt-get install logwatch
Configuration
_$: cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/
_$: cp /etc/logwatch/conf/logwatch.conf /etc/logwatch/conf/logwatch.conf.bak
_$: mkdir /var/cache/logwatch
/etc/logwatch/conf/logwatch.conf:
---------------------------------
...
TmpDir = /var/cache/logwatch
Output = mail
MailTo = <user>@domain.com
MailFrom = Logwatch
Range = yesterday
Detail = Med
_$: which logwatch
/usr/sbin/logwatch
/etc/cron.daily/00logwatch:
---------------------------
...
#execute
/usr/sbin/logwatch --mailto <user>@domain.com
Check
1) Logwatch output
_$: logwatch --range today --output stdout
2) Email to the address specified in MailTo
_$: logwatch --range today
3) Email to the address specified in the command line flag
_$: logwatch --range today --mailto <user>@domain.com
4) The script located at /etc/cron.daily
sends an email to the <user>@domain.com
address:
_$: find /etc/cron* -name "*logwatch*"
/etc/cron.daily/00logwatch
_$: /etc/cron.daily/00logwatch