How to monitoring log Files? Logwatch + postfix

Created: Aug. 21, 2020, 10:43 a.m.
Update: Feb. 28, 2021, 6:12 a.m.
How to monitoring log files of many servers?

How to monitoring log files of many servers?

The best and easy way to this is receive by email daily the report of syslog.

Enviromment variables

sudo is required
email admin
email account
email pass        123456

Logwatch + Postfix (Satelite/SmartHost)
Postfix = Satelite = SmartHost
$ dpk-reconfigure postfix

New Alias

Add line at the end of file. This is a redirect for admin of domain.
$ vim /etc/alias
update alias DB
$ newaliases

OR (AA) edit logwatch script crontab daily

$ vim /etc/cron.daily/00logwatch
add theses lines
# comment /usr/sbin/logwatch --output mail
/usr/sbin/logwatch --mailto
/usr/sbin/logwatch --mailto
/usr/sbin/logwatch --mailto

(AT) Test Logwatch

$ bash /etc/cron.daily/00logwatch

SSMTP - Alternative to setup a email account using a external mail server with user and pass

Alias email is not acceptable in this case!
$ apt-get install ssmtp
change setting
$ vim /etc/ssmtp/ssmtp.conf

mailhub =
AuthUser =
AuthPass = 12345
go to AA to finish logwatch setup then AT to test.

Tiago de Souza Moraes - - 2021 // CSS by UIKIT CSS