Proxmox 输入插件
此插件使用 Proxmox API 收集有关在 Proxmox 实例上运行的容器和虚拟机的信息。
引入版本: Telegraf v1.16.0 标签: server 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Provides metrics from Proxmox nodes (Proxmox Virtual Environment > 6.2).
[[inputs.proxmox]]
## API connection configuration. The API token was introduced in Proxmox v6.2.
## Required permissions for user and token: PVEAuditor role on /.
base_url = "https://:8006/api2/json"
api_token = "USER@REALM!TOKENID=UUID"
## Node name, defaults to OS hostname
## Unless Telegraf is on the same host as Proxmox, setting this is required.
# node_name = ""
## Additional tags of the VM stats data to add as a tag
## Supported values are "vmid" and "status"
# additional_vmstats_tags = []
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
## HTTP response timeout (default: 5s)
# response_timeout = "5s"权限
插件需要有权访问 Proxmox API。在 Proxmox 中,API 令牌是相应用户的一部分。这意味着 API 令牌无法执行用户无法执行的命令。
对于 Telegraf,必须为 API 令牌和用户提供至少 /. 上的 PVEAuditor 角色。下面是创建 telegraf 用户和令牌,然后确保用户和令牌具有正确角色的示例
## Create a influx user with PVEAuditor role
pveum user add influx@pve
pveum acl modify / -role PVEAuditor -user influx@pve
## Create a token with the PVEAuditor role
pveum user token add influx@pve monitoring -privsep 1
pveum acl modify / -role PVEAuditor -token 'influx@pve!monitoring'有关更多详细信息,请参阅此 Proxmox 文档示例。
Metrics
- proxmox
- 标签 (tags)
- node_fqdn - telegraf 运行所在节点的 FQDN
- vm_name - VM/容器的名称
- vm_fqdn - VM/容器的 FQDN
- vm_type - VM/容器的类型 (lxc, qemu)
- vm_id - VM/容器的 ID
- 字段 (fields)
- status
- uptime
- cpuload
- mem_used
- mem_total
- mem_free
- mem_used_percentage
- swap_used
- swap_total
- swap_free
- swap_used_percentage
- disk_used
- disk_total
- disk_free
- disk_used_percentage
- 标签 (tags)
示例输出
proxmox,host=pxnode,node_fqdn=pxnode.example.com,vm_fqdn=vm1.example.com,vm_id=112,vm_name=vm1,vm_type=lxc cpuload=0.147998116735236,disk_free=4461129728i,disk_total=5217320960i,disk_used=756191232i,disk_used_percentage=14,mem_free=1046827008i,mem_total=1073741824i,mem_used=26914816i,mem_used_percentage=2,status="running",swap_free=536698880i,swap_total=536870912i,swap_used=172032i,swap_used_percentage=0,uptime=1643793i 1595457277000000000此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。