If you want to script this yourself you save the threshold to a variable, run 'df -m' and pipe it through awk with the devicename as searchterm, print the (space separated) fifth field and save that as a variable. Then remove the percentage sign from the variable ("VAR=${VAR//\%}"), then make the variable have a default value to take unmounted partitions into account ("${VAR:=0}"), then compare ("-ge") with your threshold value and "&& mail args".
|