update fan control
This commit is contained in:
@ -25,10 +25,29 @@ check_temperature() {
|
||||
ipmitool -I lanplus -H "$HOST" -U "$USER" -P "$PASS" raw 0x30 0x30 0x01 0x00 &> /dev/null
|
||||
# set initial fan to 20%
|
||||
ipmitool -I lanplus -H "$HOST" -U "$USER" -P "$PASS" raw 0x30 0x30 0x02 0xff 0x14 &> /dev/null
|
||||
LOW_TO_HIGH=false
|
||||
CURRENT_PROFILE="MANUAL"
|
||||
elif [ "$max_temp" -gt 60 ] && [ "$CURRENT_PROFILE" != "AUTO" ]; then
|
||||
elif [ "$max_temp" -le 65 ] && [ "$CURRENT_PROFILE" != "MANUAL2" ]; then
|
||||
# enable manual fan control
|
||||
ipmitool -I lanplus -H "$HOST" -U "$USER" -P "$PASS" raw 0x30 0x30 0x01 0x00 &> /dev/null
|
||||
# set initial fan to 30%
|
||||
ipmitool -I lanplus -H "$HOST" -U "$USER" -P "$PASS" raw 0x30 0x30 0x02 0xff 0x1e &> /dev/null
|
||||
# set low_to_high used to determine wait time
|
||||
if [[ "$CURRENT_PROFILE" == "MANUAL"]]; then
|
||||
LOW_TO_HIGH=true
|
||||
else
|
||||
LOW_TO_HIGH=false
|
||||
fi
|
||||
CURRENT_PROFILE="MANUAL2"
|
||||
elif [ "$max_temp" -gt 65 ] && [ "$CURRENT_PROFILE" != "AUTO" ]; then
|
||||
# enable Dell fan control
|
||||
ipmitool -I lanplus -H "$HOST" -U "$USER" -P "$PASS" raw 0x30 0x30 0x01 0x01 &> /dev/null
|
||||
# set low_to_high used to determine wait time
|
||||
if [[ "$CURRENT_PROFILE" == "MANUAL2"]]; then
|
||||
LOW_TO_HIGH=true
|
||||
else
|
||||
LOW_TO_HIGH=false
|
||||
fi
|
||||
CURRENT_PROFILE="AUTO"
|
||||
fi
|
||||
}
|
||||
@ -49,6 +68,7 @@ USER=""
|
||||
PASS=""
|
||||
VMID=""
|
||||
CURRENT_PROFILE=""
|
||||
LOW_TO_HIGH=false
|
||||
|
||||
start_time=$(ps -o lstart= -p $(cat /var/run/qemu-server/$VMID.pid))
|
||||
start_time=$(date -d "$start_time" +%s)
|
||||
@ -63,8 +83,8 @@ disable_third_party_mode
|
||||
while true; do
|
||||
check_temperature
|
||||
|
||||
if [[ "$CURRENT_PROFILE" == "AUTO" ]]; then
|
||||
sleep 300
|
||||
if [[ "$CURRENT_PROFILE" == "AUTO" || "$LOW_TO_HIGH" == true]]; then
|
||||
sleep 180
|
||||
else
|
||||
sleep 60
|
||||
fi
|
||||
|
Reference in New Issue
Block a user