Scripts/R710-IPMI-TEMP/R710-IPMITemp.sh
NoLooseEnds 5a828b496f Initial commit
Added readme files and my R710 IPMI temperature monitor script.
2017-10-19 10:10:10 +02:00

24 lines
726 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Requires ipmitool  apt-get install ipmitool
# Tested on ubuntu
# IPMI
IPMIHOST=192.168.0.120
IPMIUSER=root
IPMIPW=calvin
# TEMPERATURE
MAXTEMP=27
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW sdr type temperature |grep Ambient |grep -Po '\d{2}')
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!"
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x01
else
printf "Temperature is OK ($TEMP C)" | systemd-cat -t R710-IPMI-TEMP
echo "Temperature is OK ($TEMP C)"
fi