Created
April 16, 2013 09:37
-
-
Save benoitjpnet/5394672 to your computer and use it in GitHub Desktop.
Check temperature of CPU and send mail if critical threshold is reached.
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
#!/bin/sh | |
[email protected] | |
subject="Warning: Temperature critical" | |
critical=50 | |
temperature=$(sensors -u coretemp-isa-0000 | grep temp2_input | grep -Eo "[0-9.]{2,}") | |
calc=$(echo "$temperature >= $critical" | bc) | |
if (( $calc )); then | |
echo -e "Attention, la température du processeur de la machine samba a dépassé le seuil\nde $critical °C ! Elle est actuellement de $temperature °C.\n\nVérifiez la climatisation de la salle serveur." | mail -s "$subject" "$mailto" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment