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