Setup Logwatch

From banana_wiki
Jump to: navigation, search

Logwatch - a utility that parses your log files and e-mails you a summary of them so that you have a better chance of spotting strange behaviour on your server(s).

Install Logwatch

apt-get install logwatch

Then we will need to copy the sample config file like this:

cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf

Edit the config specifically:

Output = mail
MailTo =
Detail = low
Format = html

Finally we need to edit the cron files for it.

vim /etc/cron.daily/00logwatch </code>

and add:

/usr/sbin/logwatch --mailto

and create

mkdir /var/cache/logwatch

and then run logwatch to see if anything comes up in the mailbox you specified.

note: make sure exim4 or some other mailer is installed and functioning for this to work.