Just getting started with prometheus and I figured it could be used to monitor whether it can monitor service availability over a VPN connection.
So I have the prometheus server itself on box A. Now I need to monitor whether IP 172.20.40.40 on port 9000 is available. That's the box on the other side of the VPN. We will call that service server, server C. Now my box B with IP 192.169.1.10 is able to reach box C because part of the encryption domain. We have installed blackbox exporter on the box B so it can check on box C.
I believe prometheus will scrape box B for box C information. Below are my configs
BlackBox Config
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_status_codes: []
method: GET
Prometheus Config
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets:
- https://pagertree.com
- https://www.google.com
- http://172.20.40.40:9000
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: "blackbox_exporter:9115"
I am not seeing in the prometheus docs the part that allows to set the IP of the blackbox itself. On the blackbox doc as well it doesn't look like the blackbox config should contain the target IPs either. So I am a bit confused. Could it be blackbox should only run where prometheus is
This is the line what specifies the blackbox exporter to talk to, so you can change that to 192.169.1.10:9115.