Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-u does not work when -c is used #274

Closed
asarubbo opened this issue Apr 28, 2023 · 3 comments
Closed

-u does not work when -c is used #274

asarubbo opened this issue Apr 28, 2023 · 3 comments

Comments

@asarubbo
Copy link

 ~ $ fping -v
fping: Version 5.1

This works for me:

~ $ fping -4 -r 1 -t 1000 10.10.5.90 10.10.5.1 -q -u
10.10.5.90

However when I add -c it doesn't

 ~ $ fping -4 -r 1 -t 1000 10.10.5.90 10.10.5.1 -q -u -c 1
10.10.5.90 : xmt/rcv/%loss = 1/0/100%
10.10.5.1  : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.171/0.171/0.171

Because it also prints about reachable targets.

@auerswal
Copy link
Collaborator

auerswal commented Feb 4, 2024

I am not really sure what you want to achieve with the above fping invocation.

It seems to me as if fping -u -r 1 10.10.5.90 10.10.5.1 already provides all the interesting information. So what purpose have the options -c 1 -q? Do you attempt to get the following output (I am using two different IP addresses for illustration)?

$ fping -r1 -q -u -c1 8.8.8.7 8.8.8.8 2>&1 | grep -v ,
8.8.8.7 : xmt/rcv/%loss = 1/0/100%

Since the fping command line specifies to send just one echo request, the statistics can be added with, e.g., sed:

$ fping -r1 -u 8.8.8.7 8.8.8.8 | sed 's,$, : xmt/rcv/%loss = 1/0/100%,'
8.8.8.7 : xmt/rcv/%loss = 1/0/100%

It seems to me as if just -u -r N already provides all the information the combination of -r 1 -c N -q -u can give.

@asarubbo
Copy link
Author

asarubbo commented Feb 5, 2024

I am not really sure what you want to achieve with the above fping invocation.

I was just saying that by adding -c 1 (so just a count) it prints out the reachable targets and their stats, while with -q it shouldn't.

@auerswal
Copy link
Collaborator

auerswal commented Feb 5, 2024

The option -c N prints one output line for every received reply or timeout, and one summary line per target at the end.

The combination -c N -q only prints the summary line per target, but not the individual per-probe reports.

If you want the output format of -u, i.e., just the Name or IP address of each unreachable target, but want fping to try several times to reach each target, you can use -r N optionally combined with -B 1, instead of using -c N. (By default, fping uses -r 3.)

auerswal added a commit to auerswal/fping that referenced this issue Feb 5, 2024
 * Move -c, --count=N description to output options:

   The -c option not only adjusts the number of probes, but also
   changes the output mode.  This is similar to -C, --vcount=N.
   Move the description from the "probing options" section to the
   "output options" sections, next to -C, --vcount=N.

   This might be helpful, since at the heart of issues schweikert#271 and
   schweikert#274 there seems to be a misunderstanding of what -c does.

 * Move -i, --interval=MSEC description to probing options:

   The -i option does not directly affect the output format, but
   rather the probe generation, i.e., the minimum time between
   probes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants