diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix index 43584f6..8f25806 100644 --- a/hosts/carbon/configuration.nix +++ b/hosts/carbon/configuration.nix @@ -448,6 +448,7 @@ enable = true; id = "104"; pubkey = "sro9DUSMtVr5xV2o3GTgg+0vmLj+bRc8fN+3pIr6+HY="; + bird = true; }; services.unbound = { diff --git a/hosts/dn42-il-gw1/configuration.nix b/hosts/dn42-il-gw1/configuration.nix index 12a37bf..e9f0a08 100644 --- a/hosts/dn42-il-gw1/configuration.nix +++ b/hosts/dn42-il-gw1/configuration.nix @@ -310,6 +310,7 @@ enable = true; id = "301"; pubkey = "kTuC3/rLr4Qb3C4oEn1ecB/vS78poxmu6/Id3Rc1VGY="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/hosts/dn42-il-gw5/configuration.nix b/hosts/dn42-il-gw5/configuration.nix index d1263be..8e74f73 100644 --- a/hosts/dn42-il-gw5/configuration.nix +++ b/hosts/dn42-il-gw5/configuration.nix @@ -168,6 +168,7 @@ enable = true; id = "305"; pubkey = "DRJ4FFqNCRgxzmD+k4WKVKJiKKTxTm5Uupcz04j1Ag8="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/hosts/dn42-il-gw6/configuration.nix b/hosts/dn42-il-gw6/configuration.nix index d1b4d8b..5c69c14 100644 --- a/hosts/dn42-il-gw6/configuration.nix +++ b/hosts/dn42-il-gw6/configuration.nix @@ -168,6 +168,7 @@ enable = true; id = "306"; pubkey = "5+/S3Fj0HknkKgUTgtmDhS7MoHZ2Ygsi/+eij+Gnf34="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/hosts/gatekeeper/configuration.nix b/hosts/gatekeeper/configuration.nix index d529264..23f3ddb 100644 --- a/hosts/gatekeeper/configuration.nix +++ b/hosts/gatekeeper/configuration.nix @@ -252,6 +252,7 @@ enable = true; id = "101"; pubkey = "H9Pvx/BzwEMM7acT9mioT8zBD2Yn13L82EKKqdAfeGM="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/hosts/monitoring-3/configuration.nix b/hosts/monitoring-3/configuration.nix index d05f294..d0980ee 100644 --- a/hosts/monitoring-3/configuration.nix +++ b/hosts/monitoring-3/configuration.nix @@ -23,6 +23,12 @@ let "${host.config.networking.hostName}.mon.clerie.de:9100") monitoringHosts; + birdMonitoringTargets = mapAttrsToList (name: host: + "${host.config.networking.hostName}.mon.clerie.de:9324") + (filterAttrs (name: host: + attrByPath ["clerie" "monitoring" "bird"] false host.config) + monitoringHosts); + in { imports = [ @@ -137,6 +143,15 @@ in { } ]; } + { + job_name = "bird-exporter"; + scrape_interval = "20s"; + static_configs = [ + { + targets = birdMonitoringTargets; + } + ]; + } { job_name = "zimmer-temp"; scrape_interval = "20s"; diff --git a/hosts/nonat/configuration.nix b/hosts/nonat/configuration.nix index c361006..2487663 100644 --- a/hosts/nonat/configuration.nix +++ b/hosts/nonat/configuration.nix @@ -172,6 +172,7 @@ enable = true; id = "103"; pubkey = "BHRfdK+HsoBXQHgLXotMnfPgfRrsVNHdSg19fvS2kg4="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/hosts/porter/configuration.nix b/hosts/porter/configuration.nix index 6c31e3e..be1d3d0 100644 --- a/hosts/porter/configuration.nix +++ b/hosts/porter/configuration.nix @@ -172,6 +172,7 @@ enable = true; id = "102"; pubkey = "+mJN+ustPo2ehP0wqajYs3nTdJ0SPuIDyiZQSHFIK3o="; + bird = true; }; system.stateVersion = "21.03"; diff --git a/modules/monitoring/default.nix b/modules/monitoring/default.nix index 728ecb4..3e34324 100644 --- a/modules/monitoring/default.nix +++ b/modules/monitoring/default.nix @@ -21,6 +21,7 @@ in type = types.str; description = "Public Key of the monitoring wireguard interface of this host"; }; + bird = mkEnableOption "Monitor bird"; }; }; @@ -47,5 +48,11 @@ in openFirewall = true; firewallFilter = "-i wg-monitoring -p tcp -m tcp --dport 9100"; }; + + services.prometheus.exporters.bird = mkIf cfg.bird { + enable = true; + openFirewall = true; + firewallFilter = "-i wg-monitoring -p tcp -m tcp --dport 9324"; + }; }; }