Difference between revisions of "Blackbox exporter"
Jump to navigation
Jump to search
m (Busk moved page Prometheus blackbox exporter to Blackbox exporter without leaving a redirect ) |
|||
| (9 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | # Example | ||
| + | https://github.com/prometheus/blackbox_exporter/blob/master/example.yml | ||
| + | |||
| + | # Multiple | ||
| + | - https://stackoverflow.com/questions/52952805/register-multiple-blackbox-exporters-in-one-job-in-prometheus | ||
| + | ``` | ||
| + | scrape_configs: | ||
| + | - job_name: probe | ||
| + | params: | ||
| + | module: | ||
| + | - http_2xx | ||
| + | target: | ||
| + | - http://xyz/api/serverping | ||
| + | metrics_path: /probe | ||
| + | scheme: http | ||
| + | static_configs: | ||
| + | - targets: | ||
| + | - bbexporter1:9115 | ||
| + | - bbexporter2:9115 | ||
| + | - bbexporter3:9115 | ||
| + | - bbexporter4:9115 | ||
| + | - bbexporter5:9115 | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | curl "http://192.x.x.x:9115/probe?target=https://google.com&module=http_2xx" | ||
| + | ``` | ||
| + | |||
| + | Multiple URLs | ||
| + | ``` | ||
| + | scrape_configs: | ||
| + | - job_name: 'blackbox' | ||
| + | metrics_path: /probe | ||
| + | params: | ||
| + | module: [http_2xx] # Look for a HTTP 200 response. | ||
| + | static_configs: | ||
| + | - targets: | ||
| + | - http://prometheus.io # Probe with http. | ||
| + | - https://prometheus.io # Probe with https. | ||
| + | - http://example.com:8080 # Probe with http on port 8080. | ||
| + | relabel_configs: | ||
| + | - source_labels: [__address__] | ||
| + | target_label: __param_target | ||
| + | - source_labels: [__param_target] | ||
| + | target_label: instance | ||
| + | - target_label: __address__ | ||
| + | replacement: 127.0.0.1:9115 # Blackbox exporter's address. | ||
| + | ``` | ||
| + | |||
| + | # Best | ||
https://blog.devops.dev/prometheus-blackbox-exporter-with-kube-prometheus-stack-23a045ccbab2 | https://blog.devops.dev/prometheus-blackbox-exporter-with-kube-prometheus-stack-23a045ccbab2 | ||
| + | https://www.opsramp.com/guides/prometheus-monitoring/prometheus-blackbox-exporter/ | ||
| + | |||
| + | # And more | ||
curl http://blackbox-exporter-prometheus-blackbox-exporter.prometheus:9115/probe?target=example.com:443&module=tcp_connect&debug=true | curl http://blackbox-exporter-prometheus-blackbox-exporter.prometheus:9115/probe?target=example.com:443&module=tcp_connect&debug=true | ||
| Line 12: | Line 65: | ||
https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md | https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md | ||
| + | |||
| + | |||
| + | |||
| + | # Multiple Exporters from Single Job | ||
| + | |||
| + | - https://medium.com/geekculture/single-prometheus-job-for-dozens-of-blackbox-exporters-2a7ba492d6c8 | ||
| + | |||
| + | # More | ||
| + | |||
| + | https://stackoverflow.com/questions/58832749/prometheus-blackbox-exporter-citing-several-modules-per-job | ||
| + | |||
| + | https://medium.com/@akshyanshal/blackbox-exporter-to-monitor-websites-with-prometheus-and-visualize-on-grafana-e81d8a679de2 | ||
| + | |||
| + | https://www.opsramp.com/guides/prometheus-monitoring/prometheus-blackbox-exporter/ | ||
| + | |||
| + | https://stackoverflow.com/questions/74759672/promethues-check-external-api-json-response | ||
| + | |||
| + | https://www.squadcast.com/blog/prometheus-blackbox-exporter | ||
Latest revision as of 18:37, 22 February 2024
Example
https://github.com/prometheus/blackbox_exporter/blob/master/example.yml
Multiple
scrape_configs:
- job_name: probe
params:
module:
- http_2xx
target:
- http://xyz/api/serverping
metrics_path: /probe
scheme: http
static_configs:
- targets:
- bbexporter1:9115
- bbexporter2:9115
- bbexporter3:9115
- bbexporter4:9115
- bbexporter5:9115
curl "http://192.x.x.x:9115/probe?target=https://google.com&module=http_2xx"
Multiple URLs
scrape_configs:
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets:
- http://prometheus.io # Probe with http.
- https://prometheus.io # Probe with https.
- http://example.com:8080 # Probe with http on port 8080.
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115 # Blackbox exporter's address.
Best
https://blog.devops.dev/prometheus-blackbox-exporter-with-kube-prometheus-stack-23a045ccbab2
https://www.opsramp.com/guides/prometheus-monitoring/prometheus-blackbox-exporter/
And more
https://blog.ruanbekker.com/cheatsheets/blackbox-exporter/
https://dmachard.github.io/posts/0043-blackbox-prometheus-dns/
https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md
Multiple Exporters from Single Job
More
https://www.opsramp.com/guides/prometheus-monitoring/prometheus-blackbox-exporter/
https://stackoverflow.com/questions/74759672/promethues-check-external-api-json-response