From c0588926b826cab4ced76b9fe5bfcd69f9bc090c Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Wed, 20 Apr 2016 18:22:04 -0600 Subject: [PATCH] Add n_cpu field to system plugin closes #1041 --- plugins/inputs/system/system.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inputs/system/system.go b/plugins/inputs/system/system.go index 42b0310a4..55e606225 100644 --- a/plugins/inputs/system/system.go +++ b/plugins/inputs/system/system.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "fmt" + "runtime" "github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/load" @@ -43,6 +44,7 @@ func (_ *SystemStats) Gather(acc telegraf.Accumulator) error { "uptime": hostinfo.Uptime, "n_users": len(users), "uptime_format": format_uptime(hostinfo.Uptime), + "n_cpus": runtime.NumCPU(), } acc.AddFields("system", fields, nil)