fping question

I'm trying to write a script that will fping several hundred hosts at a time to get packet loss statistics. I'm using the -q argument to run the command in quiet mode and only get the overall packet loss on 100 packets sent to each host.

The problem I'm running into is that I'm piping to output to a file, and the summary information doesn't get sent. Even running the following produces only an empty file: fping -e -c 5 -q www.yahoo.com www.lycos.com www.google.com > test.txt. Omitting the -q tag does output the individual packet information to the text file, but not the summary information.

Anyone have any ideas on how I can capture the summary data in a file? This was attempted with a shell script. I also tried writing a perl script with

`fping -e -c 5 -q www.yahoo.com`;

and even

print `fping -e -c 5 -q www.yahoo.com`;

and piped the output of the perl script to a file, to no avail.

Help!

Comments

  • : I'm trying to write a script that will fping several hundred hosts at a time to get packet loss statistics. I'm using the -q argument to run the command in quiet mode and only get the overall packet loss on 100 packets sent to each host.
    :
    : The problem I'm running into is that I'm piping to output to a file, and the summary information doesn't get sent. Even running the following produces only an empty file: fping -e -c 5 -q www.yahoo.com www.lycos.com www.google.com > test.txt. Omitting the -q tag does output the individual packet information to the text file, but not the summary information.
    :
    : Anyone have any ideas on how I can capture the summary data in a file? This was attempted with a shell script. I also tried writing a perl script with
    :
    : `fping -e -c 5 -q www.yahoo.com`;
    :
    : and even
    :
    : print `fping -e -c 5 -q www.yahoo.com`;
    :
    : and piped the output of the perl script to a file, to no avail.
    :
    : Help!
    :

    Hi,

    try to redirect the output from stderr to stdout:

    fping -e -c 5 -q www.yahoo.com 2>&1

    regards
    [black]SaThaRiel[/black]

    [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]

  • Yep, I figured this out about a half hour after posting... I logged into an IRC FreeBSDHelp channel and was told to try 2>. That worked like a charm! Thanks kindly for the prompt info, however. Nice to know where some knowledgeable and timely assistance can be found.

    Thanks again!


    : : I'm trying to write a script that will fping several hundred hosts at a time to get packet loss statistics. I'm using the -q argument to run the command in quiet mode and only get the overall packet loss on 100 packets sent to each host.
    : :
    : : The problem I'm running into is that I'm piping to output to a file, and the summary information doesn't get sent. Even running the following produces only an empty file: fping -e -c 5 -q www.yahoo.com www.lycos.com www.google.com > test.txt. Omitting the -q tag does output the individual packet information to the text file, but not the summary information.
    : :
    : : Anyone have any ideas on how I can capture the summary data in a file? This was attempted with a shell script. I also tried writing a perl script with
    : :
    : : `fping -e -c 5 -q www.yahoo.com`;
    : :
    : : and even
    : :
    : : print `fping -e -c 5 -q www.yahoo.com`;
    : :
    : : and piped the output of the perl script to a file, to no avail.
    : :
    : : Help!
    : :
    :
    : Hi,
    :
    : try to redirect the output from stderr to stdout:
    :
    : fping -e -c 5 -q www.yahoo.com 2>&1
    :
    : regards
    : [black]SaThaRiel[/black]
    :
    : [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]
    :
    :

  • This post has been deleted.
  • This post has been deleted.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories