![lm-sensors 的“sensors”命令不断报告相同的温度](https://linux22.com/image/844898/lm-sensors%20%E7%9A%84%E2%80%9Csensors%E2%80%9D%E5%91%BD%E4%BB%A4%E4%B8%8D%E6%96%AD%E6%8A%A5%E5%91%8A%E7%9B%B8%E5%90%8C%E7%9A%84%E6%B8%A9%E5%BA%A6.png)
我有一个在所有节点上运行 Ubuntu 12.04 LTS 的小型集群。我最近设置了 ganglia 来监控集群,除了一个问题之外,它运行良好。我想向监视器添加一个 CPU 温度指标,因此我在 /usr/local/bin/ 中创建了一个“temps”函数,它由以下行组成:
sensors|grep temp$1|awk '{print $2}'|grep -o '[0-9.]\+'
然后我在 crontab 中添加了以下几行,以便每 2 分钟更新一次温度:
*/2 * * * * /usr/bin/gmetric --name temp1 --value `/usr/local/bin/temps 1` --type int16 --units Celcius
*/2 * * * * /usr/bin/gmetric --name temp2 --value `/usr/local/bin/temps 2` --type int16 --units Celcius
设置完成后,我注意到温度始终没有变化。它始终报告温度 1 为 27.8,温度 2 为 29.8。无论机器负载如何,这就是“传感器”报告的值。以下是“传感器”的完整输出:
root@NUCTest:~# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +27.8°C (crit = +106.0°C)
temp2: +29.8°C (crit = +106.0°C)
我这里遗漏了什么?谢谢。
答案1
我通过 Braiam 对我的原始问题的评论找到了一些方向。我重新运行sensors-detect
并回答了关于将行添加到 的问题/etc/modules
。我认为我第一次选择了默认的否。现在我得到了更完整的输出,其中sensors
包括非虚拟设备。以下是我现在得到的结果:
root@NUCTest:~# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +27.8°C (crit = +106.0°C)
temp2: +29.8°C (crit = +106.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +35.0°C (high = +87.0°C, crit = +105.0°C)
Core 0: +33.0°C (high = +87.0°C, crit = +105.0°C)
Core 1: +36.0°C (high = +87.0°C, crit = +105.0°C)
nct6776-isa-0a30
Adapter: ISA adapter
Vcore: +0.65 V (min = +0.00 V, max = +1.74 V)
in1: +1.00 V (min = +0.00 V, max = +0.00 V) ALARM
AVCC: +3.36 V (min = +0.00 V, max = +0.00 V) ALARM
+3.3V: +3.34 V (min = +0.00 V, max = +0.00 V) ALARM
in4: +1.06 V (min = +0.00 V, max = +0.00 V) ALARM
in5: +0.00 V (min = +0.00 V, max = +0.00 V)
3VSB: +3.33 V (min = +0.00 V, max = +0.00 V) ALARM
Vbat: +3.28 V (min = +0.00 V, max = +0.00 V) ALARM
fan1: 0 RPM (min = 0 RPM) ALARM
fan2: 3183 RPM (min = 0 RPM) ALARM
SYSTIN: +65.0°C (high = +0.0°C, hyst = +0.0°C) ALARM sensor = thermistor
CPUTIN: +36.5°C (high = +80.0°C, hyst = +75.0°C) sensor = diode
AUXTIN: +87.0°C (high = +80.0°C, hyst = +75.0°C) ALARM sensor = thermistor
PECI Agent 0: +29.0°C
cpu0_vid: +2.050 V
intrusion0: ALARM
intrusion1: ALARM
有趣的是虚拟设备仍然存在。我很想知道它到底是什么。