Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Script: Hybrid CPU & HD Fan Zone Controller

GolDenis

Member
Joined
Oct 25, 2019
Messages
38
2019-12-20 11:02:12: Drives are cool enough, going to 30%
2019-12-20 11:02:23: HD fan speed should be low, but 1400 > 1200.
2019-12-20 11:02:41: HD fan speed should be low, but 1500 > 1200.
2019-12-20 11:02:46: Resetting BMC
2019-12-20 11:02:58: HD fan speed should be low, but 1400 > 1200.
2019-12-20 11:03:15: HD fan speed should be low, but 1500 > 1200.
2019-12-20 11:03:20: Resetting BMC
Means that something wrong with my fan?
why it's unmanaged?
 

Kevin Horton

Neophyte Sage
Joined
Dec 2, 2015
Messages
679
2019-12-20 11:02:12: Drives are cool enough, going to 30%
2019-12-20 11:02:23: HD fan speed should be low, but 1400 > 1200.
2019-12-20 11:02:41: HD fan speed should be low, but 1500 > 1200.
2019-12-20 11:02:46: Resetting BMC
2019-12-20 11:02:58: HD fan speed should be low, but 1400 > 1200.
2019-12-20 11:03:15: HD fan speed should be low, but 1500 > 1200.
2019-12-20 11:03:20: Resetting BMC
Means that something wrong with my fan?
why it's unmanaged?
What are your BMC fan speed thresholds? Show us the output of ipmitool sensor | grep FAN
 

GolDenis

Member
Joined
Oct 25, 2019
Messages
38
root@freenas[~]# ipmitool sensor | grep FAN
FAN1 | 2300.000 | RPM | cr | 400.000 | 500.000 | 700.000 | 1200.000 | 1500.000 | 2400.000
FAN2 | 4300.000 | RPM | nr | 300.000 | 400.000 | 500.000 | 2200.000 | 2400.000 | 2600.000
FAN3 | 1200.000 | RPM | ok | 300.000 | 400.000 | 500.000 | 2000.000 | 2100.000 | 2300.000
FAN4 | na | | na | na | na | na | na | na | na
FANA | 1400.000 | RPM | cr | 500.000 | 600.000 | 700.000 | 1200.000 | 1400.000 | 1600.000

FAN1 - water cooling pump fan (pwm) (2300rpm max)
FAN2 - it's water cooling pump (no pwm)
FAN3 - 1500 rpm max (pwm)
FANA - 1500 rpm max (pwm)
 

Kevin Horton

Neophyte Sage
Joined
Dec 2, 2015
Messages
679
root@freenas[~]# ipmitool sensor | grep FAN
FAN1 | 2300.000 | RPM | cr | 400.000 | 500.000 | 700.000 | 1200.000 | 1500.000 | 2400.000
FAN2 | 4300.000 | RPM | nr | 300.000 | 400.000 | 500.000 | 2200.000 | 2400.000 | 2600.000
FAN3 | 1200.000 | RPM | ok | 300.000 | 400.000 | 500.000 | 2000.000 | 2100.000 | 2300.000
FAN4 | na | | na | na | na | na | na | na | na
FANA | 1400.000 | RPM | cr | 500.000 | 600.000 | 700.000 | 1200.000 | 1400.000 | 1600.000

FAN1 - water cooling pump fan (pwm) (2300rpm max)
FAN2 - it's water cooling pump (no pwm)
FAN3 - 1500 rpm max (pwm)
FANA - 1500 rpm max (pwm)
Is FANA the HD fan? If so, I wonder if perhaps it sometimes runs fast enough to trip the 1600 rpm upper limit in the fan thresholds. if FANA is the HD fan, it might be worth increasing its upper thresholds a bit.
 

GolDenis

Member
Joined
Oct 25, 2019
Messages
38
Is FANA the HD fan? If so, I wonder if perhaps it sometimes runs fast enough to trip the 1600 rpm upper limit in the fan thresholds. if FANA is the HD fan, it might be worth increasing its upper thresholds a bit.
Yeap... All 4 HD fans connected to the FANA via splitter.
Strange thing, that I cant see that MB try to spin down the fans at all.
& switch to the Optimal mode doesnt help
1576915522751.png

