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
WNPP-ALERT(1)                                                 General Commands Manual                                                WNPP-ALERT(1)

NAME
wnpp-alert - check for installed packages up for adoption or orphaned SYNOPSIS
wnpp-alert [--diff] [package ...] wnpp-alert --help|--version DESCRIPTION
wnpp-alert downloads the lists of packages which have been orphaned (O), are up for adoption (RFA), or the maintainer has asked for help (RFH) from the WNPP webpages, and then outputs a list of packages installed on the system, or matching the listed packages, which are in those lists. Note that WNPP, and therefore wnpp-alert's output, is source package based. OPTIONS
--diff, -d If the ~/.devscripts_cache directory exists, compare the output of wnpp-alert to the previous output (cached in the file wnpp-diff) and output the differences. --help, -h Show a summary of options. --version, -v Show version and copyright information. SEE ALSO
http://www.debian.org/devel/wnpp AUTHOR
wnpp-alert was written by Arthur Korn <arthur@korn.ch> and modified by Julian Gilbey <jdg@debian.org> for the devscripts package. It is in the public domain. DEBIAN Debian Utilities WNPP-ALERT(1)