diff --git a/plugins/inputs/ping/README.md b/plugins/inputs/ping/README.md index 4996fdc37..4f953c8e1 100644 --- a/plugins/inputs/ping/README.md +++ b/plugins/inputs/ping/README.md @@ -31,6 +31,13 @@ apt-get install iputils-ping ## Interface or source address to send ping from (ping -I ) ## on Darwin and Freebsd only source address possible: (ping -S ) # interface = "" + + ## Specify the ping executable binary, default is "ping" + # binary = "ping" + + ## Arguments for ping command + ## when arguments is not empty, other options (ping_interval, timeout, etc) will be ignored + # arguments = ["-c", "3"] ``` ### Metrics: diff --git a/plugins/inputs/ping/ping.go b/plugins/inputs/ping/ping.go index a95f27ebf..53c109d75 100644 --- a/plugins/inputs/ping/ping.go +++ b/plugins/inputs/ping/ping.go @@ -133,6 +133,7 @@ func (p *Ping) pingToURL(u string, acc telegraf.Accumulator) { if exitError, ok := err.(*exec.ExitError); ok { if ws, ok := exitError.Sys().(syscall.WaitStatus); ok { status = ws.ExitStatus() + fields["result_code"] = status } }