From d1bf241be239be6e8ad1cd3e933478276bd6ada5 Mon Sep 17 00:00:00 2001 From: Sean Cline Date: Tue, 21 Mar 2023 16:44:09 -0700 Subject: [PATCH 1/4] Adding options for 14gen Dell servers via env var --- Dell_iDRAC_fan_controller.sh | 36 ++++++++++++++++++++++++++++++++---- Dockerfile | 1 + README.md | 1 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index bb6c536..a1bba1a 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -35,10 +35,24 @@ function retrieve_temperatures () { # Parse CPU data local CPU_DATA=$(echo "$DATA" | grep "3\." | grep -Po '\d{2}') - CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $1;}') + if $14_GEN + then + # 14 Gen server + CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}') + else + # 14 Gen or older + CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $1;}') + fi if $IS_CPU2_TEMPERATURE_SENSOR_PRESENT then - CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}') + if $14_GEN + then + # 14 Gen server + CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $4;}') + else + # 14 Gen or older + CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}') + fi else CPU2_TEMPERATURE="-" fi @@ -57,12 +71,26 @@ function retrieve_temperatures () { 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 $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null + if $14_GEN + then + # 14 Gen Server + continue + else + # 13 Gen or older server + ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null + fi } 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 $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null + if $14_GEN + then + # 14 Gen Server + continue + else + # 13 Gen or older server + ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null + fi } # Returns : diff --git a/Dockerfile b/Dockerfile index 3c9d72c..2f06629 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN chmod 0777 /Dell_iDRAC_fan_controller.sh ENV IDRAC_HOST local #ENV IDRAC_USERNAME root #ENV IDRAC_PASSWORD calvin +ENV 14_GEN false ENV FAN_SPEED 5 ENV CPU_TEMPERATURE_THRESHOLD 50 ENV CHECK_INTERVAL 60 diff --git a/README.md b/README.md index aadeb7e..e161b95 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ All parameters are optional as they have default values (including default iDRAC - `CPU_TEMPERATURE_THRESHOLD` 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). - `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. +- `14_GEN` parameter that disabled 3rd party PCI calls and outputs CPU temperatures correctly for 14th Gen Dell servers, ex Dell r640, 740 series. Must have idrac 3.30.30.30 or older. **Default** value is false.

(back to top)

From ae1fe1edcbfacc164b637f7e0bd8164faf3ff7a5 Mon Sep 17 00:00:00 2001 From: Sean Cline Date: Tue, 21 Mar 2023 16:48:58 -0700 Subject: [PATCH 2/4] Cant start env variable with numbers --- Dell_iDRAC_fan_controller.sh | 8 ++++---- Dockerfile | 2 +- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index a1bba1a..0b28eb2 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -35,7 +35,7 @@ function retrieve_temperatures () { # Parse CPU data local CPU_DATA=$(echo "$DATA" | grep "3\." | grep -Po '\d{2}') - if $14_GEN + if $DELL_14_GEN then # 14 Gen server CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}') @@ -45,7 +45,7 @@ function retrieve_temperatures () { fi if $IS_CPU2_TEMPERATURE_SENSOR_PRESENT then - if $14_GEN + if $DELL_14_GEN then # 14 Gen server CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $4;}') @@ -71,7 +71,7 @@ function retrieve_temperatures () { 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 - if $14_GEN + if $DELL_14_GEN then # 14 Gen Server continue @@ -83,7 +83,7 @@ function enable_third_party_PCIe_card_Dell_default_cooling_response () { 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 - if $14_GEN + if $DELL_14_GEN then # 14 Gen Server continue diff --git a/Dockerfile b/Dockerfile index 2f06629..4bfc237 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN chmod 0777 /Dell_iDRAC_fan_controller.sh ENV IDRAC_HOST local #ENV IDRAC_USERNAME root #ENV IDRAC_PASSWORD calvin -ENV 14_GEN false +ENV DELL_14_GEN false ENV FAN_SPEED 5 ENV CPU_TEMPERATURE_THRESHOLD 50 ENV CHECK_INTERVAL 60 diff --git a/README.md b/README.md index e161b95..b06ba85 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ All parameters are optional as they have default values (including default iDRAC - `CPU_TEMPERATURE_THRESHOLD` 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). - `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. -- `14_GEN` parameter that disabled 3rd party PCI calls and outputs CPU temperatures correctly for 14th Gen Dell servers, ex Dell r640, 740 series. Must have idrac 3.30.30.30 or older. **Default** value is false. +- `DELL_14_GEN` parameter that disabled 3rd party PCI calls and outputs CPU temperatures correctly for 14th Gen Dell servers, ex Dell r640, 740 series. Must have idrac 3.30.30.30 or older. **Default** value is false.

(back to top)

From 208ca9615caa37c91cbe1ca2ede8fa40b8503227 Mon Sep 17 00:00:00 2001 From: Sean Cline Date: Tue, 21 Mar 2023 16:59:18 -0700 Subject: [PATCH 3/4] Fixing some if not true statements --- Dell_iDRAC_fan_controller.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index 0b28eb2..671d878 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -71,11 +71,7 @@ function retrieve_temperatures () { 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 - if $DELL_14_GEN - then - # 14 Gen Server - continue - else + if ! $DELL_14_GEN # 13 Gen or older server ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null fi @@ -83,11 +79,8 @@ function enable_third_party_PCIe_card_Dell_default_cooling_response () { 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 - if $DELL_14_GEN + if ! $DELL_14_GEN then - # 14 Gen Server - continue - else # 13 Gen or older server ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null fi From 7cc4635dfd0317124a2568ec61b308cca5b77d6c Mon Sep 17 00:00:00 2001 From: Sean Cline Date: Tue, 21 Mar 2023 17:07:35 -0700 Subject: [PATCH 4/4] Missing `fi` --- Dell_iDRAC_fan_controller.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index 671d878..e96dc42 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -72,6 +72,7 @@ function retrieve_temperatures () { 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 if ! $DELL_14_GEN + then # 13 Gen or older server ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null fi