prometheus windows_exporter 无法获取windows_os_info

在Grafana上未显示主机名和系统版本信息,原因是windows_exporter遇到counternotfound错误。通过查看exporter日志,发现net、os、system和cpu等收集器均报告了该错误。为解决问题,执行了Windows性能计数器重置(lodctr/r),成功重建了性能计数器设置。
摘要由CSDN通过智能技术生成

prometheus windows_exporter 无法获取windows_os_info

现象

grafana上不显示主机名,系统版本等信息
在这里插入图片描述

排查

查看exporter的日志,debug日志包含 metrics: counter not found

time="2023-06-01T14:25:25+08:00" level=error msg="failed collecting net metrics:<nil> counter not found" source="net.go:137"
time="2023-06-01T14:25:25+08:00" level=error msg="collector net failed after 0.003287s: counter not found" source="exporter.go:207"
time="2023-06-01T14:25:25+08:00" level=error msg="failed collecting os metrics:<nil> counter not found" source="os.go:137"
time="2023-06-01T14:25:25+08:00" level=error msg="collector os failed after 0.003287s: counter not found" source="exporter.go:207"
time="2023-06-01T14:25:25+08:00" level=error msg="failed collecting system metrics:<nil> counter not found" source="system.go:73"
time="2023-06-01T14:25:25+08:00" level=error msg="collector system failed after 0.003287s: counter not found" source="exporter.go:207"
time="2023-06-01T14:25:25+08:00" level=error msg="collector cpu failed after 0.003287s: counter not found" source="exporter.go:207"
time="2023-06-01T14:25:25+08:00" level=error msg="failed collecting logical_disk metrics:<nil> counter not found" source="logical_disk.go:163"
time="2023-06-01T14:25:25+08:00" level=error msg="collector logical_disk failed after 0.003287s: counter not found" source="exporter.go:207"

解决:

重置windows性能计数器:

  • 用管理员用户打开终端
C:\Windows\system32>lodctr /r
Info: Successfully rebuilt performance counter setting from system backup store
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值