{"id":5,"date":"2008-07-18T10:48:34","date_gmt":"2008-07-18T14:48:34","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=5"},"modified":"2012-12-29T20:00:10","modified_gmt":"2012-12-30T01:00:10","slug":"measure-cpu-temp-in-ubuntu","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2008\/07\/18\/measure-cpu-temp-in-ubuntu\/","title":{"rendered":"Measure CPU temperature and your fan speed in Ubuntu Linux"},"content":{"rendered":"<p><strong>Update (2010-10-10<\/strong>): If you are getting &#8220;<em>E: Couldn&#8217;t find package sensors-applet<\/em>&#8221; errors, then add universe to \/etc\/apt\/sources.list (add or uncomment http:\/\/archive.ubuntu.com\/ubuntu &lt;dist code&gt; universe)<\/p>\n<p>lm-sensors is a very useful tool to measure your CPU temperature and your fan speed (which is not in \/proc\/cpuinfo) in Ubuntu Linux. In order to use it, you will first need to install it.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo apt-get install lm-sensors libsensors4\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nSuggested packages:\r\ni2c read-edid sensord\r\nThe following NEW packages will be installed:\r\nlibsensors4 lm-sensors\r\n0 upgraded, 2 newly installed, 0 to remove and 24 not upgraded.\r\nNeed to get 0B\/250kB of archives.\r\nAfter this operation, 918kB of additional disk space will be used.\r\nSelecting previously deselected package libsensors4.\r\n(Reading database ... 117271 files and directories currently installed.)\r\nUnpacking libsensors4 (from ...\/libsensors4_1%3a3.0.0-4ubuntu1_i386.deb) ...\r\nSelecting previously deselected package lm-sensors.\r\nUnpacking lm-sensors (from ...\/lm-sensors_1%3a3.0.0-4ubuntu1_i386.deb) ...\r\nSetting up libsensors4 (1:3.0.0-4ubuntu1) ...\r\nudev active, devices will be created in \/dev\/.static\/dev\/&lt;\/code&gt;\r\n\r\nSetting up lm-sensors (1:3.0.0-4ubuntu1) ...\r\n\r\nProcessing triggers for libc6 ...\r\nldconfig deferred processing now taking place\r\n<\/pre>\n<p>Now, before you can use it, you need to configure it by running sensors-detect as root. Just press Enter whenever the script asks you a question.<br \/>\nWhen it asks you &#8220;Do you want to add these lines automatically?&#8221;, type in yes and press enter.<br \/>\n<code><br \/>\n$ sudo sensors-detect<br \/>\n# sensors-detect revision 5016 (2007-11-11 22:20:16 +0100)<\/code><\/p>\n<p>This program will help you determine which kernel modules you need<br \/>\nto load to use lm_sensors most effectively. It is generally safe<br \/>\nand recommended to accept the default answers to all questions,<br \/>\nunless you know what you&#8217;re doing.<\/p>\n<p>We can start with probing for (PCI) I2C or SMBus adapters.<br \/>\nDo you want to probe now? (YES\/no):<br \/>\nProbing for PCI bus adapters&#8230;<br \/>\nUse driver `i2c-viapro&#8217; for device 0000:00:07.3: VIA Technologies VT82C596 Apollo ACPI<\/p>\n<p>We will now try to load each adapter module in turn.<br \/>\nModule `i2c-viapro&#8217; already loaded.<br \/>\nIf you have undetectable or unsupported adapters, you can have them<br \/>\nscanned by manually loading the modules before running this script.<\/p>\n<p>To continue, we need module `i2c-dev&#8217; to be loaded.<br \/>\nDo you want to load `i2c-dev&#8217; now? (YES\/no):<br \/>\nModule loaded successfully.<\/p>\n<p>We are now going to do the I2C\/SMBus adapter probings. Some chips may<br \/>\nbe double detected; we choose the one with the highest confidence<br \/>\nvalue in that case.<br \/>\nIf you found that the adapter hung after probing a certain address,<br \/>\nyou can specify that address to remain unprobed.<\/p>\n<p>Next adapter: SMBus Via Pro adapter at 5000 (i2c-0)<br \/>\nDo you want to scan it? (YES\/no\/selectively):<br \/>\nClient found at address 0x2d<br \/>\nHandled by driver `gl520sm&#8217; (already loaded), chip type `gl520sm&#8217;<br \/>\nClient found at address 0x50<br \/>\nProbing for `Analog Devices ADM1033&#8217;&#8230;                     No<br \/>\nProbing for `Analog Devices ADM1034&#8217;&#8230;                     No<br \/>\nProbing for `SPD EEPROM&#8217;&#8230;                                 Yes<br \/>\n(confidence 8, not a hardware monitoring chip)<br \/>\nProbing for `EDID EEPROM&#8217;&#8230;                                No<br \/>\nClient found at address 0x51<br \/>\nProbing for `Analog Devices ADM1033&#8217;&#8230;                     No<br \/>\nProbing for `Analog Devices ADM1034&#8217;&#8230;                     No<br \/>\nProbing for `SPD EEPROM&#8217;&#8230;                                 Yes<br \/>\n(confidence 8, not a hardware monitoring chip)<br \/>\nProbing for `EDID EEPROM&#8217;&#8230;                                No<br \/>\nClient found at address 0x52<br \/>\nProbing for `Analog Devices ADM1033&#8217;&#8230;                     No<br \/>\nProbing for `Analog Devices ADM1034&#8217;&#8230;                     No<br \/>\nProbing for `SPD EEPROM&#8217;&#8230;                                 Yes<br \/>\n(confidence 8, not a hardware monitoring chip)<br \/>\nProbing for `EDID EEPROM&#8217;&#8230;                                No<\/p>\n<p>Some chips are also accessible through the ISA I\/O ports. We have to<br \/>\nwrite to arbitrary I\/O ports to probe them. This is usually safe though.<br \/>\nYes, you do have ISA I\/O ports even if you do not have any ISA slots!<br \/>\nDo you want to scan the ISA I\/O ports? (YES\/no):<br \/>\nProbing for `National Semiconductor LM78&#8242; at 0x290&#8230;       No<br \/>\nProbing for `National Semiconductor LM78-J&#8217; at 0x290&#8230;     No<br \/>\nProbing for `National Semiconductor LM79&#8242; at 0x290&#8230;       No<br \/>\nProbing for `Winbond W83781D&#8217; at 0x290&#8230;                   No<br \/>\nProbing for `Winbond W83782D&#8217; at 0x290&#8230;                   No<br \/>\nProbing for `Silicon Integrated Systems SIS5595&#8217;&#8230;         No<br \/>\nProbing for `VIA VT82C686 Integrated Sensors&#8217;&#8230;            No<br \/>\nProbing for `VIA VT8231 Integrated Sensors&#8217;&#8230;              No<br \/>\nProbing for `IPMI BMC KCS&#8217; at 0xca0&#8230;                      No<br \/>\nProbing for `IPMI BMC SMIC&#8217; at 0xca8&#8230;                     No<\/p>\n<p>Some Super I\/O chips may also contain sensors. We have to write to<br \/>\nstandard I\/O ports to probe them. This is usually safe.<br \/>\nDo you want to scan for Super I\/O sensors? (YES\/no):<br \/>\nProbing for Super-I\/O at 0x2e\/0x2f<br \/>\nTrying family `National Semiconductor&#8217;&#8230;                   No<br \/>\nTrying family `SMSC&#8217;&#8230;                                     No<br \/>\nTrying family `VIA\/Winbond\/Fintek&#8217;&#8230;                       No<br \/>\nTrying family `ITE&#8217;&#8230;                                      No<br \/>\nProbing for Super-I\/O at 0x4e\/0x4f<br \/>\nTrying family `National Semiconductor&#8217;&#8230;                   No<br \/>\nTrying family `SMSC&#8217;&#8230;                                     No<br \/>\nTrying family `VIA\/Winbond\/Fintek&#8217;&#8230;                       No<br \/>\nTrying family `ITE&#8217;&#8230;                                      No<\/p>\n<p>Some CPUs or memory controllers may also contain embedded sensors.<br \/>\nDo you want to scan for them? (YES\/no):<br \/>\nAMD K8 thermal sensors&#8230;                                   No<br \/>\nAMD K10 thermal sensors&#8230;                                  No<br \/>\nIntel Core family thermal sensor&#8230;                         No<br \/>\nIntel AMB FB-DIMM thermal sensor&#8230;                         No<\/p>\n<p>Now follows a summary of the probes I have just done.<br \/>\nJust press ENTER to continue:<\/p>\n<p>Driver `gl520sm&#8217; (should be inserted):<br \/>\nDetects correctly:<br \/>\n* Bus `SMBus Via Pro adapter at 5000&#8242;<br \/>\nBusdriver `i2c-viapro&#8217;, I2C address 0x2d<br \/>\nChip `gl520sm&#8217; (confidence: 6)<\/p>\n<p>I will now generate the commands needed to load the required modules.<br \/>\nJust press ENTER to continue:<\/p>\n<p>To load everything that is needed, add this to \/etc\/modules:<\/p>\n<p>#&#8212;-cut here&#8212;-<br \/>\n# I2C adapter drivers<br \/>\ni2c-viapro<br \/>\n# Chip drivers<br \/>\ngl520sm<br \/>\n#&#8212;-cut here&#8212;-<\/p>\n<p>Do you want to add these lines automatically? (yes\/NO) yes<\/p>\n<p>If it gives the error &#8220;You need to be root to run this script.&#8221;, then re-run it as root.<\/p>\n<p>You&#8217;re done! Type sensors in the command line to run.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sensors\r\ngl520sm-i2c-0-2d\r\nAdapter: SMBus Via Pro adapter at 5000\r\n+5V:         +5.13 V  (min =  +0.00 V, max =  +0.00 V)\r\n+3.3V:       +3.31 V  (min =  +0.00 V, max =  +0.00 V)\r\n+12V:       +12.03 V  (min =  +0.00 V, max =  +0.00 V)\r\nVcore:       +2.11 V  (min =  +0.00 V, max =  +0.00 V)\r\nfan1:          0 RPM  (min =    0 RPM, div = 1)\r\nfan2:          0 RPM  (min =    0 RPM, div = 1)\r\ntemp1:       +35.0 C  (high = -130.0 C, hyst = -130.0 C)\r\ntemp2:       +35.0 C  (high = -130.0 C, hyst = -130.0 C)\r\ncpu0_vid:   +2.050 V\r\nbeep_enable:disabled\r\n<\/pre>\n<p>If you want a graphical applet, run this:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo apt-get install sensors-applet\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\nlibsensors-applet-plugin0\r\nRecommended packages:\r\nhddtemp\r\nThe following NEW packages will be installed:\r\nlibsensors-applet-plugin0 sensors-applet\r\n0 upgraded, 2 newly installed, 0 to remove and 24 not upgraded.\r\nNeed to get 118kB of archives.\r\nAfter this operation, 713kB of additional disk space will be used.\r\nDo you want to continue [Y\/n]? y\r\nGet:1 http:\/\/us.archive.ubuntu.com hardy\/universe libsensors-applet-plugin0 2.2.1-1ubuntu3 [18.5kB]\r\nGet:2 http:\/\/us.archive.ubuntu.com hardy\/universe sensors-applet 2.2.1-1ubuntu3 [99.7kB]\r\nFetched 118kB in 1s (74.0kB\/s)\r\nSelecting previously deselected package libsensors-applet-plugin0.\r\n(Reading database ... 117338 files and directories currently installed.)\r\nUnpacking libsensors-applet-plugin0 (from ...\/libsensors-applet-plugin0_2.2.1-1ubuntu3_i386.deb) ...\r\nSelecting previously deselected package sensors-applet.\r\nUnpacking sensors-applet (from ...\/sensors-applet_2.2.1-1ubuntu3_i386.deb) ...\r\nSetting up libsensors-applet-plugin0 (2.2.1-1ubuntu3) ...&lt;\/code&gt;\r\n\r\nSetting up sensors-applet (2.2.1-1ubuntu3) ...\r\n\r\nProcessing triggers for libc6 ...\r\nldconfig deferred processing now taking place\r\n<\/pre>\n<p>Then right click a panel and select &#8220;Add to Panel&#8221;. Then in the list select &#8220;Hardware Sensors Monitor&#8221; and click &#8220;Add&#8221;.<\/p>","protected":false},"excerpt":{"rendered":"<p>Update (2010-10-10): If you are getting &#8220;E: Couldn&#8217;t find package sensors-applet&#8221; errors, then add universe to \/etc\/apt\/sources.list (add or uncomment http:\/\/archive.ubuntu.com\/ubuntu &lt;dist code&gt; universe) lm-sensors is a very useful tool to measure your CPU temperature and your fan speed (which is not in \/proc\/cpuinfo) in Ubuntu Linux. In order to use it, you will first [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}