PVE安装Node-exporter监控Prometheus
一、安装
- 创建用户
1 | groupadd --system prometheus |
安装Node - exporter
1
2apt install python python-pip
pip install prometheus-pve-exporter创建配置文件
1 | vi /etc/prometheus/pve.yml |
- 编写用户配置:nodeExporter依赖PVE权限验证,查看自己默认User配置为
1 | default: |
- 设置一下权限
1 | chown -R prometheus:prometheus /etc/prometheus/ |
创建systemed
1
2
3
4
5
6
7
8
9
10
11
12
13tee /etc/systemd/system/prometheus-pve-exporter.service<<EOF
[Unit]
Description=Prometheus exporter for Proxmox VE
Documentation=https://github.com/znerol/prometheus-pve-exporter
[Service]
Restart=always
User=prometheus
ExecStart=/usr/local/bin/pve_exporter /etc/prometheus/pve.yml
[Install]
WantedBy=multi-user.target
EOF设置开机启动
1 | systemctl daemon-reload |
二、验证
三、配置Prometheus配置文件
进入自己的Prometheus主机:vim /opt/sofeware/prometheus/prometheus.yml
添加:
1 | scrape_configs: |
重启Prometheus:systemctl restart prometheus.service
四、配置Grafana
导入模板:10347 -> Proxmox via Prometheus | Grafana Labs