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: disk information alert

RE: disk information alert

From: Glenn Travis <c-glenn.travis_at_wcom.com>
Date: Wed, 23 May 2001 14:28:49 -0700
Message-ID: <F001.0030C823.20010523135050@fatcity.com>

Here is mine;
NOTE: This is for solaris and reference the /etc/vfstab file for verification, but you can take that out. NOTE2: Change email address.

HTH!


#!/bin/ksh
#
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#       Purpose:
#               To monitor filesystem usage.
#
#               If the filesystem is over the specified
#               threshold, an email will be sent.
#
#       Parameters:
#               $1 - email to send notification to.
#               $2 - filesystem to check:%full threshold.
#               $x - filesystem to check:%full threshold.
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

if [ $# -lt 2 ]
then echo "Syntax: $0 <emailtonofity> <filesystem:threshold>."

        echo "Example: $ chkfilesystem.ksh emailaddress_at_email.com /tmp:95
/export/home:80 /export/tools:90 ..."

        exit 1
fi

TMPFIL=/tmp/chkfilesystem.tmp.$$
HST=`hostname`

EMAIL=$1
shift

while [ "$1" != "" ]
do

        FILESYS=`echo $1 | cut -f1 -d':'`
        THRESHOLD=`echo $1 |cut -f2 -d':'`

        grep "$FILESYS" /etc/vfstab > /dev/null 2>&1
        if [ $? -ne 0 ]
        then    echo "Filesystem $FILESYS does not exist on $HST."
                exit 1
        fi

        echo "Checking $FILESYS > ${THRESHOLD}%..."  | tee $TMPFIL

        pctg=`df -k | grep -i $FILESYS | awk '{print $5}' | tr -d %`

        if [ $pctg -gt $THRESHOLD ]
        then    echo "$FILESYS filesystem on $HST is ${pctg}% full."
                df -k $FILESYS | tee -a $TMPFIL
                mailx -s "$FILESYS on $HST ${pctg}% full!!  Please
investigate." $EMAIL < $TMPFIL
                rm $TMPFIL
        fi

        shift

done

-----Original Message-----
Sent: Wednesday, May 23, 2001 9:36 AM
To: Multiple recipients of list ORACLE-L

Hi Gurus
Does any one having scripts to know disk space once particular partion =>75% let assume the below is not exact output of df -k command $df -k

/u01 68
/u02 40
/u03 53
/u04 76

As the disk partition reach to 75% or more.We need to get email alert. If some have such kind of script let me know.

Thanks
-seema



Get your FREE download of MSN Explorer at http://explorer.msn.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Seema Singh
  INET: oracledbam_at_hotmail.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
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Glenn Travis
  INET: c-glenn.travis_at_wcom.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
also send the HELP command for other information (like subscribing).
Received on Wed May 23 2001 - 16:28:49 CDT

Original text of this message

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