hook prometheus to blackbox exporter
This commit is contained in:
parent
efdf4a21f9
commit
0df6a16382
2 changed files with 24 additions and 1 deletions
|
@ -50,7 +50,7 @@
|
|||
notify: Restart blackbox-exporter
|
||||
loop:
|
||||
- https-internal
|
||||
- https-external-up
|
||||
- http-external-up
|
||||
- http-external-down
|
||||
|
||||
#- name: Copy the web-config folder
|
||||
|
|
|
@ -63,3 +63,26 @@ scrape_configs:
|
|||
ca_file: '/etc/prometheus/ca.crt'
|
||||
cert_file: '/etc/prometheus/prometheus-{{ lan_address }}.crt'
|
||||
key_file: '/etc/prometheus/prometheus-{{ lan_address }}.key'
|
||||
|
||||
{% for target_type in ('https-internal', 'http-external-up', 'http-external-down') %}
|
||||
- job_name: blackbox {{ target_type }}
|
||||
metrics_path: /probe
|
||||
params:
|
||||
module: [http_2xx]
|
||||
file_sd_configs:
|
||||
- files:
|
||||
- '/etc/prometheus/blackbox-{{ target_type }}-targets.json'
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: {{ lan_address }}:9115
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: '/etc/prometheus/ca.crt'
|
||||
cert_file: '/etc/prometheus/prometheus-{{ lan_address }}.crt'
|
||||
key_file: '/etc/prometheus/prometheus-{{ lan_address }}.key'
|
||||
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue