|
|
|
The Blackbox Exporter allows probing of web endpoints, for example: web certificate expiry, certificate validity, HTTP response. The configuration of endpoints is done in Prometheus' `scrape_config.yml`.
|
|
|
|
|
|
|
|
Basic pre-configured Blackbox modules are:
|
|
|
|
|
|
|
|
* http_2xx - Looks for a 200 HTTP response
|
|
|
|
* http_post_2xx - Looks for a 200 HTTP response using POST method
|
|
|
|
* tcp_connect - Probes by tcp
|
|
|
|
* http_ssl - HTTP probe for certificate validity
|
|
|
|
|
|
|
|
To probe an endpoint Prometheus has to have targets which to probe - the following is an example of what the Prometheus scrape config should include.\
|
|
|
|
`<your_project>/<your_environment>/prometheus/scrape_config.yml`
|
|
|
|
|
|
|
|
```
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: ssl_cert_validity
|
|
|
|
metrics_path: /probe # This should always be /probe for the blackbox exporter.
|
|
|
|
params:
|
|
|
|
module:
|
|
|
|
- http_ssl # Module as described above, in this case we're checking certificates
|
|
|
|
relabel_configs:
|
|
|
|
- source_labels:
|
|
|
|
- __address__
|
|
|
|
target_label: __param_target
|
|
|
|
- source_labels:
|
|
|
|
- __param_target
|
|
|
|
target_label: instance
|
|
|
|
- replacement: blackbox-exporter:9115
|
|
|
|
target_label: __address__
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
- https://<your_url_here>.ee # There can be multiple targets under the same job
|
|
|
|
``` |
|
|
|
\ No newline at end of file |