Hi Marco!
This is what you need to do:
1. Tell the blackbox exporter whom to probe
2. Tell the blackbox exporter which module should be used for that probe.
3. Tell the blackbox exporter how to probe by defining a corresponding module.
4. Tell Prometheus where the blackbox exporter sits. Prometheus will then tell the blackbox exporter 1&2.
For testing if the blackbox_exporter and its modules are set up properly, it might be a good idea to use curl or a browser instead of Prometheus first. This way you can’t get confused by the nifty relabeling setup used by prometheus and iterate faster.
To do so, just go to this URI (using curl or a browser):
http://yourblackboxexporter:exporterport/probe?target=domainorIPandportofyourtarget&module=nameofyourmodule
To actually use the module, it needs to exist and be set up the way you need it.
You might already have a predefined TCP probe. If so, cool, just use that one.
If not, the options for a module for TCP probes are shown here:
https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md#tcp_probeIt is also a nice idea to go to http://yourblackboxexporter:exporterport/ to have a log of requests and an overview of what you set up.
If this works the way you want it, you can configure Prometheus to make the same request.
You do that in the config.yml and it done with relabeling.
You can copy the example here
1. In the last line you put your blackbox exporters address and port
2. Under targets you put the address and port you want to probe.
3. Under module you put the module you want to probe.
That is it. Don’t give up. It can be a bit daunting in the beginning.
Have a nice day!
Nicolai