Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: My 10 liner alert log monitoring WORKING shell Script !!! Comments Please !!!!

Re: My 10 liner alert log monitoring WORKING shell Script !!! Comments Please !!!!

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Thu, 2 Nov 2006 22:32:38 +0100
Message-ID: <01ab01c6fec6$6cae2690$3a08310a@SYSTEM1>


> Actually its 20 lines,
> I did some initial tests, seems to be working fine.
> Appreciate your comments and feedback, suggestions
[...]

Just another point of view: I would use a kind of daemon.

tail -f alert.log | while read error; do

   case "$error" in
     ORA-*) printf "%s\n" "$ORACLE_SID" "$(date)" "$error" | mailx -s "$ORACLE_SID : ${error:0:8}" email_at_address.edu ;;

   esac
done

Just remember to restart the daemon if you remove/move the log :)

Regards
Dimitre

P.S. The ${var:start:lenght} syntax is a valid for ksh93 and bash > 2.0, if I recall correctly.

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Nov 02 2006 - 15:32:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US