RE: Script to check disk space on AIX/HP-UX

  • From: "Zelli, Brian" <Brian.Zelli@xxxxxxxxxxxxxxx>
  • To: "'alex@xxxxxxxxxxxxxx'" <alex@xxxxxxxxxxxxxx>, 'Oracle I List' <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 13 Apr 2011 14:18:19 -0400

Here is what I use as part of another script.


#-------------------------------------------------------------
# Set variables for script.
# This is the only place you need to modify.
#-------------------------------------------------------------
ORACLE_BASE=/u01/oracle
ORACLE_HOME=/u01/oracle
PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/local/bin:
RUN_DATE=`date '+%Y%m%d_%H%M%S'`
LOG_DATE=`date '+%Y%m%d'`
BACKUPDIR=/u04
BACKUPSPACE=0
WARNINGSIZE=75
MAILFILE=mailfile.out
MAILSUBJECT=mailsub.out
MAILBODY=mailbody.out
export ORACLE_BASE ORACLE_HOME PATH RUN_DATE LOG_DATE
export BACKUPDIR BACKUPPATH BACKUPSPACE
export WARNINGSIZE MAILFILE MAILSUBJECT MAILBODY RUNFILE
#----------------------------------------------------------------------
# Check status to see if space exists in directory.
#----------------------------------------------------------------------
BACKUPSPACE=`df -k ${BACKUPDIR}| tail -1|awk '{print $1}'`
if [ $BACKUPSPACE -gt $WARNINGSIZE ]; then
  echo "Subject: Disk Space low" > $MAILSUBJECT
  echo "WARNING...Disk Space low in ${BACKUPDIR} For NEXT BACKUP" > $MAILBODY
  cat $MAILSUBJECT $MAILBODY > $MAILFILE
  mail -t "your email address" < $MAILFILE
  rm mailsub.out
  rm mailbody.out
  rm mailfile.out
fi
exit


ciao,
Brian

Brian J. Zelli
title          => Senior Database Administrator
dept         => Enterprise Applications/Systems Integration
org           => Roswell Park Cancer Institute
phone       => (716) 845-4460
email        => brian.zelli@xxxxxxxxxxxxxxx<mailto:brian.zelli@xxxxxxxxxxxxxxx>


________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Alex List
Sent: Wednesday, April 13, 2011 2:06 PM
To: Oracle I List
Subject: Script to check disk space on AIX/HP-UX

Hi,

I have a shell script scheduled to run daily on Linux and check the disk space.
After reaching a limit of x% partition full, it sends mail to a group alerting 
the issue.

For HP-UX and AIX many parameters are different and doesnt work.
As I dont have skills enough to adapt this script, I thought if someone else 
has this kind of check/alert to share.

I really appreciate any comment or thought.
Thank you.
Alex


This email message may contain legally privileged and/or confidential 
information.  If you are not the intended recipient(s), or the employee or 
agent responsible for the delivery of this message to the intended 
recipient(s), you are hereby notified that any disclosure, copying, 
distribution, or use of this email message is prohibited.  If you have received 
this message in error, please notify the sender immediately by e-mail and 
delete this email message from your computer. Thank you.

Other related posts: