Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fan Control for Dell Server in ESXI
#!/bin/bash
#
# crontab -l > mycron
# echo "#" >> mycron
# echo "# At every 2nd minute" >> mycron
# echo "*/2 * * * * /bin/bash /scripts/dell_ipmi_fan_control.sh >> /tmp/cron.log" >> mycron
# crontab mycron
# rm mycron
# chmod +x /scripts/dell_ipmi_fan_control.sh
#
DATE=$(date +%Y-%m-%d-%H%M%S)
echo "" && echo "" && echo "" && echo "" && echo ""
echo "$DATE"
#
STATICSPEEDBASE16="0x0f"
SENSORNAME="Inlet Temp"
TEMPTHRESHOLD="38"
#
T=$(/scratch/ipmitool sdr type temperature | grep $SENSORNAME | cut -d"|" -f5 | cut -d" " -f2)
echo "$IDRACIP: -- current temperature --"
echo "$T"
#
if [[ $T > $TEMPTHRESHOLD ]]
then
echo "--> enable dynamic fan control"
/scratch/ipmitool raw 0x30 0x30 0x01 0x01
else
echo "--> disable dynamic fan control"
/scratch/ipmitool raw 0x30 0x30 0x01 0x00
echo "--> set static fan speed"
/scratch/ipmitool raw 0x30 0x30 0x02 0xff $STATICSPEEDBASE16
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment