- 浏览: 56117 次
- 性别:
- 来自: 北京
文章分类
最新评论
在 CentOS 上安装 CPU 温度监控软件(lm_sensors)
前段时间新装了一台服务器,系统是 CentOS 5.4 x64,托管在天通苑的一个机房里,上次去装机器的时候注意到他们机房有时候不开空调,机房内温度很高,所以有点不放心,所以想装一个 CPU 温度监控软件方便随时查看机器是否在正常温度下工作。
查了些资料,基本都是 lm_sensors 的,网上说的都很简单,看了几遍后心中比较有数了,就开始动手。本以为会很顺利,结果走了不少弯路,查了很多资料才最终安装成功成。现在在这里记下一些网上的文章都没有提到的细节,正是这些细节让我走了不少弯路。
先安装 lm_sensors:
[root@www ~]# yum install lm_sensors
安装完毕后运行 sensors-detect:
[root@www ~]# /usr/sbin/sensors-detect
然后一路回车,到了最后的时候出现了这个:
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Starting lm_sensors: No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
[FAILED]
网上查了下,很多的朋友也都碰到这个问题,但都不知道怎么解决,没有经验可以借鉴,只好自力更生了。
最后google到一个线索:使用最新版的 sensors-detect。于是下载最新版的 sensors-detect:
[root@www ~]# wget http://dl.lm-sensors.org/lm-sensors/files/sensors-detect
[root@www ~]# chmod u+x sensors-detect
[root@www ~]# ./sensors-detect
…
这次安装还是没成功,但是,非常重要的是,这个新版的sensors-detect给出了失败的原因:
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.
Warning: the required module ipmisensors 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.
No modules to load, skipping modules configuration.
有了错误原因,解决起来就好办了,google这个 coretemp ,找到了这篇post:
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14748
我是个懒人,直接用6楼提供的rpm安装了:
[root@www ~]# wget http://www.cs.vsu.ru/~raskhozhev/files/dkms-coretemp-1.00-1.noarch.rpm
[root@www ~]# rpm -i dkms-coretemp-1.00-1.noarch.rpm
提示需要这个rpm包依赖 dkms 包,那就装吧:
[root@www ~]# yum install dkms
”dkms-2.1.1.2-1.el5.rf.noarch.rpm“
安装不成功,会提示安装 kernel-devel,
[root@www ~]# rpm -i dkms-coretemp-1.00-1.noarch.rpm
成功了,接着重新开始 sensors-detect:
[code="java"][root@www~]/usr/sbin/sensors-detect
[code="java"] sensors-detect
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `coretemp':
* Chip `Intel Core family thermal sensor' (confidence: 9)
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors
for initialization at boot time.
You should now start the lm_sensors service to load the required
kernel modules.
Unloading i2c-dev... OK
启动服务: service sensors start
终于看到绿色OK,启动 lm_sensors:
[root@www ~]# sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +34°C (high = +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +34°C (high = +100°C)
总结:
Linux Kernel 2.6.22 以上才自带 coretemp,CentOS 5.4 使用的是 Kernel 2.6.18,所以没有自带这个模块,需要自己patch或者安装第三方做好的rpm
lm_sensors 需要 coretemp 模块,否则无法找到传感器。
上面的错误信息也提到缺少 ipmisensors 模块(如果装上这个模块,lm_sensors 好像还可以查看风扇转速、CPU电压等其他信息,但我不需要这些,所以没装),但如果不装,也能查看CPU温度
转自:http://liang.eu/servers/install-lm_sensors-on-centos-5-4-64bit
发表评论
-
shell md5
2011-05-06 18:15 1412今日群里问起一个问题:echo 123|md5sumba1f2 ... -
samba 挂载文件
2011-05-03 14:31 1733[oracle@centos223 samba]$ ca ... -
linux 修改文件中某一行
2011-04-27 18:21 1158sed -i "1s/oldstr/news ... -
shell find scp 命令
2011-04-27 18:11 1949查询某个文件下 文件大小大于 10k 的文件 : f ... -
wget下载页面脚本
2011-04-27 18:04 1252首先配置文件: [wusx@centos245 gat ... -
curl 下载 字符集转化
2011-04-21 10:02 1964shell 写道 curl 下载页面时,时常会乱码,可 ... -
linux 下获取 互联网ip
2011-04-21 09:55 784方式一: [root@centos200 monitor ... -
shell 比较字符串是否相等
2011-04-20 15:39 1364比较两个字符串是否 ... -
shell 监控服务器联网状态
2011-04-20 15:34 1272-rw-r--r-- 1 root root 1037 04- ... -
linux 终端 查看 硬件信息
2011-04-14 14:52 10131)查看硬盘参数:(下面仅是速度) [r ... -
secureCRT使用技巧
2011-03-10 18:22 1013secureCRT使用技巧 使用 ... -
linux uptime命令
2011-03-09 14:37 620linux uptime命令 转自:htt ... -
linux下/proc/stat 计算CPU利用率(转)
2011-01-14 17:36 1269加深对cpu利用率的理解 转自:http://blog ... -
TOP命令详解(转)
2011-01-14 16:06 688TOP命令详解 关键词: ... -
高级bash编程
2011-01-10 13:06 457http://www.tsnc.edu.cn/default/ ... -
linux shell 递归目录文件 删除指定日期之外的文件和空目录
2010-10-30 11:27 2952#!/bin/sh #Name delFileAsD ...
相关推荐
lm_sensors(linux 下cpu温度读取工具)
Centos5.3安装lm_sensors_cpu温度监控 Centos5.3安装lm_sensors_cpu温度监控
lm_sensors是一款linux的硬件监控的软件,可以帮助我们来监控主板,CPU的工作电压,风扇转速、温度等数据。
lm_sensors-libs-3.1.1-17.el6.x86_64.rpm lm_sensors-libs-3.1.1-17.el6.x86_64.rpm
netsnmp安装依赖包lm_sensors-2.10.7-9.el5.x86_64.rpm
离线安装包,亲测可用
官方离线安装包,亲测可用
离线安装包,亲测可用
lm_sensors-2.8.7-2.src.rpm
离线安装包,亲测可用
离线安装包,亲测可用
lm_sensors-2.10.0-3.1.i386 安装包
离线安装包,亲测可用
redhat5下面安装wireshark的安装配置文件。
官方离线安装包,亲测可用
linux下完美监控cpu温度,硬盘温度,cpu风扇运行情况
lm_sensors是一款linux的硬件监控的软件,可以帮助我们来监控主板,CPU的工作电压,风扇转速、温度等数据。 此版本为ubuntu linux版本。
netsnmp安装依赖包 lm_sensors-devel-2.10.7-9.el5.x86_64.rpm
监控cpu温度,硬盘温度,cpu风扇运行情况