Skip to content

Instantly share code, notes, and snippets.

@wcypierre
Created June 24, 2020 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wcypierre/ca8dd5c58230ee3255a1a2f3cdfacb9b to your computer and use it in GitHub Desktop.
Save wcypierre/ca8dd5c58230ee3255a1a2f3cdfacb9b to your computer and use it in GitHub Desktop.
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