Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function storage_status {
  2. # Par1: host
  3. ALERTS = $( ssh -o StrictHostKeyChecking=no -t $USER_TM@$i \
  4. "sudo df -h | awk ' function isper(x){return(v+x==x+0)} BEGIN {TS_SPACE=${_SPACE_THRESHOLD_} ; count = 0} { if (\$5 > TS_SPACE && isper(\$5) && NR != 1 ) { count=count+1 } } END { print count } ' " )
  5. [ $ALERTS -ne 0 ] || return "Storage is over $_SPACE_THRESHOLD_ %" && return "OK"
  6.  
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement