File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
nixos/modules/services/monitoring/prometheus Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 4040 "flow"
4141 "fritz"
4242 "fritzbox"
43+ "frr"
4344 "graphite"
4445 "idrac"
4546 "imap-mailstat"
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments