🔥 R710 quieter
Summer is coming and my R710 server, is ... quite noisy. Fans become disturbing at 4k RPM, and ...
5.2k RPM !
I get fan info from iDRAC, with another machine, i'll make an article if you ask
I decided to investigate how to make him more !
Grab the temp
My first problem comes from iDRAC : I can't grab the CPU temp info from it
My first thought was it was an hardware problem and I didn't want to spend so much time on it. A friend advised me to try lm-sensors, so I installed it :
apt-get install lm-sensors
after the installation, run
sensors-detect
Follow the instructions to detect your hardware, this will search for all the sensors that could be available on your machine.
A simple sensors
command and ...
We got the core temp !
Only need the highest value, so ... cut/grep/sed
Final command : sensors|grep high|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p
So, I can :
- Grab CPU temp
- Grab highest CPU temp
Reduce fan speed
I can set the fans to manual mode with :
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
And change the fan speed to 3.2k with
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x13 >> /dev/null
and 3.6k with ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x17 >> /dev/null
So, I can :
- Set my fans to manual
- Change the fan speed
Put everything in scripts
Here's my final version :
#!/bin/bash
# Read the max CPU temp from sensors (lm-sensor)
tempCpu=$(sensors|grep "high"|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p)
# Define CPU limie
# Set variables
host="idrac01.pla01.lbdg.lan"
user="ipmi_read"
password="ipmi_read_password"
minCpu="50"
medCpu="56"
maxCpu="61"
if [ $tempCpu -le $minCpu ] ; then
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x13 >> /dev/null
# Set to 3200 RPM
elif [ $tempCpu -le $medCpu ] ; then
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x17 >> /dev/null
# Set to 3600 RPM
elif [ $tempCpu -le $maxCpu ] ; then
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x20 >> /dev/null
# Set to 5000 RPM
else
# Let the server decide
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x01 >> /dev/null
fi
/etc/telegraf/cpu_temp.sh
The script uses LAN communication, because, I use non-root user to send the ipmitool
command.
The user ipmi_read was created in the iDRAC settings, and only have right to write / read commands on ipmi :
Run the script every 30 seconds
The script is one time execution, so I decide to schedule it every 30 seconds.
The best way to run this script every 30 seconds is to use my existant telegraf agent, so, I could set an execution interval :
[[inputs.exec]]
commands = [
"/etc/telegraf/temp_fans.sh"
]
interval = "30s"
timeout = "14s"
data_format = "influx"
Graphical result : when reach 51°C, fan goes 3700 RPM
Bonus
And you might notice the /etc/telegraf/cpu_temp.sh
at the end, this is a script that formats data to be sent to InfluxDB :
#!/bin/bash
tempsCpu=$(sensors|grep high|cut -d "+" -f2|cut -d "." -f1)
echo -n "hardware_info,host=idrac01.pla01.lbdg.lan "
c=0
for tempCpu in $tempsCpu ; do
if [ $c != 0 ] ; then
echo -n ",core$c=$tempCpu"
else
echo -n "core$c=$tempCpu"
fi
c=$(($c + 1))
done
max_cpu=$(sensors|grep "high"|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p)
echo -n ",core_max=$max_cpu"
And, displayed with grafana (orange and blue lines)
Results
The problem is : with less noise from the server, I can hear my neighbour noise T-T