Tuesday, May 31, 2011

Monitor your logs with Logwatch

Logwatch is a Tool used to monitor linux logs and generate reports.


Q:what type of reports logwatch provide?



Ans: Reports Which we can generate with Logwatch as follows.
1-Faild Login Attempts.
2-Successful Login Attempts.
3-Storage Monitoring Report. (Free and used space)

Above you read a short intro of  logwatch

Here is a Guide for installing and configuring logwatch on Debian 5

Before Installing logwatch you must upgrade your packages using this command in your terminal.

#apt-get update
#apt-get upgrade


This Command Insure that your packages are installed on your linux are up-to-date.
After Completing this Command

We are ready to install logwatch.
follow this command for installing logwatch on your debian.

 
#apt-get install postfix logwatch
 
when this command successfully done..!!! 
we move further for configurations.
In configuration we perform the steps for setting our logwatch tool to send these
logs to specified Email Address.
Okay.. now lets start configurations.
you need to edit logwatch.conf file
Edit the file with this command.
#/usr/share/logwatch/default.conf/logwatch.conf
 
 
Set your parameters with this sequence.
Output = mail
Format = html
MailTo = your-mail@your-domain.com
MailFrom = your-email@your-domain.com
 
Note : your Email Address should be Valid beacuse these settings tells to logwatch
send these reports to MailTo = your-mail@your-domain.com From
MailFrom = your-email@your-domain.com  In Html Format.

Test your logwatch installation & configuration with this command.
#logwatch
this command sends you an email for testing purpose you need to check your email for checking your configurations. Also Check your Spam folder.

okay..!!
if you receive a successful email it means your Monitoring system working fine.

Now we have more work to do. to configure our server send us reports with daily routine at a specific time.
  Type this command to set your time at 2:00AM Daily.
# m h dom mon dow   command
0 3  * * *          /usr/sbin/logwatch

Congratulations...! You have configure your Monitoring system successfully..

Hope you enjoy this Tutorial...!!

Don't Forgot to say thanks..


No comments:

Post a Comment