1

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 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

1 Answer 1

1

I managed to get this working, through three steps:

  1. Do all of the setup in the question above.

  2. Remove the sysstat log file for the day.

    root@host:~# sar -m TEMP
    Requested activities not available in file /var/log/sysstat/sa30
    root@host:~# rm /var/log/sysstat/sa30
    
  3. Run the script /usr/lib/sysstat/debian-sa1 1 1 (may be different on non Debian/Ubuntu systems)

After this, running sar -m TEMP works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .