From c309fdd3c1d7b2c41020a544a9cc281d5ff9ced5 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Thu, 23 Nov 2023 00:19:40 +0800 Subject: [PATCH] feat(region): add nvidia_smi telegraf input plugin (#18751) --- pkg/devtool/utils/gen_telegraf_conf.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/devtool/utils/gen_telegraf_conf.go b/pkg/devtool/utils/gen_telegraf_conf.go index 85ff13e100..7f2b96f35c 100644 --- a/pkg/devtool/utils/gen_telegraf_conf.go +++ b/pkg/devtool/utils/gen_telegraf_conf.go @@ -101,6 +101,8 @@ const TELEGRAF_INPUT_LINUX = ` [[inputs.internal]] name_prefix = "agent_" collect_memstats = false +[[inputs.nvidia_smi]] + name_prefix = "agent_" ` const TELEGRAF_INPUT_WINDOWS = ` @@ -133,6 +135,8 @@ const TELEGRAF_INPUT_WINDOWS = ` [[inputs.internal]] name_prefix = "agent_" collect_memstats = false +[[inputs.nvidia_smi]] + name_prefix = "agent_" ` const TELEGRAF_INPUT_BAREMETAL = ` @@ -170,6 +174,8 @@ const TELEGRAF_INPUT_BAREMETAL = ` [[inputs.internal]] name_prefix = "agent_" collect_memstats = false +[[inputs.nvidia_smi]] + name_prefix = "agent_" ` var temp *template.Template @@ -206,7 +212,7 @@ func GenerateTelegrafConf( telegrafArgs["telegraf_agent_logfile"] = "/var/log/telegraf.log" } strBuild := strings.Builder{} - log.Errorf("telegraf args %v", telegrafArgs) + log.Infof("telegraf args %v", telegrafArgs) err := temp.Execute(&strBuild, telegrafArgs) if err != nil { return "", errors.Wrap(err, "build telegraf config")