# Plotting Your CPU Temperature in Real Time

On Linux systems, the sensors command shows information about your system's temperature:

\$ sensors
coretemp-isa-0000
Package id 0:  +64.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:        +58.0°C  (high = +80.0°C, crit = +100.0°C)
Core 1:        +63.0°C  (high = +80.0°C, crit = +100.0°C)
Core 2:        +64.0°C  (high = +80.0°C, crit = +100.0°C)
Core 3:        +58.0°C  (high = +80.0°C, crit = +100.0°C)

acpitz-virtual-0
temp1:        +27.8°C  (crit = +105.0°C)
temp2:        +29.8°C  (crit = +105.0°C)

nouveau-pci-0100
GPU core:     +0.90 V  (min =  +0.85 V, max =  +1.00 V)
temp1:        +42.0°C  (high = +95.0°C, hyst =  +3.0°C)
(crit = +105.0°C, hyst =  +5.0°C)
(emerg = +135.0°C, hyst =  +5.0°C)

asus-isa-0000
cpu_fan:        0 RPM


Are there well-known Mathematica paclets or techniques that one can use to track system temperature in real-time (especially CPU/core temperatures)?

• Mathematica does not provide this functionality built in. You'd likely have to hook up to some third party tool. – ktm Mar 31 at 20:02

Install the sensors command by using sudo apt-get install lm-sensors

Given the output on my system, a little string manipulation gives the temperature of each of the six cores.

temp[]:=
Block[{s,p},
s=RunProcess["sensors","StandardOutput"];
p=Drop[StringPosition[s,":"],2][[All,1]];
Map[ToExpression[StringTake[s,{#+11,#+14}]]&,p]
]


Now run within Dynamic

Dynamic[
ListLinePlot[temp[],
InterpolationOrder->0,Filling->Axis,
PlotRange->{{1,6},{15,30}},
Frame->True,FrameLabel->{"Core Number","Temperature  C"}]
]


• Your answer is great. I want to know how to get CPU temperature information under the Windows system. – Montevideo Apr 1 at 0:02