【问题标题】:Is it possible to give 2 targets for ssh monitoring in single prometheus job?是否可以在单个 prometheus 作业中为 ssh 监控提供 2 个目标?
【发布时间】:2018-03-12 12:00:44
【问题描述】:

我的情况是,在 blackbox.yml 中,我有 ssh_banner 模块,它可以像下面那样检查 ssh。

ssh_banner:
 prober: tcp
    tcp:
      query_response:
      - expect: "^SSH-2.0-"

下面是相关的prometheus.yml:

 - job_name: 'ssh_test'
    scrape_interval: 20s
    metrics_path: /probe
    params:
      module: ["ssh_banner"]
      target: [ "node1:22", "node2:22"]
    static_configs:
     - targets:
        - 'blackbox:9115'

我可以看到它只对 node1 而不是 node2 进行 ssh 测试。有什么办法可以放在一个地方。我知道创建一个单独的工作可以解决这个问题。但是服务器的数量可以很多。所以为每个节点创建一个单独的作业看起来不是个好主意。

【问题讨论】:

    标签: monitoring prometheus


    【解决方案1】:

    您需要follow the documentation 并为所有这些添加重新标记规则才能正常工作。这个确切的用例也有一个guide

    【讨论】:

    • 谢谢布赖恩...它正在工作。我以前读过这个页面。但忽略重新标记部分:) :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-08
    • 1970-01-01
    • 1970-01-01
    • 2016-11-15
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    相关资源
    最近更新 更多