Here is my experience installing Exporter on Proxmox and visualizing it on Grafana.
python3 -m pip install prometheus-pve-exporter
useradd --no-create-home --shell /bin/false pve_exporter
- Go to proxmox dashboard -> Datacenter -> Unchecklist Permissions -> Api Token -> Add -> User: root@pam -> Token ID: exporter (please save) -> Add -> Save Secret Token.
mkdir /etc/pve_exporter
cat<<EOF > /etc/pve_exporter/config.yaml
default:
user: root@pam
token_name: exporter #Token ID in First step
token_value: 0e976bd7-ac9a-4d5d-8715-632bb44da1b0 #Secret Token in First step
verify_ssl: false
EOF
cat<<EOF > /etc/default/pve_exporter
CONFIG_FILE=/etc/pve_exporter/config.yaml
LISTEN_ADDR=172.20.1.30 #Your IP of PVE Exporters
LISTEN_PORT=9221
EOF
cat<<EOF > /etc/systemd/system/pve_exporter.service
[Unit]
Description=PVE Expoter
Wants=network-online.target
After=network-online.target
[Service]
User=pve_exporter
Group=pve_exporter
Type=simple
EnvironmentFile=/etc/default/pve_exporter
ExecStart=pve_exporter \$CONFIG_FILE \$LISTEN_PORT \$LISTEN_ADDR
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now pve_exporter
- You can access on
http://172.20.1.30:9221/pve?target=172.20.1.30
- job_name: 'pve'
static_configs:
- targets:
- 172.20.1.30
metrics_path: /pve
params:
module: [default]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 172.20.1.30:9221
We can use template of Grafana Dashboard https://grafana.com/grafana/dashboards/10347-proxmox-via-prometheus/