Last active
September 27, 2015 03:30
-
-
Save angelbotto/077702e24cb9f5190b05 to your computer and use it in GitHub Desktop.
checks consul
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 | |
cpuused=`top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}'` | |
critical=90 | |
warning=60 | |
if [[ $cpuused > $critical ]]; then | |
echo "CPU CRITIC $cpuused" | |
exit 2 | |
elif [[ $cpuused > $warning ]]; then | |
echo "CPU HIGH $cpuused" | |
exit 1 | |
else | |
echo "CPU COOL" | |
exit 0 | |
fi |
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 | |
freespace=`df | awk 'NR == 2 { print $5+0; exit }'` | |
critical=90 | |
warning=60 | |
if [ "$freespace" -gt $critical ]; then | |
echo "DISK USE CRITICAL $freespace" | |
exit 2; | |
elif [ "$freespace" -gt $warning ]; then | |
echo "DISK USE WARNING: $freespace" | |
exit 1; | |
else | |
echo "DISCK USE FINE" | |
exit 0; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment