The blackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP.
Download the most suitable binary from the releases tab
Note: You may want to enable ipv6 in your docker configuration
docker run --rm -d -p 9115:9115 --name blackbox_exporter -v `pwd`:/config prom/blackbox-exporter:master --config.file=/config/blackbox.yml
will return metrics for a HTTP probe against google.com. The
metric indicates if the probe succeeded. Adding a
will return debug information for that probe.
The Blackbox Exporter supports TLS and basic authentication. This enables better control of the various HTTP endpoints.
To use TLS and/or basic authentication, you need to pass a configuration file
--web.config.file parameter. The format of the file is described
in the exporter-toolkit repository.
Note that the TLS and basic authentication settings affect all HTTP endpoints: /metrics for scraping, /probe for probing, and the web UI.
After a successful local build:
docker build -t blackbox_exporter .
Blackbox exporter is configured via a configuration file and command-line flags (such as what configuration file to load, what port to listen on, and the logging format and level).
Blackbox exporter can reload its configuration file at runtime. If the new configuration is not well-formed, the changes will not be applied.
A configuration reload is triggered by sending a
SIGHUP to the Blackbox exporter process or by sending a HTTP POST request to the
To view all available command-line flags, run
To specify which configuration file to load, use the
Additionally, an example configuration is also available.
HTTP, HTTPS (via the
http prober), DNS, TCP socket and ICMP (see permissions section) are currently supported.
Additional modules can be defined to meet your needs.
The timeout of each probe is automatically determined from the
scrape_timeout in the Prometheus config, slightly reduced to allow for network delays.
This can be further limited by the
timeout in the Blackbox exporter config file. If neither is specified, it defaults to 120 seconds.
The blackbox exporter needs to be passed the target as a parameter, this can be done with relabelling.
scrape_configs: - job_name: 'blackbox' metrics_path: /probe params: module: [http_2xx] # Look for a HTTP 200 response. static_configs: - targets: - http://prometheus.io # Target to probe with http. - https://prometheus.io # Target to probe with https. - http://example.com:8080 # Target to 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 # The blackbox exporter's real hostname:port.
The ICMP probe requires elevated privileges to function:
CAP_NET_RAWcapability or the root user is required.
net.ipv4.ping_group_rangeby default in
/etc/sysctl.confor similar. If not you can set
net.ipv4.ping_group_range = 0 2147483647to allow any user the ability to use ping.
setcap cap_net_raw+ep blackbox_exporter