Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

fping question

joelsephjoelseph Posts: 9Member
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

  • satharielsathariel Posts: 59Member
    : 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]

  • joelsephjoelseph Posts: 9Member
    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]
    :
    :

  • isa6699isa6699 Posts: 5Member
    This post has been deleted.
  • springwater3springwater3 Posts: 6Member
    This post has been deleted.
Sign In or Register to comment.