Skip to content

Commit

Permalink
feat(region): add nvidia_smi telegraf input plugin (#18754)
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi authored Nov 22, 2023
1 parent 2980481 commit ba762a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/devtool/utils/gen_telegraf_conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down Expand Up @@ -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 = `
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit ba762a3

Please sign in to comment.