add conditions

This commit is contained in:
Ludovic Cartier 2021-11-02 16:11:54 +01:00
parent 00f9475cb2
commit fa60f2f145

View File

@ -161,6 +161,7 @@ scrape_configs:
{% if prometheus_blackbox_exporter is defined %}
# blacbox #
{% if prometheus_blackbox_exporter_http is defined %}
{% for target in prometheus_blackbox_exporter_http.values() %}
## http check ##
- job_name: blackbox - url {{ target }}
@ -180,6 +181,8 @@ scrape_configs:
- target_label: __address__
replacement: localhost:9115
{% endfor %}
{% endif %}
{% if prometheus_blackbox_exporter_ping is defined %}
{% for target in prometheus_blackbox_exporter_ping.values() %}
## ping ##
- job_name: blackbox - ping {{ target }}
@ -199,3 +202,4 @@ scrape_configs:
replacement: localhost:9115
{% endfor %}
{% endif %}
{% endif %}