logwatch tool to monitor all the log files and send you via mail

 Step:1

sudo apt-get update

sudo apt-get install logwatch


Step 2: Configure Logwatch

sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf

Edit configuration file
sudo nano /etc/logwatch/conf/logwatch.conf

Key parameters to configure:
Output
Output = mail

MailTo:
MailTo = your-email@example.com

MailFrom:
MailFrom = logwatch@example.com

Detail:
Set the level of detail (Low, Med, High).
Detail = Low

Service:

Service = All

Step:3

LogDir = /var/log


Step 4: Test Logwatch Configuration

sudo logwatch --output mail --mailto your-email@example.com --detail Low

Comments

Popular posts from this blog

Linux Commands part - 2