No Description
Simon Pasquier 1bb5828ecb
Fix CircleCI job to publish container images (#478)
2 days ago
.circleci Fix CircleCI job to publish container images (#478) 2 days ago
.github Add &debug=true to issue template 1 year ago
config config: close configuration file (#467) 1 month ago
prober Use timeout for chooseProtocol (#458) 1 month ago
vendor added yamlv3 (#457) 1 month ago
.dockerignore New release process using docker, circleci and a centralized building tool 3 years ago
.gitignore New release process using docker, circleci and a centralized building tool 3 years ago
.golangci.yml Add .golangci.yml 1 month ago
.promu.yml *: bump Go version to 1.12 (#469) 4 weeks ago
.travis.yml *: bump Go version to 1.12 (#469) 4 weeks ago
CONFIGURATION.md Add regexp matching of HTTP response headers to the http probe (#419) 3 months ago
Dockerfile #352 - swap MAINTAINER for LABEL 1 month ago
LICENSE Add all the project infrastructure, use assigned port 3 years ago
MAINTAINERS.md Replace AUTHORS.md by an updated MAINTAINERS.md (#112) 2 years ago
Makefile Use Makefile.common from Prometheus 1 year ago
Makefile.common makefile: update Makefile.common with newer version 1 week ago
NOTICE Add missing license headers 3 years ago
README.md separating build and run instructions, so users can just download the released software (#452) 1 month ago
VERSION Release 0.14.0 2 months ago
blackbox.yml Empty in YAML means null. (#440) 2 months ago
example.yml Add regexp matching of HTTP response headers to the http probe (#419) 3 months ago
go.mod added yamlv3 (#457) 1 month ago
go.sum added yamlv3 (#457) 1 month ago
history.go Make the history limit a configurable flag (#308) 1 year ago
main.go added yamlv3 (#457) 1 month ago
main_test.go add license information to missing Go files (resolves #448) (#450) 1 month ago

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.

Running this software

From binaries

Download the most suitable binary from the releases tab

Then:

./blackbox_exporter <flags>

Using the docker image

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

Checking the results

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 the software

Local Build

make

Building with Docker

After a successful local build:

docker build -t blackbox_exporter .

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.