Add more ipmi stuff

This commit is contained in:
Marko Korhonen 2020-02-17 15:09:09 +02:00
parent eed7aabf01
commit 6649ff205c
6 changed files with 17 additions and 19 deletions

View file

@ -4,16 +4,16 @@ IPMIHOST=10.0.0.82
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)
echo $TEMP > /tmp/idrac-temp
mkdir -p /tmp/ipmi
DATA=`ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr get "FAN 1 RPM" "FAN 2 RPM" "FAN 3 RPM" "FAN 4 RPM" "FAN 5 RPM" "FAN 6 RPM" | grep "Sensor Reading" | awk '{ print $4 }'`
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
echo "$DATA"
echo "$DATA" | head -1 | tail -1> /tmp/ipmi/fan1
echo "$DATA" | head -2 | tail -1> /tmp/ipmi/fan2
echo "$DATA" | head -3 | tail -1> /tmp/ipmi/fan3
echo "$DATA" | head -4 | tail -1> /tmp/ipmi/fan4
echo "$DATA" | head -5 | tail -1> /tmp/ipmi/fan5
echo "$DATA" | head -6 | tail -1> /tmp/ipmi/fan6

View file

@ -7,7 +7,9 @@ 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)
echo $TEMP > /tmp/idrac-temp
mkdir -p /tmp/ipmi
echo $TEMP > /tmp/ipmi/temp
if [[ $TEMP > $MAXTEMP ]];