diff --git a/hosts/monitoring/blackbox.yml b/hosts/monitoring/blackbox.yml new file mode 100644 index 0000000..2c38e5f --- /dev/null +++ b/hosts/monitoring/blackbox.yml @@ -0,0 +1,3 @@ +modules: + icmp: + prober: icmp diff --git a/hosts/monitoring/configuration.nix b/hosts/monitoring/configuration.nix index ef27ebd..461cee8 100644 --- a/hosts/monitoring/configuration.nix +++ b/hosts/monitoring/configuration.nix @@ -21,6 +21,49 @@ with lib; networking.defaultGateway = { address = "10.42.10.1"; interface = "ens18"; }; networking.defaultGateway6 = { address = "2a01:4f8:1c0c:8221::1"; interface = "ens18"; }; networking.nameservers = [ "2a01:4f8:1c0c:8221::1" "10.42.10.1" ]; + + networking.hosts = { + # Vlan + "10.42.10.1" = [ "gw.services.net.bula22.de" ]; + "10.42.42.1" = [ "gw.management.net.bula22.de" ]; + "10.42.151.1" = [ "gw.technik-iot.net.bula22.de" ]; + "10.42.201.1" = [ "gw.technik.net.bula22.de" ]; + "10.42.203.1" = [ "gw.hospital.net.bula22.de" ]; + "10.42.204.1" = [ "gw.zoll.net.bula22.de" ]; + "10.42.205.1" = [ "gw.leitstelle.net.bula22.de" ]; + "10.42.206.1" = [ "gw.verwaltung.net.bula22.de" ]; + "10.42.208.1" = [ "gw.yolo.net.bula22.de" ]; + "10.42.209.1" = [ "gw.infojurte.net.bula22.de" ]; + "10.42.210.1" = [ "gw.international.net.bula22.de" ]; + "10.42.211.1" = [ "gw.programmtresen.net.bula22.de" ]; + "10.42.212.1" = [ "gw.open-office.net.bula22.de" ]; + + # Management + "10.42.42.10" = [ "wlan-controller.bula22.de" ]; + "10.42.42.11" = [ "sw-zentral-1.bula22.de" ]; + "10.42.42.12" = [ "sw-zentral-2.bula22.de" ]; + "10.42.42.13" = [ "sw-verwaltung.bula22.de" ]; + "10.42.42.14" = [ "sw-zoll-container.bula22.de" ]; + "10.42.42.15" = [ "sw-zoll-zelt.bula22.de" ]; + "10.42.42.16" = [ "sw-programmtresen.bula22.de" ]; + "10.42.42.17" = [ "sw-international.bula22.de" ]; + "10.42.42.18" = [ "sw-leitstelle.bula22.de" ]; + "10.42.42.19" = [ "sw-infojurte.bula22.de" ]; + "10.42.42.20" = [ "sw-technik-zelt.bula22.de" ]; + "10.42.42.21" = [ "sw-technik-container.bula22.de" ]; + "10.42.42.22" = [ "sw-hospital.bula22.de" ]; + "10.42.42.23" = [ "sw-fuf.bula22.de" ]; + "10.42.42.24" = [ "sw-waschhaus.bula22.de" ]; + "10.42.42.25" = [ "sw-buehne.bula22.de" ]; + "10.42.42.26" = [ "sw-trabantenstadt.bula22.de" ]; + }; + + services.prometheus.exporters.blackbox = { + enable = true; + listenAddress = "[::1]"; + port = 9115; + configFile = ./blackbox.yml; + }; services.prometheus.exporters.node.enable = true; services.prometheus.alertmanager = { enable = true; @@ -65,6 +108,85 @@ with lib; } ]; } + { + job_name = "blackbox"; + metrics_path = "/probe"; + params = { + module = [ "icmp" ]; + }; + static_configs = [ + { + targets = [ + # Internet Probes + "clerie.de" + "vcp.de" + "bundeslager.vcp.de" + + # Vlan Probes + "gw.services.net.bula22.de" + "gw.management.net.bula22.de" + "gw.technik-iot.net.bula22.de" + "gw.technik.net.bula22.de" + "gw.hospital.net.bula22.de" + "gw.zoll.net.bula22.de" + "gw.leitstelle.net.bula22.de" + "gw.verwaltung.net.bula22.de" + "gw.yolo.net.bula22.de" + "gw.infojurte.net.bula22.de" + "gw.international.net.bula22.de" + "gw.programmtresen.net.bula22.de" + "gw.open-office.net.bula22.de" + + # Management Probes + "wlan-controller.bula22.de" + "sw-zentral-1.bula22.de" + "sw-zentral-2.bula22.de" + "sw-verwaltung.bula22.de" + "sw-zoll-container.bula22.de" + "sw-zoll-zelt.bula22.de" + "sw-programmtresen.bula22.de" + "sw-international.bula22.de" + "sw-leitstelle.bula22.de" + "sw-infojurte.bula22.de" + "sw-technik-zelt.bula22.de" + "sw-technik-container.bula22.de" + "sw-hospital.bula22.de" + "sw-fuf.bula22.de" + "sw-waschhaus.bula22.de" + "sw-buehne.bula22.de" + "sw-trabantenstadt.bula22.de" + + # Service Probes + "router.bula22.de" + "radius.bula22.de" + "yate.bula22.de" + "monitoring.bula22.de" + "dns.bula22.de" + "nerd.bula22.de" + "pre-router.bula22.de" + "nixdeploy.bula22.de" + + # External Service Probes + "vcp-bula-mon.bula22.de" + "vcp-bula-telko.bula22.de" + ]; + } + ]; + relabel_configs = [ + { + source_labels = [ "__address__" ]; + target_label = "__param_target"; + } + { + source_labels = [ "__param_target" ]; + target_label = "instance"; + } + { + target_label = "__address__"; + replacement = "[::1]:9115"; + } + ]; + } ]; alertmanagers = [ {