Blackbox exporter

The blackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC.

Using the docker image

docker run --rm -d -p 9115:9115 --name blackbox_exporter -v `pwd`:/config prom/blackbox-exporter:master --config.file=/config/blackbox.yml
Config blackbox exporter:
modules:
  http_2xx:
    prober: http
    http:
      valid_status_codes: []
      method: GET
      preferred_ip_protocol: "ip4"
      tls_config:
        insecure_skip_verify: true

Prometheus server:

Config Prometheus server to scrape Blackbox Exporter:

- job_name: 'blackbox'
  metrics_path: /probe
  params:
    module: [http_2xx] # Look for a HTTP 200 response. 

  static_configs:
    - targets:

  # add targets to probe
      - https://monitor-dev.cuonglv2.com/login
      - https://dev.cuonglv2.com/cloud-pbx?detail=true
      - https://cuonglv2.com/
      - https://sso.cuonglv2.com/oidc/.well-known/openid-configuration
      - https://cuonglv2.com/dev?detail=true
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: 10.1.0.x:9115

Restart prometheus

systemctl restart prometheus