Added healthchecks.io to the script instead

Added healthchecks.io to the script instead of cron command. That way I get a notification if the script triggers the dynamic fans.
This commit is contained in:
NoLooseEnds 2018-04-12 23:45:34 +02:00
parent f6d22cfe35
commit 6300d3306d
2 changed files with 6 additions and 4 deletions

View file

@ -27,10 +27,12 @@ TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW sdr type tempera
if [[ $TEMP > $MAXTEMP ]];
then
printf "Temperature is too high! ($TEMP C) Activating dynamic fan control!" | systemd-cat -t R710-IPMI-TEMP
echo "Temperature is too high! ($TEMP C) Activating dynamic fan control!"
printf "Temperature is too high! Activating dynamic fan control! ($TEMP C)" | systemd-cat -t R710-IPMI-TEMP
echo "Temperature is too high! Activating dynamic fan control! ($TEMP C)"
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x01
else
# healthchecks.io
curl -fsS --retry 3 https://hchk.io/8470021f-33f3-4a31-b2cd-741f28c47164 >/dev/null 2>&1
printf "Temperature is OK ($TEMP C)" | systemd-cat -t R710-IPMI-TEMP
echo "Temperature is OK ($TEMP C)"
fi

View file

@ -5,9 +5,9 @@ I'm running this on an Ubuntu VM on ESXi (on the R710 box), but it should be abl
I run the script via CRON every 5 minutes from my Ubuntu Server VM running on ESXi.
`*/5 * * * * /bin/bash /path/to/script/R710-IPMITemp.sh && curl -fsS --retry 3 https://hchk.io/XXX-XXX-XXX > /dev/null 2>&1`
`*/5 * * * * /bin/bash /path/to/script/R710-IPMITemp.sh > /dev/null 2>&1`
Notice thate I use [healthchecks.io](https://healthchecks.io) to notify if the cron command fails (it would also trigger if the internet goes down for some reason). Remember to get your own check URL if you want it, or else just remove the curl command.
Notice thate I use [healthchecks.io](https://healthchecks.io) in the script to notify if the temp goes to high (it would also trigger if the internet goes down for some reason). Remember to get your own check URL if you want it, or else just remove the curl command.
The Scripts [Reddit thread](https://www.reddit.com/r/homelab/comments/779cha/manual_fan_control_on_r610r710_including_script/)