Skip to content

Instantly share code, notes, and snippets.

@arturoherrero
Created January 20, 2014 20:37
Show Gist options
  • Save arturoherrero/8528658 to your computer and use it in GitHub Desktop.
Save arturoherrero/8528658 to your computer and use it in GitHub Desktop.
Email notification for monitor load
#!/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