Monitor CPU temperature in Ubuntu


Recently I need to monitor CPU temperature as my desktop was getting power off after using it couple hours.
In Ubuntu we can monitor CPU and other system temperatures, fan speeds, and other system data using an application lm-sensors. It can also show this information on your desktop or GNOME panel using one of several other applications.

First we have to install lm-sensors on the system. To do so run,

sudo apt-get install lm-sensors

Run sudo sensors-detect and answer YES to all YES/no questions.

sudo sensors-detect

Following output I received after running above command

# sensors-detect revision 5946 (2011-03-23 11:54:44 +0100)
# Board: Intel Corporation D101GGC
 
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.
 
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No
 
Some Super I/O chips contain embedded 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): Yes
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     Yes
Found `SMSC DME1737 Super IO'                               
    (hardware monitoring capabilities accessible via SMBus only)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
 
Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): Yes
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No
 
Some hardware monitoring chips are 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): Yes
Probing for `National Semiconductor LM78' 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
 
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): yes
Using driver `i2c-piix4' for device 0000:00:14.0: ATI Technologies Inc IXP SB400 SMBus Controller
Module i2c-dev loaded successfully.
 
Next adapter: SMBus PIIX4 adapter at 0b00 (i2c-0)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x2e
Probing for `Myson MTP008'...                               No
Probing for `National Semiconductor LM78'...                No
Probing for `National Semiconductor LM79'...                No
Probing for `National Semiconductor LM80'...                No
Probing for `National Semiconductor LM85'...                No
Probing for `National Semiconductor LM96000 or PC8374L'...  No
Probing for `Analog Devices ADM1027'...                     No
Probing for `Analog Devices ADT7460 or ADT7463'...          No
Probing for `SMSC EMC6D100 or EMC6D101'...                  No
Probing for `SMSC EMC6D102'...                              No
Probing for `SMSC EMC6D103'...                              No
Probing for `SMSC EMC6D103S'...                             No
Probing for `Winbond WPCD377I'...                           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 `Analog Devices ADT7490'...                     No
Probing for `Andigilog aSC7611'...                          No
Probing for `Andigilog aSC7621'...                          No
Probing for `National Semiconductor LM87'...                No
Probing for `Analog Devices ADM1024'...                     No
Probing for `National Semiconductor LM93'...                No
Probing for `National Semiconductor LM94'...                No
Probing for `Winbond W83781D'...                            No
Probing for `Winbond W83782D'...                            No
Probing for `Winbond W83791D'...                            No
Probing for `Winbond W83792D'...                            No
Probing for `Winbond W83793R/G'...                          No
Probing for `Nuvoton W83795G/ADG'...                        No
Probing for `Winbond W83627HF'...                           No
Probing for `Winbond W83627EHF'...                          No
Probing for `Winbond W83627DHG/W83667HG/W83677HG'...        No
Probing for `Asus AS99127F (rev.1)'...                      No
Probing for `Asus AS99127F (rev.2)'...                      No
Probing for `Asus ASB100 Bach'...                           No
Probing for `Winbond W83L786NR/NG/R/G'...                   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 `Maxim MAX6639'...                              No
Probing for `Texas Instruments AMC6821'...                  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 `Texas Instruments THMC51'...                   No
Probing for `ITE IT8712F'...                                No
Probing for `SMSC DME1737'...                               Success!
    (confidence 6, driver `dme1737')
Probing for `SMSC SCH5027D-NW'...                           No
Probing for `SMSC EMC2103'...                               No
Probing for `Fintek F75373S/SG'...                          No
Probing for `Fintek F75375S/SP'...                          No
Probing for `Fintek F75387SG/RG'...                         No
Probing for `Winbond W83791SD'...                           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
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
 
Next adapter: Radeon i2c bit bus DVI_DDC (i2c-1)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c bit bus VGA_DDC (i2c-2)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c hw bus MM_I2C (i2c-3)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c bit bus MONID (i2c-4)
Do you want to scan it? (YES/no/selectively): yes
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'...                                Yes
    (confidence 8, not a hardware monitoring chip)
Client found at address 0x51
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x53
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
 
Next adapter: Radeon i2c bit bus GPIOPAD_MASK (i2c-5)
Do you want to scan it? (YES/no/selectively): yes
 
Now follows a summary of the probes I have just done.
Just press ENTER to continue: 
 
Driver `dme1737':
  * Bus `SMBus PIIX4 adapter at 0b00'
    Busdriver `i2c_piix4', I2C address 0x2e
    Chip `SMSC DME1737' (confidence: 6)
 
To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
dme1737
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!
 
Do you want to add these lines automatically to /etc/modules? (yes/NO)yes
Successful!
 
Monitoring programs won't work until the needed modules are
loaded. You may want to run 'service module-init-tools start'
to load them.
 
Unloading i2c-dev... OK
Unloading cpuid... OK

At the end of sensors-detect, a list of modules that needs to be loaded will displayed. Type “yes” to have sensors-detect insert those modules into /etc/modules, or edit /etc/modules yourself.

Next, run “sudo service module-init-tools start”. This will read the changes you made to /etc/modules in above step, and insert the new modules into the kernel.

sudo service module-init-tools start

Next, you should test that lm-sensors works correctly. Run the “sensors” command and check the output. Example output is below:

sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +40.0°C  (crit = +75.0°C)
 
dme1737-i2c-0-2e
Adapter: SMBus PIIX4 adapter at 0b00
5VSB:         +0.00 V  (min =  +0.00 V, max =  +6.64 V)  ALARM
Vcore:        +1.36 V  (min =  +0.00 V, max =  +2.99 V)
+3.3V:        +3.38 V  (min =  +0.00 V, max =  +4.38 V)
+5V:          +5.17 V  (min =  +0.00 V, max =  +6.64 V)
+12V:        +12.18 V  (min =  +0.00 V, max = +15.94 V)
3VSB:         +3.37 V  (min =  +0.00 V, max =  +4.38 V)
Vbat:         +0.00 V  (min =  +0.00 V, max =  +4.38 V)
fan1:        2276 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan4:           0 RPM  (min =    0 RPM)
temp1:        +43.2°C  (low  = -127.0°C, high = +69.0°C)
SIO Temp:     +44.2°C  (low  = -127.0°C, high = +69.0°C)
temp3:        +59.0°C  (low  = -127.0°C, high = +69.0°C)  ALARM
cpu0_vid:    +1.088 V

The sensor output may be tweaked by editing the “/etc/sensors.conf” file. It is possible to correct inaccurate scaling too. For details check “man sensors.conf”.

You can also install xsensors to view the temperature graphically. To do so run

sudo apt-get install xsensors

Now go to Applications > System Tools > Xsensors. You will get following screen depending on your configuration.

Readers if you are using any other tool, please let us know the same.

Subscribe / Share

Article by Vidyadhar

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Vidyadhar tagged this post with: , , , , , , , , , , , , , , , , , Read 271 articles by

Leave a Reply

rss twitter facbook

Categories

Archives