How to monitor System Logs with Logwatch on CentOS

Logwatch is a powerful and versatile log parser and analyzer. Logwatch is designed to give a unified report of all activity on a server, which can be delivered through the command line or email.

Before installing Logwatch we need to update system packages.

Install Logwatch:

Logwatch requires a mail transport agent (MTA) to send its reports.

How to configure Logwatch:

After installing logwatch we need to edit the configuration file to add the email address to which logwatch will send the reports.

Edit the file “/usr/share/logwatch/default.conf/logwatch.conf” and modify the below lines:

Issue the command to test the installation:

Automating Logwatch:
Now we will add the logwatch to cron to send the report at a perticualr time.

Finally we will get an email from the logwatch at 11:59 PM everyday.

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply