I wanted dynamic fan control on when powering off the server so the fans shut the fuck up

This commit is contained in:
Tristan Smith 2024-03-23 13:59:12 -04:00
parent ab1cb88e6a
commit fc72d469b6

View file

@ -20,6 +20,8 @@ def power_on():
def power_off(): def power_off():
print("Powering off the server...") print("Powering off the server...")
execute_ipmi_command("chassis power off") execute_ipmi_command("chassis power off")
print("Enabling dynamic fan control...")
execute_ipmi_command("raw 0x30 0x30 0x01 0x01")
def set_fan_speed(speed): def set_fan_speed(speed):
print(f"Setting fan speed to {speed}%...") print(f"Setting fan speed to {speed}%...")
@ -88,6 +90,7 @@ if args.power == 'on':
elif args.power == 'off': elif args.power == 'off':
power_off() power_off()
if args.fan is not None: if args.fan is not None:
set_fan_speed(args.fan) set_fan_speed(args.fan)