Skip to content

Commit

Permalink
Don't consider pid of 0 when using systemd lookup in procstat (influx…
Browse files Browse the repository at this point in the history
  • Loading branch information
Frakenz authored and Mathieu Lecarme committed Apr 17, 2020
1 parent 2d4abc6 commit f5b3fd6
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 f5b3fd6

Please sign in to comment.