I think you're trying to do two things:
1. Get Prometheus to scrape blackbox_exporter on hosts 1stclient_ip and 2ndclient_ip
2. Get blackbox_exporter on those hosts to make an ICMP probe *to itself*
So you're right, you want a scrape address like
or you could even do
Let's say you want to do the first one of those. You'll need a bit more rewriting to achieve this. Here's one way (which also keeps the 9115 out of the instance label):
- job_name: 'blackbox-selftest'
metrics_path: /probe
params:
module: [icmp]
static_configs:
- targets:
- 1stclient_ip
- 2ndclient_ip
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__address__]
replacement: '${1}:9115'
target_label: __address__
Personally though, I don't think this check is needed, if you are planning to use those blackbox_exporter instances to probe *other* systems. At that point, the metric 'up' will tell you whether blackbox_exporter is working or not, and you can simply alert on that, if you want to know when blackbox_exporter goes down.
That is, when probing some other target:
up=1, probe_success=1 => blackbox_exporter is working, target is working
up=1, probe_success=0 => blackbox_exporter is working, target is down
up=0 => blackbox_exporter itself is down or unreachable
And if all you want to do is ping 1stclient_ip and 2ndclient_ip, and not do any probe tests from those hosts to other hosts, you could run a single instance of blackbox_exporter on the prometheus server instead.