diff --git a/plugins/inputs/ping/ping.go b/plugins/inputs/ping/ping.go index b415c6d4d..3368a25e0 100644 --- a/plugins/inputs/ping/ping.go +++ b/plugins/inputs/ping/ping.go @@ -128,7 +128,7 @@ func hostPinger(args ...string) (string, error) { // args returns the arguments for the 'ping' executable func (p *Ping) args(url string) []string { // Build the ping command args based on toml config - args := []string{"-c", strconv.Itoa(p.Count)} + args := []string{"-c", strconv.Itoa(p.Count), "-n", "-s", "16"} if p.PingInterval > 0 { args = append(args, "-i", strconv.FormatFloat(p.PingInterval, 'f', 1, 64)) } diff --git a/plugins/inputs/ping/ping_test.go b/plugins/inputs/ping/ping_test.go index 64da15b51..6663207a0 100644 --- a/plugins/inputs/ping/ping_test.go +++ b/plugins/inputs/ping/ping_test.go @@ -76,7 +76,7 @@ func TestArgs(t *testing.T) { // Actual and Expected arg lists must be sorted for reflect.DeepEqual actual := p.args("www.google.com") - expected := []string{"-c", "2", "www.google.com"} + expected := []string{"-c", "2", "-n", "-s", "16", "www.google.com"} sort.Strings(actual) sort.Strings(expected) assert.True(t, reflect.DeepEqual(expected, actual), @@ -84,7 +84,7 @@ func TestArgs(t *testing.T) { p.Interface = "eth0" actual = p.args("www.google.com") - expected = []string{"-c", "2", "-I", "eth0", "www.google.com"} + expected = []string{"-c", "2", "-n", "-s", "16", "-I", "eth0", "www.google.com"} sort.Strings(actual) sort.Strings(expected) assert.True(t, reflect.DeepEqual(expected, actual), @@ -92,7 +92,7 @@ func TestArgs(t *testing.T) { p.Timeout = 12.0 actual = p.args("www.google.com") - expected = []string{"-c", "2", "-I", "eth0", "-t", "12.0", "www.google.com"} + expected = []string{"-c", "2", "-n", "-s", "16", "-I", "eth0", "-t", "12.0", "www.google.com"} sort.Strings(actual) sort.Strings(expected) assert.True(t, reflect.DeepEqual(expected, actual), @@ -100,7 +100,7 @@ func TestArgs(t *testing.T) { p.PingInterval = 1.2 actual = p.args("www.google.com") - expected = []string{"-c", "2", "-I", "eth0", "-t", "12.0", "-i", "1.2", + expected = []string{"-c", "2", "-n", "-s", "16", "-I", "eth0", "-t", "12.0", "-i", "1.2", "www.google.com"} sort.Strings(actual) sort.Strings(expected) diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index bbad51506..d4f150c83 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -68,4 +68,6 @@ tmpdir=$(mktemp -d) exit_if_fail ./telegraf -config $tmpdir/config.toml \ -test -input-filter cpu:mem +mv ./telegraf $CIRCLE_ARTIFACTS + exit $rc