Skip to content

Host Setup

VM monitoring configuration

This document describes how to expose metrics from VMs for Prometheus scraping: node_exporter (system metrics), prometheus-podman-exporter (Podman containers), and collectd's Prometheus output (OpenMediaVault).

Prerequisites

  • A working Prometheus server that can reach the VMs.
  • Root or sudo access on each VM.

Node Exporter (systemd, RHEL/Fedora examples)

  1. Install the package:
dnf install node-exporter
  1. Check the service status:
systemctl status prometheus-node-exporter
  1. Create or update a systemd override file to set exporter options. Create /etc/systemd/system/prometheus-node-exporter.service.d/override.conf with the following contents:

Tip

Edit systemd file with this command:

systemctl edit prometheus-node-exporter
[Service]
ExecStart=
ExecStart=/usr/bin/node_exporter \
  --web.listen-address=0.0.0.0:9100 \
  --collector.systemd \
  --collector.systemd.unit-include=".*" \
  --collector.processes \
  --no-collector.xfs \
  --collector.filesystem.mount-points-exclude="^/(sys|proc|dev|run|var/lib/docker|var/lib/containers|var/lib/kubelet)(/|$)" \
  --collector.filesystem.fs-types-exclude="^(autofs|binfmt_misc|cgroup|cgroup2|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tmpfs|tracefs)$"

Notes: - --no-collector.xfs avoids XFS-related issues in some environments. - Filesystem excludes reduce noisy metrics from pseudo and container mounts.

  1. Reload systemd and restart the service:
systemctl daemon-reload
systemctl enable --now prometheus-node-exporter
systemctl status prometheus-node-exporter
  1. Verify metrics are exposed:
curl http://localhost:9100/metrics | head

OpenMediaVault (collectd → Prometheus)

OpenMediaVault uses collectd. The write_prometheus plugin exposes metrics over HTTP for Prometheus.

  1. Install the required library:
apt update && apt install libmicrohttpd12
  1. Create /etc/collectd/collectd.conf.d/prometheus.conf with:
LoadPlugin write_prometheus

<Plugin "write_prometheus">
  Port "9103"
</Plugin>
  1. Restart and verify collectd:
systemctl restart collectd
systemctl status collectd
curl http://localhost:9103
  1. If errors occur, check logs:
journalctl -u collectd

Prometheus configuration examples

Add jobs to Prometheus scrape_configs to collect from the targets:

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'node_exporter'
    static_configs:
      - targets: ['vm1.example.com:9100', 'vm2.example.com:9100']

  - job_name: 'podman_exporter'
    static_configs:
      - targets: ['podman-host.example.com:12666']

  - job_name: 'collectd'
    static_configs:
      - targets: ['omv-host.example.com:9103']

Reload or restart Prometheus after updating the configuration.

Testing and verification

  • Confirm service units are running on each host (systemctl status).
  • Use curl from the host and from the Prometheus server to confirm endpoints return metrics.
  • Check Prometheus web UI → Status → Targets to ensure targets are UP.

Notes and recommendations

  • Tune collector options to reduce noisy or high-cardinality metrics.
  • Use hostnames or private IPs appropriate for your environment in Prometheus targets.