2009-08-19 00:08:14 +0000 2009-08-19 00:08:14 +0000
135
135
Advertisement

如何在linux下监控CPU温度?

Advertisement

如何使用Linux监控和显示CPU温度?

Advertisement

答案 (7)

77
77
77
2013-01-26 20:52:03 +0000

使用'sensor'(来自 lm-sensors)和'watch'(来自 procps pkg),你可以在命令行中通过以下方式实时监控传感器的数据:

watch -n 1 -d sensors

这将每隔1秒显示一次传感器,并突出显示与前一秒的差异。

24
24
24
2009-08-19 00:10:32 +0000

lm-sensors

Lm-sensors 是一个适用于 Linux 的硬件健康监控包。它允许你从温度、电压和风扇速度传感器中获取信息。它适用于大多数较新的系统。这个软件包包含了一些程序,可以帮助你设置和读取lm-sensors的数据。 Ubuntu Package 主页

计算机温度监控器是 GNOME 桌面的一个小程序,它可以在屏幕上显示计算机 CPU 和磁盘的温度。你可以设置警报,当温度达到一定的温度时通知你。可以在面板上添加多个显示器,以监控不同的传感器。它的设计很像CPU Frequency Gnome applet,所以它们在面板上是相互匹配的。

9
Advertisement
9
9
2013-09-20 18:07:41 +0000

我有一台戴尔服务器(Poweredge R420),运行Fedora / Red Hat Linux。我安装了lm_sensors,但是sensors给我一个消息说内核驱动没有加载。我用 sensors-detect 找出我需要的传感器,结果发现我需要 IPMI。我安装了它,但还是不行:

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

Driver `ipmisensors':
  * ISA bus, address 0xca8
    Chip `IPMI BMC KCS' (confidence: 8)

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.
$ ipmitool sensor
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
Get Device ID command failed
Unable to open SDR for reading

经过一番研究后,我找到了这个页面 http://osdir.com/ml/hardware.ipmitool.devel/2008-02/msg00012.html

他们的脚本ipmimod.sh对我来说是开箱即用:

#!/bin/bash

#IPMI kernel module installer for Redhat-style machines
#dranch-3r7Miqu9kMnR7s880joybQ@xxxxxxxxxxxxxxxx

#07/26/06 - use absolute paths for modprobe
#05/01/06 - orig version

/sbin/modprobe ipmi_devintf

maj=`cat /proc/devices | awk '/ipmidev/{print $1}'`
echo $maj
if [-c /dev/ipmi0]
then
   rm -f /dev/ipmi0
   /bin/mknod /dev/ipmi0 c $maj 0
else
   /bin/mknod /dev/ipmi0 c $maj 0
fi

IPMI_DRIVERS="ipmi_si ipmi_si_drv ipmi_kcs_drv"
for driver in $IPMI_DRIVERS; do
  find /lib/modules/`uname -r`/kernel/drivers/char/ipmi | grep $driver > /dev/null
  RETURN_VALUE=$?
  if [$RETURN_VALUE -eq 0] ; then
    #Here are specific memory locations for Supermicro AOC-type IPMI cards
    /sbin/modprobe $driver type=kcs ports=0xca8 regspacings=4
    break
  fi
done

运行后,我终于可以看到CPU的温度了:

$ ipmitool sensor | grep Temp
Inlet Temp | 24.000 | degrees C | ok | na | -7.000 | 3.000 | 42.000 | 47.000 | na
Temp | na | degrees C | na | na | 3.000 | 8.000 | 77.000 | 83.000 | na
Temp | na | degrees C | na | na | 3.000 | 8.000 | 77.000 | 83.000 | na

我希望这对有困难的dell服务器的人有帮助。

6
6
6
2013-07-18 13:43:11 +0000

Linux允许你访问温度信息传感器。该驱动包含使用 lm-sensors 的读取支持:

类型

modprobe coretemp
sensors
4
Advertisement
4
4
2017-09-03 04:36:54 +0000

我发现了其他有gui监测温度的软件。这款软件的名字是。Psensor。https://wpitchoune.net/psensor/

,请看互联网上的文章。 https://www.tecmint.com/psensor-monitors-hardware-temperature-in-linux/

要在Ubuntu/Mint上安装,请在终端上运行这个命令:

sudo apt install psensor

要运行程序,只需运行这个命令:

sudo psensor

谢谢。

3
3
3
2017-05-25 10:19:34 +0000

ACPI

值得一提的是acpi命令,

acpi -t # or -V for all

-t | —thermal*:显示热信息

来自apt-cache show acpi

描述-en:显示ACPI设备信息 试图在ACPI系统上复制“老” apm命令的功能,包括电池和热信息
不支持ACPI悬浮,只显示ACPI设备的信息。

首页。 http://sourceforge.net/projects/acpiclient

在类似Ubuntu的系统上,你可以用

sudo apt-get install acpi

注:你可以用watch -n 1 -d acpi -V监控温度,或者你可以用脚本(不管有没有sensors命令)开始解析它的输出(或date的输出),添加颜色,将输出记录到文件中…..

while [[1]] ; do acpi -t | awk '{printf ("%2.2f ",$4)}'; date; sleep 1 ; done

1
Advertisement
1
1
2009-08-19 01:37:48 +0000

你可以将命令行返回到conky文件中,在你的屏保中显示。

sudo apt-get install conky

&001

然后在你的/home/user文件夹中构建你梦想中的.conkyrc文件,并将其添加到你的应用程序中。

Advertisement