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: monitoring listener.log

RE: monitoring listener.log

From: NGUYEN Philippe (Cetelem) <philippe.nguyen_at_cetelem.fr>
Date: Thu, 03 May 2001 08:44:45 -0700
Message-ID: <F001.002F878C.20010503082109@fatcity.com>

Hi and
thanks to " Danisment Gazi Unal (what does it mean ?)" Here
is the script :

#!/bin/sh
# This script make 2 things :
# 1- archive alert files
# 2- search "ORA-" in alert.log file
# if error is found , send an email to adresses passed in parameters
#
# Entry parameters :
# 1- SID
# 2- list of emails separated by a space
# Ex : % ALTERTCHECK ORCL <A

href="mailto:user1_at_company.com">user1_at_company.com <A href="mailto:user2_at_company.com">user2_at_company.com
# ---------------------------------------------------------------
SCRIPT_DIR=/home/ORCL/script
ORACLE_SID=$1
shift
EMAIL=$*
# Set ALERT_DIR and ALERT_FILE
# ------------------------------------------

ALERT_DIR=/app/oracle/admin/$ORACLE_SID/bdump
ALERT_FILE=alert_$ORACLE_SID.log
ALERT_LOG=$ALERT_DIR/$ALERT_FILE

ERRFILE=$SCRIPT_DIR/ALERT_ERRORS.TXT
SUBJECT="Error in alert file of $ORACLE_SID"
# Remove the alert file #30
# ------------------------------------------------
if [ -f $ALERT_LOG.30 ]
then
/bin/rm $ALERT_LOG.30
fi
# Renanme the alert file, ex: 29 to 30, 28 to 29, .., 01 to 02, etc.
# ------------------------------------------------------
i=29
while [ $i -ge 1 ] ;
do
j=`expr $i + 1`
if [ -f $ALERT_LOG.$i ]
then
mv $ALERT_LOG.$i $ALERT_LOG.$j
fi
i=`expr $i - 1`
done
 
# Rename the current alert log file to #1
# -------------------------

if [ -f $ALERT_LOG ]
then
mv $ALERT_LOG $ALERT_LOG.1
fi
# Create a new alert file, not mandotory (Oracle will do this)
# --------------------------------------------
touch $ALERT_LOG
chmod 777 $ALERT_LOG
# Remove the error file
# ---------------------------

if [ -f $ERRFILE ]
then
/bin/rm $ERRFILE
fi
 
# Searching for ORA- in the alert log #1
# if error, send mail to adresses in parameters
# -------------------------------------------------------
cat $ALERT_LOG.1 |grep '\ORA-' > $ERRFILE if [ -s $ERRFILE ]
then
cat $ERRFILE | mailx -s "$SUBJECT" $EMAIL fi

  -----Message
  d'origine-----De: Saurabh Sharma
  [mailto:saurabhs_at_fcsltd.com]Date: vendredi 27 avril 2001   12:12Ą: Multiple recipients of list ORACLE-LObjet: Re:   monitoring listener.log
  hey can u elaborate how do u scan each log   file, and convert it in email msg.
  how do u do this..
   
  saurabh sharma
  dba
   
  <BLOCKQUOTE
  style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">

    Hi list,
    We have a script wich monitor the alert.log for     each database. This script scan the alert.log file and send an email if an     ORA-xxx error occured
    Now, we want to write a script monitoring the     listener.log file : wich kind of message or variable indicate a     network  problem (ORA-xxx, ...) ?
    ...then we 'll have the same question for the log     file made by OEM ! TIA    Received on Thu May 03 2001 - 10:44:45 CDT

Original text of this message

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