hmchzb19<em></em 阅读(35) 评论(0)
笔记本先后经历了两次返场维修,第一次,因为主板自动断电,第二次则是因为SSD硬盘插上去认不到。
过了20天左右的时间,笔记本才能正常使用。但是开机感觉风扇的转速一会飞快,一会儿又没有声音,怀疑CPU的风扇有问题。

所以研究了下如何检查CPU的温度:

两种方案:
1.  ACPI

点击(此处)折叠或打开

  1. acpi_available
显示没有输出,我只能man一下看看。

点击(此处)折叠或打开

  1. NAME
  2.        acpi_available - test whether ACPI subsystem is available

  3. SYNOPSIS
  4.        acpi_available

  5. DESCRIPTION
  6.        acpi_available checks whether the ACPI ("Advanced Configuration and Power Interface") subsystem is available, as evidenced by the presence of the /proc/acpi directory.

  7. OPTIONS
  8.        None.

  9. EXIT STATUS
  10.        0 (true) ACPI subsystem is available
  11.        1 (false) ACPI subsystem is not available
看来我需要检查acpi_available的返回值。

点击(此处)折叠或打开

  1. root@kali:~# acpi_available
  2. root@kali:~# echo $?
  3. 0
继续

点击(此处)折叠或打开

  1. apt-get install acpi
  2. root@kali:~# acpi -t
    Thermal 0: active, 90.0 degrees C
    Thermal 1: ok, 0.0 degrees C
看到这个温度,我有点懵,这个温度有点过高了。

2. 我决定再使用lm-sensors来确定下:

点击(此处)折叠或打开

  1. apt-get install lm-sensors
  2. sensors-detect
  3. 一路yes下来,最后看到这个
  4. Now follows a summary of the probes I have just done.
    Just press ENTER to continue:

    Driver `coretemp':
      * Chip `Intel digital thermal sensor' (confidence: 9)

    To load everything that is needed, add this to /etc/modules:
    #----cut here----
    # Chip drivers
    coretemp
    #----cut here----
    If you have some drivers built into your kernel, the list above will
    contain too many modules. Skip the appropriate ones!

    Do you want to add these lines automatically to /etc/modules? (yes/NO)yes
    Successful!

    Monitoring programs won't work until the needed modules are
    loaded. You may want to run '/etc/init.d/kmod start'
    to load them.

    Unloading i2c-dev... OK
    Unloading cpuid... OK



到这里配置完成,使用命令来查看下:


点击(此处)折叠或打开

  1. root@kali:~# sensors
  2. acpitz-virtual-0
  3. Adapter: Virtual device
  4. temp1: +49.0°C (crit = +105.0°C)
  5. temp2: +0.0°C (crit = +105.0°C)

  6. coretemp-isa-0000
  7. Adapter: ISA adapter
  8. Package id 0: +47.0°C (high = +105.0°C, crit = +105.0°C)
  9. Core 0: +45.0°C (high = +105.0°C, crit = +105.0°C)
  10. Core 1: +46.0°C (high = +105.0°C, crit = +105.0°C)

过了段时间,大概1小时后,温度降到了这样。

3. 使用logger 脚本记录10分钟温度的变化。
脚本如下:

点击(此处)折叠或打开

  1. exec 1> >(logger -s -t $(basename $0)) 2>&1

  2. i=0
  3. while [[ $i -le 20 ]];do
  4.     sleep 30
  5.     sensors
  6.     let i=$i+1
  7. done