- Modern infrastructure requires continuous availability monitoring.
- Traditional monitoring checks internal metrics, but does not verify real user accessibility.
- Prometheus is a powerful open-source monitoring and alerting system.
- Blackbox Exporter extends Prometheus by enabling external probing of services.
Install and Configure Blackbox for Prometheus on Ubuntu 24
Create a system user
Extract and install
tar -xvf blackbox_exporter-*.linux-amd64.tar.gz
cd blackbox_exporter-*
sudo mv blackbox_exporter /usr/local/bin/
sudo chown blackbox:blackbox /usr/local/bin/blackbox_exporter
Configure Blackbox
Create configuration directory:
sudo mkdir /etc/blackbox_exporter
sudo nano /etc/blackbox_exporter/blackbox.yml
configuration:
modules:
http_2xx:
prober: http
timeout: 5s
http:
method: GET
valid_status_codes: []
preferred_ip_protocol: "ip4"
icmp:
prober: icmp
timeout: 5s
tcp_connect:
prober: tcp
timeout: 5s
Create Systemd Service
sudo nano /etc/systemd/system/blackbox_exporter.service
Add:
[Unit]
Description=Blackbox Exporter
After=network.target
[Service]
User=blackbox
Group=blackbox
Type=simple
ExecStart=/usr/local/bin/blackbox_exporter \
--config.file=/etc/blackbox_exporter/blackbox.yml
[Install]
WantedBy=multi-user.target
Reload and start service
sudo systemctl daemon-reload
sudo systemctl enable blackbox_exporter
sudo systemctl start blackbox_exporter
Check status:
sudo systemctl status blackbox_exporter
Verify Blackbox Exporter
Open:
http://SERVER-IP:9115
Configure Prometheus
Edit Prometheus config:
sudo nano /etc/prometheus/prometheus.yml
Add:
scrape_configs:
- job_name: 'blackbox-http'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://google.com
- https://yourdomain.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: localhost:9115
Restart Prometheus:
sudo systemctl restart prometheus
View in Prometheus
Access with:
http://SERVER-IP:9090
Blackbox Exporter enhances monitoring by testing services from an external perspective rather than relying only on internal metrics. When integrated with Prometheus, it provides powerful and flexible probing capabilities for HTTP, HTTPS, TCP, ICMP, and DNS. It helps quickly detect website downtime, SSL certificate issues, network failures, and port connectivity problems.
If you need expert assistance with Blackbox for Prometheus on Ubuntu 24, the team at Skynats is here to help. Our certified engineers specialize in DevOps & Infrastructure solutions, including monitoring setup, performance optimization, alert configuration, and production-grade observability architecture. Whether you’re deploying Blackbox exporter for uptime monitoring, integrating it with existing Prometheus environments, or scaling your infrastructure for high availability, we ensure a secure and reliable implementation tailored to your business needs.