diff --git a/m/hut/blackbox.yml b/m/hut/blackbox.yml index 83de003..e69acd3 100644 --- a/m/hut/blackbox.yml +++ b/m/hut/blackbox.yml @@ -121,12 +121,11 @@ modules: - expect: "PING :([^ ]+)" send: "PONG ${1}" - expect: "^:[^ ]+ 001" - icmp_example: + icmp: prober: icmp timeout: 5s icmp: preferred_ip_protocol: "ip4" - source_ip_address: "127.0.0.1" dns_udp_example: prober: dns timeout: 5s diff --git a/m/hut/monitoring.nix b/m/hut/monitoring.nix index 304590f..61fa22c 100644 --- a/m/hut/monitoring.nix +++ b/m/hut/monitoring.nix @@ -100,7 +100,7 @@ }]; } { - job_name = "blackbox"; + job_name = "blackbox-http"; metrics_path = "/probe"; params = { module = [ "http_2xx" ]; }; static_configs = [{ @@ -128,6 +128,36 @@ } ]; } + { + job_name = "blackbox-icmp"; + metrics_path = "/probe"; + params = { module = [ "icmp" ]; }; + static_configs = [{ + targets = [ + "1.1.1.1" + "8.8.8.8" + "ssfhead" + "gw.bsc.es" + ]; + }]; + relabel_configs = [ + { + # Takes the address and sets it in the "target=" URL parameter + source_labels = [ "__address__" ]; + target_label = "__param_target"; + } + { + # Sets the "instance" label with the remote host we are querying + source_labels = [ "__param_target" ]; + target_label = "instance"; + } + { + # Shows the host target address instead of the blackbox address + target_label = "__address__"; + replacement = "127.0.0.1:${toString config.services.prometheus.exporters.blackbox.port}"; + } + ]; + } { # Scrape the IPMI info of the hosts remotely via LAN job_name = "ipmi-lan";