fix(nasp): fix bucket name

This commit is contained in:
Dict Xiong 2024-06-14 19:39:12 +08:00
parent 12002fe4c8
commit 3b8816d15c

View File

@ -32,6 +32,11 @@ in
}; };
telegraf = { telegraf = {
enable = lib.mkEnableOption "telegraf"; enable = lib.mkEnableOption "telegraf";
bucket = lib.mkOption {
type = lib.types.str;
description = "target influxdb bucket";
default = "trash";
};
}; };
gSeries = { gSeries = {
enable = lib.mkEnableOption "the g-series server configurations"; enable = lib.mkEnableOption "the g-series server configurations";
@ -281,19 +286,19 @@ in
}; };
inputs.system = { inputs.system = {
name_override = "load"; name_override = "load";
tags = { bucket = "device"; }; tags = { bucket = telegrafCfg.bucket; };
fieldpass = [ "load1" "bucket" ]; fieldpass = [ "load1" "bucket" ];
interval = "15s"; interval = "15s";
}; };
inputs.mem = { inputs.mem = {
name_override = "memory"; name_override = "memory";
tags = { bucket = "device"; }; tags = { bucket = telegrafCfg.bucket; };
fieldpass = [ "used" "total" "bucket"]; fieldpass = [ "used" "total" "bucket"];
interval = "30s"; interval = "30s";
}; };
inputs.temp = { inputs.temp = {
name_override = "temperture"; name_override = "temperture";
tags = { bucket = "device"; }; tags = { bucket = telegrafCfg.bucket; };
}; };
}; };
}; };
@ -384,16 +389,19 @@ in
nasp.nginx.enable = lib.mkDefault true; nasp.nginx.enable = lib.mkDefault true;
nasp.nginx.enableCodeServer = lib.mkDefault true; nasp.nginx.enableCodeServer = lib.mkDefault true;
nasp.sops.enable = lib.mkDefault true; nasp.sops.enable = lib.mkDefault true;
nasp.telegraf.enable = lib.mkDefault true; nasp.telegraf = {
enable = lib.mkDefault true;
bucket = "g-series";
};
services.telegraf.extraConfig = { services.telegraf.extraConfig = {
inputs.net = { inputs.net = {
interfaces = [ gCfg.eth0Name gCfg.eth1Name gCfg.eth2Name ]; interfaces = [ gCfg.eth0Name gCfg.eth1Name gCfg.eth2Name ];
ignore_protocol_stats = true; ignore_protocol_stats = true;
tags = { bucket = "device"; }; tags = { bucket = "g-series"; };
}; };
inputs.nvidia_smi = { inputs.nvidia_smi = {
bin_path = "/run/current-system/sw/bin/nvidia-smi"; bin_path = "/run/current-system/sw/bin/nvidia-smi";
tags = { bucket = "device"; }; tags = { bucket = "g-series"; };
}; };
}; };
services.ntp = { services.ntp = {