Here's what I use.  Pretty basic (crappy) but may be a starting point for
you.  You'll have to go through and change where you alert files are stored
and to whom to send the email.  I schedule them to run about every 15
minutes. blat is a mail utility you can downloaded from the internet.  
 
 
 
HP-UX:
 
if [ -s "ORAerr.tmp" ]
  then
    exit
fi
grep ORA- /u01/app/oracle/admin/orcl/bdump/alert_sid.log > ORAerr.tmp
if [ -s "ORAerr.tmp" ]
  then
  cat crlf.txt /u01/app/oracle/ORAerr.tmp | /usr/sbin/sendmail
-CsendmailORA.cf 
-F"Oracle dbsrv1 alert error" username @company.com
<mailto:[EMAIL PROTECTED]> 
fi
 
 
 
WINdoze:
 
find "ORA-" c:\orant\rdbms80\trace\*ALRT.LOG* > e:\dbwork\alerts.txt
if errorlevel 1 goto NEXT
rem net send dba "An ORACLE error has been found in the alert file.  Please
check the alerts.txt file on dbsrv2"
blat e:\dbwork\alerts.txt -t dba @company.com <mailto:[EMAIL PROTECTED]>  -s
"Oracle (dbsrv2) alert"
:NEXT
find "ORA-" c:\orant\rdbms80\trace\orcl\*ALRT.LOG* >
e:\dbwork\alertsorcl.txt
if errorlevel 1 goto END
rem net send dba "An ORACLE error has been found in the ORCL alert file.
Please check the alerts.txt file on dbsrv2"
blat e:\dbwork\alertsorcl.txt -t dba @company.com <mailto:[EMAIL PROTECTED]>
-s "Oracle ORCL alert"
erase c:\orant\rdbms80\trace\orcl\orclalrt.tmp
rename c:\orant\rdbms80\trace\orcl\orclalrt.log orclalrt.tmp
:END

 

-----Original Message-----
Sent: Friday, March 21, 2003 11:40 AM
To: Multiple recipients of list ORACLE-L


Anyone have a "simple" script to scan an alert
log for errors and email a report if found?
 
Customer wants something to run "often", but only
email when an error is found. I've got something
that does a bit of that and runs twice a day, but
always sends out.
 
Thanks.
 
Maks.
 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Eberhard, Jeff
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to