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: Email/Paging/Mobile Phone alerts

Re: Email/Paging/Mobile Phone alerts

From: John Carlson <jcarlson_at_CJ.COM>
Date: Thu, 22 Feb 2001 17:54:15 -0800
Message-ID: <F001.002BB46B.20010222173022@fatcity.com>

I will make the assumption this is on unix and you can write a shell script.  Here is a skeleton of the code.  You can put your own checks it.
 

EXAMPLE

>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

#!/bin/ksh
 

tail -1f alert_xxxxx.log | while read linedo
 

#### any other code you want here.
 
    echo $line | grep ORA-    if [ $? -eq
0 ] ; then       
(           
error=`echo $line | sed
's=:.*=='`           
echo "To: <A 
href="mailto:dba_alert_at_wherever.net">dba_alert_at_wherever.net"            
echo "Subject: `uname -n` 

$error"           
echo "`uname -n`
alert_log"           
echo $prevline | sed
's=:=-='           
echo $line | sed 's=:=-='        ) | mail <A
href="mailto:dba_alert_at_wherever.net">dba_alert_at_wherever.net    fi
 
    prevline=$line
 

done
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 

This will run perpetually and check every line the alert log writes.  You can test for any messages you want and send messages to whatever.  Note the sed command changes ':' to '-' because mail has a problem with colons in the text body sometimes.  Also, some mail servers cannot handle it properly without the extra "To:". 
 

Obviously, this is just a snippet of code.  You need to customize it for your own needs.  You may need to write other scripts to query the database to get number of connections and active connections if you need that.
 

HTH,
John Carlson
http://www.cj.com
>>> ravindra_at_sentica.com 02/22/01 03:15PM >>>I am looking at a solution of sending a email/paging/Mobilephone alertsin case of a problem on the database that is reported in the alert.logfile. like tablespace full,no. of processes exceeded,instance going downetc.I want a solution other than OEM.What are the other ways of sending suchalert to notify the person who takes care of the database.Thanks-Ravindra-- Please see the official ORACLE-L FAQ: http://www.orafaq.com--
Author: Ravindra Basavaraja  INET:
ravindra_at_sentica.com Received on Thu Feb 22 2001 - 19:54:15 CST

Original text of this message

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