Install and configure Logwatch in Ubuntu-Server

To watch the logs and send alert periodically to admin by configuring logwatch.

Install Logwatch using

# sudo apt-get install logwatch

Edit logwatch.conf file

# /usr/share/logwatch/default.conf/logwatch.conf

Change the following:

# Output = mail
# Format = html
# MailTo = user@https://https://https://https://www.https://https://https://www.

Save and exit wq!

Edit the file 00logwatch to append the mail were we need to get the Logs

# /etc/cron.daily/00logwatch

Add the following line.

# /usr/sbin/logwatch –mailto
# /usr/sbin/logwatch –mailto

Save and exit.

Test the Logwatch using command

# logwatch

If we need to get log in specific time add in cronjob as below
Create a Cronjob using

crontab -e

Append the Below Content

# m h dom mon dow command
0 10 * * * /usr/sbin/logwatch

That’s it we have done with log watch configuration.

Leave a Comment

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

We promise not to spam you, and we don't usually send more than one email a week.

You have Successfully Subscribed!