schweikert / fping

High performance ping tool

Home Page:https://fping.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

-q does not remove per ping output when in -l (loop) mode

arctica opened this issue · comments

Running version 5.0 on MacOS 10.15 I noticed that using the -q parameter has no effect when used in combination with -l (loop mode).

The -q parameter only quiet warnings. Do you have an example of what you don't want to see with -q?

I see same behavior on 5.0 as what @arctica stated. Below I state what I see:

OS Information

fping: Version 5.0
OS: Ubuntu 20.04

Help for -q option:

   -q, --quiet        quiet (don't show per-target/per-ping results)
   -Q, --squiet=SECS  same as -q, but show summary every n seconds

Regular fping with short timeout

root@8ca8ee184d27:/app# fping 4.2.2.2 1.2.3.4 -t 30 
4.2.2.2 is alive
1.2.3.4 is unreachable

Fping with -q (no output)

root@8ca8ee184d27:/app# fping 4.2.2.2 1.2.3.4 -t 30 -q
root@8ca8ee184d27:/app# 

Fping with a count set

root@8ca8ee184d27:/app# fping 4.2.2.2 1.2.3.4 -t 30 -c 2 
4.2.2.2 : [0], 64 bytes, 22.7 ms (22.7 avg, 0% loss)
1.2.3.4 : [0], timed out (NaN avg, 100% loss)
4.2.2.2 : [1], 64 bytes, 23.7 ms (23.2 avg, 0% loss)
1.2.3.4 : [1], timed out (NaN avg, 100% loss)

4.2.2.2 : xmt/rcv/%loss = 2/2/0%, min/avg/max = 22.7/23.2/23.7
1.2.3.4 : xmt/rcv/%loss = 2/0/100%

fping with -q with a count set

root@8ca8ee184d27:/app# fping 4.2.2.2 1.2.3.4 -t 30 -c 2 -q
4.2.2.2 : xmt/rcv/%loss = 2/2/0%, min/avg/max = 23.5/23.9/24.4
1.2.3.4 : xmt/rcv/%loss = 2/0/100%

All above is working as expected. The count set is closest to a loop, and with q provided only outputs the summary. However, with the loop set the output continues to display. To be consistent with count, it should display the summary when the user stops fping.

root@8ca8ee184d27:/app# fping 4.2.2.2 1.2.3.4 -t 30 -l -q
4.2.2.2 : [0], 64 bytes, 25.4 ms (25.4 avg, 0% loss)
1.2.3.4 : [0], timed out (NaN avg, 100% loss)
4.2.2.2 : [1], timed out (25.4 avg, 50% loss)
1.2.3.4 : [1], timed out (NaN avg, 100% loss)
4.2.2.2 : [2], 64 bytes, 20.6 ms (23.0 avg, 33% loss)
1.2.3.4 : [2], timed out (NaN avg, 100% loss)
^C
4.2.2.2 : xmt/rcv/%loss = 3/2/33%, min/avg/max = 20.6/23.0/25.4
1.2.3.4 : xmt/rcv/%loss = 3/0/100%

@arctica - as a workaround you could use -Q with a higher timeframe than your test which seems to behave as expected where it only shows the summary. I use time below only to show how long the test was run.

root@8ca8ee184d27:/app# time fping 4.2.2.2 1.2.3.4 -t 30 -l -Q 1000
^C4.2.2.2 : xmt/rcv/%loss = 3/2/33%, min/avg/max = 23.2/23.6/24.1
1.2.3.4 : xmt/rcv/%loss = 3/0/100%

real	0m3.003s
user	0m0.000s
sys	0m0.003s

We can't change what we output due to compatibility concerns.