Created
January 20, 2014 20:37
-
-
Save arturoherrero/8528658 to your computer and use it in GitHub Desktop.
Email notification for monitor load
This file contains hidden or 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
| #!/usr/bin/env bash | |
| mail="[email protected]" | |
| maxload="9" | |
| hostname=`hostname` | |
| load=`w | head -n1 | awk '{print $10}' | cut -d"," -f1` | |
| if [ $load -gt $maxload ] | |
| then | |
| echo "$hostname - High load found" | | |
| mail -s "$hostname - High load found" $mail | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment