forked from zentralwerk/network
nixos-module/collectd/default: fix user
This commit is contained in:
parent
31334c4149
commit
4f42b64b18
|
@ -13,6 +13,7 @@ let
|
||||||
customTypesDb = builtins.toFile "types.db" ''
|
customTypesDb = builtins.toFile "types.db" ''
|
||||||
stations value:GAUGE:0:U
|
stations value:GAUGE:0:U
|
||||||
'';
|
'';
|
||||||
|
user = config.services.collectd.user;
|
||||||
isUpstream =
|
isUpstream =
|
||||||
builtins.match "upstream.*" hostName != null ||
|
builtins.match "upstream.*" hostName != null ||
|
||||||
builtins.match "anon.*" hostName != null;
|
builtins.match "anon.*" hostName != null;
|
||||||
|
@ -90,15 +91,15 @@ in
|
||||||
else maxTimeout
|
else maxTimeout
|
||||||
) 180 (builtins.attrNames config.site.net);
|
) 180 (builtins.attrNames config.site.net);
|
||||||
in ''
|
in ''
|
||||||
Exec "collectd" "${pkgs.ruby}/bin/ruby" "${./dhcpcount.rb}" "${toString maxTimeout}"
|
Exec "${user}" "${pkgs.ruby}/bin/ruby" "${./dhcpcount.rb}" "${toString maxTimeout}"
|
||||||
'';
|
'';
|
||||||
}) (lib.optionalAttrs config.services.unbound.enable {
|
}) (lib.optionalAttrs config.services.unbound.enable {
|
||||||
plugins.exec = ''
|
plugins.exec = ''
|
||||||
Exec "collectd" "${pkgs.ruby}/bin/ruby" "${./unbound.rb}"
|
Exec "${user}" "${pkgs.ruby}/bin/ruby" "${./unbound.rb}"
|
||||||
'';
|
'';
|
||||||
}) (lib.optionalAttrs hasStarlink {
|
}) (lib.optionalAttrs hasStarlink {
|
||||||
plugins.exec = ''
|
plugins.exec = ''
|
||||||
Exec "collectd" "${self.packages.${system}.starlink-stats}/bin/starlink-stats" "192.168.100.1:9200"
|
Exec "${user}" "${self.packages.${system}.starlink-stats}/bin/starlink-stats" "192.168.100.1:9200"
|
||||||
'';
|
'';
|
||||||
}) ];
|
}) ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue