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: Need script that monitors for archive directory filling up

RE: Need script that monitors for archive directory filling up

From: Smith, Ron L. <rlsmith_at_kmg.com>
Date: Wed, 13 Dec 2000 15:28:49 -0600
Message-Id: <10709.124498@fatcity.com>


Here is the script we use. It is part of a set of scripts that run every 15 minutes. The script will monitor whichever filesystem you pass it when it is executed.

Ron Smith
Database Administration
rlsmith_at_kmg.com  

# ******************************************************************
#
# SYNTAX
#
# filesys.sh (/filesystem) (PCT) (dba)
#
# ******************************************************************

# cd to the monitoring script directory

. $HOME/cdmonitoring.sh

FILESYS=$1
FILESYSN=`echo $FILESYS | sed s!/!! `
PCT=$2
DBA=$3
ATCNT=`echo $DBA | grep @ | wc -l`
export ATCNT
PATH=/usr/local/bin:$PATH:.
export PATH
SERVER=`uname -a | cut -d " " -f2`

# Check to see if an error file exists. If it does get out.

if [ -e filesys_$FILESYSN.err ]
then echo "File filesys_$FILESYSN.err exists - will exit now"

        exit
fi

# Issue a bdf command and grep for the file system

RESULT=`bdf | grep $FILESYS | awk '{print $5 }' | cut -d% -f1 ` echo $RESULT

if [ "$RESULT" -le "0" ]

        then
        echo "File system not found" > temp_$FILESYSN.txt
        exit 99

fi

# Check to see if PCT used is greater than PCT

if [ "$RESULT" -gt $PCT ]

        then
        echo "-DBA- File system $FILESYS on Server $SERVER almost full " >
filesys_$FILESYSN.err
     if [ "$ATCNT" -gt "0" ]
             then
             echo "email sent"
             elm -s "-DBA- Warning! File system $FILESYS on Server $SERVER
almost full " $DBA < filesys_$FILESYSN.err
             else
             echo "page sent"
             pager $DBA "`cat filesys_$FILESYSN.err`"
     fi

fi

-----Original Message-----
From: Cherie_Machler_at_gelco.com [mailto:Cherie_Machler_at_gelco.com] Sent: Wednesday, December 13, 2000 1:12 PM To: Multiple recipients of list ORACLE-L Subject: Need script that monitors for archive directory filling up

I've been bit one time too many by the archive directory filling up in unix.

I am looking for a korn shell script that will log into the database and find out what mount point the archives log files are being stored on. Then I'd like the script to do something like a df -k and see if the mount point has crossed a threshold for percentage full (something like 85% full). If that mount point is more than 85% full, I'd like the script to send me an email.

Anybody have such a script they'd be willing to send me? I think I can code the SQL part but I'm not that great with the unix part.

Eternal gratitude in advance,

Cherie Machler
Gelco Information Network

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Cherie_Machler_at_gelco.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (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
Received on Wed Dec 13 2000 - 15:28:49 CST

Original text of this message

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