From 9411c52cde16f8dc80d1e9f8a0bc9a53f4c0571a Mon Sep 17 00:00:00 2001 From: Ryan Bush <20880666+rpbush@users.noreply.github.com> Date: Fri, 13 Jan 2023 12:15:43 +0100 Subject: [PATCH] Updated comments --- Dell_iDRAC_fan_controller.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index 40a2ef9..fbae5c6 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -67,9 +67,11 @@ IS_DELL_PROFILE_APPLIED=true # Start monitoring while true; do + # Sleep for the specified interval before taking another reading sleep $CHECK_INTERVAL & SLEEP_PROCESS_PID=$! + # Retrieve sensor data using ipmitool DATA=$(ipmitool -I $LOGIN_STRING sdr type temperature | grep degrees) INLET_TEMPERATURE=$(echo "$DATA" | grep Inlet | grep -Po '\d{2}' | tail -1) EXHAUST_TEMPERATURE=$(echo "$DATA" | grep Exhaust | grep -Po '\d{2}' | tail -1) @@ -77,10 +79,13 @@ while true; do CPU1_TEMPERATURE=$(echo $CPU_DATA | awk '{print $1;}') CPU2_TEMPERATURE=$(echo $CPU_DATA | awk '{print $2;}') + # Define functions to check if CPU1 and CPU2 temperatures are above the threshold CPU1_OVERHEAT () { [ $CPU1_TEMPERATURE -gt $CPU_TEMPERATURE_TRESHOLD ]; } CPU2_OVERHEAT () { [ $CPU2_TEMPERATURE -gt $CPU_TEMPERATURE_TRESHOLD ]; } + # Initialize a variable to store comments COMMENT=" -" + # Check if CPU1 is overheating and apply Dell profile if true if CPU1_OVERHEAT then apply_Dell_profile