Help me in finding logic


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help me in finding logic
# 22  
Old 04-11-2009
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
Login or Register to Ask a Question