1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.bird;
15 birdVersion = mkOption {
16 type = types.enum [ 1 2 ];
19 Specifies whether BIRD1 or BIRD2 is in use.
22 birdSocket = mkOption {
24 default = "/run/bird/bird.ctl";
26 Path to BIRD2 (or BIRD1 v4) socket.
29 newMetricFormat = mkOption {
33 Enable the new more-generic metric format.
39 SupplementaryGroups = singleton (if cfg.birdVersion == 1 then "bird" else "bird2");
41 ${pkgs.prometheus-bird-exporter}/bin/bird_exporter \
42 -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
43 -bird.socket ${cfg.birdSocket} \
44 -bird.v2=${if cfg.birdVersion == 2 then "true" else "false"} \
45 -format.new=${if cfg.newMetricFormat then "true" else "false"} \
46 ${concatStringsSep " \\\n " cfg.extraFlags}
48 RestrictAddressFamilies = [
49 # Need AF_UNIX to collect data