From 6e73fb265f4bb992a3a3519b6be63159a7423645 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 12 Nov 2021 19:34:07 -0500 Subject: Add pms7003 exporter --- data/aliases.nix | 2 +- modules/monitoring.nix | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/data/aliases.nix b/data/aliases.nix index e41bac5..a13fc42 100644 --- a/data/aliases.nix +++ b/data/aliases.nix @@ -57,6 +57,6 @@ rec { port = 11115; }; hledger-web = { port = 11116; }; - prometheus-pms7003-exporter = { port = 11117; }; + prometheus-pms7003-exporter = { host = "172.20.100.10"; port = 11117; }; }; } diff --git a/modules/monitoring.nix b/modules/monitoring.nix index a4ead4b..65e292d 100644 --- a/modules/monitoring.nix +++ b/modules/monitoring.nix @@ -31,6 +31,11 @@ in type = lib.types.int; default = aliases.services.prometheus-snmp-exporter.port; }; + prometheus-pms7003-exporter = lib.mkOption { + type = lib.types.str; + default = with aliases.services.prometheus-pms7003-exporter; + "${host}:${toString port}"; + }; snmp-targets = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ aliases.ip.ap2 ]; @@ -79,6 +84,12 @@ in { targets = ["127.0.0.1:${toString cfg.prometheus-exporter-port}"]; } ]; } + { + job_name = "pms7003"; + static_configs = [ + { targets = ["${cfg.prometheus-pms7003-exporter}"]; } + ]; + } { job_name = "snmp"; metrics_path = "/snmp"; -- cgit v1.2.3