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