This script will be helpful, If you need to be alerted when ever the disk usage on your server goes beyond certain limit.#!/bin/sh
ADMIN="me@somewher.com" # Set your Mail ID here, to which you need to get the alert Mail
# Set alert on disk usage beyond 90%
ALERT=90
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s "Alert: Almost out of disk space $usep" $ADMIN
fi
------
Save and install script as cronjob as per the requirement!