
Script to Monitor Specific FIel system and send alert
Hi, here is a script that will perform an action if a filesystem goes
over
a specified capacity. Just change the echo line to whatever action
you want to take:
#!/bin/ksh
for SLICE in `df -k | egrep -v Filesystem | nawk '{print $6}'` ; do
USED=`df -k $SLICE | tail -1 | nawk '{print int($5)}'`
# If capacity is over 85%, do something
if [ "$USED" -gt 85 ] ; then
echo "The ${SLICE} partition is over ${USED}% full."
fi
done
Hope this gets you started
jim