Skip to content

Commit e22efc3

Browse files
authored
Merge pull request #56 from scline/feature/14gen
Feature/14gen
2 parents 8610b3b + 2a5a8a0 commit e22efc3

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

Dell_iDRAC_fan_controller.sh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ then
4646
exit 1
4747
fi
4848

49+
# If server model is Gen 14 (*40) or newer
50+
if [[ $SERVER_MODEL =~ .*[RT][[:space:]]?[0-9][4-9]0.* ]]
51+
then
52+
DELL_POWEREDGE_GEN_14_OR_NEWER=true
53+
CPU1_TEMPERATURE_INDEX=2
54+
CPU2_TEMPERATURE_INDEX=4
55+
else
56+
DELL_POWEREDGE_GEN_14_OR_NEWER=false
57+
CPU1_TEMPERATURE_INDEX=1
58+
CPU2_TEMPERATURE_INDEX=2
59+
fi
60+
4961
# Log main informations
5062
echo "Server model: $SERVER_MANUFACTURER $SERVER_MODEL"
5163
echo "iDRAC/IPMI host: $IDRAC_HOST"
@@ -138,15 +150,19 @@ while true; do
138150
fi
139151
fi
140152

141-
# Enable or disable, depending on the user's choice, third-party PCIe card Dell default cooling response
142-
# 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
143-
if $DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE
153+
# If server model is Gen 14 (*40) or newer
154+
if ! $DELL_POWEREDGE_GEN_14_OR_NEWER
144155
then
145-
disable_third_party_PCIe_card_Dell_default_cooling_response
146-
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Disabled"
147-
else
148-
enable_third_party_PCIe_card_Dell_default_cooling_response
149-
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Enabled"
156+
# Enable or disable, depending on the user's choice, third-party PCIe card Dell default cooling response
157+
# 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
158+
if $DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE
159+
then
160+
disable_third_party_PCIe_card_Dell_default_cooling_response
161+
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Disabled"
162+
else
163+
enable_third_party_PCIe_card_Dell_default_cooling_response
164+
THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_STATUS="Enabled"
165+
fi
150166
fi
151167

152168
# Print temperatures, active fan control profile and comment if any change happened during last time interval

functions.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ function retrieve_temperatures () {
3838

3939
# Parse CPU data
4040
local CPU_DATA=$(echo "$DATA" | grep "3\." | grep -Po '\d{2}')
41-
CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $1;}')
41+
CPU1_TEMPERATURE=$(echo $CPU_DATA | awk "{print \$$CPU1_TEMPERATURE_INDEX;}")
4242
if $IS_CPU2_TEMPERATURE_SENSOR_PRESENT
4343
then
44-
CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}')
44+
CPU2_TEMPERATURE=$(echo $CPU_DATA | awk "{print \$$CPU2_TEMPERATURE_INDEX;}")
4545
else
4646
CPU2_TEMPERATURE="-"
4747
fi
@@ -58,11 +58,13 @@ function retrieve_temperatures () {
5858
fi
5959
}
6060

61+
# /!\ Use this function only for Gen 13 and older generation servers /!\
6162
function enable_third_party_PCIe_card_Dell_default_cooling_response () {
6263
# We could check the current cooling response before applying but it's not very useful so let's skip the test and apply directly
6364
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null
6465
}
6566

67+
# /!\ Use this function only for Gen 13 and older generation servers /!\
6668
function disable_third_party_PCIe_card_Dell_default_cooling_response () {
6769
# We could check the current cooling response before applying but it's not very useful so let's skip the test and apply directly
6870
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null

0 commit comments

Comments
 (0)