Browse Source

fix(go.d/nvidia_smi): disable loop mode on Win (#19040)

fix(go.d/nvidia_smi): disable loop mode by default on Win

(cherry picked from commit 5647f9f353249a1c78e5f051c873bf5eddc48871)
Ilya Mashchenko 2 days ago
parent
commit
3638b69305
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go

+ 3 - 0
src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go

@@ -68,6 +68,9 @@ func (nv *NvidiaSmi) Configuration() any {
 
 func (nv *NvidiaSmi) Init() error {
 	if nv.exec == nil {
+		if runtime.GOOS == "windows" && nv.LoopMode {
+			nv.LoopMode = false
+		}
 		smi, err := nv.initNvidiaSmiExec()
 		if err != nil {
 			return err