Go Makefile
Clone or download
abh and brian-brazil [dns] Add serial number metric for dns soa queries (#333)
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Latest commit 33ae924 Jun 13, 2018
Permalink
Failed to load latest commit information.
.circleci Fix CircleCI for releases (#323) May 23, 2018
.github Add &debug=true to issue template Sep 20, 2017
config Implemented strict yaml unmarshalling. (#310) Apr 16, 2018
prober [dns] Add serial number metric for dns soa queries (#333) Jun 13, 2018
vendor vendor: remove unused dependencies May 22, 2018
.dockerignore New release process using docker, circleci and a centralized building… May 14, 2016
.gitignore New release process using docker, circleci and a centralized building… May 14, 2016
.promu.yml Workaround netbsd/arm not building. Sep 20, 2017
.travis.yml Switch travis to 1.10 also Feb 26, 2018
CONFIGURATION.md [probers] Allow configuration of source addresses. Jan 26, 2018
Dockerfile Change to Kingpin flags (#199) Jul 26, 2017
LICENSE Add all the project infrastructure, use assigned port Sep 5, 2015
MAINTAINERS.md Replace AUTHORS.md by an updated MAINTAINERS.md (#112) Feb 16, 2017
Makefile Use Makefile.common from Prometheus May 22, 2018
Makefile.common Use Makefile.common from Prometheus May 22, 2018
NOTICE Add missing license headers May 14, 2016
README.md Improve relabel config documentation (#286) Jan 18, 2018
VERSION Release 0.12.0 Feb 27, 2018
blackbox.yml Handle timeout header being missing (#193) Jul 14, 2017
example.yml [dns] Add serial number metric for dns soa queries (#333) Jun 13, 2018
history.go Make the history limit a configurable flag (#308) Apr 13, 2018
main.go Make the history limit a configurable flag (#308) Apr 13, 2018
main_test.go Allow logs to be viewed more than once Sep 20, 2017

README.md

Blackbox exporter Build Status

CircleCI Docker Repository on Quay Docker Pulls

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

Building and running

Local Build

make
./blackbox_exporter <flags>

Visiting http://localhost:9115/probe?target=google.com&module=http_2xx will return metrics for a HTTP probe against google.com. The probe_success metric indicates if the probe succeeded. Adding a debug=true parameter will return debug information for that probe.

Building with Docker

docker build -t blackbox_exporter .
docker run -d -p 9115:9115 --name blackbox_exporter -v `pwd`:/config blackbox_exporter --config.file=/config/blackbox.yml

Configuration

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 /-/reload endpoint.

To view all available command-line flags, run ./blackbox_exporter -h.

To specify which configuration file to load, use the --config.file flag.

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 10 seconds.

Prometheus Configuration

The blackbox exporter needs to be passed the target as a parameter, this can be done with relabelling.

Example config:

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.

Permissions

The ICMP probe requires elevated privileges to function:

  • Windows: Administrator privileges are required.
  • Linux: root user or CAP_NET_RAW capability is required.
    • Can be set by executing setcap cap_net_raw+ep blackbox_exporter
  • BSD / OS X: root user is required.