View Single Post

  #2 (permalink)  
Old 06-10-2008, 04:58 PM
unSpawn unSpawn is offline
Junior Member
User
 
Join Date: Feb 2008
My distro: .
Posts: 10
Rep Power: 0
unSpawn is on a distinguished road
Default

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".
Reply With Quote