add telegraf
This commit is contained in:
@@ -23,6 +23,9 @@ in {
|
||||
group = config.users.users.${config.syscfg.defaultUser}.group;
|
||||
};
|
||||
"${config.syscfg.hostname}_wg_priv" = { };
|
||||
telegraf = {
|
||||
mode = "0400";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ in with lib; {
|
||||
type = types.oneOf [ types.bool (types.submodule { options = import ./server.nix {inherit lib;}; }) ];
|
||||
default = false;
|
||||
};
|
||||
monitoring = mkOption {
|
||||
type = types.submodule { options = import ./monitoring.nix { inherit lib; }; };
|
||||
default = { };
|
||||
};
|
||||
media = mkOption {
|
||||
type = types.submodule { options = import ./media.nix { inherit lib; }; };
|
||||
default = {};
|
||||
|
||||
54
modules/shared/syscfg/monitoring.nix
Normal file
54
modules/shared/syscfg/monitoring.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
telegraf = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
collectors = mkOption {
|
||||
type = types.listOf (types.enum [
|
||||
"cpu"
|
||||
"mem"
|
||||
"swap"
|
||||
"system"
|
||||
"disk"
|
||||
"diskio"
|
||||
"kernel"
|
||||
"net"
|
||||
"netstat"
|
||||
"processes"
|
||||
"temp"
|
||||
"mdstat"
|
||||
"smart"
|
||||
"docker"
|
||||
"ping"
|
||||
]);
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
outputs = {
|
||||
urls = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
database = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
token = mkOption {
|
||||
type = types.str;
|
||||
default = "$INFLUXDB_TOKEN";
|
||||
};
|
||||
secretName = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user