ssh探测
:set paste ,然后按i,再复制一下内容(这样就不会有#号):
- job_name: 'blackbox-ssh'
# metrics的path 注意不都是/metrics
metrics_path: /probe
# 传入的参数
params:
# 使用ssh_banner模块
module: [ssh_banner]
static_configs:
- targets: #填地址
- ip1:22
- ip2:22
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox_exporter:9115 # The blackbox exporter's real hostname:port.
Curl -vvv -X POST localhost:9090/-/reload 刷新
icmp探测
- job_name: 'blackbox_icmp'
metrics_path: /probe
params:
module: [icmp]
static_configs:
- targets:
- ip1
- ip2
- baidu.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115 # The blackbox exporter's real hostname:port.