feat: add foundry vtt to allerting

This commit is contained in:
2025-09-08 17:13:02 +02:00
parent eb40b7ff06
commit a0ffb52f98
2 changed files with 17 additions and 4 deletions

View File

@@ -7,7 +7,9 @@ let
cfg = config.services.blackbox-exporter;
nginxVHosts = config.services.nginx.virtualHosts or {};
allDomains = lib.attrNames nginxVHosts;
allDomains = (lib.attrNames nginxVHosts) ++ [
"foundry-vtt.cloonar.com"
];
filteredDomains = builtins.filter (d: !builtins.elem d cfg.blacklistDomains) allDomains;
httpsDomains = lib.map (d: "https://${d}") filteredDomains;
domainsString = builtins.concatStringsSep "\n "
@@ -45,8 +47,16 @@ in {
# Configuration file for Blackbox Exporter
environment.etc."blackbox_exporter/blackbox.yml".text = ''
modules:
http_2xx:
http_200_final:
prober: http
http:
method: GET
follow_redirects: true
preferred_ip_protocol: "ip4" # <-- important: avoid blanket IPv6 failures
# optional: if you want to prefer v6 but fall back to v4, add:
# ip_protocol_fallback: true
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"] # tidy, not required but nice
valid_status_codes: [200]
'';
# Add scrape config for VictoriaMetrics agent
@@ -55,7 +65,7 @@ in {
- job_name: "blackbox_http_all_domains"
metrics_path: "/probe"
params:
module: ["http_2xx"]
module: ["http_200_final"]
static_configs:
- targets: