Loading nixos/modules/services/monitoring/prometheus/exporters.nix +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ let "flow" "fritz" "fritzbox" "frr" "graphite" "idrac" "imap-mailstat" Loading nixos/modules/services/monitoring/prometheus/exporters/frr.nix 0 → 100644 +49 −0 Original line number Diff line number Diff line { config, lib, pkgs, ... }: let cfg = config.services.prometheus.exporters.frr; inherit (lib) mkOption types concatStringsSep concatMapStringsSep ; in { port = 9342; extraOpts = { enabledCollectors = mkOption { type = types.listOf types.str; default = [ ]; example = [ "vrrp" ]; description = '' Collectors to enable. The collectors listed here are enabled in addition to the default ones. ''; }; disabledCollectors = mkOption { type = types.listOf types.str; default = [ ]; example = [ "bfd" ]; description = '' Collectors to disable which are enabled by default. ''; }; }; serviceOpts = { serviceConfig = { DynamicUser = false; RuntimeDirectory = "prometheus-frr-exporter"; ExecStart = '' ${lib.getExe pkgs.prometheus-frr-exporter} \ ${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \ ${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \ --web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags} ''; }; }; } Loading
nixos/modules/services/monitoring/prometheus/exporters.nix +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ let "flow" "fritz" "fritzbox" "frr" "graphite" "idrac" "imap-mailstat" Loading
nixos/modules/services/monitoring/prometheus/exporters/frr.nix 0 → 100644 +49 −0 Original line number Diff line number Diff line { config, lib, pkgs, ... }: let cfg = config.services.prometheus.exporters.frr; inherit (lib) mkOption types concatStringsSep concatMapStringsSep ; in { port = 9342; extraOpts = { enabledCollectors = mkOption { type = types.listOf types.str; default = [ ]; example = [ "vrrp" ]; description = '' Collectors to enable. The collectors listed here are enabled in addition to the default ones. ''; }; disabledCollectors = mkOption { type = types.listOf types.str; default = [ ]; example = [ "bfd" ]; description = '' Collectors to disable which are enabled by default. ''; }; }; serviceOpts = { serviceConfig = { DynamicUser = false; RuntimeDirectory = "prometheus-frr-exporter"; ExecStart = '' ${lib.getExe pkgs.prometheus-frr-exporter} \ ${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \ ${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \ --web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags} ''; }; }; }