You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
653 B
Bash
20 lines
653 B
Bash
5 years ago
|
#!/bin/bash
|
||
|
|
||
5 years ago
|
IPMIHOST=10.0.0.82
|
||
5 years ago
|
IPMIUSER=ReekyMarko
|
||
|
IPMIPW={{@@ env['PASS_IPMI'] @@}}
|
||
|
IPMIEK=0000000000000000000000000000000000000000
|
||
|
MAXTEMP=27
|
||
|
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
|
||
|
|
||
5 years ago
|
mosquitto_pub -u reekynet -P {{@@ env['PASS_MQTT'] @@}} -t "ipmi/temp" -m "$TEMP"
|
||
5 years ago
|
|
||
5 years ago
|
|
||
|
if [[ $TEMP > $MAXTEMP ]];
|
||
|
then
|
||
|
printf "Warning: Temperature is too high! Activating dynamic fan control! ($TEMP C)"
|
||
|
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x01
|
||
|
else
|
||
|
printf "Temperature is OK ($TEMP C)"
|
||
|
fi
|