Sample Header Ad - 728x90

Enable sysstat temperature logging

2 votes
1 answer
1547 views
I'm trying to enable sysstat to take temperature readings, so that I have past temperature information to diagnose host failures in the future. I tried this command to get temperature information:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22
Here's what the sar man page has to say about this:
-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:
According to this, power management information (which temperature is a subset of) is not logged by default. So, I changed the file /etc/sysstat/sysstat to enable it. I changed this:
# 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"
into this:
SADC_OPTIONS="-S DISK,POWER"
Another issue on the [sysstat issue tracker](https://github.com/sysstat/sysstat/issues/156) said that sysstat requires lm-sensors to function, so I installed that package too. Here's the output of 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)
So this does seem to correctly detect my temperature sensors. I also tried waiting ten minutes for another collection to happen. (My system is configured to log every ten minutes, at :05, :15, :25, etc.) Unfortunately, after all that, I still get the same error:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22
Asked by Nick ODell (2798 rep)
Mar 22, 2022, 09:35 PM
Last activity: Aug 7, 2024, 03:23 PM