www.question-defense.com | Engage: Visit :: Login :: Register

If you have been following my progress over the last few days you will know that after a complete rebuild of the tools server and a change of the operating system, I have been working hard to get all our temp monitoring back online. The server previously ran Gentoo Linux, which although is still my favorite distro, is just not suited for a production server environment.  So we decided to go with Cent OS which is a very well built distro aimed at running on production servers. My only complaint is that its kernel and some of its packages are a little bit out of date.  On the bright side, this has given us a few challenges to work through and more importantly some good articles to share.  So after getting my GPU temps going and graphing I turned my attention to the cpu. We are currently running a Intel i7 965 Extreme edition which I just put in last night. In the following article I will show how I eventually got lm_sensors and the coretemp module to work on Cent OS 5.4


I actually did fid quite a bit of info on the net about this issue since cpu monitoring is a pretty common thing to do, however, I was pretty unsatisfied with most of the solutions I found so I decided to rewrite a simple article on how to get this going.

Te first thing to do is to install lm_sensors with yum:

yum install lm_sensors

Once this is installed you are supposed to run the sensors-detect script but in my case this did not work for two reasons.
the first reason was that I did not have the coretemp module loaded (I’ll come back to this) and the second reason was that my Intel i7 chip was not even being detected. You may or may not have the second problem depending on how new your hardware is. On my development box, where I do all my testing I have a Intel Q6600 and I did not have this issue.

The problem is that the lm_sensors package in the yum repo is a little old so what I did was grabbed the newest version of the sensors-detect script from the lm_sensors web site.

The script is located in /usr/sbin:

[root@tools ~]# cd /usr/sbin/
[root@tools sbin]# rm -rf sensors-detect
[root@tools sbin]# wget http://dl.lm-sensors.org/lm-sensors/files/sensors-detect
--2010-03-24 09:28:48--  http://dl.lm-sensors.org/lm-sensors/files/sensors-detect
Resolving dl.lm-sensors.org... 160.45.254.26
Connecting to dl.lm-sensors.org|160.45.254.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 169608 (166K) [text/plain]
Saving to: `sensors-detect'

100%[=====================================================================================================>] 169,608      246K/s   in 0.7s

2010-03-24 09:28:50 (246 KB/s) - `sensors-detect' saved [169608/169608]

[root@tools sbin]# chmod 755 sensors-detect

Once we get that installed we run the script:

Warning: the required module coretemp is not currently installed
on your system. If it is built into the kernel then it's OK.
Otherwise, check http://www.lm-sensors.org/wiki/Devices for
driver availability.

The script appears to run fine and detect our CPU however at the end we are presented with this error message. After some investigation I found the problem. The coretemp kernel module was not introduced until kernel version 2.6.22 and Cent OS has a 2.6.18 kernel, so the module does not exist yet and therefore cannot be loaded.

You can check your kernel version with the following command:

[root@dev-tools sbin]# uname -a
Linux dev-tools 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:32:21 EST 2010 x86_64 x86_64 x86_64 GNU/Linux

So I figured I was not the first one to have this issue so I started to do some searching. Most of the posts I found said to grab a newer kernel source and grab the coretemp.c file and compile and insert it myself. This was a fine solution and it did work however, not so simple for novices so I decided to build my own .rpm when I stumbled across the website of a guy that already did it for us. I am never one to reinvent the wheel so I decided to use his rpm.

The site is located here and as you can see he has actually gone to the trouble of building rpms for every type of kernel available. Since we are using e15 x86_64 (use uname -a to determine this) I just grabbed his rpm and installed it.
We download the rpm and install it:

[root@tools ~]# wget http://www.pperry.f2s.com/linux/coretemp/kmod-coretemp-1.1-2.el5.x86_64.rpm
--2010-03-24 09:42:39--  http://www.pperry.f2s.com/linux/coretemp/kmod-coretemp-1.1-2.el5.x86_64.rpm
Resolving www.pperry.f2s.com... 194.154.164.100
Connecting to www.pperry.f2s.com|194.154.164.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46586 (45K) [application/x-rpm]
Saving to: `kmod-coretemp-1.1-2.el5.x86_64.rpm.1'

100%[=====================================================================================================>] 46,586       187K/s   in 0.2s    

2010-03-24 09:42:39 (187 KB/s) - `kmod-coretemp-1.1-2.el5.x86_64.rpm.1' saved [46586/46586]

