我正在尝试使sysstat能够获取温度读数,这样我就有了过去的温度信息来诊断将来的主机故障。
我尝试使用这个命令来获取温度信息:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22下面是特区手册页面对此的看法:
-m { keyword [,...] | ALL }
Report power management statistics. Note that these statistics depend on sadc's option "-S POWER" to
be collected.
Possible keywords are CPU, FAN, FREQ, IN, TEMP and USB.
[...]
With the TEMP keyword, statistics about devices temperature are reported. The following values are
displayed:根据这一点,默认情况下不记录电源管理信息(其中温度是其中的一个子集)。因此,我更改了文件/etc/sysstat/sysstat以启用它。我改变了这个:
# Parameters for the system activity data collector (see sadc(8) manual page)
# which are used for the generation of log files.
# By default contains the `-S DISK' option responsible for generating disk
# statisitcs. Use `-S XALL' to collect all available statistics.
SADC_OPTIONS="-S DISK"这方面:
SADC_OPTIONS="-S DISK,POWER"sysstat问题跟踪器上的另一个问题是sysstat需要lm传感器才能工作,所以我也安装了这个包。下面是sensors的输出:
$ sensors
acpitz-acpi-0
Adapter: ACPI interface
temp1: +27.8°C (crit = +119.0°C)
temp2: +29.8°C (crit = +119.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +89.0°C (high = +82.0°C, crit = +100.0°C)
Core 0: +86.0°C (high = +82.0°C, crit = +100.0°C)
Core 1: +88.0°C (high = +82.0°C, crit = +100.0°C)
Core 2: +89.0°C (high = +82.0°C, crit = +100.0°C)
Core 3: +89.0°C (high = +82.0°C, crit = +100.0°C)
Core 4: +88.0°C (high = +82.0°C, crit = +100.0°C)
Core 5: +87.0°C (high = +82.0°C, crit = +100.0°C)
nvme-pci-0800
Adapter: PCI adapter
Composite: +38.9°C (low = -273.1°C, high = +84.8°C)
(crit = +84.8°C)
Sensor 1: +38.9°C (low = -273.1°C, high = +65261.8°C)
Sensor 2: +37.9°C (low = -273.1°C, high = +65261.8°C)所以这似乎正确地探测到了我的温度传感器。
我还试着等待十分钟,等待另一个收集发生。(我的系统被配置为每十分钟记录一次,时间:05,:15,:25,等等)
不幸的是,在这之后,我仍然会遇到同样的错误:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22发布于 2022-03-30 17:33:11
通过三个步骤,我成功地做到了这一点:
/usr/lib/sysstat/debian-sa1 1 1 (在非Debian/Ubuntu系统上可能有所不同)之后,运行sar -m TEMP就能工作了。
https://unix.stackexchange.com/questions/696447
复制相似问题