Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

Virtual Server or Dedicated Server?

A virtual server normally exposes no hardware sensors. The CPU you see is a virtual one provided by the hypervisor, and the real temperatures belong to the host, which only the provider can read. On a VPS, the commands below usually report that no sensors were found, and that is expected. They apply to dedicated (bare-metal) servers and other physical machines. How virtualization separates guests from the hardware is explained in what is KVM virtualization.

Install lm-sensors

sudo apt install lm-sensors     # Debian and Ubuntu
sudo dnf install lm_sensors     # AlmaLinux and Rocky Linux

Note the different package names: a hyphen on Debian and Ubuntu, an underscore on AlmaLinux and Rocky Linux.

Detect the Sensors If Needed

sudo sensors-detect

The script probes the hardware and asks a series of questions. Pressing Enter accepts the suggested answer, which is the safe choice. sudo sensors-detect --auto accepts all suggested answers without asking. Its manual warns that some probes can upset certain chips and advises against running it on production servers, so try sensors first: if a coretemp or k10temp block already appears, skip this step.

Read the Temperatures

sensors

Output is grouped by chip. On Intel processors, look for the coretemp block with a package line and one line per core. On AMD processors, the k10temp block shows Tctl, a control value for fan control that does not have to match the real temperature, and on many models Tccd lines with the measured temperature of each chip die. Many lines also show the high and critical limits the hardware reports, which are the figures to compare against.

To follow the values while the server is under load:

watch -n 2 sensors

Read the Kernel Files Directly

Without installing anything, the kernel publishes thermal zones under /sys/class/thermal. Values are in thousandths of a degree Celsius:

cat /sys/class/thermal/thermal_zone*/type
cat /sys/class/thermal/thermal_zone*/temp

A value of 45000 means 45 degrees. This short loop prints both side by side:

for z in /sys/class/thermal/thermal_zone*; do
  echo "$(cat "$z/type"): $(( $(cat "$z/temp") / 1000 )) C"
done

Many servers have no thermal zones and publish their sensors under /sys/class/hwmon instead, which is what lm-sensors reads.

Use IPMI on a Dedicated Server

Server hardware has a management controller (BMC) with its own sensors for CPU, inlet air, memory, and fans. Read them with ipmitool:

sudo apt install ipmitool     # Debian and Ubuntu
sudo dnf install ipmitool     # AlmaLinux and Rocky Linux
sudo modprobe ipmi_devintf
sudo ipmitool sdr type Temperature
sudo ipmitool sdr type Fan

ipmitool talks to the controller through the kernel modules ipmi_msghandler, ipmi_si, and ipmi_devintf. If it cannot open the device, also load ipmi_si with modprobe. The sdr output lists each sensor with its reading and status. Inlet temperature tells you about the room; CPU temperature tells you about the load and the cooler.

What to Do About High Temperatures

  1. Check the load. A CPU at full use runs hot; find the cause with atop or ps and top.
  2. Check the fans with ipmitool sdr type Fan. A fan at zero or flagged as failed needs a hardware check.
  3. Compare the inlet temperature with earlier readings. A high inlet value points at cooling in the room, not at the server.
  4. If the hardware is at a data center, open a ticket with your hosting provider and include the sensor output.

Monitoring Instead of Spot Checks

A reading once in a while shows little. Monitoring tools such as Prometheus with node_exporter, or Zabbix, collect the same hwmon and IPMI values over time and can alert on a threshold. On a VPS, watch CPU use and steal time instead, since temperature is the provider's side. When those questions matter for your workload, VPS vs dedicated server compares the two.

Was this answer helpful?
Loading...