FreeBSD find CPU (processor) temperature command

Posted on in Categories , , , last updated February 24, 2017

I‘m 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 determine CPU temperature on FreeBSD Unix operating system?
temperature in FreeBSD

You can read data from FreeBSD kernel using any one the following method.

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: Determine CPU temperature
Fig.01: Determine CPU temperature

(optional) Load coretemp 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:
coretemp_load="YES"
Save and close the file. To load the driver without rebooting the box, enter:
# kldload coretemp
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

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

2 comment

Leave a Comment