Grafana to monitor blackbox_exporter installed in different hosts

Hi !

I installed blackbox_exporter in two different hosts… Both are exporting data to prometheus and are correctly installed and working, since I can see accessing 9915 port.

Now, I would like to select which host I would like to see blackbox_exporter data, using a grafana dashboard. My first doubt is, how to configure prometheus yml file, since I have two blackbox_exporters… Should I config 2 jobs, like the one below? Or I can in yml file map two different sources, like: replacement: [, replacement:]

  • job_name: “pingtime”
    metrics_path: /probe
    module: [icmp_ipv4]
    scrape_interval: 30s
    - targets:
    - source_labels: [address]
    target_label: __param_target
    - source_labels: [__param_target]
    target_label: instance
    - target_label: address

And so, after that how should I set grafana dashboard variables to allow me to select from which source I will get blackbox_exporter data.

Thank you !!


As for the variable setup, you can have a look at this example :

Here Is an example of one of my configurations :

  • job_name: ‘jvm’
    • targets: [‘’]
      hostname: was01
      cellname: refcell
      servername: was1server1
    • targets: [‘’]
      hostname: was01
      cellname: intcell
      servername: was1server2

So here I map 3 different variable in my dashboard and filter on those.

Hope it helps, Good Luck