Operating System - Linux
1828370 Members
2951 Online
109976 Solutions
New Discussion

Re: Tools to monitor log files

 
wvsa
Regular Advisor

Tools to monitor log files

Good afternoon;

Trying to find out how my fellow linux admins are monitoring their log files. Is anyone using swatch? If so where can I download swatch for redhat linux as4. Are there other log monitoring tools, tools that will work in the same vain as swatch, the ability to send a email when certain patterns are detected/noted in the log files.

Thank you for the input, will do my best to assign points.
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: Tools to monitor log files

Shalom,

Since almost everybody needs something different, the best tool in my opinion are your own shell scripts.

You grep the log file, look for critical terms and use mail -s to send the output to email.

Example:

lbolts=$(grep -i lbolt /var/log/messages| wc -l)

lbolt(a hpux disk error)is searched for int he log and converted to a count.

if [ $lbolt -ge 1 ]
then
echo "Disk error" | mail -s "Disk Error" yourmail@your.net
fi

The if/fi loop should be self evident.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: Tools to monitor log files

'logwatch' (which should already be on your RH machine) does a fantastic job too.. and is fairly easily cusomizable.

It's just set to run once-a-day by default, but you can change that pretty easily.
One long-haired git at your service...