Last active
November 11, 2024 10:40
-
-
Save skyrocknroll/41e112336ac36901586a505c32f3724b to your computer and use it in GitHub Desktop.
dell fan #temp #fan #ipmi #rx720d #fan #control
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
#!/usr/bin/env bash | |
# ---------------------------------------------------------------------------------- | |
# Script for checking the temperature reported by the ambient temperature sensor, | |
# and if deemed too high send the raw IPMI command to enable dynamic fan control. | |
# | |
# Requires: | |
# ipmitool – apt-get install ipmitool | |
# slacktee.sh – https://github.com/course-hero/slacktee | |
# ---------------------------------------------------------------------------------- | |
# IPMI SETTINGS: | |
# Modify to suit your needs. | |
# DEFAULT IP: 192.168.0.120 | |
# TEMPERATURE | |
# Change this to the temperature in celcius you are comfortable with. | |
# If the temperature goes above the set degrees it will send raw IPMI command to enable dynamic fan control | |
LOWTEMP=45 | |
HIGHTEMP=55 | |
# This variable sends a IPMI command to get the temperature, and outputs it as two digits. | |
# Do not edit unless you know what you do. | |
while true; do | |
dt=$(date '+%d/%m/%Y %H:%M:%S'); | |
TEMP=$(ipmitool sdr type temperature | grep Temp | grep degrees | grep -Po '\d{2}' | tail -1) | |
if [[ $TEMP < $LOWTEMP ]]; then | |
ipmitool raw 0x30 0x30 0x01 0x00 | |
ipmitool raw 0x30 0x30 0x02 0xff 0xa | |
printf "$dt Warning: Temperature is OK! setting fan control to 10%% ($TEMP C)\n" | |
elif [[ $TEMP > $HIGHTEMP ]]; then | |
printf "$dt Warning: Temperature is High! Activating dynamic fan control! ($TEMP C)\n" | |
ipmitool raw 0x30 0x30 0x01 0x01 | |
else | |
ipmitool raw 0x30 0x30 0x01 0x00 | |
ipmitool raw 0x30 0x30 0x02 0xff 0x15 | |
printf "$dt Warning: Temperature is OK! setting fan control to 20%% ($TEMP C)\n" | |
fi | |
sleep 10 | |
done |
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
#!/usr/bin/env bash | |
# ---------------------------------------------------------------------------------- | |
# Script for checking the temperature reported by the ambient temperature sensor, | |
# and if deemed too high send the raw IPMI command to enable dynamic fan control. | |
# | |
# Requires: | |
# ipmitool – apt-get install ipmitool | |
# slacktee.sh – https://github.com/course-hero/slacktee | |
# ---------------------------------------------------------------------------------- | |
# IPMI SETTINGS: | |
# Modify to suit your needs. | |
# DEFAULT IP: 192.168.0.120 | |
# TEMPERATURE | |
# Change this to the temperature in celcius you are comfortable with. | |
# If the temperature goes above the set degrees it will send raw IPMI command to enable dynamic fan control | |
MAXTEMP=40 | |
# This variable sends a IPMI command to get the temperature, and outputs it as two digits. | |
# Do not edit unless you know what you do. | |
for VARIABLE in 1 2 3 4 5; do | |
TEMP=$(ipmitool sdr type temperature | grep Temp | grep degrees | grep -Po '\d{2}' | tail -1) | |
if [[ $TEMP > $MAXTEMP ]]; then | |
printf "Warning: Temperature is too high! Activating dynamic fan control! ($TEMP C)\n" | |
ipmitool raw 0x30 0x30 0x01 0x01 | |
else | |
printf "Temperature is OK ($TEMP C), setting fans to 10%%\n" | |
ipmitool raw 0x30 0x30 0x01 0x00 | |
ipmitool raw 0x30 0x30 0x02 0xff 0xa | |
fi | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ipmitool -I lanplus -H 192.168.0.115 -U root -P 'calvin' ipmitool raw 0x30 0x30 0x01 0x01