Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. *cat $PATHNAME/NodeList.csv | while read output
  2. do
  3. STATUS=`ssh -q $output 'df -P -H' |tail -n +2 | awk '{print $5 " " $1}'`
  4. if [ $? -eq 0 ]; then
  5. ALERT=40
  6. echo $output
  7. usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
  8. partition=$(echo $output | awk '{ print $2 }' )
  9. elif [ $usep -ge $ALERT ]; then
  10. echo "Running out of space "$partition ($usep%)" on ${output} as on $(date)"
  11. else
  12. echo "Disk Usage for $partition is $usep% which is below Threshold...!!!"
  13. fi
  14. else
  15. echo "$output is Not Reachable"
  16. fi
  17. done > $PATHNAME/ReportPing.csv*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement