prometheus-frr-exporter: fix communication to frr unix socket (#369539)

authored by Sandro and committed by GitHub 0b4b1319 f0a2b50d

+17
+17
nixos/modules/services/monitoring/prometheus/exporters/frr.nix
··· 17 17 { 18 18 port = 9342; 19 19 extraOpts = { 20 + user = mkOption { 21 + type = types.str; 22 + default = "frr"; 23 + description = '' 24 + User name under which the frr exporter shall be run. 25 + The exporter talks to frr using a unix socket, which is owned by frr. 26 + ''; 27 + }; 28 + group = mkOption { 29 + type = types.str; 30 + default = "frrtty"; 31 + description = '' 32 + Group under which the frr exporter shall be run. 33 + The exporter talks to frr using a unix socket, which is owned by frrtty group. 34 + ''; 35 + }; 20 36 enabledCollectors = mkOption { 21 37 type = types.listOf types.str; 22 38 default = [ ]; ··· 38 54 serviceConfig = { 39 55 DynamicUser = false; 40 56 RuntimeDirectory = "prometheus-frr-exporter"; 57 + RestrictAddressFamilies = [ "AF_UNIX" ]; 41 58 ExecStart = '' 42 59 ${lib.getExe pkgs.prometheus-frr-exporter} \ 43 60 ${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \