Skip to content

Commit

Permalink
Don't consider pid of 0 when using systemd lookup in procstat (#5972)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frakenz authored and danielnelson committed Jun 14, 2019
1 parent d38f760 commit cc2f3b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/procstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func (p *Procstat) systemdUnitPIDs() ([]PID, error) {
if !bytes.Equal(kv[0], []byte("MainPID")) {
continue
}
if len(kv[1]) == 0 {
if len(kv[1]) == 0 || bytes.Equal(kv[1], []byte("0")) {
return nil, nil
}
pid, err := strconv.Atoi(string(kv[1]))
Expand Down

0 comments on commit cc2f3b2

Please sign in to comment.