prometheus-pve-exporter 安装指南
0x00
记录一次安装pve-exporter并且配置prometheus-operator的serviceMonitor。
prometheus-pve-exporter的作用是收集proxmox VE宿主机的状态并且提供一个接口供prometheus监控系统使用。
0x01 exporter安装
安装过程(python安装)
进入proxmox VE后台,进入节点的web shell
安装pip3
1
apt install python3-pip
安装prometheus-pve-exporter
1
pip3 install prometheus-pve-exporter
编写配置文件
1
2mkdir /etc/prometheus-pve-exporter
nano /etc/prometheus-pve-exporter/pve.yml写入以下内容
1
2
3default:
user: your-username
password: your-password编写启动脚本
1
nano /etc/init.d/prometheus-pve-exporter
写入以下内容
1
2
3
pve_exporter /etc/prometheus-pve-exporter/pve.yml 9221 0.0.0.0
exit 0测试并且重启
1
2sh /etc/init.d/prometheus-pve-exporter &
curl http://localhost:9221/如果获取到返回值说明启动成功。
0x02 prometheus配置
prometheus需要发现这个exporter。要让prometheus自动发现服务,需要添加一个ServiceMonitor,prometheus可以自动获取到ServiceMonitor,相当于添加了一个中转站。
创建文件pve-monitor.yaml
1 | apiVersion: v1 |
应用
1 | kaf pve-monitor.yaml |
prometheus-pve-exporter 安装指南
https://blog.timzhong.top/2020/12/09/prometheus-pve-exporter-install-guide/