安装测试系统:

硬件:普通PC机,

软件:redhat linux as 4  2.6 .9 , 安装系统自带的lm_sensors-2.8.7-2.i386

这个软件可以在linux下收集到系统温度。然后我用cacti显示。

由于是系统自带的。所以我在安装系统的时候就已经安装好的。所以如果你找不到的话。可以在系统盘上找,然后rpm安装。这个我就不说了。

下来看配置:

运行:  /sbin/depmod –a

vi /etc/ld.so.conf

加入这一行: /usr/local/lib

运行: ldconfig

运行:sensors-detect 扫瞄你的主机使用那些芯片组

1: We can start with probing for (PCI) I2C or SMBus adapters.

You do not need any special privileges for this.

Do you want to probe now? (YES/no): YES

2:Next adapter: SMBus I801 adapter at 0500 (Algorithm unavailable)

Do you want to scan it? (YES/no/selectively): YES

3:Do you want to scan the ISA bus? (YES/no): YES

4:Do you want to scan for Super I/O sensors? (YES/no): YES

5:Do you want to scan for secondary Super I/O sensors? (YES/no): YES

6:Now follows a summary of the probes I have just done.

Just press ENTER to continue: 回车

7:I will now generate the commands needed to load the I2C modules.

Sometimes, a chip is available both through the ISA bus and an I2C bus.

ISA bus access is faster, but you need to load an additional driver module

for it. If you have the choice, do you want to use the ISA bus or the

I2C/SMBus (ISA/smbus)? ISA

显示:

To make the sensors modules behave correctly, add these lines to

/etc/modules.conf:

#----cut here----

# I2C module options

alias char-major-89 i2c-dev

#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----

# I2C adapter drivers

modprobe i2c-isa

# I2C chip drivers

modprobe w83627hf

# sleep 2 # optional

/usr/bin/sensors -s # recommended

#----cut here----

WARNING! If you have some things built into your kernel, the list above

will contain too many modules. Skip the appropriate ones! You really should

try these commands right now to make sure everything is working properly.

Monitoring programs won't work until it's done.

8:Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): YES

Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors

for initialization at boot time.

完成。

cat /etc/sysconfig/lm_sensors

显示:

MODULE_0=i2c-isa

MODULE_1=w83627hf

启动

[root@linux etc]# /etc/rc.d/init.d/lm_sensors start

Starting lm_sensors:                                       [  OK  ]

测试:运行 sensors

显示:

w83627thf-isa-0290

Adapter: ISA adapter

VCore:     +1.53 V  (min =  +1.93 V, max =  +1.93 V)

+12V:      +5.59 V  (min = +10.82 V, max = +13.19 V)

+3.3V:     +3.26 V  (min =  +3.14 V, max =  +3.47 V)

+5V:       +5.01 V  (min =  +4.75 V, max =  +5.25 V)

-12V:     -14.91 V  (min = -10.80 V, max = -13.18 V)

V5SB:      +4.44 V  (min =  +4.76 V, max =  +5.24 V)

VBat:      +3.23 V  (min =  +2.40 V, max =  +3.60 V)

fan1:        0 RPM  (min = 225000 RPM, div = 2)

CPU Fan:  3668 RPM  (min =   -1 RPM, div = 2)

fan3:        0 RPM  (min = 14062 RPM, div = 8)

M/B Temp:    +35°C  (high =    +5°C, hyst =    +0°C)   sensor = thermistor

CPU Temp:  +42.0°C  (high =  +100°C, hyst =   +95°C)   sensor = PII/Celeron diode

temp3:     +25.5°C  (high =  +100°C, hyst =   +95°C)   sensor = thermistor

ERROR: Can't get VID data!

alarms:   Chassis intrusion detection                      ALARM

beep_enable:

Sound alarm disabled

eeprom-i2c-0-50

Adapter: SMBus I801 adapter at 0500

Memory type:            DDR SDRAM DIMM

Memory size (MB):       512

运行: ntsysv

设置lm_sensors 开机运行。

接下来 设置与 cacti整合:

编辑数据采集脚本

Vi mrtg.sh

#!/bin/sh

cputemp=`sensors | grep "CPU Temp" | awk '{print $3}' | cut -c 2-3`

systemp=`sensors | grep temp3 | awk '{print $2}' | cut -c 2-3`

uptime=`uptime | awk '{print $3 " " $4 " " $5}'`

echo $cputemp

echo $systemp

echo $uptime

echo linux226

添加权限:chmod +x mrtg.sh

采集结果如下:

42

26

4:50, 2 users,

linux226

接下来改写档案

WorkDir: /var/www/html/mrtg/temp/Language: big5Target[index]: `/var/www/html/mrtg/temp/mrtg.temp`MaxBytes[index]:60Options[index]: gauge, nopercent, growright

YLegend[index]: Temp (度)

ShortLegend[index]: 度

LegendO[index]: 系统温度;

LegendI[index]: CPU温度;

Title[index]: Blue-Moon City 系统温度表

PageTop[index]:

Blue-Moon City 主机温度表

系统: RedHat 9.0+Apache 2.0.40 

Mrtg添加:root#/usr/bin/mrtg /var/www/html/mrtg/temp/mrtg.cfg.temp

然后将上面这条命令加入crontab 里定时运行。

我在pc机测试没有问题。。IBM服务器测试没有成功,总是 sensors-detect 时候出错。

