Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need To Monitor Disk Space

Status
Not open for further replies.

Aselim

MIS
May 3, 2000
2
0
0
US
I desperatley need to monitor free space on my filesystems. Aside from an external app does anyone know any quick way (a script etc...) that I can use to do so??
 
i have been attempting this myself and <br><br>my awk statement does not see the 90 as a 90.<br><br>90 &gt; 95 is true ?????<br><br>do i need to convert the 90 to an interger or something?<br><br>mikeb
 
try this, hp-ux 11.00<br><br>#! /bin/sh<br><br># audit of disk space and mail to sys admins if over 90% full<br>bdf ¦ grep -iv filesystem ¦ awk '{ print $6
 
This is a ksh which we run every 15 minutes, it uses a control file, making it more flexible. It runs out of a nfs mounted file and keeps an eye on 9 HP_UX boxes.

FILE01=&quot;/tmp/$LOGNAME.temp.bdf.msg1&quot;
FILE02=&quot;/tmp/$LOGNAME.temp.bdf.msg2&quot;
FILEcontrol=/tmp/$LOGNAME.temp.bdf.control
rm -f $FILEcontrol

cat /Syst/allow03 | egrep &quot;FILESYSTEM:&quot; >> $FILEcontrol
awk '{OFS=&quot; &quot;} {FS=&quot;:&quot;} {print $2 $3 $4 $5}' $FILEcontrol |
while read F2 F3 F4 F5
do
# echo &quot;$F2=$F3=$F4=$F5=&quot;
if [ &quot;$(hostname)&quot; = &quot;$F2&quot; ]; then
export MountP=&quot;$F3&quot;
export PercentFull=&quot;$F4&quot;
export WarningFlag=&quot;~&quot;
rm -f $FILE01
rm -f $FILE02
/usr/bin/bdf $MountP > $FILE01
BDF1=$(grep $MountP $FILE01 | cut -c46-47)
if [ &quot;$BDF1&quot; -gt &quot;$PercentFull&quot; ]; then
export WarningFlag=&quot;X&quot;
echo &quot;=&quot; > $FILE02
echo &quot;= $(date)&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
echo &quot;= WARNING !!&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
echo &quot;= $MountP&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
echo &quot;= is $BDF1% full&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
echo &quot;= on $(hostname)&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
echo &quot;= You may want to schedule a cleanup&quot; >> $FILE02
echo &quot;=&quot; >> $FILE02
cat $FILE02 | /usr/bin/mailx -s &quot;FILE SYSTEM ON $(hostname)&quot; $F5@TFSGATE
fi
fi
done

rm -f $FILE01
rm -f $FILE02
rm -f $FILEcontrol


The control file (allow03) looks like this:

FILESYSTEM - FILE SYSTEM NOTIFICATIONS
FILESYSTEM:HOSTNAME :Mount :%% :NOTIFY
FILESYSTEM:hp01 :/tmp :80 :jbond
FILESYSTEM:hp01 :/tmp :80 :dtracy
FILESYSTEM:hp06 :/u01 :88 :jbond
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top