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

  • From: "Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx>
  • To: <cichomitiko@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 3 Nov 2006 11:03:57 -0700

You can not worry about a daemon restart if you use 'tail --follow=name
alertSID.log'.

--
Ron Reidy

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Radoulov, Dimitre
Sent: Thursday, November 02, 2006 2:33 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: My 10 liner alert log monitoring WORKING shell Script !!!
Comments Please !!!!

> 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@xxxxxxxxxxx ;;
   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. 

--
//www.freelists.org/webpage/oracle-l



This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is 
intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

--
//www.freelists.org/webpage/oracle-l


Other related posts: