Logwatcher can be configured to send analyzed log reports periodically via email to the administrator. This section guides you on how to setup the logwatcher to send periodic email of its analyzed reports.
This section assumes you already installed logwatcher. Otherwise, visit the index page: Logwatcher
Outside of this topic, you need to setup your system-level email service like Exim4
up before expecting logwatch to send email.
Now by reading the default configurations and their respective comments on /usr/share/logwatch/default.conf/logwatch.conf
, you create/update your config file inside /etc/logwatch/conf/logwatch.conf
with :
Output = mail
Format = html
Range = Today
Detail = High
MailFrom = "Logwatch@localhost"
IMPORTANT NOTE:
/usr/share/logwatch/default.conf/logwatch.conf
. This is not the right way because you should NEVER modifies the default settings at all./etc/logwatch/conf/logwatch.conf
by reading the configuration descriptions in /usr/share/logwatch/default.conf/logwatch.conf
.With the configurations file in placed, you can execute a manual test by calling logwatch
using root:
$ /usr/sbin/logwatch
If everything is configured correctly, you should receive an email with all the log file.
As you guess it, to alter the timing for logwatch, you can edit the /etc/crontab
scheduler. There are 2 ways to do it:
That's all for configure logwatcher to email all logs.