Allow using system plugin in Windows (#3127)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/host"
|
"github.com/shirou/gopsutil/host"
|
||||||
"github.com/shirou/gopsutil/load"
|
"github.com/shirou/gopsutil/load"
|
||||||
@@ -23,7 +24,7 @@ func (_ *SystemStats) SampleConfig() string { return "" }
|
|||||||
|
|
||||||
func (_ *SystemStats) Gather(acc telegraf.Accumulator) error {
|
func (_ *SystemStats) Gather(acc telegraf.Accumulator) error {
|
||||||
loadavg, err := load.Avg()
|
loadavg, err := load.Avg()
|
||||||
if err != nil {
|
if err != nil && !strings.Contains(err.Error(), "not implemented") {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user