node_exporter: enable on vno1 subnet
This commit is contained in:
parent
563ccd613a
commit
c822cc95c2
@ -74,8 +74,11 @@ in {
|
||||
};
|
||||
|
||||
services = {
|
||||
node_exporter.enable = true;
|
||||
sshguard.enable = false;
|
||||
node_exporter = {
|
||||
enable = true;
|
||||
extraSubnets = [myData.subnets.vno1.cidr];
|
||||
};
|
||||
tailscale = {
|
||||
enable = true;
|
||||
silenceLogs = true;
|
||||
|
@ -3,12 +3,18 @@
|
||||
lib,
|
||||
myData,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
cfg = config.mj.services.node_exporter;
|
||||
in {
|
||||
options.mj.services.node_exporter = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable node_exporter";
|
||||
extraSubnets = lib.mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mj.services.node_exporter.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
enabledCollectors = ["systemd" "processes"];
|
||||
@ -29,7 +35,7 @@
|
||||
|
||||
mj.services.friendlyport.ports = [
|
||||
{
|
||||
subnets = [myData.subnets.tailscale.cidr];
|
||||
subnets = [myData.subnets.tailscale.cidr] ++ cfg.extraSubnets;
|
||||
tcp = [myData.ports.exporters.node];
|
||||
}
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user