From bd78b8e1b356e25265c214e2356cda7d40233445 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Tue, 27 Jun 2017 16:31:28 -0700 Subject: [PATCH] Fix build on Windows (#2972) --- plugins/inputs/system/linux_sysctl_fs.go | 12 +++++++++++- plugins/inputs/system/processes.go | 9 --------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/inputs/system/linux_sysctl_fs.go b/plugins/inputs/system/linux_sysctl_fs.go index add17e9ae..55ebcb668 100644 --- a/plugins/inputs/system/linux_sysctl_fs.go +++ b/plugins/inputs/system/linux_sysctl_fs.go @@ -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 { diff --git a/plugins/inputs/system/processes.go b/plugins/inputs/system/processes.go index 68796fed6..1ceb4fb2d 100644 --- a/plugins/inputs/system/processes.go +++ b/plugins/inputs/system/processes.go @@ -20,7 +20,6 @@ import ( type Processes struct { execPS func() ([]byte, error) - getHostProc func() string readProcFile func(filename string) ([]byte, error) forcePS bool @@ -63,14 +62,6 @@ func (p *Processes) Gather(acc telegraf.Accumulator) error { return nil } -func GetHostProc() string { - procPath := "/proc" - if os.Getenv("HOST_PROC") != "" { - procPath = os.Getenv("HOST_PROC") - } - return procPath -} - // Gets empty fields of metrics based on the OS func getEmptyFields() map[string]interface{} { fields := map[string]interface{}{