-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prometheus-frr-exporter: init prometheus exporter module
(cherry picked from commit 578c5b6)
- Loading branch information
1 parent
9e6465a
commit b0ed136
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ let | |
"flow" | ||
"fritz" | ||
"fritzbox" | ||
"frr" | ||
"graphite" | ||
"idrac" | ||
"imap-mailstat" | ||
|
49 changes: 49 additions & 0 deletions
49
nixos/modules/services/monitoring/prometheus/exporters/frr.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
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} | ||
''; | ||
}; | ||
}; | ||
} |