经查询:IBM服务器不建议用lm_sensors 软件。

linux实时监测cpu温度,Linux 监控CPU 温度相关推荐

  1. 【忙里偷闲一下午总结:全网最全最细】Linux实时监测CPU 温度,拿来即用版本,亲测无异常,建议收藏

    文章目录 前言 项目需求 需求具体实现 1 lm_sensors工具安装 2 每行脚本具体说明 3 终极代码实现(放大招) 前言 各位小伙伴好久不见,最近工作和生活上琐事比较多,所以一直没更文,今天忙 ...

  2. linux 循环 cpu使用率脚本,监控CPU使用率的三种方法(shell脚本)

    监控CPU使用率的三种方法(shell脚本),供大家学习参考. 方法一: 复制代码 代码如下: #!/bin/sh #监控CPU使用率 #Written by Chameleon #Http://ch ...

  3. java 监控系统cpu,java系统监控CPU 磁盘

    java系统监控CPU 磁盘 import java.io.*; /** * linux 下cpu 内存 磁盘 jvm的使用监控 * @author avery_leo * */ public cla ...

  4. 嵌入式linux实时化技术,嵌入式Linux实时化技术

    引言 Linux支持PowerPC.MIPS.ARM.DSP等多种嵌入式处理器,逐渐被用于多种关键性场合.其中实时多媒体处理.工业控制.汽车电子等特定应用对Linux提出了强实时性需求.Linux提供 ...

  5. mysql监控内存cpu使用率_监控 cpu 内存 网卡的使用情况的一个命令 比较实用

    sar -r -u -n DEV 1 1000 >/data/200.sql  2>&1 & 监控结果: 02:51:11 PM kbmemfree kbmemused  ...

  6. linux终端图形化监控,Stress Terminal UI(s-tui):在Linux终端中监控CPU利用率

    Python部落(python.freelycode.com)组织翻译,禁止转载,欢迎转发. 作者:Alex Manuskin           编译自:https://github.com/ama ...

  7. Linux实时操作系统Xenomai的一小时半入门视频推荐

    今天探索到了一个B站Up主工控小包总(上海翌控科技)的视频和最近的学习十分相关,感兴趣的小伙伴们可以去亲自探索一下,我在本篇文章里主要是做一些总结. 苏州诺达佳自动化NP6工控机 苏州诺达佳自动化NP ...

  8. nmon下载使用和监控CPU和内存

    nmon下载使用和监控CPU和内存 nmon下载与使用 nmon下载 nmon命令 监控CPU和内存 监控CPU 监控内存 注意事项 nmon下载与使用 nmon下载 以下所述工具包链接如下: htt ...

  9. linux dstat 监控mysql_linux命令---dstat强大的性能监测工具(通用的系统资源统计工具:可以实时的监控cpu、磁盘、网络、IO、内存等使用情况。)...

    dstat命令是一个用来替换vmstat.iostat.netstat.nfsstat和ifstat这些命令的工具,是一个全能系统信息统计工具.与sysstat相比,dstat拥有一个彩色的界面,在手 ...

  10. Linux如何通过sensors来监控CPU温度

    当你在linux系统下运行一下比较占用CPU资源的程序时,你会很关心你的CPU是否超温,小编就在介绍下如何实时监控CPU的温度 1.首先查看是否安装sensors包,使用以下命令查看: rpm -qa ...

最新文章

  1. python ffmpeg pyav
  2. poj 1190 生日蛋糕 难|供自己瞻仰
  3. javaBean为什么要implements Serializable
  4. 2015年要学习和巩固的知识点
  5. 剑指Offer——跳台阶
  6. C# 连接远程MySql出错,显示表不存在 [ C# | MySql | Table 'TABLENAME' doesn't exist ]
  7. linux下无对应分辨率,linux mint 向“显示(display)”面板添加没有提供的分辨率选项,使虚拟机中的linux mint可以全屏显示...
  8. excel 使用连接符合并单元格内容或者给单元格内容添加信息
  9. Vue 自定义弹出框组件(类似淘宝选择规格)
  10. 抽签小程序,妈妈再也不用担心谁洗碗(分配任务)了,so easy
  11. ID3、C4.5决策树算法的Python实现(注释详细)
  12. Matlab 导入并显示png格式的透明图片
  13. mips和sparc交叉编译工具链网址
  14. 算法学习-图像的数据格式BGR
  15. ffplay 内存优化
  16. linux eval命令详解,linux命令详解——eval
  17. [整理】linux学习笔记(3)
  18. 玉米社:网站seo站内优化技巧有哪些?
  19. 【转】我的助理辞职了!—给不听话的下属看看
  20. 网页标题添加ico图标

热门文章

  1. 北邮 复习 软件工程_【真题回忆】2018北邮软件工程专业课真题回忆版
  2. pdf 加深 扫描件_扫描文字字体如何加深 pdf扫描件字体加深
  3. JS生成 UUID的方法
  4. Swagger注解 详解
  5. 改 主机名 后 虚拟机 不能启动
  6. linux怎样删除链接文件,在 Linux 中怎样移除(删除)符号链接
  7. PowerPC技术与市场杂谈
  8. 基于LabVIEW的音频信号采集分析系统
  9. ajax+php 实现即时聊天
  10. bc547可以用8050代换吗_代换S8550 S8050三极管要特别注意放大倍数