Giter Club home page Giter Club logo

ipmi_fancontrol-ng's Introduction

IPMI Fan Control Daemon

This script controls IPMI compatible server's fan speeds in response to CPU Temperatures provided by lm-sensors. This script has been tested on a Dell PowerEdge R210 II in a homelab environment, but should work on any IPMI compatible server.

NOTE:

The script puts your server into "Full Fan Speed Mode", and then modifies what "Full Speed" means, You have to manually use IPMI to set it to e.g. "Optimal" when you're not using the script.

NOTE:

You use this script at your own risk, and no warranty is provided. Do not use in produciton environments.

What's new?

The original script provided a "step" approach where fans would take large "steps" depending on the temps. In this version, scalar equations are generated to provide an easy (and quiet) slope to follow to the next step. These equations are simple Y=mx+b linear slopes that effectivly provide a fan "curve" based on the entries in the %cpu_temp_to_fan_speed hash table.

Installation and Usage

# Install dependencies (Debian, your pkg names may be different)
apt install lm-sensors ipmitool

# Verify IPMI modules are loaded
lsmod | grep -i ipmi

# Install
cp ipmi_fancontrol-ng /usr/bin/
cp ipmi_fancontrol-ng.service /usr/lib/systemd/system/
chmod +x /usr/bin/ipmi_fancontrol-ng

# Enable on boot and start
systemctl enable ipmi_fancontrol-ng
systemctl start ipmi_fancontrol-ng

InfluxDB & Telegraf

Metrics are output to the file /tmp/fan_speed_telegraf by default and can be input into InfluxDB with the following Telegraf config block:

[[inputs.exec]]
  commands = [
    "/usr/bin/cat /tmp/fan_speed_telegraf"
  ]

  timeout = "5s"
  data_format = "influx"

Metrics Available

  • Fan Speed %
  • Fan Speed HEX

More documentation is planned, however I am available to answer basic configuration questions in the mean time.

ipmi_fancontrol-ng's People

Contributors

drspeedy 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

Watchers

 avatar  avatar

ipmi_fancontrol-ng's Issues

Script fails to run - Cannot set fan speed to FULL - Cannot read temperatures.

I'm trying to get this set up to control fans on a debian server, running on the host, but I'm not having much luck.
I've changed the following from the file that ships with the repo:

$cpu_temp_to_fan_speed{75} = 0x64;
$cpu_temp_to_fan_speed{70} = 0x56;
$cpu_temp_to_fan_speed{60} = 0x32;
$cpu_temp_to_fan_speed{55} = 0x19;
$cpu_temp_to_fan_speed{50} = 0x0F;
$cpu_temp_to_fan_speed{45} = 0x06;
$cpu_temp_to_fan_speed{35} = 0x03;

When running the script I get an error about not being able to send the ipmi command, and also an error about not getting the temperatures. For reference, the command I've been using to control my fans previous to trying to implement this was ipmitool raw 0x30 0x70 0x66 0x01 0x00 0x03. See below for sample output of your script:

/usr/bin/ipmi_fancontrol-ng 
Setting Fan mode to FULL SPEED.
Unable to send RAW command (channel=0x0 netfn=0x30 lun=0x0 cmd=0x30 rsp=0xcc): Invalid data field in request

=================================================================
Calling UpdateFanSpeed()...
=================================================================
ERROR: Can't get value of subfeature temp3_min: I/O error
ERROR: Can't get value of subfeature temp3_max: I/O error
ERROR: Can't get value of subfeature temp4_min: I/O error
ERROR: Can't get value of subfeature temp4_max: I/O error
ERROR: Can't get value of subfeature temp5_min: I/O error
ERROR: Can't get value of subfeature temp5_max: I/O error
ERROR: Can't get value of subfeature temp6_min: I/O error
ERROR: Can't get value of subfeature temp6_max: I/O error
ERROR: Can't get value of subfeature temp7_min: I/O error
ERROR: Can't get value of subfeature temp7_max: I/O error
ERROR: Can't get value of subfeature temp3_min: I/O error
ERROR: Can't get value of subfeature temp3_max: I/O error
ERROR: Can't get value of subfeature temp4_min: I/O error
ERROR: Can't get value of subfeature temp4_max: I/O error
ERROR: Can't get value of subfeature temp5_min: I/O error
ERROR: Can't get value of subfeature temp5_max: I/O error
ERROR: Can't get value of subfeature temp6_min: I/O error
ERROR: Can't get value of subfeature temp6_max: I/O error
ERROR: Can't get value of subfeature temp7_min: I/O error
ERROR: Can't get value of subfeature temp7_max: I/O error
Maximum CPU Temperature Seen: 0 degrees C.
Maximum GPU Temperature Seen: 0 degrees C.
Current Minimum Fan Speed: 30000 RPM
Current Maximum Fan Speed: 0 RPM
Current Fan Duty Cycle: 0%
Desired Fan Duty Cycle: -8%
=================================================================
Update Complete - going to sleep for 5 seconds...
=================================================================
^C

