prometheus - windows_exporter 服务在服务器重启后断开与 prometheus 的连接
问题描述
我正面临 windows_exporter 服务和 prometheus 连接的奇怪问题。我正在使用 Prometheus grafana 来监控我们的 windows vms (Azure)。Prometheus Grafana 服务器基于 Linux (Ubuntu)。
10 个关键的 Windows 服务器被添加到 Prometheus 目标历史记录中。一些 Windows 服务器 24/7 运行,其中一些设置为在一天结束时自动关闭并在第二天重新启动。
添加到普罗米修斯服务器时的初始目标工作正常,但是一旦服务器重新启动,一些服务器就会不一致地断开与普罗米修斯服务器的连接。
Windows 虚拟机操作系统:Windows 服务器 2016 /2019
curl from prometheus server to windows target : curl: (7) Failed to connect to 52.xxx.xxx.xxx port 9182: Connection refused (注意:在windows服务器中手动重启服务会重新建立连接)
在目标机器上检查时 windows_exporter 服务状态显示正在运行并且还设置为自动延迟启动,我也得到了 http://localhost:9182/metrics的指标响应
无论我们重启多少次,所有 linux 目标都运行良好。这个问题是因为最近的 Windows 更新吗?
还有其他人面临同样的问题并且有任何可能的解决方案吗?
感谢您的时间!
Prometheus.yml 文件:
- job_name: 'Win_Server_1'
scrape_interval: 4m
static_configs:
- targets: ['xx.1xx.xx.xx:9182']
- job_name: 'Win_Server_2'
scrape_interval: 4m
static_configs:
- targets: ['xx.1xx.xx.xx:9182']
- job_name: 'Win_Server_3'
scrape_interval: 4m
static_configs:
- targets: ['xx.1xx.xx.xx:9182']
解决方案
推荐阅读
- pyspark - Pyspark 在聚合表中获取计数
- mysql - 用于添加/减去值和按月分组的 MySQL 查询
- python - 您可以从外部 python 文件附加到字典吗?
- python - 网页上的破折号输出
- c# - 打开带有附件的客户端默认邮件
- reactjs - 使用 Bootstrap 的 React 中的单选按钮总是发布相同的值
- react-native - 有没有办法在本机反应中获取专辑文件夹列表?
- flutter - 如何在颤动中创建类似 facebook 的评论结构?
- c - 自制外壳问题
- large-files - 为什么超过 400MB 的文件无法通过 Dropzone 上传?