Skip to content

PVE Exporter on Proxmox VE Node in a venv

znerol edited this page Jun 30, 2024 · 3 revisions

Install PVE Exporter

Make sure venv is installed (i.e. apt install python3-venv), then prepare a new env for the PVE Exporter:

python3 -m venv /opt/prometheus-pve-exporter

Install PVE Exporter into the new env:

/opt/prometheus-pve-exporter/bin/pip install prometheus-pve-exporter

Note: During the installation of pyyaml pip might complain that the C bindings cannot be compiled. This is not a problem as long as it finally emits the following line: Successfully installed prometheus-pve-exporter requests prometheus-client pyyaml proxmoxer certifi idna chardet urllib3

Check whether pve_exporter is executable:

/opt/prometheus-pve-exporter/bin/pve_exporter --help

Configure

The configuration file uses YAML syntax. Be sure to provide the proper account and password.

mkdir -p /etc/prometheus
cat <<EOF > /etc/prometheus/pve.yml
default:
    user: prometheus@pve
    password: sEcr3T!
    verify_ssl: false
EOF

Start on boot-up

Add a systemd unit for the PVE Exporter:

cat <<EOF> /etc/systemd/system/prometheus-pve-exporter.service
[Unit]
Description=Prometheus exporter for Proxmox VE
Documentation=https://github.com/znerol/prometheus-pve-exporter

[Service]
Restart=always
User=prometheus
ExecStart=/opt/prometheus-pve-exporter/bin/pve_exporter --config.file /etc/prometheus/pve.yml

[Install]
WantedBy=multi-user.target
EOF

Then reload systemd and start the unit:

systemctl daemon-reload
systemctl start prometheus-pve-exporter
Clone this wiki locally