Logwatch is a package that parses logs files on your system and sends over a report. This is a useful way to monitor whats going on and ensure you can spot issues more timely and easily.
sudo apt update && sudo apt upgrade
sudo apt install logwatch
sudo vim /usr/share/logwatch/default.conf/logwatch.conf
I’d recommend setting following parameters as below:
Output = mail
Format = html
MailTo = support@domain.tld
MailFrom = logwatch@fqdn-of-the-server-here
Range = Today
Detail = 10
Service = All
sudo vim /usr/share/logwatch/dist.conf/logwatch.conf
I’d recommend setting following parameters as below:
MailFrom = logwatch@fqdn-of-the-server-here
sudo vim /etc/postfix/main.cf
I’d recommend setting following parameters as below:
mydestination = $myhostname, FQDN of the server here, localhost.localdomain, localhost
logwatch --mailto your-email@domain.tld
It is likely that the e-mails sent from the server are getting blocked by spamfilters. Make sure to have a public A-record for your FQDN. Also check your spam filter and/or configure things like MX, SPF, DKIM and