04-11-2009
34,
0
Join Date: Mar 2009
Last Activity: 15 April 2011, 3:26 PM EDT
Location: Montreal, Canada
Posts: 34
Thanks Given: 0
Thanked 0 Times in 0 Posts
aks,
Here is an example for what your wotsrc could be, assuming:
- The alert frequency will be every 10 minutes
- Lines containing the expression "TimeOutException" and "OutOfMemoryException" in file /var/log/TraceLog.log will trigger an email
- You want to be alerted for any logged message in /var/log/Critical.log except messages starting with "Test"
---- start of wotsrc ----
config poll 600
from /var/log/TraceLog.log
/.*TimeOutException*./ mail=yourself@yourmail.net
/.*OutOfMemoryException*./ mail=yourself@yourmail.net
from /var/log/Critical.log
/Test/ ignore
/(.*)/ mail=yourself@yourmail.net
----end of wotsrc ----
you may start it using that script from /etc/init.d/wots
#!/sbin/sh
WOTS_CFG=/usr/local/etc/wotsrc
WOTSPID=/var/run/wots.pid
case "$1" in
start)
# WOTS
#
touch $WOTSPID
chgrp nobody $WOTSPID
chmod 664 $WOTSPID
su nobody -c "/usr/local/bin/wots --config=$WOTS_CFG --pidfile=$WOTSPID &"
;;
restart) ;;
stop)
if [ -f $WOTSPID ]; then
kill -15 `cat $WOTSPID`
fi
;;
esac
- Laurent