diff --git a/README.md b/README.md index 65fcd34..07a0431 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,13 @@ echo -e "To: tobias@tobiastime.xyz\nFrom: snorlax@tobiastime.xyz\nSubject: RAID logfile=/var/log/raidtemp.log -raidtemp=$(megacli -AdpAllInfo -aAll | grep -i 'roc temperature' | awk '{print $4, $5, $6}') +raidtemp=$(megacli -AdpAllInfo -aAll | grep -i 'roc temperature' | awk '{print $4}') -echo "The RAID controller's temperature is "$raidtemp" at $(date)" >> "$logfile" +echo "The RAID controller's temperature is "$raidtemp" degrees celsius at $(date)" >> "$logfile" + +#If the RAID card's temp is above 80 degrees email me + +[ "$raidtemp" -gt 80 ] && echo -e "To: tobias@tobiastime.xyz\nFrom: snorlax@tobiastime.xyz\nSubject: RAID Array\nMegaCLI has reported the RAID card's temperature is above 80 degrees celsius at $(date)" | ssmtp tobias@tobiastime.xyz ``` Crontab Entry, (this runs the script every 3 hours):