Code Monkey home page Code Monkey logo

spacelama / r710-fan-control Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nolooseends/scripts

41.0 41.0 10.0 603 KB

A fork of R710-IPMI-TEMP from NoLooseEnds/Scripts, generalised to a fan control daemon for Dell Poweredge servers. Has reported to work on R710s, R520, R730. Allows more flexible control of the fan throttling vs the vanilla iDrac control which tends to ramp the fans up to full velocity the moment you add non-Dell hardware.

Perl 100.00%

r710-fan-control's People

Contributors

dalcon007 avatar jacobjangles avatar nolooseends avatar spacelama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

r710-fan-control's Issues

surgical change for system without hddtemp command

Hi I'm attempting to run the code on a PowerEdge R420, with TrueNAS-SCALE-22.02.3.

It's based on Debian, but does not allow installing software using apt.

The script runs as expected in interactive mode, except for the hddtemp command -- which is not present in the OS (and I cannot add).

The current output looks like this:

root@r420-01[~/custom-scripts]# ./fan-speed-control.pl 
timeout: failed to run command ‘hddtemp’: No such file or directory

cputemps=+37.0 ; +27.0
coretemps=+37.0 ; +30.0 ; +30.0 ; +30.0 ; +29.0 ; +26.0 ; +26.0 ; +27.0 ; +26.0 ; +24.0 ; +26.0 ; +25.0
ambient_ipmitemps=26
hddtemps=
weighted_temp = 30.00 ; ambient_temp 26.00
--> disable dynamic fan control

demand(0.00) -> 2
--> ipmitool raw 0x30 0x30 0x02 0xff 0x2

timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory

cputemps=+39.0 ; +30.0
coretemps=+39.0 ; +31.0 ; +32.0 ; +30.0 ; +31.0 ; +26.0 ; +28.0 ; +30.0 ; +29.0 ; +25.0 ; +28.0 ; +27.0
ambient_ipmitemps=26
hddtemps=
weighted_temp = 32.09 ; ambient_temp 26.00
--> disable dynamic fan control

demand(1.05) -> 2
timeout: failed to run command ‘hddtemp’: No such file or directory
timeout: failed to run command ‘hddtemp’: No such file or directory

I am looking for a surgical way to fail past the hddtemp call at line 204 and carry on with the rest of the script. That is, just blank the output for hdd temps, as I don't need to monitor them at all.

Any thoughts or suggestions?

thanks in advance... Brad

Maximum demand + evil copy paste

The maximum demand cap should be 100 instead of 255, it is a percent that is later converted to hex value and sent to ipmi as is.

if ($demand>255) { $demand=255; }

Not really that important, as if your temps demand more than 100% to ipmi I suppose it uses 100% fan speed anyway (and you've already been cooking it), but still...

There is also a comment for the second "if" (for the three slope definitions) that should reflect the third slope points instead of the second ones.

line 153 reads
# y1 = demand1 ; x1 = desired_temp1 ; y2 = demand2 ; x2 = desired_temp2
and should be
# y1 = demand2 ; x1 = desired_temp2 ; y2 = demand3 ; x2 = desired_temp3

Doesn't matter at all but was a bit confusing at first.

Other than that, I find this a great job at making the fan control a bit more "intelligent". Best I found so far. Thank you!

it dose not work

I upgrade my iDrac version to v2.85.85.85, then I found every tool dose't work
image

Suggestion: use "sensors" and "hddtemp" command options to simplify sensor readings

sensors has a -j option to output it's readings in json structures, and they are pretty similar for parsing. I have 2 types of NVMe drives in my system (2 U.2 drives and a bunch of M.2) and they as well as the CPU packages and cores all report their temperatures as floats. The key for each item's temperature is "temp#_input" with # being the number sensor on the particular device, starting at 1.
So for example, all my NVMe drives have a single sensor returned there, in an array called "composite", itself in an array called "nvme-pci-####", with the #### being the PCI address.
The CPUs and their cores have the sensor in an array called either "package id #" or "core #" (# being which number CPU or Core it is) which are in a array called "core temp-isa-000#" (with # being which CPU it is). Package ID, CPU number and Core number all start at 0 and increment in number.
On each processor, the key "temp1_input" always seems to be the Package temperature, while all the individual core temperatures are "temp2_input" and onwards.
This pattern holds on my R730 and my 11th gen intel NUC

Example output:

   "nvme-pci-8100":{
      "Adapter": "PCI adapter",
      "Composite":{
         "temp1_input": 33.850,
         "temp1_max": 74.850,
         "temp1_min": -0.150,
         "temp1_crit": 79.850,
         "temp1_alarm": 0.000
      }
   },
   "nvme-pci-0500":{
      "Adapter": "PCI adapter",
      "Composite":{
         "temp1_input": 34.850,
         "temp1_max": 74.850,
         "temp1_min": -0.150,
         "temp1_crit": 79.850,
         "temp1_alarm": 0.000
      }
   },
   "coretemp-isa-0001":{
      "Adapter": "ISA adapter",
      "Package id 1":{
         "temp1_input": 36.000,
         "temp1_max": 90.000,
         "temp1_crit": 100.000,
         "temp1_crit_alarm": 0.000
      },
      "Core 0":{
         "temp2_input": 30.000,
         "temp2_max": 90.000,
         "temp2_crit": 100.000,
         "temp2_crit_alarm": 0.000
      },
      "Core 1":{
         "temp3_input": 30.000,
         "temp3_max": 90.000,
         "temp3_crit": 100.000,
         "temp3_crit_alarm": 0.000
      },
      "Core 2":{
         "temp4_input": 30.000,
         "temp4_max": 90.000,
         "temp4_crit": 100.000,
         "temp4_crit_alarm": 0.000
      },
      "Core 3":{
         "temp5_input": 30.000,
         "temp5_max": 90.000,
         "temp5_crit": 100.000,
         "temp5_crit_alarm": 0.000
      },
      "Core 4":{
         "temp6_input": 31.000,
         "temp6_max": 90.000,
         "temp6_crit": 100.000,
         "temp6_crit_alarm": 0.000
      }

So we just need the value for key "temp1_input" inside any "coretemp-isa-" array for the overall CPU temp, and any value for key "temp[2...100]_input" from any "coretemp-isa-" array for the separate cores. Because we know they are values with decimals, it's pretty safe to cast them as floats without needing to do any further regex to get rid of dots, degrees symbols, letters and so on.

hddtemp can report all the temps from SATA and "I think" SAS drives as just a list of integer numbers by using the -n option.

Example output from my R730:

# hddtemp -n /dev/sd?
24
25
24
24
24
25
25
26
26
27
33
32
/dev/sdm: USB:  drive supported, but it doesn't have a temperature sensor.
/dev/sdn: DELL: S.M.A.R.T. not available

Pretty simple, as you go to each line if it casts successfully to an int, keep it, if it doesn't, drop it. Or evaluate each line for starting with a "/" and if it does, skip that reading, if it doesn't, cast to an int and store in an array to be evaluated. Either way means less regex to filter unwanted values, and less thinking ahead for what sort of characters might pop up that we don't want.
Two of the drives in the output above actually report floats in smartctl for their temperatures to 2 decimal places, but hddtemp seems to either round the temp or just drop the decimal places, so it seems we can rely on ints for it.

Hopefully can lead to cleaner, easier to maintain code, and less issues like we had with the differences of the raw output of these commands on different OS's, like our little snafu with the difference between proxmox 6 and 7 using unicode for the degrees symbol or not.

Given time I might be able to create a version like this and send you a pull, but I genuinely know nothing about perl so no promises!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.