This document tells you how to install, setup, and use '''lm_sensors''' so that you can monitor CPU and/or motherboard temperature and fan speeds.

+

[[zh-CN:Lm sensors]]

+

[[ja:Lm sensors]]

+

{{lowercase title}}

+

[http://www.lm-sensors.org/ lm_sensors] (Linux monitoring sensors) is a free and open-source application that provides tools and drivers for monitoring temperatures, voltage, and fans. This document explains how to install, configure, and use lm_sensors so that you can monitor CPU temperatures, motherboard temperatures, and fan speeds.

== Usage ==

== Usage ==

=== Installation ===

=== Installation ===

−

Install the {{Package Official|lm_sensors}} package from [extra]:

+

Install the {{Pkg|lm_sensors}} package from the [[Official Repositories|official repositories]].

−

# pacman -S lm_sensors

=== Setting up lm_sensors ===

=== Setting up lm_sensors ===

Use '''sensors-detect''' to detect and generate a list of kernel modules:

Use '''sensors-detect''' to detect and generate a list of kernel modules:

# sensors-detect

# sensors-detect

−

This will create the {{Filename|/etc/conf.d/lm_sensors}} configuration file which is used by the {{Codeline|sensors}} daemon to automatically load kernel modules on boot. You will be asked if you want to probe for various hardware. The "safe" answers are the defaults so just hitting enter to all the questions will generally not cause any problems.

+

This will create the {{ic|/etc/conf.d/lm_sensors}} configuration file which is used by the {{ic|sensors}} daemon to automatically load kernel modules on boot. You will be asked if you want to probe for various hardware. The "safe" answers are the defaults, so just hitting {{Keypress|Enter}} to all the questions will generally not cause any problems.

When the detection is finished, you will be presented with a summary of the probes. Here is an example summary from my system:

When the detection is finished, you will be presented with a summary of the probes. Here is an example summary from my system:

−

<pre>

+

{{hc|# sensors-detect|<nowiki>

Now follows a summary of the probes I have just done.

Now follows a summary of the probes I have just done.

Just press ENTER to continue:

Just press ENTER to continue:

Line 26:

Line 28:

Driver `coretemp':

Driver `coretemp':

* Chip `Intel Core family thermal sensor' (confidence: 9)

* Chip `Intel Core family thermal sensor' (confidence: 9)

−

</pre>

+

</nowiki>}}

−

If you plan on using the daemon, be sure to answer '''YES''' when asked if you want to to generate {{filename|/etc/conf.d/lm_sensors}}.

+

If you plan on using the daemon, be sure to answer '''YES''' when asked if you want to to generate {{ic|/etc/conf.d/lm_sensors}}.

−

To automatically load the kernel modules at boot time, add '''sensors''' to the '''DAEMONS''' array in {{Filename|/etc/rc.conf}}

+

To automatically load the kernel modules at boot time, add {{ic|sensors}} to the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}

DAEMONS=(syslog-ng crond ... sensors ...)

DAEMONS=(syslog-ng crond ... sensors ...)

−

Alternatively, instead of using the daemon, you can add the modules to the '''MODULES''' array in {{Filename|/etc/rc.conf}}:

+

On a systemd system you just need:

−

MODULES=(coretemp it87 acpi-cpufreq)

+

systemctl enable lm_sensors.service

+

+

Alternatively, instead of using the daemon, you can add the modules to the {{ic|MODULES}} array in {{ic|/etc/modules-load.d/lm_sensors.conf}}:

+

coretemp

+

it87

+

acpi-cpufreq

+

+

=== Automatic lm_sensors deployment ===

+

If you wish to deploy lm-sensors on multiple diferent linux machines issue is that sensors-detect ask you quite a few questions. There are few tricks that you can use to automate replies.

+

+

First one is if you wish to accept defaults which sensors-detect suggest you need just to press [ENTER] all the time. To automate this use this one liner:

+

+

# yes "" | sensors-detect

+

+

If you wish to override defaults and answer YES to all questions then use this oneliner:

+

+

# yes | sensors-detect

=== Testing your lm_sensors ===

=== Testing your lm_sensors ===

−

