Black Box Exporter: Advanced Configurations, Probes and Tools
57%
The ICMP Probe
To add a new probe for a different protocol, such as ICMP, you need to follow the same steps. First, add the module configuration to the Blackbox Exporter configuration file. Here is how we are going to proceed:
cat < /etc/prometheus/blackbox.yml
modules:
icmp_ipv4:
prober: icmp
timeout: 3s
icmp:
preferred_ip_protocol: ip4
EOF
We created the module. Now we want to monitor our two servers server1 and server2 using the ICMP probe, so let's call the new module by running the following command (don't forget to export server1 and server2 as environment variables):
cat < /etc/prometheus/prometheus.yml
scrape_configs:
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [icmp_ipv4]
static_configs:
- targets:
- $server1
- $server2
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [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.
