From 44c6bccca6d8bc6f0d0c0c3152ef986161fe73e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 5 Sep 2023 15:26:50 +0300 Subject: [PATCH] snmp: add some routers --- hosts/vno1-oh2/configuration.nix | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/hosts/vno1-oh2/configuration.nix b/hosts/vno1-oh2/configuration.nix index 31b4e72..554fc02 100644 --- a/hosts/vno1-oh2/configuration.nix +++ b/hosts/vno1-oh2/configuration.nix @@ -317,6 +317,41 @@ job_name = "vno1-rp3b.servers.jakst"; static_configs = [{targets = ["${myData.hosts."vno1-rp3b.servers.jakst".jakstIP}:${port}"];}]; } + { + job_name = "snmp_exporter"; + static_configs = [{targets = ["127.0.0.1:9116"];}]; + } + { + job_name = "snmp-mikrotik"; + static_configs = [ + { + targets = [ + "192.168.189.2" # kids + "192.168.189.3" # livingroom + "192.168.189.4" # commbox + ]; + } + ]; + metrics_path = "./snmp"; + params = { + auth = ["public_v2"]; + module = ["mikrotik"]; + }; + relabel_configs = [ + { + source_labels = ["__address__"]; + target_label = "__param_target"; + } + { + source_labels = ["__param_target"]; + target_label = "instance"; + } + { + target_label = "__address__"; + replacement = "127.0.0.1:9116"; + } + ]; + } ]; };