[HPADM] [SUMMARY] Disk Usage

From: Stephanie C (stepchung@gmail.com)
Date: Tue Aug 23 2005 - 11:48:05 EDT


Thanks Roger Realsen and Goncheroski, Joseph J. Both Roger and Jo come
up with the following wonderful script. This is what I need. Thanks
Guys...

Original question: Email/page if disk file system reaches a critical level.

----------------------------------------------------------------------------------------------------
#!/bin/ksh

CRIT=/dmp/disk_critical.log
DANG=/dmp/disk_dangerous.log

bdf|grep -v Filesystem|grep -v SD_CDROM|sed 's/%//g'|while read a b c d e f
do
  if [ ${e} -gt 60 ]
  then
     echo "Filesystem ${f} is at Critical level: $e% " > ${CRIT}
  elif [ ${e} -gt 50 ]
  then
     echo "Filesystem ${f} is at Dangerous level: $e% " > ${DANG}
  else
     echo "Filesystem ${f} is okay" > /dev/null
  fi
done

if [ -f ${CRIT} ] ; then
   mailx -m -s "CRITICAL DISK USAGE" email@company.com < ${CRIT}
fi
if [ -f ${DANG} ] ; then
   mailx -m -s "DANGEROUS DISK USAGE" email@company.com < ${DANG}
fi

rm -f ${CRIT}
rm -f ${DANG}
-------------------------------------------------------------------------------------------

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:49 EDT