For Fedora/CentOS/RedHat
#yum install logwatch
For Ubuntu
$sudo apt-get install logwatch
Configure Logwatch
Once you have installed Logwatch, you will need to configure it to email you the reports it generates. You are encouraged to look through the entire configuration, but you may safely use Logwatch after editing the lines below.File: /usr/share/logwatch/default.conf/logwatch.conf
Output = mail
Format = html
MailTo = rajat@yeswedeal.com
MailFrom = logwatch@yeswedeal.com
Issue the following command to test your logwatch installation:
logwatchOnce you have issued this command, you will need to check your email to make sure that logwatch is working. Be sure to check your spam folder as these emails may be seen as spam.
Adding a Cron Job for Logwatch
You can add a cron job for Logwatch in order to receive daily emails of new reports. You can add a new entry to your crontab by running crontab -e. The following example cron job runs Logwatch at 1 AM each day, issuing you an email report of the daily activity:# m h dom mon dow command 0 1 * * * /usr/sbin/logwatchCongratulations! You can now monitor system logs with Logwatch!
1 comment:
Hey Rajat ,
Is it possible to add custom files to be monitored and logged by this tool along with having migrated over to another remote server as we have faced with some hackers gaining access and then flushing the logs by which all information of their presence on server is lost.
Post a Comment