FreeBSD find CPU (processor) temperature command

last updated in Categories , , ,

I am a new FreeBSD Unix user. How do I get the temperature of an Intel or AMD processor (CPU) in FreeBSD using command line option? Is there a command line option for determining CPU temperature on FreeBSD Unix operating system?

You can read data from FreeBSD kernel using any one the following method. Freebsd check cpu temperature with the following commands:

FreeBSD find CPU (processor) temperature command

You must enable coretemp device driver for Intel based cpu for digital thermal sensor. See below how to load the driver as a module at boot time using /boot/loader.conf file on a FreeBSD to get CPU temperature. The coretemp driver reports each CPU core’s temperature through a sysctl command.

A note about AMD cpus

You need to use the amdtemp device driver for AMD processor on-die digital thermal sensor.

How to determine CPU temperature on FreeBSD

You just need to type the following command to see cpu temperature in FreeBSD operating system:
$ sysctl -a | grep temperature
OR
$ sysctl dev.cpu | grep temperature
Sample outputs:

Fig.01: FreeBSD find CPU (processor) temperature
Fig.01: Determine CPU temperature

How to load coretemp or amdtemp driver at boot time

For Intel based cpu you need to load or use coretemp driver. To load the driver as a module at boot time, append the following line in loader.conf(5):
# vi /boot/loader.conf
Append the following for Intel CPUs:
coretemp_load="YES"
Append the following if you are using AMD CPUs:
amdtemp_load="YES"
Save and close the file. To load the driver without rebooting the box, enter:
# kldload coretemp
OR for AMD CPUs:
# kldload amdtemp
Once loaded you can verify it with dmesg command
# dmesg | tail -10
Sample outputs:

igb0: link state changed to UP
arp: 192.168.2.254 moved from 20:5c:24:70:00:f8 to 00:08:a2:0a:ba:b8 on igb0
coretemp0: <CPU On-Die Thermal Sensors> on cpu0
coretemp1: <CPU On-Die Thermal Sensors> on cpu1
coretemp2: <CPU On-Die Thermal Sensors> on cpu2
coretemp3: <CPU On-Die Thermal Sensors> on cpu3
coretemp4: <CPU On-Die Thermal Sensors> on cpu4
coretemp5: <CPU On-Die Thermal Sensors> on cpu5
coretemp6: <CPU On-Die Thermal Sensors> on cpu6
coretemp7: <CPU On-Die Thermal Sensors> on cpu7

Now to determine your CPU temperature on FreeBSD, type:
# sysctl -a | grep -i temperature
Sample output from Intel Xeon E3-1285L v4 CPU:

hw.acpi.thermal.tz1.temperature: 29.9C
hw.acpi.thermal.tz0.temperature: 27.9C
dev.cpu.7.temperature: 41.0C
dev.cpu.6.temperature: 41.0C
dev.cpu.5.temperature: 40.0C
dev.cpu.4.temperature: 40.0C
dev.cpu.3.temperature: 41.0C
dev.cpu.2.temperature: 41.0C
dev.cpu.1.temperature: 40.0C
dev.cpu.0.temperature: 40.0C

A note about ipmitool

To see detailed sensor information use ipmitool (Intelligent Platform Management Interface) command as follows on your FreeBSD based server:
# ipmitool sensor
Sample outputs:

ATX+5VSB         | 5.070      | Volts      | ok    | 4.230     | 4.710     | na        | na        | 5.550     | 5.610     
+3VSB            | 3.500      | Volts      | ok    | 2.780     | 2.820     | na        | na        | 3.660     | 3.680     
Vcore            | 0.830      | Volts      | ok    | 0.540     | 0.560     | 0.600     | 1.490     | 1.560     | 1.640     
VCCM             | 1.350      | Volts      | ok    | 1.090     | 1.120     | na        | na        | 1.720     | 1.750     
+1.1             | 1.090      | Volts      | ok    | 0.850     | 0.890     | 0.940     | 1.150     | 1.210     | 1.270     
+1.0             | 1.020      | Volts      | ok    | 0.850     | 0.890     | 0.940     | 1.150     | 1.210     | 1.270     
BAT              | 3.200      | Volts      | ok    | 2.380     | 2.500     | na        | na        | 3.580     | 3.680     
+3V              | 3.300      | Volts      | ok    | 2.780     | 2.820     | na        | na        | 3.660     | 3.680     
+5V              | 5.010      | Volts      | ok    | 4.230     | 4.710     | na        | na        | 5.550     | 5.610     
+12V             | 12.200     | Volts      | ok    | 10.100    | 10.300    | na        | na        | 13.300    | 13.400    
CPU_FAN1         | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na        
REAR_FAN1        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na        
FRNT_FAN1        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na        
FRNT_FAN2        | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na        
REAR_FAN2        | 1200.000   | RPM        | ok    | na        | na        | 100.000   | na        | na        | na        
CPU_FAN2         | na         | RPM        | na    | na        | na        | 100.000   | na        | na        | na        
MB Temperature   | 55.000     | degrees C  | ok    | na        | na        | na        | 80.000    | na        | na        
CPU Temperature  | 52.000     | degrees C  | ok    | na        | na        | na        | 80.000    | 85.000    | 90.00

Conclusion

You just learned how to check cpu temperature on a FreeBSD based system. For more info see coretemp docs here/here and read the man pages by typing the following man command:
$ man 4 coretemp # <- for INTEL cpus
$ man 4 amdtemp # <- for AMD cpus
$ man 8 sysctl

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

2 comment

  1. AMD
    #kldload amdtemp
    #sysctl -a | grep temperature
    dev.cpu.1.temperature: 40.3C
    dev.cpu.0.temperature: 40.3C

    Have a question? Post it on our forum!