Node-Exporter
Installation
- available in Debain as .deb
- Install smartmontools without recommnded packages, otherwise it will install
the
mailutils(default) orbsd-mailxpackage.
sudo apt install --no-install-recommends smartmontools
sudo apt install prometheus-node-exporter
Textfile collector
cat /usr/share/doc/prometheus-node-exporter-collectors/README.textfile
Default path set by node-exporter installed as debian package: /var/lib/prometheus/node-exporter
Push to prometheus
When the node is behind a NAT/firewall metrics can get pushed.
A custom, ansible managed systemd service push-prometheus-metrics.service is triggered by
push-prometheus-metrics.timer on a regular basis and pushes all node-exporter
metrics to the custom Pushgateway instance
using /usr/local/bin/push-prometheus-metrics.
Community collector scripts
- node-exporter-textfile-collector-scripts
- checked out in
~/project/monitoring/prometheus/exporters/node-exporter-textfile-collector-scripts
Issues
apt_upgrades_pending metric doesn't update to 0 anymore
- Prometheus node-exporter
apt_upgrades_pendingmetric doesn't update to0anymore- The fix it merged:
Always write value for apt_upgrades_pending and apt_upgrades_held
and packaged in version
0.0~git20260402.7b3b207-1, but the Trixie Debian package is behind - Debian bug report
- The fix it merged:
Always write value for apt_upgrades_pending and apt_upgrades_held
and packaged in version
- Workarounds:
scp /home/varac/projects/monitoring/prometheus/exporters/node-exporter-textfile-collector-scripts/apt_info.py \
root@jump:/usr/share/prometheus-node-exporter-collectors/
or manually downgrade to the Bookworm package and pin it
Missing temp metrics on raspberry
Node exporter apparently doesn't track this metric and this was super easy to do by myself.
Metrics
CPU count
https://github.com/prometheus/node_exporter/blob/master/example-rules.yml#L4:
count(node_cpu{mode="idle"}) without (cpu,mode)