Created
October 1, 2012 12:18
-
-
Save murphybytes/3811301 to your computer and use it in GitHub Desktop.
does remote disk checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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