找回密码
 立即注册
首页 业界区 安全 prometheus监控windows window_exporter代理安装和配置 ...

prometheus监控windows window_exporter代理安装和配置

坪钗 4 天前
1,代理客户端安装和配置

下载地址:https://github.com/prometheus-community/windows_exporter/releases
1.1 这里需要下载msi安装包,
exe文件需要手动执行,且不会自动启动,直接下载一个msi安装包安装,会自动生成服务以及自动启动。
1.2 根据prometheus版本来决定下载window_exporter的版本,最新版本的exporter并不一定适配你的prometheus服务端,最好是跟prometheus发布时间差不多的exporter,否则可能会出现各种异常问题。
笔者是一个prometheus-2.47.0的prometheus,下载了最新版的window_exporter-0.31.3,安装后在grafana面板上,收集不到一些服务器的信息,最后退回到windows_exporter-0.29.0才恢复正常。
1.png

windows_exporter安装后生成的服务。
2.png

windows_exporter安装后生成的http服务,http://192.168.1.4:9182/metrics 也即暴露给prometheus服务端的接口
3.png

 
2,服务端配置

2.1 修改prometheus的配置文件,在windows_performance_monitor这个标签页中增加上述服务IP地址和端口号,如果没有可以直接配置。
  1.   - job_name: 'windows_performance_monitor'
  2.     static_configs:
  3.       - targets: ['192.168.1.1:9182','192.168.1.2:9182','192.168.1.3:9182','192.168.1.4:9182']
  4.         labels:
  5.           install: 'qa_performance_test_server'
复制代码
2.2 重启prometheus服务
进入prometheus的后台管理页面 http://192.168.*.*:9090/targets?search=,在windows_performance_monitor标签页下面可以发现新增的服务器配置,这个endpoint地址http://192.168.1.4:9182/metrics实际上就是上述客户端暴露给服务端的数据采集入口
4.png

2.3 回到grafana的监控面板,会发现已经将目标服务器载入监控列表。
5.png
6.png


来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

相关推荐

您需要登录后才可以回帖 登录 | 立即注册