OK I know it's not the best name, but in short, this is a .NET Core 3.0 service that monitors the temperature of a Dell PowerEdge R620 and automatically engages or disengages static fan control based on temperature, in order to control noise in a homelab.
While designed around a R620 (which is what I have), I believe it will work with the R610, R720, and R710. And probably lots others. YMMV.
This program sends automated, raw IPMI commands to your iDRAC device at regular intervals. As such, USE AT YOUR OWN RISK.
ipmitool
installed, and has access to the iDRAC device you wish to monitor/control. Test it with a simple command like ./ipmitool -I lanplus -H 10.10.1.2 -U root -P password sdr type temperature
where the host, user, and password are replaced as appropriate.DOTNET_ENVIRONMENT
environment variable to Production
on target machine.Settings for this app are stored in appsettings.json
, and its environment-specific derivatives. Settings in environment-specific app settings files, like appsettings.Production.json
, override the setting of the same name and path in the parent JSON file.
It's honestly easier to simply delete the file appsettings.Production.json
after you deploy to your server. That way, the app will only take its configuration from appsettings.json and you can keep it all in one spot.
Here are the settings and what they do:
(?<=0Eh|0Fh).+(\d{2})
, works for me, but your output may look different from mine. My output is stored in test_temp_response.txt
, for reference.
To get an idea of how the Regex works, if you're not comfortable, go to a site like RegEx101.com, paste the content of test_temp_response.txt
in the "Text String" box, and paste the Regex from the settings file, (?<=0Eh|0Fh).+(\d{2})
, in the Regex field. Note the capture groups on the right. Then replace the Test String with your ipmitool output for "sdr type temperature", and change the Regex to capture the same groups as mine did. The Regex matches on multiline, case-sensitive.ipmitool sdr list full | grep Fan
can tell you your current fan speed from that percentage./usr/bin/ipmitool
in Linux or C:\Program Files (x86)\Dell\SysMgt\bmc\ipmitool.exe
in Windows, specify its path here. Otherwise leave blank. Any value you provide here will be used to attempt to execute the tool, regardless of operating system, so make sure you use the right slashes!These instructions assume you're using an Ubuntu/Debian-based system. Adjust as necessary for your distribution. Any will work, so long as dotnet is installed and it's 64-bit.
sudo adduser dotnetuser
./var/dotnet/r620-monitor/
. You can place it wherever you like, but this is where I put it, and where the rest of the instructions will assume you put it.appsettings.production.json
to your preferences. This is where you set polling frequency, max temperature, how should parse your ipmitool output to read temperature, etc.sudo chown -R dotnetuser:dotnetuser /var/dotnet/r620-monitor
sudo chmod +x /var/dotnet/r620-monitor/JDMallen.IPMITempMonitor
/etc/systemd/system/dotnet-r620-monitor.service
using your favorite text editor with elevated privileges. I used vim: sudo vim /etc/systemd/system/dotnet-r620-monitor.service
.
[Unit]
Description=Temp monitor and fan control for R620 server
[Service] Type=notify ExecStart= /var/dotnet/r620-monitor/JDMallen.IPMITempMonitor WorkingDirectory=/var/dotnet/r620-monitor User=dotnetuser Group=dotnetuser Restart=on-failure RestartSec=10 KillSignal=SIGINT SyslogIdentifier=%n PrivateTmp=true Environment=DOTNET_ENVIRONMENT=Production Environment=Settings__IpmiPassword={your_iDRAC_password}
[Install] WantedBy=multi-user.target
8. Reload systemctl config to load this service: `sudo systemctl daemon-reload`
9. Start the service: `sudo systemctl start dotnet-r620-monitor.service`. Note that the service will always start by setting your server fan control to Automatic mode, to establish a sort of baseline of which mode it's in. Assuming it's not above threshold, it'll quiet down your server after {BackToManualThresholdInSeconds} seconds.
10. Monitor its status: `sudo systemctl status dotnet-r620-monitor.service` or `sudo journalctl -u dotnet-r620-monitor.service -f`
11. Stress your box to see if it works as intended!
## Screenshot
Here's a shot of the service running on my system with a set threshold of 50 C, with 20-second polling, 10-reading average, and 60 second manual release:
![Screenshot of journalctl showing service working](https://raw.githubusercontent.com/jdmallen/dell-ipmi-fan-control-monitor/master/service_in_action.png)
Sure enough, I heard the beast (the R620) start screaming from our basement the moment it switched to Automatic mode.