Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Fan Scripts for Supermicro Boards Using PID Logic

Fan Scripts for Supermicro Boards Using PID Logic 2019-10-04

Discovered that BMC reset on my machine takes 105 seconds, so lengthened the wait after reset from 60 to 120 sec.
Thanks: Dice
In both scripts:
  1. removed Ki and I (integral) term
  2. code tweaks to marginally improve efficiency
  3. added option to output to log only vs. log + console
  4. revised tuning advice at end of scripts to make it easier
In (dual-zone script):
  1. because some boards don't report correct fan duty, the script will now try to read it the first time and make needed adjustment, then assume the duty remains as it was set and not read it further
  2. added a setting to control whether interim CPU data are logged
  3. changed BMC reset code to avoid cycling resets that a few people reported.
Note that I don't have a way to test the dual zone script. Please report any issues. Also if you have previous versions, don't forget to copy over your settings.

See discussion for more details.
A couple of slight imrovements to the code for getting CPU temps. Thanks to @bestboy for the research, it can now handle any number of cores. Also the actual temperature reading might be slightly more efficient.
I had earlier switched to the best solution recommended by @Stux for reading CPU temperature in Now, with refined, complete bash code suggested by @bestboy, the apparently more efficient method has been incorporated into all 3 of the scripts that read temperature.

If you want the gory details, instead of reading CPU temp from the IPMI, we are now reading it from sysctl. We use the hottest of up to 10 cores as CPU temperature. I used awk instead of cut to get the actual numbers from the sysctl output, not sure if that is much of an improvement.

Thanks to Stux and bestboy!
Changed the command for reading CPU temperature. The new command, suggested by @Stux, is probably somewhat more efficient.
In, the reading of duty cycles from the motherboard is now commented out (disabled) by default. Some boards report incorrect duty, and this causes the script to go bonkers. I have no idea how widespread this fault is, but there is really no harm in not asking the board for duty cycles - the script assumes the duty is what it sets. There is also some minor code cleanup. (the single-zone version) has some improvements in logic that make it work better. It holds drive temps better. Also after a CPU-intensive task, the fans can come down quickly as the CPU cools until the drives need cooling. I finally got it perfect. Also some minor cleanup.
The single-zone script had an issue that caused fan control based on drive temperatures to be inaccurate if the system went through a long period of high CPU use. That's fixed here, other scripts not updated.