lm_sensors
configurationservermonitoringlm_sensors

How to set up #

After installing lm_sensors most users would typically use sensors-detect --auto to configure it and usually a successive call of sensors already shows most sensor readings correctly. There is also the lm_sensors daemon, which can be activated with something like systemctl enable lm_sensors (, if your system uses systemd that is).

The issue with automatic sensors-detection #

But there are always some superfluous values in the output and often some to cause an ALARM. This is not a big issue as long as the tool is called manually. But there is also the lm_sensors service, which is there to constantly monitor the sensors and can be used to inform the admin about malfunctions via syslog or even via email, if configured correctly. This is of cause an issue, if it happens every single time the monitoring daemon runs the test.

Manually create a custom sensors.conf #

If there is no smoke escaping your case chances are, that you want to get rid of unnecessary warnings and man sensors.conf should be there to help you with that. But in order to keep it a little shorter, here is what you want to do:

  1. In one terminal window you have watch sensors open and decreased the font size, so that everything fits on the screen.

  2. In another terminal you run sensors -u | less to find the exact names for the sensors.

  3. In a third terminal you open an arbitory named configuration file under /etc/sensors.d/.

Then you start by adding ignore lines for certain chips to the configuration file from step 3. The syntax is simple, e.g.

chip "nct6798-isa-0290"
  ignore intrusion0
  ignore intrusion1

Automatically generate a custom sensors.conf #

But as a lazy person one would probably want to ignore all and adjust or delete only the relevant values. One way to create a template is (I know jq is horrible to read):

sensors -u -j | jq -r 'to_entries[] | "\nchip \"\(.key)\"",(.[]?[]?|to_entries?|.[]|"  ignore \(."key")")' > /etc/sensors.d/template

Example #

For my motherboard, a ASRock Steel Legend x570 I ended up with:

# /etc/sensors.d/asrock-steel-legend-570

chip "nct6798-isa-0290"
  ignore intrusion0
  ignore intrusion1
  ignore fan1
  ignore fan2
  ignore fan4
  ignore fan5
  ignore fan7
  set in1_min 1.500
  set in1_max 1.750
  set in0_min 0
  label in4 "CPU voltage"
  set in4_min 1.81
  set in4_max 1.83
  set in5_max 1000
  set in6_max 1.5
  set in9_max 1.75
  set in10_max 1000
  set in11_max 1000
  set in12_max 1000
  set in13_max 1000
  set in14_max 1000

bus "i2c-8" "SMBus PIIX4 adapter port 0 at 0b00"

chip "jc42-i2c-8-*"
  set temp1_min 10
  set temp1_max 60
  set temp1_crit 90

One aspect I have not covered yet is the bus line from the example. That is because I was yet unable to understand how chip names relate to bus names. In my example it works, but it was found by try and error. A convinient chip name i2c-8 did not work and also not the exact string I found with sensors -u.

But what I know is, that the chip "jc42-i2c-8-*"-line from the example causes an error if the bus "i2c-8" "[...]"-line is missing and sensors then prints Undeclared bus id referenced for that config file. Bus lines like that are best created by running sensors --bus-list >> /etc/sensors.d/template and could also be manually be created with the help of something like:

find /sys/bus/i2c/devices/*/name -printf "%p:\t" -exec cat '{}' \;
top