From de9c1fca8015d069dcf7a2d36f15a535d7566546 Mon Sep 17 00:00:00 2001 From: NoLooseEnds Date: Thu, 12 Apr 2018 23:45:34 +0200 Subject: [PATCH] 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. --- R710-IPMI-TEMP/R710-IPMITemp.sh | 6 ++++-- R710-IPMI-TEMP/readme.md | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/R710-IPMI-TEMP/R710-IPMITemp.sh b/R710-IPMI-TEMP/R710-IPMITemp.sh index 24b0e9c..27a7bcc 100755 --- a/R710-IPMI-TEMP/R710-IPMITemp.sh +++ b/R710-IPMI-TEMP/R710-IPMITemp.sh @@ -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 \ No newline at end of file diff --git a/R710-IPMI-TEMP/readme.md b/R710-IPMI-TEMP/readme.md index 4db724b..5f8b1e3 100644 --- a/R710-IPMI-TEMP/readme.md +++ b/R710-IPMI-TEMP/readme.md @@ -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/) @@ -50,6 +50,7 @@ _Note: The RPM may differ from model to model_ **Example of a command:** + `ipmitool -I lanplus -H 192.168.0.120 -U root -P calvin raw 0x30 0x30 0x02 0xff 0x10`