To test your setup, load the kernel modules manually or by using the sensors init script. You do '''NOT''' have to do both.

+

To test your setup, load the kernel modules manually or by using the {{ic|/etc/rc.d/sensors}} init script. You do '''NOT''' have to do both.

Example manually adding them

Example manually adding them

# modprobe it87

# modprobe it87

# modprobe coretemp

# modprobe coretemp

Example using the script

Example using the script

−

# /etc/rc.d/sensors start

+

# rc.d start sensors

You should see something like this when you run sensors

You should see something like this when you run sensors

−

<pre>$ sensors

+

{{hc|$ sensors|<nowiki>

coretemp-isa-0000

coretemp-isa-0000

Adapter: ISA adapter

Adapter: ISA adapter

Line 82:

Line 100:

acpitz-virtual-0

acpitz-virtual-0

Adapter: Virtual device

Adapter: Virtual device

−

temp1: +18.0°C (crit = +64.0°C)</pre>

+

temp1: +18.0°C (crit = +64.0°C)

+

</nowiki>}}

=== Reading SPD values from memory modules (optional) ===

=== Reading SPD values from memory modules (optional) ===

−

To read the SPD timing values from your memory modules, install {{Package AUR|i2c-tools}} from [[AUR]]. Once you have i2c-tools installed you will need to load the eeprom kernel module.

+

To read the SPD timing values from your memory modules, install {{pkg|i2c-tools}} from the [[Official Repositories|official repositories]]. Once you have i2c-tools installed, you will need to load the {{ic|eeprom}} [[Kernel_modules|kernel module]].

# modprobe eeprom

# modprobe eeprom

−

Finally you can view your memory information with

+

Finally, you can view your memory information with {{ic|decode-dimms}}.

*{{Pkg|xfce4-sensors-plugin}} - A lm_sensors plugin for the [[Xfce]] panel

−

*{{Package Official|xfce4-sensors-plugin}} - A lm_sensors plugin for the Xfce panel

+

*[[conky]] - Conky is an advanced, highly configurable system monitor for X based on torsmo

−

*''[[conky]]'' - Conky is an advanced, highly configurable system monitor for X based on torsmo

+

*{{Pkg|kdeutils-superkaramba}} - Superkaramba is a tool which gives posibility to create different widgets for KDE desktop. Check the [http://www.kde-look.org/index.php?xcontentmode=38 karamba section on kde-look.org] for examples of making karamba front-ends for sensors data.

−

*{{Package Official|kdeutils-superkaramba}} - Superkaramba is a tool which gives posibility to create different widgets for KDE desktop. Check the [http://www.kde-look.org/index.php?xcontentmode=38 karamba section on kde-look.org] for examples of making karamba front-ends for sensors data.

*{{Package AUR|sensors-applet-git}} - an applet for the GNOME Panel to display readings from hardware sensors, including CPU temperature, fan speeds and voltage readings.

−

*{{Package AUR|hardware-monitor}} - a GNOME Panel applet that displays some sensors readings as well as other hardware monitoring.

=== sensord ===

=== sensord ===

−

There is an optional daemon called sensord (included with the lm_sensors package) which can log your data to a round robin database (rrd) and later visualize graphically. See the sensord man page for details.

+

There is an optional daemon called sensord (included with the {{Pkg|lm_sensors}} package) which can log your data to a round robin database (rrd) and later visualize graphically. See the sensord man page for details.

==Troubleshooting==

==Troubleshooting==

−

=== Sensors not working since Linux 2.6.31 ===

+

=== Renumbering Cores for Multi-CPU Systems ===

−

A change in version 2.6.31 has made some sensors stop working. See [http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31 this FAQ entry] for a detailed explanation and for some example errors. To fix sensors, add the following to your kernel boot line (e.g. in your [[GRUB]]/[[GRUB2]] configuration file) and reboot your machine:

+

In rare cases, the actual numbering of physical cores on multi-processor motherboards can be incorrect. Consider the following HP Z600 workstation with dual Xeons:

−

acpi_enforce_resources=lax

+

{{hc|$ sensors|<nowiki>

−

{{Warning|In some situations, this may be dangerous. Consult the FAQ for details.}}

+

coretemp-isa-0000

+

Adapter: ISA adapter

+

Core 0: +65.0°C (high = +85.0°C, crit = +95.0°C)

+

Core 1: +65.0°C (high = +85.0°C, crit = +95.0°C)

+

Core 9: +66.0°C (high = +85.0°C, crit = +95.0°C)

+

Core 10: +66.0°C (high = +85.0°C, crit = +95.0°C)

−

Note that in most cases the information is still accessible via other modules (e.g. via ACPI modules) for the hardware in question. Many utilities and monitors (e.g. /usr/bin/sensors) can gather information from either source. Where possible, this is the preferred solution.

Note the cores are numbered 0, 1, 9, 10 which is repeated into the second CPU. Most users want the core temperatures to report out in sequential order, i.e. 0,1,2,3,4,5,6,7. Fixing the order is accomplished in two steps.

−

* Upgrade kernel26 to 2.6.39. The module w83627ehf includes support for the Nuvoton NCT6776F in the stock kernel despite what http://www.lm-sensors.org/wiki/Devices says as of 2011-05-20.

−

* compile standalone driver.

−

You can download the source from http://mail.planet-ian.com/w83627ehf

+

====Step 1. ID what each chip is reporting ====

−

Then execute:

+

Run {{ic|sensors}} with the {{ic|-u}} switch to see what options are available for each physical chip:

−

$ cd <source dir>

−

$ make

−

# make install

−

# modprobe w83627ehf

−

You should add w83627ehf in MODULES array in {{Filename|/etc/rc.conf}}.

−

Put your {{Filename|/etc/sensors.d/sensors.conf}} following text:

+

{{hc|$ sensors -u coretemp-isa-0000|<nowiki>

−

{{file|name=/etc/sensors.d/sensors.conf|content=

+

coretemp-isa-0000

−

# nct6776 values for Asus p8p67

+

Adapter: ISA adapter

−

chip "nct6775-*" "nct6776-*"

+

Core 0:

−

label temp1 "MB"

+

temp2_input: 61.000

−

set temp1_max 40

+

temp2_max: 85.000

−

set temp1_max_hyst 35

+

temp2_crit: 95.000

+

temp2_crit_alarm: 0.000

+

Core 1:

+

temp3_input: 61.000

+

temp3_max: 85.000

+

temp3_crit: 95.000

+

temp3_crit_alarm: 0.000

+

Core 9:

+

temp11_input: 62.000

+

temp11_max: 85.000

+

temp11_crit: 95.000

+

Core 10:

+

temp12_input: 63.000

+

temp12_max: 85.000

+

temp12_crit: 95.000

+

</nowiki>}}

−

ignore temp2

+

{{hc|$ sensors -u coretemp-isa-0004|<nowiki>

+

coretemp-isa-0004

+

Adapter: ISA adapter

+

Core 0:

+

temp2_input: 53.000

+

temp2_max: 85.000

+

temp2_crit: 95.000

+

temp2_crit_alarm: 0.000

+

Core 1:

+

temp3_input: 54.000

+

temp3_max: 85.000

+

temp3_crit: 95.000

+

temp3_crit_alarm: 0.000

+

Core 9:

+

temp11_input: 59.000

+

temp11_max: 85.000

+

temp11_crit: 95.000

+

Core 10:

+

temp12_input: 59.000

+

temp12_max: 85.000

+

temp12_crit: 95.000

+

</nowiki>}}

−

label temp3 "CPU"

+

==== Step 2. Redefine the cores ====

−

label fan1 "Chassis1"

+

Create {{ic|/etc/sensors.d/cores.conf}} wherein the new definitions are defined based on the output of step 1:

−

label fan2 "CPU"

−

label fan3 "Power"

−

label fan4 "Chassis2"

−

set fan1_min 200

+

{{hc|/etc/sensors.d/cores.conf|<nowiki>

−

set fan2_min 400

+

chip "coretemp-isa-0000"

−

set fan3_min 300

−

set fan4_min 200

−

ignore fan5

−

label in0 "Vcore"

+

label temp2 "Core 0"

−

set in0_min 1 * 0.80

+

label temp3 "Core 1"

−

set in0_max 1 * 1.35

+

label temp11 "Core 2"

+

label temp12 "Core 3"

−

label in1 "+12V"

+

chip "coretemp-isa-0004"

−

compute in1 @ * 12, @ / 12

−

set in1_min 12 * 0.90

−

set in1_max 12 * 1.10

−

label in2 "AVCC"

+

label temp2 "Core 4"

−

set in2_min 3.3 * 0.90

+

label temp3 "Core 5"

−

set in2_max 3.3 * 1.10

+

label temp11 "Core 6"

+

label temp12 "Core 7"</nowiki>}}

−

label in3 "+3.3V"

+

Problem solved. Output after completing these steps:

−

set in3_min 3.3 * 0.90

−

set in3_max 3.3 * 1.10

−

label in4 "+5V"

+

{{hc|$ sensors|<nowiki>

−

compute in4 @ * 5, @ / 5

+

coretemp-isa-0000

−

set in4_min 5 * 0.90

+

Adapter: ISA adapter

−

set in4_max 5 * 1.10

+

Core0: +64.0°C (high = +85.0°C, crit = +95.0°C)

+

Core1: +63.0°C (high = +85.0°C, crit = +95.0°C)

+

Core2: +65.0°C (high = +85.0°C, crit = +95.0°C)

+

Core3: +66.0°C (high = +85.0°C, crit = +95.0°C)

−

ignore in5

+

coretemp-isa-0004

+

Adapter: ISA adapter

+

Core4: +53.0°C (high = +85.0°C, crit = +95.0°C)

+

Core5: +54.0°C (high = +85.0°C, crit = +95.0°C)

+

Core6: +59.0°C (high = +85.0°C, crit = +95.0°C)

+

Core7: +60.0°C (high = +85.0°C, crit = +95.0°C)

−

label in7 "3VSB"

+

smsc47b397-isa-0480

−

set in7_min 3.3 * 0.90

+

Adapter: ISA adapter

−

set in7_max 3.3 * 1.10

+

fan1: 1734 RPM

+

fan2: 1726 RPM

+

fan3: 1222 RPM

+

fan4: 2827 RPM

+

temp1: +45.0°C

+

temp2: +37.0°C

+

temp3: +23.0°C

+

temp4: -128.0°C

+

</nowiki>}}

−

label in8 "Vbat"

+

=== Sensors not working since Linux 2.6.31 ===

−

set in8_min 3.3 * 0.90

+

A change in version 2.6.31 has made some sensors stop working. See [http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31 this FAQ entry] for a detailed explanation and for some example errors. To fix sensors, add the following to your kernel boot line (e.g. in your [[GRUB]]/[[GRUB2]] configuration file) and reboot your machine:

−

set in8_max 3.3 * 1.10

+

acpi_enforce_resources=lax

−

}}

+

{{Warning|In some situations, this may be dangerous. Consult the FAQ for details.}}

−

And execute:

+

Note that in most cases the information is still accessible via other modules (e.g. via ACPI modules) for the hardware in question. Many utilities and monitors (e.g. {{ic|/usr/bin/sensors}}) can gather information from either source. Where possible, this is the preferred solution.

−

sensors -s

===K10Temp Module===

===K10Temp Module===

−

Some K10 processors have issues with their temperature sensor. From the kernel documentation ({{Filename|linux-&lt;version&gt;/Documentation/hwmon/k10temp}}):

+

Some K10 processors have issues with their temperature sensor. From the kernel documentation ({{ic|linux-&lt;version&gt;/Documentation/hwmon/k10temp}}):

−

:''All these processors have a sensor, but on those for Socket F or AM2+, the sensor may return inconsistent values (erratum 319). The driver will refuse to load on these revisions unless you specify the "force=1" module parameter.''

+

:''All these processors have a sensor, but on those for Socket F or AM2+, the sensor may return inconsistent values (erratum 319). The driver will refuse to load on these revisions unless you specify the {{ic|1=force=1}} module parameter.''

−

:''Due to technical reasons, the driver can detect only the mainboard's socket type, not the processor's actual capabilities. Therefore, if you are using an AM3 processor on an AM2+ mainboard, you can safely use the "force=1" parameter.''

+

:''Due to technical reasons, the driver can detect only the mainboard's socket type, not the processor's actual capabilities. Therefore, if you are using an AM3 processor on an AM2+ mainboard, you can safely use the {{ic|1=force=1}} parameter.''

On affected machines the module will report "unreliable CPU thermal sensor; monitoring disabled". If you still want to use the module you can:

On affected machines the module will report "unreliable CPU thermal sensor; monitoring disabled". If you still want to use the module you can:

# rmmod k10temp

# rmmod k10temp

# modprobe k10temp force=1

# modprobe k10temp force=1

−

Confirm with [[Lm_sensors#Testing your lm_sensors]] that the sensor is in fact valid and reliable. If it is, you can edit {{Filename|/etc/modprobe.d/k10temp.conf}} and add:

+

Confirm with [[Lm_sensors#Testing your lm_sensors]] that the sensor is in fact valid and reliable. If it is, you can edit {{ic|/etc/modprobe.d/k10temp.conf}} and add:

options k10temp force=1

options k10temp force=1

This will allow the module to load at boot.

This will allow the module to load at boot.

==See also==

==See also==

−

*[[hddtemp]] - Software to read temps of HDDs.

+

*[[hddtemp]] - Software to read temperatures of hard drives.

*[[monitorix]] - Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible.

*[[monitorix]] - Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible.

Revision as of 21:15, 11 January 2013

zh-CN:Lm sensorslm_sensors (Linux monitoring sensors) is a free and open-source application that provides tools and drivers for monitoring temperatures, voltage, and fans. This document explains how to install, configure, and use lm_sensors so that you can monitor CPU temperatures, motherboard temperatures, and fan speeds.

Usage

Installation

Setting up lm_sensors

Use sensors-detect to detect and generate a list of kernel modules:

# sensors-detect

This will create the /etc/conf.d/lm_sensors configuration file which is used by the sensors daemon to automatically load kernel modules on boot. You will be asked if you want to probe for various hardware. The "safe" answers are the defaults, so just hitting Template:Keypress to all the questions will generally not cause any problems.

When the detection is finished, you will be presented with a summary of the probes. Here is an example summary from my system:

sensord

There is an optional daemon called sensord (included with the lm_sensors package) which can log your data to a round robin database (rrd) and later visualize graphically. See the sensord man page for details.

Troubleshooting

Renumbering Cores for Multi-CPU Systems

In rare cases, the actual numbering of physical cores on multi-processor motherboards can be incorrect. Consider the following HP Z600 workstation with dual Xeons:

Note the cores are numbered 0, 1, 9, 10 which is repeated into the second CPU. Most users want the core temperatures to report out in sequential order, i.e. 0,1,2,3,4,5,6,7. Fixing the order is accomplished in two steps.

Step 1. ID what each chip is reporting

Run sensors with the -u switch to see what options are available for each physical chip:

Sensors not working since Linux 2.6.31

A change in version 2.6.31 has made some sensors stop working. See this FAQ entry for a detailed explanation and for some example errors. To fix sensors, add the following to your kernel boot line (e.g. in your GRUB/GRUB2 configuration file) and reboot your machine:

acpi_enforce_resources=lax

Warning: In some situations, this may be dangerous. Consult the FAQ for details.

Note that in most cases the information is still accessible via other modules (e.g. via ACPI modules) for the hardware in question. Many utilities and monitors (e.g. /usr/bin/sensors) can gather information from either source. Where possible, this is the preferred solution.

K10Temp Module

Some K10 processors have issues with their temperature sensor. From the kernel documentation (linux-<version>/Documentation/hwmon/k10temp):

All these processors have a sensor, but on those for Socket F or AM2+, the sensor may return inconsistent values (erratum 319). The driver will refuse to load on these revisions unless you specify the force=1 module parameter.

Due to technical reasons, the driver can detect only the mainboard's socket type, not the processor's actual capabilities. Therefore, if you are using an AM3 processor on an AM2+ mainboard, you can safely use the force=1 parameter.

On affected machines the module will report "unreliable CPU thermal sensor; monitoring disabled". If you still want to use the module you can: