Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


lm_sensors

lm_sensors is a hardware monitoring utility package.

Reference(s)

Table of contents


Install

A correct kernel config is needed:

$ cd /usr/src/linux
# make nconfig
    >
    > Device Drivers  --->
    >     I2C support  --->
    >         -*- I2C support # Symbol: I2C [=y]
    >         ...
    >         <*>   I2C device interface # Symbol: I2C_CHARDEV [=y]
    >
    > Device Drivers  --->
    >     <*> Hardware Monitoring support  ---> # Symbol: HWMON [=y]
    #
    # Select a driver, e.g.:
    #
    >         [*] Intel Core/Core2/Atom temperature sensor (coretemp) # Symbol: SENSORS_CORETEMP [=y]

Warning

After configuring the kernel don't forget to do a kernel make and rebuild!

# emerge -a lm_sensors
# pacman -S lm_sensors
# apt install lm-sensors
# yum install lm_sensors
# dnf install lm_sensors

Config

Append lm_sensors to the USE variable in your make.conf:

# euse -E lm_sensors
# vi /etc/portage/make.conf # check that the use flag "lm_sensors" has been append:
    > ...
    > USE="... lm_sensors"
    > ...

Warning

After modifying the USE variable in your make.conf, don't forget to update the system using the following command so the changes take effect: # emerge --ask --changed-use --deep @world


Use

  • Run a sensors detection:

    # sensors-detect # read carfully, you might not want to probe I2C/SMBus : it's more risky
    

  • Optionally, add lm_sensors to your init system start it:

# rc-update add lm_sensors default
# rc-services lm_sensors start
# sv up cronie
# ln -s /etc/runit/sv/lm_sensors /run/runit/service/
# service lm_sensors start
# chkconfig lm_sensors on
# systemctl start lm_sensors
# systemctl enable lm_sensors
  • Finally, you can run it like so:
    # sensors
    

If this cheat sheet has been useful to you, then please consider leaving a star here.