Prometheus Proxmox VE Exporter是一款从Proxmox VE节点收集信息并供Prometheus监控系统使用的导出器。它支持多种收集器(状态、版本、节点、集群、资源、配置等),可通过Docker便捷部署,适用于监控Proxmox VE集群的运行状态、资源使用及版本信息等。
注意:自2.0.0版本起不再支持Python 2,请使用Python 3.6或更高版本。
shellpython3 -m pip install prometheus-pve-exporter
shelldocker pull prompve/prometheus-pve-exporter
shelldocker run -it --rm prompve/prometheus-pve-exporter --help
shelldocker run --name prometheus-pve-exporter -d -p 127.0.0.1:9221:9221 -v /path/to/pve.yml:/etc/pve.yml prompve/prometheus-pve-exporter
运行后,可通过 http://localhost:9221/ 访问Prometheus PVE Exporter。
usage: pve_exporter [-h] [--collector.status] [--collector.version] [--collector.node] [--collector.cluster] [--collector.resources] [--collector.config] [config] [port] [address] 位置参数: config 配置文件路径(pve.yml) port 导出器监听端口(默认9221) address 导出器绑定地址 可选参数: -h, --help 显示帮助信息并退出 --collector.status, --no-collector.status 暴露节点/虚拟机/容器状态(默认:启用) --collector.version, --no-collector.version 暴露PVE版本信息(默认:启用) --collector.node, --no-collector.node 暴露PVE节点信息(默认:启用) --collector.cluster, --no-collector.cluster 暴露PVE集群信息(默认:启用) --collector.resources, --no-collector.resources 暴露PVE资源信息(默认:启用) --collector.config, --no-collector.config 暴露PVE开机启动状态(默认:启用)
在双栈机器上,使用::作为address参数可同时绑定IPv6和IPv4套接字。访问 http://localhost:9221/pve?target=1.2.3.4 获取指标(其中1.2.3.4为Proxmox VE节点IP)。可通过module请求参数指定配置文件中的模块。若导出器直接部署在Proxmox主机上,target参数默认为localhost,可省略。
注意:
config收集器会对每个客户机VM/容器发起一次API调用,大规模部署中建议使用--no-collector.config禁用该收集器。
yamldefault: user: prometheus@pve # PVE用户名 password: sEcr3T! # 对应密码
yamldefault: user: prometheus@pve # PVE用户名 token_name: "..." # 令牌名称 token_value: "..." # 令牌值
配置直接传递给proxmoxer.ProxmoxAPI()。若Proxmox VE使用自签名证书,需将证书导入本地信任存储(Debian/Ubuntu可参考此SE回答),或在凭据同级添加verify_ssl: false。PVE默认支持Let's Encrypt,建议优先配置可信证书。
为安全起见,需创建具有只读访问权限(PVEAuditor角色)的用户用于指标收集。
yamlscrape_configs: - job_name: 'pve' static_configs: - targets: - 192.168.1.2:9221 # 运行PVE导出器的Proxmox VE节点 - 192.168.1.3:9221 # 运行PVE导出器的Proxmox VE节点 metrics_path: /pve params: module: [default]
yamlscrape_configs: - job_name: 'pve' static_configs: - targets: - 192.168.1.2 # Proxmox VE节点IP - 192.168.1.3 # Proxmox VE节点IP 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: 127.0.0.1:9221 # PVE导出器地址
来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429