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

Home -> Community -> Usenet -> c.d.o.server -> Re: I think this is a better way to get alert from alert.log

Re: I think this is a better way to get alert from alert.log

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 30 Jul 2002 19:22:58 +0200
Message-ID: <6pidkucjcobhs94llqedtogbl891vad813@4ax.com>


On 30 Jul 2002 09:05:32 -0700, yong321_at_yahoo.com (Yong Huang) wrote:

>In May there was a thread
>http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=3c37534ece5e3937&rnum=2
>talking about how to get alert about errors/warnings from alert.log.
>Recently I started to do a similar thing in a new way. Instead of
>periodically scanning these log files, why not do what tail -f does?
>So here's the command I use:
>
>nohup tail -f thelog | nohup nawk '/SomeString/ {system("mailx -s
>CheckLogNow youremail < /dev/null")}' &
>
>You can avoid "Sending output to nohup.out" if you launch it from csh.
>You need nawk or gawk because awk's system command may be broken. You
>do need two nohup's since nohup doesn't allow command sequences. You
>can also put the command sequences without nohup in a script and nohup
>thescript &.
>
>This approach is lighter-weight than the common method using a cron
>job. It also sends a notice to you as soon as the SomeString (such
>such ^ORA-00600 where ^ means line beginning) shows up in thelog
>instead of waiting till your cron job runs next time.
>
>If you use Windows, you have to use David Korn's UWin, Microsoft's
>Windows Services for UNIX (I'm really impressed by this one), Hamilton
>Lab's CShell for Windows, MKS, Cygwin or others similar.
>
>Critique is welcome.
>
>Yong Huang

How do you know you get *all* error messages if you rely on tail. Remember : *all* logswitches go to the alert. I have been dealing with a similar script which missed 4031 errors for *days*

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Tue Jul 30 2002 - 12:22:58 CDT

Original text of this message

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