刚开始使用普罗米修斯,我想它可以用来监控是否可以通过VPN连接监控服务可用性。
所以我把普罗米修斯服务器本身放在A盒上。现在我需要监视端口9000上的IP 172.20.40.40是否可用。那是VPN另一边的盒子。我们将称之为服务服务器,服务器C。现在我的IP为192.169.1.10的B框能够到达C框,因为它是加密域的一部分。我们已经在B框上安装了blackbox exporter,所以它可以在C框上选中。
我相信普罗米修斯会把盒子B擦掉以获取盒子C的信息。以下是我的配置
黑盒配置
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_status_codes: []
method: GET
普罗米修斯配置
- 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"
我在普罗米修斯的文档中没有看到允许设置黑匣子本身的IP的部分。在blackbox doc上,看起来blackbox配置也不应该包含目标IPs。所以我有点困惑。是不是黑盒子应该只在普罗米修斯所在的地方