[root@tools ~]# rpm -ivh kmod-coretemp-1.1-2.el5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:kmod-coretemp          ########################################### [100%]

Make sure the module built right:

[root@tools ~]# modinfo coretemp
filename:       /lib/modules/2.6.18-164.11.1.el5/weak-updates/coretemp/coretemp.ko
license:        GPL
description:    Intel Core temperature monitor
author:         Rudolf Marek <r.marek@assembler.cz>
srcversion:     6E167863013C68E51A188A6
depends:        hwmon
vermagic:       2.6.18-92.el5 SMP mod_unload gcc-4.1

Load the module:

[root@tools ~]# modprobe coretemp

Check to make sure the module loaded properly:

[root@tools ~]# lsmod | grep coretemp
coretemp               42496  0
hwmon                  36553  2 coretemp,it87

Geat so looks like I got it installed properly and loaded, so lets rerun our sensors-detect script and see if we have better results.

Run the command sensors-detect:

[root@tools ~]# sensors-detect
Stopping lm_sensors: [  OK  ]
# sensors-detect revision 5831 (2010-03-19 11:19:53 +0100)
# System: To Be Filled By O.E.M. To Be Filled By O.E.M.
# Board: ASRock X58 SuperComputer

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):
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
Intel Core family thermal sensor...                         Success!
    (driver `coretemp')
Intel Atom 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):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found `Nuvoton W83667HG-B Super IO Sensors'                 Success!
    (address 0x290, driver `to-be-written')
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):
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): 

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):
Using driver `i2c-i801' for device 0000:00:1f.3: Intel ICH10

Next adapter: SMBus I801 adapter at 0400 (i2c-0)
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'...                                No
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: NVIDIA i2c adapter 0 at 14:00.0 (i2c-1)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 1 at 14:00.0 (i2c-2)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 2 at 14:00.0 (i2c-3)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 3 at 14:00.0 (i2c-4)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 4 at 14:00.0 (i2c-5)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 5 at 14:00.0 (i2c-6)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 0 at 13:00.0 (i2c-7)
Do you want to scan it? (YES/no/selectively): 

Next adapter: NVIDIA i2c adapter 1 at 13:00.0 (i2c-8)
Do you want to scan it? (YES/no/selectively): 

Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `to-be-written':
  * ISA bus, address 0x290
    Chip `Nuvoton W83667HG-B Super IO Sensors' (confidence: 9)

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

Note: there is no driver for Nuvoton W83667HG-B Super IO Sensors yet.
Check http://www.lm-sensors.org/wiki/Devices for updates.

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Starting lm_sensors: [  OK  ]

*note I truncated the output a little bit so the post would not be to long

Notice the last few lines no longer give the error, our intel chip is recognized and lm_sensors starts back as a service properly.

Now lets see if it works:

3-24-2010-9-59-59-AM

Looks like we are working good.

The last thing we need to do is tell lm_sensors to start at boot time:

[root@tools ~]# chkconfig lm_sensors on

Thats about it! Hope this was useful for someone.

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail

Related posts:

  1. Perl Module Error: Can’t locate URI/Escape.pm in @INC In the process of installing Monarch, which is a Nagios...
  2. Yum Error – ImportError: No module named yummain You may see an error like the below when attempting...
  3. Invalid command ‘FastCGIExternalServer’, perhaps misspelled or defined by a module not included in the server configuration I got the error below when attempting to configure a...
  4. Gentoo Linux: eth0 Stops Working During Install Using Minimal Install CD I started an install of Gentoo Linux this morning on...
  5. How to Install dig on a CentOS Linux Server Installing dig on a CentOS Linux server is easy with...
Tags: , , , , , , ,
21 Responses to “LM_Sensors on Cent OS 5.4: How To Get And Install The Coretemp Module”
  1. Pharme509 says:

    Very nice site!

    [Reply]

  2. Pharma381 says:

    Hello! ddabdaf interesting ddabdaf site! I’m really like it! Very, very ddabdaf good!

    [Reply]

  3. Pharme346 says:

    Very nice site!

    [Reply]

  4. Sam says:

    Thanks for this. I was having problems with what must be an old version of the detect script. Trying to get more diagnostic information for my server. Thanks :)

    [Reply]

  5. Hai says:

    Works! I apply to Intel i7-3820 CPU. See all the 8 cores temp. Thank you!

    [Reply]

  6.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*