processes: Fix zombie process procfs panic

fixes #822
This commit is contained in:
Cameron Sparr
2016-03-09 22:55:26 +01:00
parent 7b09623fa8
commit aa15e7916e
2 changed files with 9 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ func (p *Processes) Gather(acc telegraf.Accumulator) error {
func getEmptyFields() map[string]interface{} {
fields := map[string]interface{}{
"blocked": int64(0),
"zombie": int64(0),
"zombies": int64(0),
"stopped": int64(0),
"running": int64(0),
"sleeping": int64(0),
@@ -105,7 +105,7 @@ func (p *Processes) gatherFromPS(fields map[string]interface{}) error {
// Also known as uninterruptible sleep or disk sleep
fields["blocked"] = fields["blocked"].(int64) + int64(1)
case 'Z':
fields["zombie"] = fields["zombie"].(int64) + int64(1)
fields["zombies"] = fields["zombies"].(int64) + int64(1)
case 'T':
fields["stopped"] = fields["stopped"].(int64) + int64(1)
case 'R':