Created
June 24, 2020 02:41
-
-
Save wcypierre/ca8dd5c58230ee3255a1a2f3cdfacb9b to your computer and use it in GitHub Desktop.
Fan Control for Dell Server in ESXI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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