Quota monitoring of hard disk utilization
A small script used to monitor hard disk usage, used to monitor when hard disk usage exceeds a certain limit on the e-mail alarm.
#!/ bin/bash
ADMIN='localhost@localhost'
# set alert level 90% is default
ALERT=90
output=`df -H | grep -vE '^Filesystem| tmpfs| cdrom| used '| awk '{ print $5 " " $1 }'`
while :
do
#echo $output
usep=`echo $output | awk '{ print $1}' | cut -d'%' -f1`
partition=`echo $output | awk '{ print $2 }'`
if [ $usep -ge $ALERT ]; then
mail -s "Alert: Almost out of disk space "$partition $usep" on $(hostname) as on $(date)" $ADMIN
fi
done