Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function storage_status {
- # Par1: host
- ALERTS = $( ssh -o StrictHostKeyChecking=no -t $USER_TM@$i \
- "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 } ' " )
- [ $ALERTS -ne 0 ] || return "Storage is over $_SPACE_THRESHOLD_ %" && return "OK"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement