Understanding Network Black Box Monitoring with Prometheus
How to Install the Blackbox Exporter
We will install the Blackbox Exporter on the same server where Prometheus and Grafana are installed (monitoring host). You have multiple options to install it, using:
- Your system's package manager
- The source code
- Its Docker image
We will use Docker in this guide. The inconvenience of using Docker with the Blackbox Exporter is that you will need to deal with additional networking configuration to probe some external services, but this is a good opportunity to learn how to do it.
Let's start by installing Docker on the monitoring host if you haven't done so yet:
curl -fsSL https://get.docker.com | VERSION=27.0 sh
Start by creating a configuration file for the Blackbox Exporter using the following command. We'll dive into this configuration file later.
cat < /etc/prometheus/blackbox.yml
modules:
http_2xx:
prober: http
EOF
Now, run the Blackbox Exporter as a Docker container:
docker run -d -p 9115:9115 \
--restart always \
--name blackbox_exporter \
-v /etc/prometheus/blackbox.yml:/etc/prometheus/blackbox.yml \
quay.io/prometheus/blackbox-exporter:v0.27.0 \
--config.file=/etc/prometheus/blackbox.yml
Check if the container is running:
Observability with Prometheus and Grafana
A Complete Hands-On Guide to Operational Clarity in Cloud-Native SystemsEnroll now to unlock all content and receive all future updates for free.
