Wong,
Gald to help and thanks for the points!
here is a great script to watch your files system.
JD
#!/bin/ksh
set -vx
#####################################################################
# Check the stinkin disk space.
# If it's 60% or over, email somebody.
# If it's 65% or over, page somebody.
# Jim Dunn
#
# This file is used with crontab entry:
#
# # Check disk space every 15 min.
# 0,15,30,45 * * * * /usr/local/bin/chk_dsk_space > /dev/null 2>&1
#####################################################################
function check_bdf {
bdf -l |grep vg00 | awk '$0 !~ /^F/' > /var/tmp/bdf_out
#add another file system here
#bdf -l |grep vg01 | awk '$0 !~ /^F/' >> /var/tmp/bdf_out
awk '{if (NF!=1){
if (NF==5){
print $4"\t" $5"\t"
}
else{
print $5"\t\t" $6"\t"
}
}}' < /var/tmp/bdf_out
rm /var/tmp/bdf_out
}
check_bdf | sed 's/'%'/''/' > /var/tmp/bdf_info
function panic {
while read percent dir ; do
if ] ; then
print "File system `hostname`:$dir is at $percent%" < /dev/null
if ] ; then
mailx -s "File system full-`hostname`:$dir is at $percent%" jimd_pager < /dev/null
#print "File system full-`hostname`:$dir is at $percent%"
fi
fi
done
} < /var/tmp/bdf_info
panic
rm /var/tmp/bdf_infoMessage was edited by:
James Dunn