我试图使用使用tcp_connect模块的黑盒导出程序来探测我的LDAP服务器。源是我的k8s集群。在我的集群中,我肯定可以到达ldap服务器。
debug@debug:~$ telnet global.ldap 636
Trying 10.27.20.7...
Connected to global.ldap.
Escape character is '^]'.
^]我的Prometheus配置看起来
- job_name: 'ldap_check'
scrape_interval: 5m
metrics_path: /probe
params:
module: [tcp_connect]
static_configs:
- targets:
- 'ldaps://global.ldap:636' # Also tried 'global.ldap:636' without the 'ldaps://'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: monitoring-prometheus-blackbox-exporter:9115但是我的Prometheus /targets页面向我展示了“服务器返回的HTTP 400坏请求”,有什么我错过了吗?
发布于 2021-05-20 18:29:44
试试这个:
- job_name: ldap_check
metrics_path: /probe
static_configs:
- labels:
module: tcp_connect
targets:
- global.ldap:636
relabel_configs:
...发布于 2021-09-13 13:25:44
使用400 Bad Request使用blackbox exporter最可能的原因是缺少所请求的module (在本例中为tcp_connect)。由于tcp_connect是默认模块之一,我想有人修改了blackbox.yml配置,忘记了在其中包含默认模块。
有一种方法可以运行调试查询,并确定哪里出了问题。只要curl http://blackbox_exporter_ip:9115/probe具有相同的URL参数,Prometheus就可以加上debug=true。例如:
❯ curl 'http://localhost:9115/probe?debug=true&module=tcp_connect2&target=localhost:9115' -v
...
< HTTP/1.1 400 Bad Request
...
Unknown module "tcp_connect2"发布于 2021-10-10 14:21:06
为此使用TCP模块。
tcp_connect:
prober: tcp
timeout: 5s就像这样。telnet 10.10.10.1主机为123端口。
卷曲“connect&debut=true”
这篇文章详细介绍了这一点。如何设置Prometheus BlackBox出口商
https://stackoverflow.com/questions/67625676
复制相似问题