【问题标题】:Prometheus blackbox_exporter didn't skip SSL checkingPrometheus blackbox_exporter 没有跳过 SSL 检查
【发布时间】:2021-01-19 14:54:24
【问题描述】:

我在配置中启用了 insecure_skip_verify 参数,但 blackbox_exporter 仍然无法通过 SSL 检查。

modules:
  http_2xx:
    prober: http
    timeout: 5s
    http:
      valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
      method: GET
      preferred_ip_protocol: "ip4"
      ip_protocol_fallback: false
      no_follow_redirects: false
      fail_if_ssl: false
      fail_if_not_ssl: false
      tls_config:
        insecure_skip_verify: true

root@monitor-1:~# curl "http://localhost:9115/probe?target=https://www.263.com&module=http_2xx&debug=true"
Logs for the probe:
ts=2021-01-19T13:26:02.336532681Z caller=main.go:304 module=http_2xx target=https://www.263.com level=info msg="Beginning probe" probe=http timeout_seconds=119.5
ts=2021-01-19T13:26:02.33679155Z caller=http.go:342 module=http_2xx target=https://www.263.com level=info msg="Resolving target address" ip_protocol=ip6
ts=2021-01-19T13:26:02.341423219Z caller=http.go:342 module=http_2xx target=https://www.263.com level=info msg="Resolved target address" ip=211.150.65.26
ts=2021-01-19T13:26:02.341519047Z caller=client.go:252 module=http_2xx target=https://www.263.com level=info msg="Making HTTP request" url=https://211.150.65.26 host=www.263.com
ts=2021-01-19T13:26:02.354176072Z caller=main.go:119 module=http_2xx target=https://www.263.com level=error msg="Error for HTTP request" err="Get \"https://211.150.65.26\": x509: certificate is valid for *.263.net, 263.net, not www.263.com"
ts=2021-01-19T13:26:02.354254679Z caller=main.go:119 module=http_2xx target=https://www.263.com level=info msg="Response timings for roundtrip" roundtrip=0 start=2021-01-19T13:26:02.34163085Z dnsDone=2021-01-19T13:26:02.34163085Z connectDone=2021-01-19T13:26:02.345415737Z gotConn=0001-01-01T00:00:00Z responseStart=0001-01-01T00:00:00Z end=0001-01-01T00:00:00Z
ts=2021-01-19T13:26:02.354307734Z caller=main.go:304 module=http_2xx target=https://www.263.com level=error msg="Probe failed" duration_seconds=0.017698452

【问题讨论】:

    标签: prometheus prometheus-blackbox-exporter


    【解决方案1】:

    我认为你应该将目标中的 HTTPS 替换为 HTTP:

    curl "http://localhost:9115/probe?target=http://www.263.com&module=http_2xx&debug=true"
    

    【讨论】:

    • 我想检查一下 https 服务是否还活着。
    • 所以,你需要设置“fail_if_not_ssl: true”,但是我认为你不能通过错误的证书通过HTTPS连接,可以吗?
    • insecure_skip_verify: true 这是否应该跳过证书检查?
    • 我找到了根本原因,黑盒的配置不知什么原因没有生效。我将更改它并重试。
    猜你喜欢
    • 2011-03-23
    • 2021-03-26
    • 1970-01-01
    • 2012-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多