Skip to content

Instantly share code, notes, and snippets.

@murphybytes
Created October 1, 2012 12:18
Show Gist options
  • Save murphybytes/3811301 to your computer and use it in GitHub Desktop.
Save murphybytes/3811301 to your computer and use it in GitHub Desktop.
does remote disk checks
#!/bin/bash
limit=$2
echo $1
number=`ssh jam@${1} df -lah | awk '$1=="/dev/sda5"{print int($5)}'`
echo $number
if test $number -gt $limit
then
subject="Low Disk Space on $1"
message="Disk use is $number%. Error threshold is $limit%"
echo $subject
echo $message
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment