Linux Read CPU Temperature Sensor Chip Data

by on May 5, 2008 · 20 comments· LAST UPDATED May 6, 2008

in

Q. How do I read CPU core temperature data from a shell prompt under Linux operating system? How do I monitor my cpu hardware?

A. You can use Linux hardware monitoring tool such as lm_sensor. This tool provides some essential tools for monitoring the hardware health of Linux systems containing hardware health monitoring hardware such as the LM78, and LM75.

This tool use the System Management Bus (SMBus or SMB), which is a simple two-wire bus, derived from I²C and used for communication with low-bandwidth devices on a motherboard, especially power related chips such as a laptop's rechargeable battery subsystem. Other devices might include temperature, fan, or voltage sensors; and lid switches. PCI add-in cards may connect to an SMBus segment.

Install lm_sensors / lm-sensors package

This package may or may not be installed. Type the following command to install software on CentOS / RHEL / Fedora Linux:
# yum install lm_sensors
If you are using Debian / Ubuntu Linux, enter:
$ sudo apt-get install lm-sensors

Configure lm_sensors

To detect hardware monitoring chips, type the following command as the root user:
# sensors-detect
OR
$ sudo sensors-detect
Sample output:

# sensors-detect revision 4609 (2007-07-14 09:28:39 -0700)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.
To continue, we need module `i2c-dev' to be loaded.
Do you want to load `i2c-dev' now? (YES/no):
Module loaded successfully.
We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Next adapter: saa7133[0] (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x47
Handled by driver `ir-kbd-i2c' (already loaded), chip type `Pinnacle PCTV'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x4b
Handled by driver `tuner' (already loaded), chip type `tda8290+75a'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                No
Next adapter: SMBus I801 adapter at 4000 (i2c-1)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x2e
Probing for `Myson MTP008'...                               No
Probing for `National Semiconductor LM78'...                No
Probing for `National Semiconductor LM78-J'...              No
Probing for `National Semiconductor LM79'...                No
Probing for `National Semiconductor LM80'...                No
Probing for `National Semiconductor LM85 or LM96000'...     No
Probing for `Analog Devices ADM1027, ADT7460 or ADT7463'... No
Probing for `SMSC EMC6D100, EMC6D101 or EMC6D102'...        No
Probing for `Analog Devices ADT7462'...                     No
Probing for `Analog Devices ADT7467 or ADT7468'...          No
Probing for `Analog Devices ADT7470'...                     No
Probing for `Analog Devices ADT7473'...                     No
Probing for `Analog Devices ADT7475'...                     No
Probing for `Analog Devices ADT7476'...                     No
Probing for `Andigilog aSC7611'...                          No
Probing for `Andigilog aSC7621'...                          Success!
    (confidence 5, driver `to-be-written')
Probing for `National Semiconductor LM87'...                No
Probing for `National Semiconductor LM93'...                No
Probing for `Winbond W83781D'...                            No
Probing for `Winbond W83782D'...                            No
Probing for `Winbond W83792D'...                            No
Probing for `Winbond W83793R/G'...                          No
Probing for `Winbond W83791SD'...                           No
Probing for `Winbond W83627HF'...                           No
Probing for `Winbond W83627EHF'...                          No
Probing for `Winbond W83627DHG'...                          No
Probing for `Asus AS99127F (rev.1)'...                      No
Probing for `Asus AS99127F (rev.2)'...                      No
Probing for `Asus ASB100 Bach'...                           No
Probing for `Winbond W83L785TS-S'...                        No
Probing for `Analog Devices ADM9240'...                     No
Probing for `Dallas Semiconductor DS1780'...                No
Probing for `National Semiconductor LM81'...                No
Probing for `Analog Devices ADM1026'...                     No
Probing for `Analog Devices ADM1025'...                     No
Probing for `Analog Devices ADM1024'...                     No
Probing for `Analog Devices ADM1029'...                     No
Probing for `Analog Devices ADM1030'...                     No
Probing for `Analog Devices ADM1031'...                     No
Probing for `Analog Devices ADM1022'...                     No
Probing for `Texas Instruments THMC50'...                   No
Probing for `Analog Devices ADM1028'...                     No
Probing for `ITE IT8712F'...                                No
Probing for `SMSC DME1737'...                               No
Probing for `Fintek F75373S/SG'...                          No
Probing for `Fintek F75375S/SP'...                          No
Probing for `Fintek F75387SG/RG'...                         No
Probing for `Winbond W83791D'...                            No
Client found at address 0x44
Probing for `Maxim MAX6633/MAX6634/MAX6635'...              No
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No
Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no):
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' at 0x290...     No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No
Probing for `Silicon Integrated Systems SIS5595'...         No
Probing for `VIA VT82C686 Integrated Sensors'...            No
Probing for `VIA VT8231 Integrated Sensors'...              No
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No
Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     Yes
Found `SMSC LPC47M182 Super IO Fan Sensors'
    (but not activated)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No
Some CPUs or memory controllers may also contain embedded sensors.
Do you want to scan for them? (YES/no):
AMD K8 thermal sensors...                                   No
Intel Core family thermal sensor...                         Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `to-be-written' (should be inserted):
  Detects correctly:
  * Bus `SMBus I801 adapter at 4000'
    Busdriver `i2c-i801', I2C address 0x2e
    Chip `Andigilog aSC7621' (confidence: 5)
Driver `coretemp' (should be inserted):
  Detects correctly:
  * Chip `Intel Core family thermal sensor' (confidence: 9)
I will now generate the commands needed to load the required modules.
Just press ENTER to continue:
To make the sensors modules behave correctly, add these lines to
/etc/modules:
#----cut here----
# I2C adapter drivers
i2c-i801
# Chip drivers
# no driver for Andigilog aSC7621 yet
coretemp
#----cut here----
Do you want to add these lines to /etc/modules automatically? (yes/NO)

This is an interactive program that will walk you through the process of scanning your system for various hardware monitoring chips, or sensors, supported by libsensors, or more generally by the lm_sensors tool suite. For my system coretemp and i2c-i801 driver need to loaded in order to see sensors data. Type 'YES" to update /etc/modules files. Now you need to reboot the box. Alternatively, you can load all drivers using modprobe command
# modprobe coretemp
# modprobe i2c-i801

How do I read sensors chip data such as temperature?

Type the following command at shell prompt:
$ sensors
Sample output:

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +59°C  (high =  +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +59°C  (high =  +100°C)
coretemp-isa-0002
Adapter: ISA adapter
Core 2:      +55°C  (high =  +100°C)
coretemp-isa-0003
Adapter: ISA adapter
Core 3:      +56°C  (high =  +100°C)

Here is another output from Intel xeon server box:

w83627hf-i2c-0-2d
Adapter: SMBus I801 adapter at 1100
VCore 1:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
VCore 2:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
+3.3V:     +4.08 V  (min =  +3.14 V, max =  +3.46 V)       ALARM
+5V:       +5.11 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.73 V  (min = +10.82 V, max = +13.19 V)
-12V:      +1.21 V  (min = -13.18 V, max = -10.88 V)       ALARM
-5V:       +2.24 V  (min =  -5.25 V, max =  -4.75 V)       ALARM
V5SB:      +5.51 V  (min =  +4.73 V, max =  +5.24 V)       ALARM
VBat:      +0.54 V  (min =  +2.40 V, max =  +3.60 V)       ALARM
fan1:        0 RPM  (min =    0 RPM, div = 2)
fan2:        0 RPM  (min = 2689 RPM, div = 2)              ALARM
fan3:        0 RPM  (min = 6553 RPM, div = 2)              ALARM
temp1:       -48°C  (high =    -1°C, hyst =   -25°C)   sensor = thermistor
temp2:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
temp3:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
vid:      +1.419 V  (VRM Version 11.0)
alarms:
beep_enable:
          Sound alarm enabled
w83627hf-isa-0290
Adapter: ISA adapter
VCore 1:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
VCore 2:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
+3.3V:     +4.08 V  (min =  +3.14 V, max =  +3.46 V)       ALARM
+5V:       +5.11 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.73 V  (min = +10.82 V, max = +13.19 V)
-12V:      +1.29 V  (min = -13.18 V, max = -10.88 V)       ALARM
-5V:       +2.24 V  (min =  -5.25 V, max =  -4.75 V)       ALARM
V5SB:      +5.48 V  (min =  +4.73 V, max =  +5.24 V)       ALARM
VBat:      +0.54 V  (min =  +2.40 V, max =  +3.60 V)       ALARM
fan1:        0 RPM  (min =    0 RPM, div = 2)
fan2:        0 RPM  (min = 2689 RPM, div = 2)              ALARM
fan3:        0 RPM  (min = 6553 RPM, div = 2)              ALARM
temp1:       -48°C  (high =    -1°C, hyst =   -25°C)   sensor = thermistor
temp2:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
temp3:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
vid:      +1.419 V  (VRM Version 11.0)
alarms:
beep_enable:
          Sound alarm enabled

Further recommended readings:

Updated for accuracy.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 20 comments… read them below or add one }

1 thiery May 6, 2008 at 7:08 am

apt-get install lm_sensors is not good
use apt-get install lm-sensors instead

Reply

2 nixCraft May 6, 2008 at 8:40 am

Thanks, the post has been updated.

Reply

3 Rodrigo May 14, 2008 at 4:18 pm

Thanks again Vivek, once again i find good info and solutions on this site.

Reply

4 David Johnston May 2, 2009 at 9:18 am

Thanks for the informative article. I used your advice above and paired it with the “watch” command:

watch 'sensors | grep "Core "'

Which gives realtime output like:

Core 0: +49.0C (high = +82.0C, crit = +100.0C)
Core 1: +46.0C (high = +82.0C, crit = +100.0C)
Core 2: +45.0C (high = +82.0C, crit = +100.0C)
Core 3: +46.0C (high = +82.0C, crit = +100.0C)

Reply

5 Pat July 9, 2009 at 2:08 am

It’s not working for me, this is what I get when running ‘sensors’

No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.

Reply

6 pazuzuthewise May 3, 2010 at 12:29 pm

Also no sensors found. Loaded kernel module I was asked to by lm-sensors install.
Is there another solution?

Reply

7 Matteo June 2, 2010 at 5:12 pm

Any way to monitor these in the gui?

Reply

8 nixCraft June 2, 2010 at 5:18 pm

Gnome and others have applets. Add them to your desktop,

Reply

9 Matteo June 2, 2010 at 6:15 pm

Sorry, I’m a nub, how would I do that?

Reply

10 vinicius September 28, 2010 at 5:18 pm

Thanks for the help. I just want to know if exists another way to get this information without lm-sensors. how can help me now ?

Reply

11 vinicius October 4, 2010 at 5:24 pm

because of what the temperature is negative?
who will help me now?

temp1: -48°C (high = -1°C, hyst = -25°C) sensor = thermistor
temp2: -48.0°C (high = +80°C, hyst = +75°C) sensor = thermistor
temp3: -48.0°C (high = +80°C, hyst = +75°C) sensor = thermistor

Reply

12 Cheryl November 15, 2010 at 8:14 am

Is there anyway to tell it to convert temperatures for Fahrenheit?

Reply

13 Gagan Brahmi February 10, 2011 at 4:54 pm

sensors -f

Reply

14 Pat November 16, 2010 at 4:19 am

How do I know which temperature represents CPU, M/B, etc.? This is my sensors output…

pat@pat-desktop:~$ sensors
it8720-isa-0228
Adapter: ISA adapter
in0: +0.99 V (min = +0.00 V, max = +4.08 V)
in1: +1.94 V (min = +0.00 V, max = +4.08 V)
in2: +3.34 V (min = +0.00 V, max = +4.08 V)
in3: +2.93 V (min = +0.00 V, max = +4.08 V)
in4: +3.06 V (min = +0.00 V, max = +4.08 V)
in5: +1.89 V (min = +0.00 V, max = +4.08 V)
in6: +4.08 V (min = +0.00 V, max = +4.08 V)
in7: +2.96 V (min = +0.00 V, max = +4.08 V)
Vbat: +3.30 V
fan1: 1323 RPM (min = 10 RPM)
fan2: 0 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan5: 0 RPM (min = 0 RPM)
temp1: +34.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor
temp2: +28.0°C (low = +127.0°C, high = +60.0°C) sensor = thermal diode
temp3: +41.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor
cpu0_vid: +1.250 V

Reply

15 mikey September 6, 2011 at 11:56 am

Reply to vinicius

go here

Reply

16 dinesh November 26, 2011 at 1:43 pm

Grait!!
it help me lot.tnx

Reply

17 Ullas August 6, 2012 at 12:40 pm

I think you forgot to add
sudo /etc/init.d/module-init-tools start

Reply

18 tony j. podrasky September 1, 2012 at 3:00 am

Wow – what a great presentation!

Everything worked PERFECTLY!

I’ve been running Linux since the 1.2 SLACKWARE kernel back in 1995 – and NOTHING has worked as well as what this article said to do.

Next, I’m going to write a little C program that will run the utility and monitor it for out-of-bounds (high temp) parameters.

regards,
tony.podrasky

tony dot podrasky at gmail dot com

Reply

19 Mikkel Hoem May 14, 2013 at 10:06 pm

Great post, thanks for a quick and easy temperature check guide written neatly and easily understandable.

Reply

20 Danny Crossley July 4, 2013 at 9:33 am

This fine, but how do I interpret the output? What gives me the maximum allowed temperature for my CPU? Which values should I be monitoring? Is it “hyst”? What do temp1-3 refer to? I cannot find the answer in the documentation. Here is my output:

w83627dhg-isa-0290
Adapter: ISA adapter
Vcore: +1.29 V (min = +0.00 V, max = +1.74 V)
in1: +0.99 V (min = +0.60 V, max = +1.00 V)
AVCC: +3.38 V (min = +2.98 V, max = +3.63 V)
+3.3V: +3.38 V (min = +2.98 V, max = +3.63 V)
in4: +1.69 V (min = +1.67 V, max = +0.37 V) ALARM
in5: +1.72 V (min = +0.14 V, max = +1.16 V) ALARM
in6: +1.91 V (min = +0.16 V, max = +1.01 V) ALARM
3VSB: +3.47 V (min = +2.98 V, max = +3.63 V)
Vbat: +3.09 V (min = +2.70 V, max = +3.30 V)
fan1: 2678 RPM (min = 666 RPM, div = 8)
fan2: 0 RPM (min = 1054 RPM, div = 128) ALARM
fan3: 0 RPM (min = 958 RPM, div = 128) ALARM
fan4: 0 RPM (min = 2109 RPM, div = 128) ALARM
fan5: 0 RPM (min = 703 RPM, div = 128) ALARM
temp1: +37.0°C (high = +96.0°C, hyst = -83.0°C) sensor = thermistor
temp2: +57.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor
temp3: +32.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor
cpu0_vid: +1.300 V
intrusion0: ALARM

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: