Logwatch: Keep an eye on your system activity

Install and configure logwatch on RHEL / Centos / Fedora server

This article shortly explain how to install and configure logwatch on your Centos/RHEL server in order to keep an eye on it

Requirements

  • working MTA (mail transport agent) like postfix, exim, sendmail,  etc.
  • root access to your server

Installation

Install the logwatch package as usual

Copy the default configuration file

Then modify with your preferred editor as your need (see the example below)

If you want to specify more complex range option, you need to install the perl module Date::Manip

Install the package perl-DateManip.noarch (on Centos 5)

Customise services

All available services are located under

By default, all services are defined (see below)

Disable all services and enable one by one

For example, modify the configuration file (logwatch.conf)

Comment the line

Then add which script you want to enable (see example below)

Define services exclusions

Test your configuration

To test your configuration, run the logwatch command

Setup the crontab

By default on Centos 6, the logwatch package create a symlink in the /etc/cron.weekly directory (see below)

If you want to get an email on a daily basis on set it up in root’s crontab, help yourself 😉

That’s it !!!

Leave a Reply

Your email address will not be published. Required fields are marked *



Back to Top