- #!/usr/local/bin/bash
- # Config file for spinpid2.sh, beginning version 2020-06-17, for dual fan zones.
- # Minor changes 2020-08-20, but 2020-06-17 config
- # is still compatible with 2020-08-20 spinpid2.sh.
- # Path to ipmitool. If you're doing VM
- # you may need to add (inside quotes) the following to
- # remotely execute commands.
- # -H <hostname/ip> -U <username> -P <password>
- IPMITOOL="/bin/ipmitool"
- ################# OUTPUT SETTINGS ################
- # Change to your desired log location/name or it will be put
- # in the directory above (..) the one with the script.
- # LOG=/mnt/MyPool/MyDataSet/MyDirectory/spinpid2.log
- LOG=$(dirname "${BASH_SOURCE[0]}")/spinpid2.log
- # Where do you want output to go? Comment/uncomment (#) to select.
- # First sends output to the log file AND to screen/console, good for testing.
- # Second goes only to log file, no feedback if running manually, but doesn't take over console.
- # In the first, if you want to append to existing log, add '-a' to the tee command.
- exec > >(tee -i $LOG) 2>&1 # Log + console, good for testing
- # exec &> $LOG # Log only
- # CPU output is sent to a separate log for interim cycles
- # It can get big so turn off after testing. 1 = log cpu; anything else = don't log cpu
- CPU_LOG_YES=0
- # Path/name of cpu log
- # CPU_LOG=/mnt/MyPool/MyDataSet/MyDirectory/cpu.log
- CPU_LOG=$(dirname "${BASH_SOURCE[0]}")/cpu.log
- ################# FAN SETTINGS ################
- # Supermicro says:
- # Zone 0 - CPU/System fans, headers with number (e.g., FAN1, FAN2, etc.)
- # Zone 1 - Peripheral fans, headers with letter (e.g., FANA, FANB, etc.)
- # Some want the reverse (i.e, drive cooling fans on headers FAN1-4 and
- # CPU fan on FANA), so that's the default. But you can switch to SM way.
- ZONE_CPU=1
- ZONE_PER=0
- # Set min and max duty cycle to avoid stalling or zombie apocalypse
- DUTY_PER_MIN=20
- DUTY_PER_MAX=100
- DUTY_CPU_MIN=20
- DUTY_CPU_MAX=100
- # Using spintest.sh, measure fan RPMs at 30% duty cycle and 100% duty cycle.
- # RPM_CPU is for FANA if ZONE_CPU=1 or FAN1 if ZONE_CPU=0
- # RPM_PER is for the other fan.
- # RPM_CPU_30=400 # Your system
- # RPM_CPU_MAX=1500
- # RPM_PER_30=600
- # RPM_PER_MAX=1800
- RPM_CPU_30=500 # My system
- RPM_CPU_MAX=1400
- RPM_PER_30=500
- RPM_PER_MAX=1400
- # How should we determine what the fan duty (% of full power) is?
- # Normally we want to read that from the board (HOW_DUTY=1).
- # However, some dual-zone boards report incorrect fan duty,
- # and then we need to assume duty is what we set last time (HOW_DUTY=0)
- # (1) let the script read it
- # (0 or any other value) assume it's where it was set.
- HOW_DUTY=1
- ################# DRIVE SETTINGS ################
- SP=33.57 # Setpoint mean drive temperature (C)
- # Time interval for checking drives (minutes). Drives change
- # temperature slowly; 5 minutes is probably frequent enough.
- DRIVE_T=1
- # Tunable constants for drive control (see comments at end of script)
- Kp=4 # Proportional tunable constant
- Kd=40 # Derivative tunable constant
- ################# CPU SETTINGS ################
- # Time interval for checking CPU (seconds). 1 to 12 may be appropriate
- CPU_T=5
- # Reference temperature (C) for scaling CPU_DUTY (NOT a setpoint).
- # At and below this temperature, CPU will demand minimum
- # duty cycle (DUTY_CPU_MIN).
- CPU_REF=54 # Integer only!
- # Scalar for scaling CPU_DUTY.
- # CPU will demand this number of percentage points in additional
- # duty cycle for each degree of temperature above CPU_REF.
- CPU_SCALE=6 # Integer only!
- ################# OPTIONAL ################
- # If you wish to implement user-defined actions after Drives_check_adjust()
- # and CPU_check_adjust(), you can define Post_DRIVES_check_adjust()
- # and Post_CPU_check_adjust() here.
- # For example, barbierimc set up Grafana to graph the data: https://www.ixsystems.com/community/threads/fan-scripts-for-supermicro-boards-using-pid-logic.51054/post-555603
spinpid2.config