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 84421e620a
prometheus: monitor HTTPS records for Geo domains
Check the HTTPS DNS records of the following Geo domains:

- geo.mirror.pkgbuild.com
- riscv.mirror.pkgbuild.com

Ensure they return: "1 . alpn=h2,h3 ipv4hint=... ipv6hint=..."

Ref #606
2024-10-06 07:31:11 +03:00

60 lines
1.8 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('|') }})
geo_dns_{{ domain }}_https:
prober: dns
timeout: 5s
dns:
query_name: {{ domain }}
query_type: HTTPS
validate_answer_rrs:
fail_if_not_matches_regexp:
- {{ domain | replace('.', '\.') }}\.\t.*\tIN\tHTTPS\t1 \. alpn="h2,h3" ipv4hint="({{ hosts | map('extract', hostvars, ['ipv4_address']) | join('|') | replace('.', '\.') }})" ipv6hint="({{ hosts | map('extract', hostvars, ['ipv6_address']) | join('|') }})"
{% endfor %}