Skip to content

Commit

Permalink
Return correct response code on ping input (#4875)
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton committed Oct 17, 2018
1 parent ef3cc04 commit 976437e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func (_ *Ping) SampleConfig() string {
}

func (p *Ping) Gather(acc telegraf.Accumulator) error {

var wg sync.WaitGroup

// Spin off a go routine for each url to ping
Expand Down Expand Up @@ -109,6 +108,7 @@ func (p *Ping) Gather(acc telegraf.Accumulator) error {
if exitError, ok := err.(*exec.ExitError); ok {
if ws, ok := exitError.Sys().(syscall.WaitStatus); ok {
status = ws.ExitStatus()
fields["result_code"] = status
}
}

Expand Down

0 comments on commit 976437e

Please sign in to comment.