Installing And Configuring Logwatch In Ubuntu 14.04

What is Logwatch?

Logwatch is a customizable log analysis system. Logwatch collects the system’s logs and create a good format of report, We can get the log reports in our mail from any Linux distribution based Server’s.


Server Setup:

IP Address   : (Requires a static IP to work this)
Hostname    :
ifconfig | grep inet


sudo apt-get install logwatch -y


sudo dpkg -l | grep logwatch 

Step 2: Make changes to the configuration:

After installation we need to make changes to the conf file under

vim /usr/share/logwatch/default.conf/logwatch.conf

Output = mail
 Format = html
 MailTo = ***** (Your mail id)

Range = Today

Step 3: E-mail Setup to Receive Emails

Then edit the file 00logwatch to append the mail were we need to get the Logs, Logwatch logs will get delivered to the below Email.

vim /etc/cron.daily/00logwatch

Add the following line with email ID. By default there will be /us/sbin/logwatcg –mailto comment it using # And add the below content.

/usr/sbin/logwatch --mailto ***
/usr/sbin/logwatch --mailto

Step 4: Test the Logwatch:

To test the Logwatch just simple run the logwatch command:


Step 5: Schedule Cron Jobs

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

crontab -e

Append the Below Content or add the own scheduler.

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

Note: It won`t work in local IP .

for checking the smtp connection
telnet 25

for closing Ctrl + ]

sample mail


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s