【问题标题】:How to monitor a third party service using prometheus having blackbox exporter on a different server如何使用普罗米修斯监控第三方服务,在不同的服务器上有黑盒导出器
【发布时间】:2019-04-17 05:29:25
【问题描述】:

刚开始使用 prometheus,我认为它可以用来监控它是否可以通过 VPN 连接监控服务可用性。

所以我在盒子 A 上有了 prometheus 服务器本身。现在我需要监控端口 9000 上的 IP 172.20.40.40 是否可用。那是VPN另一边的盒子。我们将该服务服务器称为服务器 C。现在我的 IP 为 192.169.1.10 的盒子 B 能够访问盒子 C,因为它是加密域的一部分。我们在盒子 B 上安装了 blackbox 导出器,因此它可以检查盒子 C。

我相信 prometheus 会从 box B 中获取 box C 的信息。以下是我的配置

黑盒配置

modules:
  http_2xx:
    prober: http
    timeout: 5s
    http:
      valid_status_codes: []
      method: GET

普罗米修斯配置

- job_name: 'blackbox'
metrics_path: /probe
params:
  module: [http_2xx]  # Look for a HTTP 200 response.
static_configs:
  - targets:
    - https://pagertree.com
    - https://www.google.com
    - http://172.20.40.40:9000
relabel_configs:
  - source_labels: [__address__]
    target_label: __param_target
  - source_labels: [__param_target]
    target_label: instance
  - target_label: __address__
    replacement: "blackbox_exporter:9115"

我没有在 prometheus 文档中看到允许设置黑盒本身 IP 的部分。在黑盒文档上,黑盒配置看起来也不应该包含目标 IP。所以我有点困惑。难道是黑盒应该只在普罗米修斯所在的地方运行

【问题讨论】:

    标签: prometheus prometheus-blackbox-exporter


    【解决方案1】:
        replacement: "blackbox_exporter:9115"
    

    这是指定要与之通信的黑盒导出器的行,因此您可以将其更改为 192.169.1.10:9115。

    【讨论】:

      猜你喜欢
      • 2017-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-10
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      相关资源
      最近更新 更多