Update README.md
parent
6c80ba2be1
commit
8add2b1826
66
README.md
66
README.md
|
@ -158,40 +158,15 @@ vi prometheus.yml
|
||||||
- target_label: __address__
|
- target_label: __address__
|
||||||
replacement: 127.0.0.1:9115
|
replacement: 127.0.0.1:9115
|
||||||
|
|
||||||
- job_name: 'http200igssl'
|
- job_name: 'http_4xx'
|
||||||
metrics_path: /probe
|
metrics_path: /probe
|
||||||
params:
|
params:
|
||||||
module: [http200igssl]
|
module: [http_4xx]
|
||||||
consul_sd_configs:
|
consul_sd_configs:
|
||||||
- server: 'x.x.x.x:8500'
|
- server: 'x.x.x.x:8500'
|
||||||
token: 'xxx-xxx-xxx-xxx'
|
token: 'xxx-xxx-xxx-xxx'
|
||||||
services: ['blackbox_exporter']
|
services: ['blackbox_exporter']
|
||||||
tags: ['http200igssl']
|
tags: ['http_4xx']
|
||||||
relabel_configs:
|
|
||||||
- source_labels: ["__meta_consul_service_metadata_instance"]
|
|
||||||
target_label: __param_target
|
|
||||||
- source_labels: ["__meta_consul_service_metadata_company"]
|
|
||||||
target_label: company
|
|
||||||
- source_labels: ["__meta_consul_service_metadata_env"]
|
|
||||||
target_label: env
|
|
||||||
- source_labels: ["__meta_consul_service_metadata_name"]
|
|
||||||
target_label: name
|
|
||||||
- source_labels: ["__meta_consul_service_metadata_project"]
|
|
||||||
target_label: project
|
|
||||||
- source_labels: [__param_target]
|
|
||||||
target_label: instance
|
|
||||||
- target_label: __address__
|
|
||||||
replacement: 127.0.0.1:9115
|
|
||||||
|
|
||||||
- job_name: 'http4xx'
|
|
||||||
metrics_path: /probe
|
|
||||||
params:
|
|
||||||
module: [http4xx]
|
|
||||||
consul_sd_configs:
|
|
||||||
- server: 'x.x.x.x:8500'
|
|
||||||
token: 'xxx-xxx-xxx-xxx'
|
|
||||||
services: ['blackbox_exporter']
|
|
||||||
tags: ['http4xx']
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: ["__meta_consul_service_metadata_instance"]
|
- source_labels: ["__meta_consul_service_metadata_instance"]
|
||||||
target_label: __param_target
|
target_label: __param_target
|
||||||
|
@ -211,7 +186,7 @@ vi prometheus.yml
|
||||||
|
|
||||||
### 配置Blackbox_Exporter
|
### 配置Blackbox_Exporter
|
||||||
|
|
||||||
主要是默认的配置,增加了4xx和忽略ssl的模块。
|
参考配置,2XX,4XX,TCP类型的监控,注意模块名称不要与已有的重复。
|
||||||
|
|
||||||
```
|
```
|
||||||
cat blackbox.yml
|
cat blackbox.yml
|
||||||
|
@ -225,36 +200,21 @@ modules:
|
||||||
- 302
|
- 302
|
||||||
- 303
|
- 303
|
||||||
no_follow_redirects: true
|
no_follow_redirects: true
|
||||||
|
preferred_ip_protocol: ip4
|
||||||
|
ip_protocol_fallback: false
|
||||||
|
|
||||||
http_post_2xx:
|
http_4xx:
|
||||||
prober: http
|
|
||||||
http:
|
|
||||||
method: POST
|
|
||||||
tcp_connect:
|
|
||||||
prober: tcp
|
|
||||||
ssh_banner:
|
|
||||||
prober: tcp
|
|
||||||
tcp:
|
|
||||||
query_response:
|
|
||||||
- expect: "^SSH-2.0-"
|
|
||||||
- send: "SSH-2.0-blackbox-ssh-check"
|
|
||||||
icmp:
|
|
||||||
prober: icmp
|
|
||||||
|
|
||||||
http4xx:
|
|
||||||
prober: http
|
prober: http
|
||||||
http:
|
http:
|
||||||
valid_status_codes:
|
valid_status_codes:
|
||||||
- 401
|
- 401
|
||||||
- 403
|
- 403
|
||||||
- 404
|
- 404
|
||||||
http200igssl:
|
preferred_ip_protocol: ip4
|
||||||
prober: http
|
ip_protocol_fallback: false
|
||||||
http:
|
|
||||||
valid_status_codes:
|
tcp_connect:
|
||||||
- 200
|
prober: tcp
|
||||||
tls_config:
|
|
||||||
insecure_skip_verify: true
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 批量导入脚本
|
### 批量导入脚本
|
||||||
|
@ -279,5 +239,5 @@ modules:
|
||||||
所有代码都在里面,抛砖引玉。
|
所有代码都在里面,抛砖引玉。
|
||||||
|
|
||||||
```
|
```
|
||||||
https://github.com/starsliao/Prometheus/tree/master/Blackbox-Manager
|
https://github.com/starsliao/ConsulManager
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue