Reduced tests occurence to improve performances
This commit is contained in:
parent
a8c12a62c9
commit
2a5a8a03fc
2 changed files with 22 additions and 34 deletions
32
functions.sh
32
functions.sh
|
|
@ -38,24 +38,10 @@ function retrieve_temperatures () {
|
|||
|
||||
# Parse CPU data
|
||||
local CPU_DATA=$(echo "$DATA" | grep "3\." | grep -Po '\d{2}')
|
||||
if $DELL_POWEREDGE_GEN_14_OR_NEWER
|
||||
then
|
||||
# 14 Gen server or newer
|
||||
CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}')
|
||||
else
|
||||
# 13 Gen server or older
|
||||
CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $1;}')
|
||||
fi
|
||||
CPU1_TEMPERATURE=$(echo $CPU_DATA | awk "{print \$$CPU1_TEMPERATURE_INDEX;}")
|
||||
if $IS_CPU2_TEMPERATURE_SENSOR_PRESENT
|
||||
then
|
||||
if $DELL_POWEREDGE_GEN_14_OR_NEWER
|
||||
then
|
||||
# 14 Gen server or newer
|
||||
CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $4;}')
|
||||
else
|
||||
# 13 Gen server or older
|
||||
CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}')
|
||||
fi
|
||||
CPU2_TEMPERATURE=$(echo $CPU_DATA | awk "{print \$$CPU2_TEMPERATURE_INDEX;}")
|
||||
else
|
||||
CPU2_TEMPERATURE="-"
|
||||
fi
|
||||
|
|
@ -72,22 +58,16 @@ function retrieve_temperatures () {
|
|||
fi
|
||||
}
|
||||
|
||||
# /!\ Use this function only for Gen 13 and older generation servers /!\
|
||||
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_POWEREDGE_GEN_14_OR_NEWER
|
||||
then
|
||||
# 13 Gen server or older
|
||||
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null
|
||||
fi
|
||||
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 > /dev/null
|
||||
}
|
||||
|
||||
# /!\ Use this function only for Gen 13 and older generation servers /!\
|
||||
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_POWEREDGE_GEN_14_OR_NEWER
|
||||
then
|
||||
# 13 Gen server or older
|
||||
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null
|
||||
fi
|
||||
ipmitool -I $IDRAC_LOGIN_STRING raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00 > /dev/null
|
||||
}
|
||||
|
||||
# Returns :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue