Wednesday, March 29, 2017

Daily Task Automation: High load notification

The below code will trigger an email if the load is higher than 5
load=`w | head -n1 | awk '{print$10}' | cut -d"," -f1`
if [ $load -gt 5 ]; then
echo "High Load Found." | mail -s "High Load Found."  mail@example.com
fi

No comments:

Post a Comment