Fix build on Windows (#2972)

This commit is contained in:
Daniel Nelson
2017-06-27 16:31:28 -07:00
committed by GitHub
parent d40e441240
commit 90909ae708
2 changed files with 11 additions and 10 deletions

View File

@@ -3,11 +3,13 @@ package system
import (
"bytes"
"io/ioutil"
"os"
"strconv"
"path"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
"path"
)
// https://www.kernel.org/doc/Documentation/sysctl/fs.txt
@@ -80,6 +82,14 @@ func (sfs *SysctlFS) Gather(acc telegraf.Accumulator) error {
return nil
}
func GetHostProc() string {
procPath := "/proc"
if os.Getenv("HOST_PROC") != "" {
procPath = os.Getenv("HOST_PROC")
}
return procPath
}
func init() {
inputs.Add("linux_sysctl_fs", func() telegraf.Input {