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
cf(1)																	     cf(1)

   NAME
       cf - Confluence compiler

   SYNOPSIS
	   cf [options] [file] [arguments]

   DESCRIPTION
       Confluence  is  a functional programming language for reactive system design, including digital logic systems (ASIC, FPGA) and control ori-
       ented hard real-time software.

       The Confluence compiler (cf) translates a Confluence description into Verilog and VHDL (for digital logic synthesis), C (for simulation and
       software targets), and NuSMV (for formal verification, via model checking).

   OPTIONS
       -h OR -help Prints this information then exits.

       -b filename OR -base_env filename

	      Sets the base environment for the compilation.
		     Overrides the CF_ENV

	      environment variable.
		     If CF_ENV not defined and -base_env option not set, the base environment defaults to /usr/share/confluence/base.cf.

       -e integer OR -error_limit integer

	      Sets the maximum number of reported errors.
		     A negative number reports all errors.

       -c OR -compile_only Parses and compiles, but does not evaluate a program.

       -o name

	      Sets the output file name.
		     Default is out.fnf.

       -test Run the built in unit tests.

   ENVIRONMENT VARIABLES
       CF_ENV A filename that specifies the base environment (commonly base.cf).

       CF_LIB The directory location of the Confluence standard library (optional).

   VERSION
       0.10.6

   AUTHOR
       Tom Hawkins (tomahawkins@yahoo.com)

   SEE ALSO
       http://www.confluent.org/

   COPYRIGHT
       Copyright (C) 2003-2005 Tom Hawkins

								  31 January 2010							     cf(1)