Here is what I get from ipmitool sensor:

ipmitool sensor
CPU Temp         | 31.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 90.000    | 95.000    | 95.000    
System Temp      | 24.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
Peripheral Temp  | 38.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
M2NVMeSSD Temp1  | na         |            | na    | na        | na        | na        | na        | na        | na        
M2NVMeSSD Temp2  | na         |            | na    | na        | na        | na        | na        | na        | na        
MB_10G_LAN Temp  | 64.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 95.000    | 100.000   | 105.000   
VRMCpu Temp      | 23.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 95.000    | 100.000   | 105.000   
VRMSoc Temp      | 31.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 95.000    | 100.000   | 105.000   
VRMABCD Temp     | 26.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 95.000    | 100.000   | 105.000   
VRMEFGH Temp     | 23.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 95.000    | 100.000   | 105.000   
DIMMA1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMA2 Temp      | 25.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
DIMMB1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMB2 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMC1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMC2 Temp      | 26.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
DIMMD1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMD2 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMME1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMME2 Temp      | 23.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
DIMMF1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMF2 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMG1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMG2 Temp      | 22.000     | degrees C  | ok    | 5.000     | 5.000     | 10.000    | 80.000    | 85.000    | 90.000    
DIMMH1 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
DIMMH2 Temp      | na         |            | na    | na        | na        | na        | na        | na        | na        
FAN1             | na         |            | na    | na        | na        | na        | na        | na        | na        
FAN2             | na         |            | na    | na        | na        | na        | na        | na        | na        
FAN3             | 2200.000   | RPM        | ok    | 300.000   | 500.000   | 700.000   | 25300.000 | 25400.000 | 25500.000 
FAN4             | 2200.000   | RPM        | ok    | 300.000   | 500.000   | 700.000   | 25300.000 | 25400.000 | 25500.000 
FAN5             | 2200.000   | RPM        | ok    | 300.000   | 500.000   | 700.000   | 25300.000 | 25400.000 | 25500.000 
FAN6             | na         |            | na    | na        | na        | na        | na        | na        | na        
12V              | 12.112     | Volts      | ok    | 9.680     | 9.936     | 10.704    | 13.712    | 14.480    | 14.736    
5VCC             | 5.050      | Volts      | ok    | 3.940     | 4.030     | 4.360     | 5.590     | 5.920     | 6.010     
3.3VCC           | 3.310      | Volts      | ok    | 2.613     | 2.681     | 2.885     | 3.718     | 3.922     | 3.990     
VBAT             | 0x4        | discrete   | 0x04ff| na        | na        | na        | na        | na        | na        
VDDCR            | 0.967      | Volts      | ok    | 0.400     | 0.499     | 0.607     | 1.570     | 1.732     | 1.804     
VMEMABCD         | 1.243      | Volts      | ok    | 0.979     | 1.003     | 1.081     | 1.387     | 1.465     | 1.489     
VMEMEFGH         | 1.256      | Volts      | ok    | 0.976     | 0.997     | 1.074     | 1.389     | 1.466     | 1.487     
VDD_5_DUAL       | 5.159      | Volts      | ok    | 4.019     | 4.139     | 4.439     | 5.729     | 6.029     | 6.149     
VDD_33_DUAL      | 3.293      | Volts      | ok    | 2.613     | 2.681     | 2.885     | 3.718     | 3.922     | 3.990     
SOCRUN           | 0.834      | Volts      | ok    | 0.295     | 0.498     | 0.631     | 1.065     | 1.142     | 1.338     
SOCDUAL          | 0.893      | Volts      | ok    | 0.711     | 0.725     | 0.781     | 1.012     | 1.068     | 1.082     
Chassis Intru    | 0x0        | discrete   | 0x0000| na        | na        | na        | na        | na        | na        
PS1 Status       | 0x1        | discrete   | 0x0100| na        | na        | na        | na        | na        | na        
PS2 Status       | 0x1        | discrete   | 0x0100| na        | na        | na        | na        | na        | na 

My system is a Supermicro X11 - Supermicro AS-2113S-WTRT

Fan Speeds Inaccurate

I forked a fork of this and wanted to test the percentages. I have access to the IPMI and set the curve to straight 100% and noticed the fan speeds only got up to about 34% in the IPMI even though the script had them set to "100%"

I am trying to figure out the best way to adjust the ipmi preable raw to reflect a proper hex value to adjust this.

how to adjust target maximum temperature

ipmi_fancontrol-ng worked wonders on my R210II, and made the noise levels almost bearable. however fan speed is hoovering around 6000 rpm, which is quite noticeable. I wouldn't mind to let it running a bit hotter if I could get fans to spin at around 3000rpn. how could I get there ?

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.