5 echo "Usage: $0 <fs> <percentage> [email]"
7 echo " fs - file system to check"
8 echo " percentage - acceptable file system usage treshold"
9 echo " email - send warning to specified e-mail address (print to stdout, if omitted)"
10 echo "Example: $0 / 95 admin@cutekittens.tld"
14 if [ $
(df
-m $1 |
sed 1d |
awk '{print $5}' |
sed "s/%//") -ge $2 ]
16 subject
="WARNING! File system usage ($1) on $(hostname) is higher than $2 percent!"
22 df
-m |
mail -s "${subject}" $3