리눅스에서 CPU 온도를 어떻게 모니터링 할 수 있습니까?


136

Linux를 사용하여 CPU 온도를 어떻게 모니터링하고 표시합니까?


4
짧고 빠르며 정확한 질문에 대한 답변이 너무 많다는 것을 알게되어서 반가워요 :-)
Jan Koester

답변:


124

다른 사람들이 지적했듯이 lm-sensors 패키지 가 필요합니다 . 패키지를 설치하는 것 외에도 sensors-detect 명령을 실행하여 로드해야하는 커널 모듈을 식별해야한다고 생각했습니다.

이 작업을 수행하지 않은 경우이 작업을 수동으로 한 번 실행하고 컴퓨터의 센서가 감지되는지 확인하십시오.

$ sudo sensors-detect 
# sensors-detect revision 5249 (2008-05-11 22:56:25 +0200)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no): 
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7

We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.

We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.

Next adapter: SMBus I801 adapter at 10c0 (i2c-0)
Do you want to scan it? (YES/no/selectively): 
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No

Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no): 
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' at 0x290...     No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     Yes
Found unknown chip with ID 0x2803
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No

Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no): 
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD K10 thermal sensors...                                  No
Intel Core family thermal sensor...                         Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No

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

Driver `coretemp' (should be inserted):
  Detects correctly:
  * Chip `Intel Core family thermal sensor' (confidence: 9)

I will now generate the commands needed to load the required modules.
Just press ENTER to continue: 

To load everything that is needed, add this to /etc/modules:

#----cut here----
# Chip drivers
coretemp
#----cut here----

Do you want to add these lines automatically? (yes/NO)

운이 좋으면 랩톱에서 다양한 센서를 지원합니다. 그렇지 않은 경우 여전히 CPU에 대한 기본 센서 세트를 찾을 수 있습니다.

$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:       +40.5°C  (crit = +105.0°C)                  

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +35.0°C  (crit = +100.0°C)                  

coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +40.0°C  (crit = +100.0°C)                  

2
화면에 표시하려면 감지를 위해 lm- 센서를 사용하는 gkrellm을 사용하는 것이 좋습니다.
Col

1
화면에 표시하고 gkrellm을 사용하지 않으려면 conky를 대신 사용할 수도 있습니다.
괴짜

1
Redhat을 사용하는 경우 패키지는 lm_sensors (일반 대시 대신 밑줄)라고 할 수 있습니다.
msb

아치에서도 마찬가지 lm_sensors입니다.
bfontaine

센서 감지를 처음 수행 한 후 항상 재부팅해야한다고 덧붙이고 싶습니다.
Chuck Claunch

77

lm- 센서의 '센서'와 (procps pkg의) '시계'를 사용하여 다음을 통해 명령 줄에서 센서 데이터를 실시간으로 모니터링 할 수 있습니다.

watch -n 1 -d sensors

1 초마다 센서가 표시되고 이전 초와의 차이점이 강조 표시됩니다.

Every 1.0s: /usr/bin/sensors

...
temp1:       +55C  (high =   +50C, hyst =   +45C)   sensor = thermistor   ALARM
temp2:     +35.0C  (high =   +80C, hyst =   +75C)   sensor = thermistor
temp3:     +35.0C  (high =   +80C, hyst =   +75C)   sensor = thermistor

화씨 구문을 사용하지 않는 이유는 무엇입니까?
Jacob Jan Tuinstra

6
쉽게, 위의 센서 명령에 '-f'옵션을 추가하십시오
johnnyB

2
이것이 작동하려면 lm-sensors 패키지를 설치해야합니다.
윌리엄 에버렛

24

lm- 센서

Lm- 센서는 Linux 용 하드웨어 상태 모니터링 패키지입니다. 온도, 전압 및 팬 속도 센서의 정보에 액세스 할 수 있습니다. 대부분의 최신 시스템에서 작동합니다. 이 패키지에는 lm- 센서에서 데이터를 설정하고 읽는 데 도움이되는 프로그램이 포함되어 있습니다.

설치하려면 다음을 수행하십시오.

# sudo apt-get install lm-sensors sensors-applet

사용 :

