【问题标题】:How to check specific tcp port availibility with blackbox_exporter?如何使用 blackbox_exporter 检查特定的 tcp 端口可用性?
【发布时间】:2019-04-12 05:39:22
【问题描述】:

我想检查 Oracle 数据库服务器上 tcp 端口 1521 的可用性。

但probe_success 显示0,尽管端口可用。 目标不正确?

我的配置普罗米修斯。

  - job_name: 'blackbox'
    metrics_path: /probe
    params:
      module: ['http_2xx', 'tcp_connect']  # Look for a HTTP 200 response.
    static_configs:
      - targets:
        - 172.27.1.8:1521 # Target to probe with http on port 1521.
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 172.27.1.54:9115  

blackbox.yml

modules:
  http_2xx:
    prober: http
  http_post_2xx:
    prober: http
    http:
      method: POST
  tcp_connect:
    prober: tcp
  pop3s_banner:
    prober: tcp
    tcp:
      query_response:
      - expect: "^+OK"
      tls: true
      tls_config:
        insecure_skip_verify: false
  ssh_banner:
    prober: tcp
    tcp:
      query_response:
      - expect: "^SSH-2.0-"
  irc_banner:
    prober: tcp
    tcp:
      query_response:
      - send: "NICK prober"
      - send: "USER prober prober prober :prober"
      - expect: "PING :([^ ]+)"
        send: "PONG ${1}"
      - expect: "^:[^ ]+ 001"
  icmp:
    prober: icmp

【问题讨论】:

    标签: prometheus prometheus-blackbox-exporter


    【解决方案1】:
     module: ['http_2xx', 'tcp_connect']  # Look for a HTTP 200 response.
    

    模块URL参数只带一个参数,所以你要:

      module: ['tcp_connect']
    

    【讨论】:

      猜你喜欢
      • 2017-03-13
      • 1970-01-01
      • 2011-01-10
      • 1970-01-01
      • 2016-03-15
      • 1970-01-01
      • 2011-12-21
      • 2012-04-10
      • 2013-01-23
      相关资源
      最近更新 更多