# FS usage limit in %USAGE_LIMIT=80IP="$(/sbin/ifconfig eth0 | grep 'inet addr:' | awk '{print $2}' | sed 's/[[:alpha:]:]*//')"# multiple recepients may be specified separated by white spaceMAILTO="root"SUBJECT="WARNING: Disk usage on $IP over limit ($USAGE_LIMIT%)"TMP_FILE="$(mktemp /tmp/XXXXXXXX)"## Here we go#df -l | grep -v ^Filesystem | while read line; do fs=$(echo $line | awk '{print $6}') usage=$(echo $line | awk '{print $5}' | sed 's/%//') if [ $usage -gt $USAGE_LIMIT ]; then echo $fs : $usage% >> $TMP_FILE fidone# send warning in case there is something to send[ -s "$TMP_FILE" ] && cat $TMP_FILE | mail -s "$SUBJECT" "$MAILTO"rm -f "$TMP_FILE"