1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/prometheus_exporters/templates/blackbox.yml.j2
Evangelos Foutras 19ee76d74c
geo_dns: support geo domains with subset of hosts
Useful if we wanted to create a Geo-based archive consisting of machines
in the archive_mirrors group (though this will likely not happen because
it'd break archlinux-repro due to the ~4 hour sync delay).
2022-08-21 04:44:46 +03:00

51 lines
1.4 KiB
Django/Jinja

#jinja2: lstrip_blocks: True
modules:
http_prometheus:
prober: http
timeout: 5s
http:
headers:
User-Agent: "blackbox-monitoring"
tls_connect:
prober: tcp
timeout: 5s
tcp:
tls: true
smtp_starttls:
prober: tcp
timeout: 5s
tcp:
query_response:
- expect: "^220 ([^ ]+) ESMTP (.+)$"
- send: "EHLO prober\r"
- expect: "^250-STARTTLS"
- send: "STARTTLS\r"
- expect: "^220"
- starttls: true
- send: "EHLO prober\r"
- expect: "^250"
- send: "QUIT\r"
{% for domain in geo_domains %}
{% set hosts = geo_options[domain]['hosts'] | default(groups['geo_mirrors']) %}
geo_dns_{{ domain }}_a:
prober: dns
timeout: 5s
dns:
query_name: {{ domain }}
query_type: A
preferred_ip_protocol: ip4
validate_answer_rrs:
fail_if_not_matches_regexp:
- {{ domain | replace('.', '\.') }}\.\t.*\tIN\tA\t({{ hosts | map('extract', hostvars, ['ipv4_address']) | join('|') | replace('.', '\.') }})
geo_dns_{{ domain }}_aaaa:
prober: dns
timeout: 5s
dns:
query_name: {{ domain }}
query_type: AAAA
preferred_ip_protocol: ip6
validate_answer_rrs:
fail_if_not_matches_regexp:
- {{ domain | replace('.', '\.') }}\.\t.*\tIN\tAAAA\t({{ hosts | map('extract', hostvars, ['ipv6_address']) | join('|') }})
{% endfor %}