Fan control script not working anymore

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Now in the script I downloaded from here, I got a bit confused because I have two fan zones but the script says that all FAN1+ are in Zone 0.
I found here that FAN 4 might actually be FAN A:
I take that quote to mean that only the later version 2.00 system boards have two zones, with FAN-4 serving as what's usually called FAN-A on Supermicro systems.
But then @Stux replies here that it wouldn't power auxiliary items and that You just need to change the 'FANA' setting to 'FAN4'.
How am I supposed to handle that?
You should look at the test commands at the top of the script and try those to see which fans are impacted when you change speeds of which assignment... usually looking at ipmitool sensors will give you the hints about that.

And in addition I have the two HD fans that are in the same Fan Zone (0) as the Exhaust fan, which is bigger, but have different max. speeds (2000 vs. 1300). What should I put in line 403?
You shouldn't really be mixing fans like that in the same zone... but ultimately, not including the lower speed one in the testing/reporting group would be the workaround.

Do I really need a config if I just edit the values in the script? I guess it is to make changes on the fly, but what values could I enter in that config? Like temperature thresholds?
The sample is there in the github for versions tuned (by @Kevin Horton) for different numbers of monitored disks to average for the temperatures.

Having it allows for adjustment of the disk target temp and the other PID values while still running, not really more than that at this point.

In my IPMI the fans are called "FAN1" etc. but in the your script they are "Fan 1" etc. What is the correct naming or will it work with both?
Go with your IMPI naming as the guide as per ipmitool sensors ... the script is just calling ipmitool to make the changes to fans.
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
Thanks @sretalla , only gotten now around to working on it :(

A couple more questions popped up, please bear in mind I'm no native speaker ;)

I have noted down the fan speeds when I ran the commands form the top of the script. I wrote them down along with the fans and zones, cf. screenshot attached. You can also see that in Zone 0 the exhaust fan is slower than the other two in that zone. However, if I understood right, I should set the max. for that zone to 2000 instead of 1300, correct?
2023-04-07-124831.jpg

Bildschirmfoto vom 2023-04-07 12-45-31.png



And then I named the fans here according to how they are called when I run "ipmitool sdr" in the SSH Terminal. Are the entries correctly made?
Bildschirmfoto vom 2023-04-07 12-45-12.png


And how can I test-run the script via SSH shell to see if it works?

And do you know under which path in TrueNAS Scale I can call ipmitool?

Thanks a lot for your help already in advance! Any other help is of course welcome as well :)

Happy Easter!
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
I used which command to find the ipmitool and used the /usr/bin/ipmitool path. However, when I try to run the script via bash, I get the following errors (since I have a Supermicro board should I delete the lines referring to ASRock?):
Bildschirmfoto vom 2023-04-07 13-02-02.png


And last but not least, which setting should I use in IPMI itself?
Bildschirmfoto vom 2023-04-07 13-36-40.png


I have now set it to Full because that was stux' original suggestion for his script:
1680867524323.png
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
since I have a Supermicro board should I delete the lines referring to ASRock?
Those lines shouldn't do any harm... not sure where the error is actually coming from there.

You're starting it with bash... is that really necessary?
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
Those lines shouldn't do any harm... not sure where the error is actually coming from there.

You're starting it with bash... is that really necessary?
About the lines: I can try to remove them and see what happens then in terms of error.

I don't know. How should I test it? Currently, it runs all the time at full speed and I don't know if the script is running and behind it or if it is just the setting from the IPMI...

What do you think about the other settings? Are the right changes in the right places? Thanks!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
I think we should go with the version I posted over here:


Make the same adjustments you made to the other version in that one and let me know how it goes.
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
@achmetinternet
You're starting it with bash... is that really necessary?
That very well may be the the source of your errors .pl files are generally perl files which should be run as an independent executable not via bash (or any other shell interpreter). Without looking at the script and just your errors they are exactly what I would expect when bash tries to execute a perl script.
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
I think we should go with the version I posted over here:


Make the same adjustments you made to the other version in that one and let me know how it goes.
HI @sretalla, that looks like the same script I had used before. Any suggestions what to do next? It also seems that nothing gets logged correctly. Would it help if I put up my pl file?
 

Attachments

  • Bildschirmfoto vom 2023-05-17 17-17-28.png
    Bildschirmfoto vom 2023-05-17 17-17-28.png
    27.1 KB · Views: 145

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
Hi @sretalla

Thanks a million! Both attached files are located on /mnt/Daten/apps/scripts/fancontrol . I hope I have put the correct path to the config.ini in the .pl-file.

The debug file is on level 4 and seems to yield more info on my HDD via smarttesting than anything else :) Maybe should also move it away from root.

And have you had a look at this thread: https://www.truenas.com/community/threads/fan-scripts-for-supermicro-boards-using-pid-logic.51054/

Pretty new and has a couple more scripts :)
 

Attachments

  • fancontrol.zip
    17 KB · Views: 179
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
OK, so first obvious thing is that you've left influx logging enabled, but not changed the IP to one that makes sense to me... I guess you won't have an influxdb on your router (192.168.1.1... if that's even an address on your network at all).

I suggest changing line 255 to:
my $use_influx = 0;

On line 402, you've set your CPU fan speed to 6000... can that be right? Your fan must be able to hit that speed or the script will continually try to set it (and will fail).

On lines 448 - 450, you've got your fans set incorrectly... you need to read the instructions starting on line 428... the zones must be split, so you can't use FAN1 in zone 0 and FAN4 in zone 1, you need to use FANA instead.

Make sure you're not running the script via bash, just run the .pl directly and give it a test once you've corrected the above points.
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
OK, so first obvious thing is that you've left influx logging enabled, but not changed the IP to one that makes sense to me... I guess you won't have an influxdb on your router (192.168.1.1... if that's even an address on your network at all).

I suggest changing line 255 to:
my $use_influx = 0;
OK, will do. Or can I set up an influxdb easily, i.e. write to it and make the inputs somehow visible? Maybe in a second step :)
On line 402, you've set your CPU fan speed to 6000... can that be right? Your fan must be able to hit that speed or the script will continually try to set it (and will fail).
According to the IPMI tests, it can even run 6200. It is the small fan just above the cooler on the CPU.
On lines 448 - 450, you've got your fans set incorrectly... you need to read the instructions starting on line 428... the zones must be split, so you can't use FAN1 in zone 0 and FAN4 in zone 1, you need to use FANA instead.
I have wired them like in the build from @Stux I referred to earlier in this post. I explained my setup in the first couple of lines. I got the CPU fan ganged off FAN4 which is in Fan Zone 1, all other three fans (FAN1, FAN2, FAN3) in Fan Zone 0. There is no FANA in my IPMI, I thought I had to use the namings of the fans as in my IPMI tool?!

After considering the question with regards to CPU fan speed (line 402) and the explanations on the different fan setup, I'm asking myself, what's determining what, i.e. is the cpu_max_fan_speed in line 402 dependent on cpu_fan_zone in line 438? Shouldn't I then first determine my fan zones, i.e. what belongs where and then provide inputs regardings speeds? The whole fan zone thing seems to me something that should come first and then all the stuff about speed etc. But maybe I am wrong, not an expert :) Or maybe it is all the different nomenclature. Best to define somewhere that, e.g. Fan Zone xyz is the CPU fan is FAN1 in IPMI and then just stick with FAN1. Just a suggestion but maybe I'm wrong since I am new to the perl-stuff :smile:
Make sure you're not running the script via bash, just run the .pl directly and give it a test once you've corrected the above points.
Will try the influxdb one first and report back, thanks for your help!
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
I have wired them like in the build from @Stux I referred to earlier in this post. I explained my setup in the first couple of lines. I got the CPU fan ganged off FAN4 which is in Fan Zone 1, all other three fans (FAN1, FAN2, FAN3) in Fan Zone 0. There is no FANA in my IPMI, I thought I had to use the namings of the fans as in my IPMI tool?!
OK, fair. I have just taken the supermicro fan code from @Kevin Horton (who in turn took it from @Stux ), so I expect it's fine if you follow his recommendations.
 

achmetinternet

Explorer
Joined
Jun 13, 2018
Messages
50
OK, fair. I have just taken the supermicro fan code from @Kevin Horton (who in turn took it from @Stux ), so I expect it's fine if you follow his recommendations.
Ok, but shouldn't I mention all fans in that section "$hd_fan_header" instead of just FAN1? Do I need to use semicolons? And with those changes made, shouldn't the script work?
1684992539325.png


EDIT: I ran the script via the perl command and got some output but it is a bit cryptic to me. Right after the command comes this:
1684993017090.png


Is it referring to the config file with the number of warmest disks? Afterwards it shows me some smart test results from early on like 2020, is that expected?

And at the end this appears:
Use of uninitialized value $n in numeric gt (>) at MASTER_PID_fan_control_SCALE.pl line 978.
Use of uninitialized value $hd_num_peak in division (/) at MASTER_PID_fan_control_SCALE.pl line 982.
Illegal division by zero at MASTER_PID_fan_control_SCALE.pl line 982.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
shouldn't I mention all fans in that section "$hd_fan_header" instead of just FAN1?
No, it's normal to just mention 1 to identify the "zone".

The other fans you want to capture for reporting of speeds are on the next line (including the first one).

Is it referring to the config file with the number of warmest disks?
it seems that file might have permissions issues or not exist?

Afterwards it shows me some smart test results from early on like 2020, is that expected?
Not sure what you mean... it might show the output of smartctl... that can have records of old tests in it.

And at the end this appears:
That looks like it's including a disk which has no value in it... I notice it's talking about an NVME disk in the output above, it shouldn't really be used on NVME/SSD disks as their temperatures don't need the same control as HDDs. can you confirm what hardware you have in that box?
 
Top