there are many you may try anyone ...
here is one
#!/bin/bash
ADMIN=yermail@yerdom.com
ALERT=90
df -H | grep -vE 'abc:/xyz/pqr | tmpfs |cdrom|Used' | awk '{ print $5 " " $1 }' | while read output; do
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
echo $usep
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Alert: Almost out of disk space $usep"
df -H | mail -s "Alert: out of disk space $usep" $ADMIN
fi
done
you may try this or this one ...
message=$(awk -v ALERT="$ALERT" '
NR == 1 {next}
$1 == "abc:/xyz/pqr" {next}
$1 == "tmpfs" {next}
$1 == "/dev/cdrom" {next}
1 {sub(/%/,"",$5)}
$5 >= ALERT {printf "%s is almost full: %d%%\n", $1, $5}
')
if [ -n "$message" ]; then
echo "$message" | mail -s "Alert: Almost out of disk space" "$ADMIN"
fi