Do mainstream Linux distributions typically log system temperature data, e.g. CPU or HDD temperature? If so, where can those logs be found?
Does Linux typically log system temperature data?
linux;logs;hard disk;cpu;temperature
I'm not aware of a mainstream Linux distribution which logs this type of information by default. Most mainstream Linux distributions do include various packages which can log temperatures, and some of these packages are set up to log by default.Taking Debian as an example, sensord will periodically log all the information it knows about (system temperatures, voltages etc.) to the system log, but it needs to be configured manually before it can log anything useful; hddtemp can be set up to periodically log hard drive temperatures. Many other tools can retrieve this type of information (using IPMI, SNMP, etc.) but again in most cases they need to be configured, either to be able to access the information in the first place, or to be able to interpret it, or both.This configuration requirement means that it would be difficult to set up a generic distribution which logs temperatures by default in a meaningful way. (Most of the systems I've seen have at least one, invalid, monitoring entry which would set off alarms if it was auto-configured!) Of course it's entirely possible to set up an installer image for your own systems since you know what they are and how they're configured... Once you've configured the various tools required to extract temperature information, you'd be better off using a proper monitoring tool (such as Munin) to log the temperatures instead of relying on the system logs. That way you can also set up alerts to be notified when things start going wrong.Expanding on the sensord example, you can find its output in the system log, with sensord as the process name; so either look for sensord in /var/log/syslog (by default), or run journalctl -u sensord. You'll see periodic logs like the following (I've removed the date and hostname):sensord[2489]: Chip: acpitz-virtual-0sensord[2489]: Adapter: Virtual devicesensord[2489]:   temp1: 27.8 Csensord[2489]:   temp2: 29.8 Csensord[2489]: Chip: coretemp-isa-0000sensord[2489]: Adapter: ISA adaptersensord[2489]:   Physical id 0: 33.0 Csensord[2489]:   Core 0: 29.0 Csensord[2489]:   Core 1: 30.0 Csensord[2489]:   Core 2: 26.0 Csensord[2489]:   Core 3: 29.0 Csensord[2489]: Chip: nct6776-isa-0a30sensord[2489]: Adapter: ISA adaptersensord[2489]:   in0: +1.80 V (min = +1.60 V, max = +2.00 V)sensord[2489]:   in1: +1.86 V (min = +1.55 V, max = +2.02 V)sensord[2489]:   in2: +3.41 V (min = +2.90 V, max = +3.66 V)sensord[2489]:   in3: +3.39 V (min = +2.83 V, max = +3.66 V)sensord[2489]:   in4: +1.50 V (min = +1.12 V, max = +1.72 V)sensord[2489]:   in5: +1.26 V (min = +1.07 V, max = +1.39 V)sensord[2489]:   in6: +1.04 V (min = +0.80 V, max = +1.20 V)sensord[2489]:   in7: +3.31 V (min = +2.90 V, max = +3.66 V)sensord[2489]:   in8: +3.22 V (min = +2.50 V, max = +3.60 V)sensord[2489]:   fan1: 1251 RPM (min = 200 RPM)sensord[2489]:   fan2: 0 RPM (min = 0 RPM)sensord[2489]:   fan3: 299 RPM (min = 200 RPM)sensord[2489]:   fan4: 1315 RPM (min = 0 RPM)sensord[2489]:   fan5: 628 RPM (min = 200 RPM)sensord[2489]:   SYSTIN: 32.0 C (limit = 80.0 C, hysteresis = 70.0 C)sensord[2489]:   CPUTIN: 33.0 C (limit = 85.0 C, hysteresis = 80.0 C)sensord[2489]:   AUXTIN: 24.0 C (limit = 80.0 C, hysteresis = 75.0 C)sensord[2489]:   PECI Agent 0: 31.0 C (limit = 95.0 C, hysteresis = 92.0 C)sensord[2489]:   PCH_CHIP_CPU_MAX_TEMP: 57.0 C (limit = 95.0 C, hysteresis = 90.0 C)sensord[2489]:   PCH_CHIP_TEMP: 0.0 Csensord[2489]:   PCH_CPU_TEMP: 0.0 Csensord[2489]:   beep_enable: Sound alarm enabledsensord[2489]: Chip: jc42-i2c-9-18sensord[2489]: Adapter: SMBus I801 adapter at 0580sensord[2489]:   temp1: 32.8 C (min = 0.0 C, max = 60.0 C)sensord[2489]: Chip: jc42-i2c-9-19sensord[2489]: Adapter: SMBus I801 adapter at 0580sensord[2489]:   temp1: 33.5 C (min = 0.0 C, max = 60.0 C)sensord[2489]: Chip: jc42-i2c-9-1asensord[2489]: Adapter: SMBus I801 adapter at 0580sensord[2489]:   temp1: 34.0 C (min = 0.0 C, max = 60.0 C)sensord[2489]: Chip: jc42-i2c-9-1bsensord[2489]: Adapter: SMBus I801 adapter at 0580sensord[2489]:   temp1: 33.2 C (min = 0.0 C, max = 60.0 C)To get this I had to determine which modules were needed (using sensors-detect): by default the system only knew about the ACPI-reported temperatures, which don't actually correspond to anything (they never vary). coretemp gives the CPU core temperatures on Intel processors, nct6776 is the motherboard's hardware monitor, and jc42 is the temperature monitor on the DIMMs. To make it useful for automated monitoring, I should at least disable the ACPI values and re-label the fans, and correct fan4's minimum value. There are many other configuration possibilities, lm_sensors' example configuration file gives some idea.