I run a small homelab: a single-node Kubernetes cluster (MicroK8s) inside a VM on Proxmox, with Prometheus, Loki and Grafana for observability. node-exporter runs as a DaemonSet and gives me CPU, memory, disk and network metrics for the node. One day I went to build a temperature panel in Grafana and found... nothing.
This post explains why, and the simple fix.
The symptom
node-exporter has two collectors for temperatures, both enabled by default:
- hwmon: reads
/sys/class/hwmon/*and exportsnode_hwmon_temp_celsius. This is where CPU sensors likecoretemp(Intel) ork10temp(AMD) show up. - thermal_zone: reads
/sys/class/thermal/*and exportsnode_thermal_zone_temp.
Querying the exporter from inside the VM gave me either nothing or a meaningless ACPI zone:
curl -s http://<vm-ip>:9100/metrics | grep -E 'node_hwmon_temp|node_thermal_zone'
Why it happens
A virtual machine doesn't see the physical hardware sensors. The hypervisor gives the guest a virtual CPU, and there is no coretemp or k10temp chip inside it. node-exporter is working correctly; there is simply nothing to read.
My next idea was to get the temperature from Proxmox. It turns out the Proxmox API (and therefore pve-exporter) reports CPU usage per node and per guest, but not temperature. Proxmox doesn't collect hardware sensor data at all.
So the temperature can only come from one place: the Proxmox host itself.
The fix: node-exporter on the Proxmox host
Proxmox is Debian underneath, so this is a few commands:
apt install lm-sensors prometheus-node-exporter
sensors-detect --auto # loads coretemp (Intel) or k10temp (AMD)
sensors # you should now see Package/Core or Tctl temperatures
The Debian package installs node-exporter as a systemd service listening on port 9100. Check that the temperatures are exported:
curl -s localhost:9100/metrics | grep node_hwmon_temp_celsius
Is it OK to install things on the hypervisor?
I hesitated here, because the usual advice is to keep the hypervisor lean. But that advice is aimed at heavy agents and running Docker on the host. node-exporter is a single static binary that only reads from /proc and /sys, and it's the standard way to monitor a Proxmox host. A few details make it a clean install:
- Use the Debian package, not a binary downloaded by hand. It's an older version, but it gets security updates through
aptlike the rest of the system. - Run it on bare metal, not in an LXC container or VM. Otherwise you're back to the original problem: no sensors.
- Restrict access to port 9100. node-exporter has no authentication and exposes details like mounts, network interfaces and kernel version. See the next section.
Locking down port 9100
You have two options, and you can combine them.
Option 1: Proxmox firewall. Under Datacenter → (your node) → Firewall, add a rule that accepts TCP 9100 only from your Prometheus server, then drop it for everyone else.
Be careful if the Proxmox firewall isn't enabled yet. Turning it on at the datacenter level with a DROP input policy can lock you out of the web UI and SSH. Check your rules for ports 8006 and 22 before enabling it.
If Prometheus runs inside Kubernetes (as mine does), the traffic usually leaves the cluster with the node's IP, not the pod's, because of SNAT. Check the firewall log after the first scrape to confirm which source IP to allow.
Option 2: bind to the management interface only. Edit /etc/default/prometheus-node-exporter:
ARGS="--web.listen-address=<management-ip>:9100"
Then restart the service:
systemctl restart prometheus-node-exporter
Scraping the host from Prometheus
My Prometheus discovers targets through Kubernetes, so it doesn't know about the Proxmox host. Add a static job to prometheus.yml:
scrape_configs:
- job_name: proxmox-host
static_configs:
- targets: ["<proxmox-host-ip>:9100"]
labels:
instance: proxmox
Reload Prometheus and check that the target is UP on the Status → Targets page.
The Grafana panel
node-exporter also exports a node_hwmon_sensor_label metric with the human-readable name of each sensor (such as "Package id 0" or "Core 0"). Joining the two gives readable legends:
node_hwmon_temp_celsius{instance="proxmox"}
* on (chip, sensor) group_left(label)
node_hwmon_sensor_label{instance="proxmox"}
Use {{label}} as the legend and set the unit to Celsius. To show just one number (for example in a stat panel), filter for the package sensor: label="Package id 0" on Intel, or label="Tctl" on AMD.
Bonus: Google Coral temperature
If you use a Google Coral TPU (for example with Frigate), note that it doesn't show up in node-exporter either:
- The PCIe/M.2 Coral driver (
gasket/apex) exposes temperature in/sys/class/apex/apex_0/temp(in millidegrees). That isn't a hwmon device, so node-exporter ignores it. - The USB Coral has no temperature sensor at all.
For the PCIe version, the textfile collector works well. A small cron job writes a metric file:
#!/bin/sh
# /usr/local/bin/coral-temp.sh, run every minute from cron
DIR=/var/lib/prometheus/node-exporter
T=$(cat /sys/class/apex/apex_0/temp)
echo "coral_temp_celsius $(awk "BEGIN{print $T/1000}")" > "$DIR/coral.prom.$$"
mv "$DIR/coral.prom.$$" "$DIR/coral.prom"
The Debian package already reads .prom files from /var/lib/prometheus/node-exporter. Writing to a temporary file and then renaming it prevents node-exporter from reading a half-written file. Run this wherever the Coral is visible: on the host, or inside the VM if you passed the device through.
If you run Frigate, its /api/stats endpoint also reports the Coral temperature, so a Frigate exporter is another option.
Summary
- VMs can't see hardware temperature sensors, so node-exporter inside a VM shows no CPU temperature.
- The Proxmox API doesn't expose temperatures either.
- Install
lm-sensorsandprometheus-node-exporteron the Proxmox host, restrict port 9100, and add a static scrape job. - Coral temperature needs the textfile collector (or Frigate's stats).
Ten minutes of work, and now I have a temperature panel that actually shows something.