looks strange for me.
 

GolDenis

Member
Joined
Oct 25, 2019
Messages
38
hm.... my idea - that something wrong with water pump connection
Its extremely high rpm & that's not PWM so.... its just rush with 12v power & show 4300 rpm to the MB
& of cause its unmanaged.
Any ideas? Switch it somewhere to any port without rpm feedback? (Just feed it with 12v only)
Is someone had the same experience with a similar problem? (Don't want to shut down NAS & doing useless monkey job)
 

GolDenis

Member
Joined
Oct 25, 2019
Messages
38
looks after thresholds tunning everything is stabilized.
Need to change CPU water system fan, cause too noisy.

[screen is terminating]
root@freenas[~]# ipmitool sensor | grep FAN
FAN1 | 2300.000 | RPM | nc | 400.000 | 500.000 | 700.000 | 2300.000 | 2500.000 | 2600.000
FAN2 | 4300.000 | RPM | nc | 300.000 | 400.000 | 500.000 | 4300.000 | 4500.000 | 4600.000
FAN3 | 1200.000 | RPM | ok | 300.000 | 400.000 | 500.000 | 1500.000 | 2300.000 | 2500.000
FAN4 | na | | na | na | na | na | na | na | na
FANA | 1400.000 | RPM | ok | 500.000 | 600.000 | 700.000 | 1600.000 | 2300.000 | 2500.000


Code:
2019-12-21 15:07:26: CPU Temp: 36.0 <= 39, CPU Fan going low.
2019-12-21 15:07:26: Maximum HD Temperature: 38
2019-12-21 15:07:26: Drives are warming, going to 50%
2019-12-21 15:10:27: Maximum HD Temperature: 38
2019-12-21 15:13:29: Maximum HD Temperature: 38
2019-12-21 15:16:29: Maximum HD Temperature: 38
2019-12-21 15:19:30: Maximum HD Temperature: 38
2019-12-21 15:22:32: Maximum HD Temperature: 38
2019-12-21 15:25:33: Maximum HD Temperature: 38
2019-12-21 15:28:34: Maximum HD Temperature: 38
2019-12-21 15:31:35: Maximum HD Temperature: 38
2019-12-21 15:34:36: Maximum HD Temperature: 38
2019-12-21 15:37:36: Maximum HD Temperature: 38
2019-12-21 15:40:37: Maximum HD Temperature: 38
2019-12-21 15:43:38: Maximum HD Temperature: 38
2019-12-21 15:46:39: Maximum HD Temperature: 38
2019-12-21 15:49:40: Maximum HD Temperature: 38
2019-12-21 15:52:42: Maximum HD Temperature: 38
2019-12-21 15:55:42: Maximum HD Temperature: 38
2019-12-21 15:58:43: Maximum HD Temperature: 38
2019-12-21 16:01:44: Maximum HD Temperature: 38
2019-12-21 16:04:45: Maximum HD Temperature: 38
2019-12-21 16:07:46: Maximum HD Temperature: 38
2019-12-21 16:10:47: Maximum HD Temperature: 38
2019-12-21 16:13:48: Maximum HD Temperature: 38
2019-12-21 16:16:50: Maximum HD Temperature: 38
2019-12-21 16:19:50: Maximum HD Temperature: 38
2019-12-21 16:22:51: Maximum HD Temperature: 38
2019-12-21 16:25:52: Maximum HD Temperature: 38
2019-12-21 16:28:53: Maximum HD Temperature: 38
2019-12-21 16:31:54: Maximum HD Temperature: 38
2019-12-21 16:34:55: Maximum HD Temperature: 38
2019-12-21 16:37:57: Maximum HD Temperature: 38
2019-12-21 16:40:58: Maximum HD Temperature: 38
2019-12-21 16:43:59: Maximum HD Temperature: 38
2019-12-21 16:47:01: Maximum HD Temperature: 38
2019-12-21 16:50:01: Maximum HD Temperature: 38
2019-12-21 16:53:03: Maximum HD Temperature: 38
2019-12-21 16:56:04: Maximum HD Temperature: 38
2019-12-21 16:59:04: Maximum HD Temperature: 38
2019-12-21 17:02:05: Maximum HD Temperature: 38
2019-12-21 17:05:07: Maximum HD Temperature: 38
2019-12-21 17:08:07: Maximum HD Temperature: 38
2019-12-21 17:11:08: Maximum HD Temperature: 38
2019-12-21 17:14:09: Maximum HD Temperature: 38
2019-12-21 17:17:10: Maximum HD Temperature: 38
2019-12-21 17:20:11: Maximum HD Temperature: 38
2019-12-21 17:23:12: Maximum HD Temperature: 38
 

Gilgameshxg

Member
Joined
Nov 26, 2018
Messages
28
Hello! So I got the script from https://jro.io/nas/ which in the script references it come from this thread which references this one come from Kevin which kevin's was based on Stux's if I have that right. Is this one the newest version of the script? I keep getting the error below and wondering what I'm doing wrong. I nano'ed into a new file pasted a few times and chmod +x the file and I tried with nano -w "script name" but still the same thing. I'm pretty new to this and any help would be super awsome!

syntax error at ./fanctrl.pl line 74, near "the last period"
BEGIN not safe after errors--compilation aborted at ./fanctrl.pl line 76.

Which is at the below part of the script

## this prevents the HD fans from spinning up when the CPU fans are capable of providing
## sufficient cooling.
$cpu_hd_override_temp = 62;
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605

Kevin Horton

Neophyte Sage
Joined
Dec 2, 2015
Messages
679
@Stux - A user of my PID variation of your script reported that the CPU fan control did not work as described in the comments in the CPU THRESHOLD TEMPS section. Specifically, the comment on line 62 states that the CPU fan will go to Medium if the temperature drops below this value. I.e. there will be temperature hysteresis in the control loop that switches the CPU fan between Medium and High. The user reports that his CPU fan cycles quickly between Medium and High, and back to Medium again, as the CPU temperature moves above or below the value in $high_cpu_temp. Looking at the code, I see that it matches the behavior he reports.

Question - is that the way you intended it to work, and it is the comment on line 62 that is wrong? Or, did you intended to have CPU temperature hysteresis on the switching between High and Med, and the actual code failed to implement it?

From a system design perspective, it seems logical that we would want some temperature hysteresis in that control loop. I haven't run into this problem myself as my CPU rarely gets to the high temp threshold.
 

n00bftw007

Junior Member
Joined
Jul 11, 2020
Messages
21
Before I go messing about with this, does anyone know if it will work as it is now, with a SuperMicro X11SDV-12C-TLN2F? Thanks in advance.
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605
Before I go messing about with this, does anyone know if it will work as it is now, with a SuperMicro X11SDV-12C-TLN2F?
I haven't seen @Stux around for quite a while and I think you'll have a better run with @Kevin Horton 's adaptation: https://github.com/khorton/nas_fan_control/
I can quote from that version that it will at least work for the X11SSM-F

It would of course only take a few minutes for you to try these (from the script headers):
Code:
# The following ipmitool commands can be run when connected to the FreeNAS server via ssh.  They are useful to set a desired fan duty cycle before
# checking the fan speeds.

# Set duty cycle in Zone 0 to 100%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 100 
# Set duty cycle in Zone 0 to  50%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 50
# Set duty cycle in Zone 0 to  20%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 20

# Set duty cycle in Zone 1 to 100%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 100
# Set duty cycle in Zone 1 to  50%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 50
# Set duty cycle in Zone 1 to  20%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 20

# Check duty cycle in Zone 0:                   ipmitool raw 0x30 0x70 0x66 0x00 0x00
# result is hex, with 64 being 100% duty cycle.  32 is 50% duty cycle.  14 is 20% duty cycle.

#  Check duty cycle in Zone 1:                  ipmitool raw 0x30 0x70 0x66 0x00 0x01
# result is hex, with 64 being 100% duty cycle.  32 is 50% duty cycle.  14 is 20% duty cycle.

# Check fan speeds using: ipmitool sdr


Remembering that Fan zones are supposed to be assigned only to the headers:
Code:
## FAN ZONES
# Your CPU/case fans should probably be connected to the main fan sockets, which are in fan zone zero
# Your HD fans should be connected to FANA which is in Zone 1
 

n00bftw007

Junior Member
Joined
Jul 11, 2020
Messages
21
I haven't seen @Stux around for quite a while and I think you'll have a better run with @Kevin Horton 's adaptation: https://github.com/khorton/nas_fan_control/
I can quote from that version that it will at least work for the X11SSM-F

It would of course only take a few minutes for you to try these (from the script headers):
Code:
# The following ipmitool commands can be run when connected to the FreeNAS server via ssh.  They are useful to set a desired fan duty cycle before
# checking the fan speeds.

# Set duty cycle in Zone 0 to 100%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 100
# Set duty cycle in Zone 0 to  50%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 50
# Set duty cycle in Zone 0 to  20%: ipmitool raw 0x30 0x70 0x66 0x01 0x00 20

# Set duty cycle in Zone 1 to 100%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 100
# Set duty cycle in Zone 1 to  50%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 50
# Set duty cycle in Zone 1 to  20%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 20

# Check duty cycle in Zone 0:                   ipmitool raw 0x30 0x70 0x66 0x00 0x00
# result is hex, with 64 being 100% duty cycle.  32 is 50% duty cycle.  14 is 20% duty cycle.

#  Check duty cycle in Zone 1:                  ipmitool raw 0x30 0x70 0x66 0x00 0x01
# result is hex, with 64 being 100% duty cycle.  32 is 50% duty cycle.  14 is 20% duty cycle.

# Check fan speeds using: ipmitool sdr


Remembering that Fan zones are supposed to be assigned only to the headers:
Code:
## FAN ZONES
# Your CPU/case fans should probably be connected to the main fan sockets, which are in fan zone zero
# Your HD fans should be connected to FANA which is in Zone 1
When trying to run these command via putty ''# Set duty cycle in Zone 1 to 100%: ipmitool raw 0x30 0x70 0x66 0x01 0x01 100'', i get the error message ''Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory''
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605
Did you buy the IPMI add-on for the board?

What do you get from ipmitool sensor?

A quick bit of googling shows that it's probably there on the board... did you enable it in the BIOS settings?
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605
ipmitool is part of FreeNAS... you should just be able to run it from the shell directly.
 

n00bftw007

Junior Member
Joined
Jul 11, 2020
Messages
21
ipmitool is part of FreeNAS... you should just be able to run it from the shell directly.
The FreeNAS OS is on a different network (10.10.10.6, connecting 2 systems together, point to point 10gb/e) to the IPMI server (192.168.1.23 - plugged into router via IPMI port on the same mobo), so the IPMI tool is not going to run through FreeNAS right?

I have no IPMI option in FreeNAS
 
Last edited:

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605
The FreeNAS OS is on a different network
FreeNAS is going to access the IPMI via the internal device (like was shown in the error messages you got... it's looking for one of those, so there's no network to consider... "Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0")
 

n00bftw007

Junior Member
Joined
Jul 11, 2020
Messages
21
FreeNAS is going to access the IPMI via the internal device (like was shown in the error messages you got... it's looking for one of those, so there's no network to consider... "Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0")
Ah ok. I assume 'Update IPMI LAN Configuration' has to be enabled for FreeNAS to pick it up. Well, i keep enabling it, hit 'save and reset', go into the BIOS again, and it's set back to NO, instead of yes :/
1596043262251.png
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
2,605
Well at least we know that the module is there.

I don't think you need to worry about that setting.
What do you see in FreeNAS under /dev in terms of ipmi?
 
Top