debian

Debian cpustat如何查看CPU温度

小樊
70
2025-04-01 21:12:54
栏目: 智能运维

在Debian系统中,cpustat 是一个用于显示CPU使用情况的工具,但它本身并不直接提供CPU温度的监控功能。要查看CPU温度,你可以使用其他工具,如 lm-sensors

以下是在Debian上安装和使用 lm-sensors 来查看CPU温度的步骤:

安装 lm-sensors

  1. 打开终端。
  2. 更新包列表:
    sudo apt update
    
  3. 安装 lm-sensors
    sudo apt install lm-sensors
    

配置 lm-sensors

  1. 运行 sensors-detect 命令来检测系统中的传感器:

    sudo sensors-detect
    

    按照提示操作,通常情况下,你可以选择默认选项(通常是 yes)来检测所有传感器。

  2. 配置完成后,重新加载 lm-sensors 配置:

    sudo service kmod restart
    

查看CPU温度

  1. 使用 sensors 命令查看所有传感器的信息:

    sensors
    

    这将显示系统中所有检测到的传感器及其温度。

  2. 如果你只想查看CPU的温度,可以使用 grep 命令过滤输出:

    sensors | grep 'temp'
    

示例输出

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +45.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:        +42.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:        +43.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:        +41.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:        +40.0°C  (high = +80.0°C, crit = +98.0°C)

在这个示例中,Package id 0 表示CPU的整体温度,而 Core 0, Core 1, 等表示各个核心的温度。

通过这些步骤,你应该能够在Debian系统上成功查看CPU的温度。

0
看了该问题的人还看了