lol

prometheus-frr-exporter: init prometheus exporter module (#313651)

authored by

Sandro and committed by
GitHub
c161f610 145137c1

+50
+1
nixos/modules/services/monitoring/prometheus/exporters.nix
··· 40 40 "flow" 41 41 "fritz" 42 42 "fritzbox" 43 + "frr" 43 44 "graphite" 44 45 "idrac" 45 46 "imap-mailstat"
+49
nixos/modules/services/monitoring/prometheus/exporters/frr.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + let 9 + cfg = config.services.prometheus.exporters.frr; 10 + inherit (lib) 11 + mkOption 12 + types 13 + concatStringsSep 14 + concatMapStringsSep 15 + ; 16 + in 17 + { 18 + port = 9342; 19 + extraOpts = { 20 + enabledCollectors = mkOption { 21 + type = types.listOf types.str; 22 + default = [ ]; 23 + example = [ "vrrp" ]; 24 + description = '' 25 + Collectors to enable. The collectors listed here are enabled in addition to the default ones. 26 + ''; 27 + }; 28 + disabledCollectors = mkOption { 29 + type = types.listOf types.str; 30 + default = [ ]; 31 + example = [ "bfd" ]; 32 + description = '' 33 + Collectors to disable which are enabled by default. 34 + ''; 35 + }; 36 + }; 37 + serviceOpts = { 38 + serviceConfig = { 39 + DynamicUser = false; 40 + RuntimeDirectory = "prometheus-frr-exporter"; 41 + ExecStart = '' 42 + ${lib.getExe pkgs.prometheus-frr-exporter} \ 43 + ${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \ 44 + ${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \ 45 + --web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags} 46 + ''; 47 + }; 48 + }; 49 + }