# sensors-detect
...
# sensors
V1.5:      +2.467 V  (min =  +1.42 V, max =  +1.58 V)   ALARM
VCore:     +1.479 V  (min =  +1.48 V, max =  +1.63 V)   ALARM
V3.3:      +3.373 V  (min =  +3.13 V, max =  +3.47 V)
V5:       +5.000 V  (min =  +4.74 V, max =  +5.26 V)
V12:      +11.734 V  (min = +11.38 V, max = +12.62 V)
CPU_Fan:   2299 RPM  (min = 4000 RPM)                     ALARM
fan2:         0 RPM  (min =    0 RPM)
fan3:      1057 RPM  (min =    0 RPM)
fan4:         0 RPM  (min =    0 RPM)
CPU:      +41.50°C  (low  =   +10°C, high =   +50°C)
Board:    +35.25°C  (low  =   +10°C, high =   +35°C)
Remote:   +35.50°C  (low  =   +10°C, high =   +35°C)     ALARM
CPU_PWM:   144
Fan2_PWM:  112
Fan3_PWM:  112
vid:      +1.550 V  (VRM Version 9.0)

또는 애플릿을 작업 표시 줄에 추가하십시오.

여기에 이미지 설명을 입력하십시오


computertemp 애플릿을 사용해 볼 수도 있습니다.

우분투 패키지

홈페이지

컴퓨터 온도 모니터는 그놈 데스크탑의 작은 애플릿으로 컴퓨터 CPU와 디스크의 온도를 화면에 표시합니다.

온도를 파일에 기록 할 수도 있습니다. 온도에 도달했을 때 알리도록 경보를 설정할 수 있습니다. 여러 센서를 패널에 추가하여 다른 센서를 모니터링 할 수 있습니다. CPU Frequency Gnome 애플릿처럼 보이도록 설계되었으므로 패널에서 서로 일치합니다.

설치하려면 다음을 수행하십시오.

sudo apt-get install computertemp

그런 다음 작업 표시 줄에 추가하십시오

여기에 이미지 설명을 입력하십시오


9

Fedora / Red Hat Linux를 실행하는 Dell 서버 (Poweredge R420)가 있습니다 . lm_sensors를 설치했지만 sensors커널 드라이버가로드되지 않았다는 메시지가 표시되었습니다. 나는 sensor-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을 사용하도록 조언하는 페이지를 확인했습니다. 설치했지만 여전히 작동하지 않습니다.

$ 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

이것이 델 서버가 온도를 얻는 데 어려움을 겪는 사람에게 도움이되기를 바랍니다.


6

Linux를 사용하면 온도 정보 센서에 액세스 할 수 있습니다. RH6.2x64와 함께 작동합니다.

이 드라이버에는 lm- 센서를 사용한 읽기 지원이 포함되어 있습니다.

유형

modprobe coretemp
sensors

4

온도를 모니터링하기 위해 gui를 사용하는 다른 소프트웨어를 발견했습니다. 소프트웨어 이름은 Psensor : https://wpitchoune.net/psensor/입니다.

그리고 인터넷 기사를 참조하십시오 : https://www.tecmint.com/psensor-monitors-hardware-temperature-in-linux/

Ubuntu / Mint에 설치하려면 터미널에서 다음 명령을 실행하십시오.

sudo apt install psensor

응용 프로그램을 실행하려면 다음을 실행하십시오.

sudo psensor

감사.


1
센서를 구성하려면이 명령을 실행하고 모든 질문에 대해 yes를 입력하십시오.sudo sensors-detect
Wellington1993

2

ACPI

언급 할 가치가있는 acpi명령,

acpi -t   # or -V for all

-t | - 열 : 열 정보 표시

보낸 사람 apt-cache show acpi:

Description-en : ACPI 장치에 대한 정보를 표시 합니다 . 배터리 및 열 정보를 포함하여 ACPI 시스템 에서 "old" apm 명령 의 기능을 복제하려고합니다 . ACPI 일시 중단을 지원하지 않으며 ACPI 장치에 대한 정보 만 표시합니다.

홈페이지 : http://sourceforge.net/projects/acpiclient

우분투와 같은 시스템에서는 다음과 같이 설치할 수 있습니다

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

conky 파일로 명령 행을 리턴하여 화면 보호기에 표시 할 수 있습니다. 그것은 공간을 먹는 애플릿보다 덜 부풀어 있습니다.

sudo apt-get install conky

그런 다음 / home / 사용자 폴더에 꿈의 .conkyrc 파일을 만들어 시작시 라우트 된 응용 프로그램에 추가하십시오.

IMP : 멋진 conky 설정에 대해서는 conky 또는 premade .conkyrc, Ubuntu 및 ubuntu-fr 포럼 스레드, Lifehacker 등에 대한 자습서를 참조하십시오 .

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.