Added option to disable third-party PCIe card default cooling response (#33)
This commit is contained in:
parent
857a3b3fbc
commit
f1c47b0a69
@ -1,20 +1,48 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Define global functions
|
# Define global functions
|
||||||
apply_Dell_profile () {
|
function apply_Dell_profile () {
|
||||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x01 > /dev/null
|
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x01 > /dev/null
|
||||||
CURRENT_FAN_CONTROL_PROFILE="Dell default dynamic fan control profile"
|
CURRENT_FAN_CONTROL_PROFILE="Dell default dynamic fan control profile"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_user_profile () {
|
function apply_user_profile () {
|
||||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x00 > /dev/null
|
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x00 > /dev/null
|
||||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x02 0xff $HEXADECIMAL_FAN_SPEED > /dev/null
|
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x02 0xff $HEXADECIMAL_FAN_SPEED > /dev/null
|
||||||
CURRENT_FAN_CONTROL_PROFILE="User static fan control profile ($DECIMAL_FAN_SPEED%)"
|
CURRENT_FAN_CONTROL_PROFILE="User static fan control profile ($DECIMAL_FAN_SPEED%)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enable_third_party_PCIe_card_Dell_default_cooling_response () {
|
||||||
|
# We could check the current cooling response before applying but it's not very useful so let's skip the test and apply directly
|
||||||
|
ipmitool -I $LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function disable_third_party_PCIe_card_Dell_default_cooling_response () {
|
||||||
|
# We could check the current cooling response before applying but it's not very useful so let's skip the test and apply directly
|
||||||
|
ipmitool -I $LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Returns :
|
||||||
|
# - 0 if third-party PCIe card Dell default cooling response is currently DISABLED
|
||||||
|
# - 1 if third-party PCIe card Dell default cooling response is currently ENABLED
|
||||||
|
# - 2 if the current status returned by ipmitool command output is unexpected
|
||||||
|
# function is_third_party_PCIe_card_Dell_default_cooling_response_disabled() {
|
||||||
|
# THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE=$(ipmitool -I $LOGIN_STRING raw 0x30 0xce 0x01 0x16 0x05 0x00 0x00 0x00)
|
||||||
|
|
||||||
|
# if [ "$THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE" == "16 05 00 00 00 05 00 01 00 00" ]; then
|
||||||
|
# return 0
|
||||||
|
# elif [ "$THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE" == "16 05 00 00 00 05 00 00 00 00" ]; then
|
||||||
|
# return 1
|
||||||
|
# else
|
||||||
|
# echo "Unexpected output: $THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE" >&2
|
||||||
|
# return 2
|
||||||
|
# fi
|
||||||
|
# }
|
||||||
|
|
||||||
# Prepare traps in case of container exit
|
# Prepare traps in case of container exit
|
||||||
gracefull_exit () {
|
function gracefull_exit () {
|
||||||
apply_Dell_profile
|
apply_Dell_profile
|
||||||
|
enable_third_party_PCIe_card_Dell_default_cooling_response
|
||||||
echo "/!\ WARNING /!\ Container stopped, Dell default dynamic fan control profile applied for safety."
|
echo "/!\ WARNING /!\ Container stopped, Dell default dynamic fan control profile applied for safety."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -49,6 +77,7 @@ echo "CPU temperature treshold: $CPU_TEMPERATURE_TRESHOLD°C"
|
|||||||
echo "Check interval: ${CHECK_INTERVAL}s"
|
echo "Check interval: ${CHECK_INTERVAL}s"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Prepare required variables and constants
|
||||||
readonly TABLE_HEADER_PRINT_INTERVAL=10
|
readonly TABLE_HEADER_PRINT_INTERVAL=10
|
||||||
i=$TABLE_HEADER_PRINT_INTERVAL
|
i=$TABLE_HEADER_PRINT_INTERVAL
|
||||||
IS_DELL_PROFILE_APPLIED=true
|
IS_DELL_PROFILE_APPLIED=true
|
||||||
@ -103,14 +132,25 @@ while true; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable or disable, depending on the user's choice, third-party PCIe card Dell default cooling response
|
||||||
|
# No comment will be displayed on the change of this parameter since it is not related to the temperature of any device (CPU, GPU, etc...) but only to the settings made by the user when launching this Docker container
|
||||||
|
if $DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE
|
||||||
|
then
|
||||||
|
disable_third_party_PCIe_card_Dell_default_cooling_response
|
||||||
|
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Disabled"
|
||||||
|
else
|
||||||
|
enable_third_party_PCIe_card_Dell_default_cooling_response
|
||||||
|
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Enabled"
|
||||||
|
fi
|
||||||
|
|
||||||
# Print temperatures array
|
# Print temperatures array
|
||||||
if [ $i -ge $TABLE_HEADER_PRINT_INTERVAL ]
|
if [ $i -ge $TABLE_HEADER_PRINT_INTERVAL ]
|
||||||
then
|
then
|
||||||
echo " ------- Temperatures -------"
|
echo " ------- Temperatures -------"
|
||||||
echo " Date & time Inlet CPU 1 CPU 2 Exhaust Active fan speed profile Comment"
|
echo " Date & time Inlet CPU 1 CPU 2 Exhaust Active fan speed profile Third-party PCIe card Dell default cooling response Comment"
|
||||||
i=0
|
i=0
|
||||||
fi
|
fi
|
||||||
printf "%12s %3d°C %3d°C %3d°C %5d°C %40s %s\n" "$(date +"%d-%m-%y %H:%M:%S")" $INLET_TEMPERATURE $CPU1_TEMPERATURE $CPU2_TEMPERATURE $EXHAUST_TEMPERATURE "$CURRENT_FAN_CONTROL_PROFILE" "$COMMENT"
|
printf "%12s %3d°C %3d°C %3d°C %5d°C %40s %51s %s\n" "$(date +"%d-%m-%y %H:%M:%S")" $INLET_TEMPERATURE $CPU1_TEMPERATURE $CPU2_TEMPERATURE $EXHAUST_TEMPERATURE "$CURRENT_FAN_CONTROL_PROFILE" "$THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS" "$COMMENT"
|
||||||
|
|
||||||
((i++))
|
((i++))
|
||||||
wait $SLEEP_PROCESS_PID
|
wait $SLEEP_PROCESS_PID
|
||||||
|
|||||||
@ -18,5 +18,6 @@ ENV IDRAC_HOST local
|
|||||||
ENV FAN_SPEED 5
|
ENV FAN_SPEED 5
|
||||||
ENV CPU_TEMPERATURE_TRESHOLD 50
|
ENV CPU_TEMPERATURE_TRESHOLD 50
|
||||||
ENV CHECK_INTERVAL 60
|
ENV CHECK_INTERVAL 60
|
||||||
|
ENV DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE false
|
||||||
|
|
||||||
CMD ["/Dell_iDRAC_fan_controller.sh"]
|
CMD ["/Dell_iDRAC_fan_controller.sh"]
|
||||||
|
|||||||
@ -61,6 +61,7 @@ docker run -d \
|
|||||||
-e FAN_SPEED=<decimal or hexadecimal fan speed> \
|
-e FAN_SPEED=<decimal or hexadecimal fan speed> \
|
||||||
-e CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold> \
|
-e CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold> \
|
||||||
-e CHECK_INTERVAL=<seconds between each check> \
|
-e CHECK_INTERVAL=<seconds between each check> \
|
||||||
|
-e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false> \
|
||||||
--device=/dev/ipmi0:/dev/ipmi0:rw \
|
--device=/dev/ipmi0:/dev/ipmi0:rw \
|
||||||
tigerblue77/dell_idrac_fan_controller:latest
|
tigerblue77/dell_idrac_fan_controller:latest
|
||||||
```
|
```
|
||||||
@ -77,6 +78,7 @@ docker run -d \
|
|||||||
-e FAN_SPEED=<decimal or hexadecimal fan speed> \
|
-e FAN_SPEED=<decimal or hexadecimal fan speed> \
|
||||||
-e CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold> \
|
-e CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold> \
|
||||||
-e CHECK_INTERVAL=<seconds between each check> \
|
-e CHECK_INTERVAL=<seconds between each check> \
|
||||||
|
-e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false> \
|
||||||
tigerblue77/dell_idrac_fan_controller:latest
|
tigerblue77/dell_idrac_fan_controller:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -97,6 +99,7 @@ services:
|
|||||||
- FAN_SPEED=<decimal or hexadecimal fan speed>
|
- FAN_SPEED=<decimal or hexadecimal fan speed>
|
||||||
- CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold>
|
- CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold>
|
||||||
- CHECK_INTERVAL=<seconds between each check>
|
- CHECK_INTERVAL=<seconds between each check>
|
||||||
|
- DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false>
|
||||||
devices:
|
devices:
|
||||||
- /dev/ipmi0:/dev/ipmi0:rw
|
- /dev/ipmi0:/dev/ipmi0:rw
|
||||||
```
|
```
|
||||||
@ -118,6 +121,7 @@ services:
|
|||||||
- FAN_SPEED=<decimal or hexadecimal fan speed>
|
- FAN_SPEED=<decimal or hexadecimal fan speed>
|
||||||
- CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold>
|
- CPU_TEMPERATURE_TRESHOLD=<decimal temperature treshold>
|
||||||
- CHECK_INTERVAL=<seconds between each check>
|
- CHECK_INTERVAL=<seconds between each check>
|
||||||
|
- DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false>
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||||
@ -133,6 +137,7 @@ All parameters are optional as they have default values (including default iDRAC
|
|||||||
- `FAN_SPEED` parameter can be set as a decimal (from 0 to 100%) or hexadecimaladecimal value (from 0x00 to 0x64) you want to set the fans to. **Default** value is 5(%).
|
- `FAN_SPEED` parameter can be set as a decimal (from 0 to 100%) or hexadecimaladecimal value (from 0x00 to 0x64) you want to set the fans to. **Default** value is 5(%).
|
||||||
- `CPU_TEMPERATURE_TRESHOLD` parameter is the T°junction (junction temperature) threshold beyond which the Dell fan mode defined in your BIOS will become active again (to protect the server hardware against overheat). **Default** value is 50(°C).
|
- `CPU_TEMPERATURE_TRESHOLD` parameter is the T°junction (junction temperature) threshold beyond which the Dell fan mode defined in your BIOS will become active again (to protect the server hardware against overheat). **Default** value is 50(°C).
|
||||||
- `CHECK_INTERVAL` parameter is the time (in seconds) between each temperature check and potential profile change. **Default** value is 60(s).
|
- `CHECK_INTERVAL` parameter is the time (in seconds) between each temperature check and potential profile change. **Default** value is 60(s).
|
||||||
|
- `DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE` parameter is a boolean that allows to disable third-party PCIe card Dell default cooling response. **Default** value is false.
|
||||||
|
|
||||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user