prometheus blackbox_exporter 黑盒监控

prometheus blackbox_exporter 黑盒监控

运行容器

docker run --rm -d -p 9115:9115   --name blackbox_exporter  prom/blackbox-exporter:master

进行访问 gaoxin.kubeasy.com 域名进行测试

curl -s "http://10.103.3.40:9115/probe?target=gaoxin.kubeasy.com&module=http_2xx" | tail -1

prometheus 添加配置

  - job_name: 'blackbox'
    metrics_path: /probe
    params:
      module: [http_2xx] # Look for a HTTP 200 response.
    static_configs:
      - targets:
        - http://www.baidu.com/ # Target to probe with http.
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.103.3.40:9115  

grafana模板 13659

参考文档:https://github.com/prometheus/blackbox_exporter

posted @ 2022-06-20 20:14  鸣昊  阅读(149)  评论(1编辑  收藏  举报