1. #!/usr/local/bin/bash
  2. # Config file for spinpid2.sh, beginning version 2020-06-17, for dual fan zones.
  3. # Minor changes 2020-08-20, but 2020-06-17 config
  4. # is still compatible with 2020-08-20 spinpid2.sh.
  5. # Path to ipmitool. If you're doing VM
  6. # you may need to add (inside quotes) the following to
  7. # remotely execute commands.
  8. # -H <hostname/ip> -U <username> -P <password>
  9. IPMITOOL="/bin/ipmitool"
  10. ################# OUTPUT SETTINGS ################
  11. # Change to your desired log location/name or it will be put
  12. # in the directory above (..) the one with the script.
  13. # LOG=/mnt/MyPool/MyDataSet/MyDirectory/spinpid2.log
  14. LOG=$(dirname "${BASH_SOURCE[0]}")/spinpid2.log
  15. # Where do you want output to go? Comment/uncomment (#) to select.
  16. # First sends output to the log file AND to screen/console, good for testing.
  17. # Second goes only to log file, no feedback if running manually, but doesn't take over console.
  18. # In the first, if you want to append to existing log, add '-a' to the tee command.
  19. exec > >(tee -i $LOG) 2>&1 # Log + console, good for testing
  20. # exec &> $LOG # Log only
  21. # CPU output is sent to a separate log for interim cycles
  22. # It can get big so turn off after testing. 1 = log cpu; anything else = don't log cpu
  23. CPU_LOG_YES=0
  24. # Path/name of cpu log
  25. # CPU_LOG=/mnt/MyPool/MyDataSet/MyDirectory/cpu.log
  26. CPU_LOG=$(dirname "${BASH_SOURCE[0]}")/cpu.log
  27. ################# FAN SETTINGS ################
  28. # Supermicro says:
  29. # Zone 0 - CPU/System fans, headers with number (e.g., FAN1, FAN2, etc.)
  30. # Zone 1 - Peripheral fans, headers with letter (e.g., FANA, FANB, etc.)
  31. # Some want the reverse (i.e, drive cooling fans on headers FAN1-4 and
  32. # CPU fan on FANA), so that's the default. But you can switch to SM way.
  33. ZONE_CPU=1
  34. ZONE_PER=0
  35. # Set min and max duty cycle to avoid stalling or zombie apocalypse
  36. DUTY_PER_MIN=20
  37. DUTY_PER_MAX=100
  38. DUTY_CPU_MIN=20
  39. DUTY_CPU_MAX=100
  40. # Using spintest.sh, measure fan RPMs at 30% duty cycle and 100% duty cycle.
  41. # RPM_CPU is for FANA if ZONE_CPU=1 or FAN1 if ZONE_CPU=0
  42. # RPM_PER is for the other fan.
  43. # RPM_CPU_30=400 # Your system
  44. # RPM_CPU_MAX=1500
  45. # RPM_PER_30=600
  46. # RPM_PER_MAX=1800
  47. RPM_CPU_30=500 # My system
  48. RPM_CPU_MAX=1400
  49. RPM_PER_30=500
  50. RPM_PER_MAX=1400
  51. # How should we determine what the fan duty (% of full power) is?
  52. # Normally we want to read that from the board (HOW_DUTY=1).
  53. # However, some dual-zone boards report incorrect fan duty,
  54. # and then we need to assume duty is what we set last time (HOW_DUTY=0)
  55. # (1) let the script read it
  56. # (0 or any other value) assume it's where it was set.
  57. HOW_DUTY=1
  58. ################# DRIVE SETTINGS ################
  59. SP=33.57 # Setpoint mean drive temperature (C)
  60. # Time interval for checking drives (minutes). Drives change
  61. # temperature slowly; 5 minutes is probably frequent enough.
  62. DRIVE_T=1
  63. # Tunable constants for drive control (see comments at end of script)
  64. Kp=4 # Proportional tunable constant
  65. Kd=40 # Derivative tunable constant
  66. ################# CPU SETTINGS ################
  67. # Time interval for checking CPU (seconds). 1 to 12 may be appropriate
  68. CPU_T=5
  69. # Reference temperature (C) for scaling CPU_DUTY (NOT a setpoint).
  70. # At and below this temperature, CPU will demand minimum
  71. # duty cycle (DUTY_CPU_MIN).
  72. CPU_REF=54 # Integer only!
  73. # Scalar for scaling CPU_DUTY.
  74. # CPU will demand this number of percentage points in additional
  75. # duty cycle for each degree of temperature above CPU_REF.
  76. CPU_SCALE=6 # Integer only!
  77. ################# OPTIONAL ################
  78. # If you wish to implement user-defined actions after Drives_check_adjust()
  79. # and CPU_check_adjust(), you can define Post_DRIVES_check_adjust()
  80. # and Post_CPU_check_adjust() here.
  81. # 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