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 [EMAIL PROTECTED] /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: [EMAIL PROTECTED]

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: [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).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Glenn Travis
  INET: [EMAIL PROTECTED]

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: [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