From 69ad61bb3062a4cecb5a50057531619438d86199 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Wed, 4 May 2016 17:52:47 -0600 Subject: [PATCH] processes: add 'unknown' procs (?) --- plugins/inputs/system/processes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/inputs/system/processes.go b/plugins/inputs/system/processes.go index 8c50a4ebd..dd7ea2b2e 100644 --- a/plugins/inputs/system/processes.go +++ b/plugins/inputs/system/processes.go @@ -70,6 +70,7 @@ func getEmptyFields() map[string]interface{} { "running": int64(0), "sleeping": int64(0), "total": int64(0), + "unknown": int64(0), } switch runtime.GOOS { case "freebsd": @@ -114,6 +115,8 @@ func (p *Processes) gatherFromPS(fields map[string]interface{}) error { fields["sleeping"] = fields["sleeping"].(int64) + int64(1) case 'I': fields["idle"] = fields["idle"].(int64) + int64(1) + case '?': + fields["unknown"] = fields["unknown"].(int64) + int64(1) default: log.Printf("processes: Unknown state [ %s ] from ps", string(status[0]))