help on tcp probe

1,465 views
Skip to first unread message

marco...@webscience.it

unread,
Jul 3, 2018, 11:57:38 AM7/3/18
to Prometheus Users

Hi.
I have found no example for configuring prometheus / blackboxexporter for probing tcp port.
i have prometheus / operator / blackboxexporter on k8s

I need to verify that some external services (not in k8s) are up and running.
i.e.: 10.10.80.11;3301

How can i configure blackbox + prometheus to accomplish this.


thank you 



Nicolai von Neudeck

unread,
Jul 4, 2018, 4:51:25 AM7/4/18
to Prometheus Users
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_probe

It 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

marco...@webscience.it

unread,
Jul 4, 2018, 4:57:24 AM7/4/18
to Prometheus Users
hi Nicolai
Thank you SOOOOOO much for your help. Really appreciated.
I will try your steps soon.

Have a great day!
Ciao


Reply all
Reply to author
Forward
0 new messages