FreeBSD

Moderators: gautam
Number of threads: 52
Number of posts: 113

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
fping question Posted by joelseph on 4 Apr 2004 at 9:09 PM
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!
Report
Re: fping question Posted by sathariel on 6 Apr 2004 at 3:47 AM
: 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
SaThaRiel

Any time things appear to be going better, you have overlooked something.

Report
Re: fping question Posted by joelseph on 6 Apr 2004 at 5:11 AM
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
: SaThaRiel
:
: Any time things appear to be going better, you have overlooked something.
:
:

Report
This post has been deleted. Posted by isa6699 on 7 May 2009 at 11:51 PM
This post has been deleted.
Report
This post has been deleted. Posted by springwater3 on 10 Mar 2010 at 1:59 AM
This post has been deleted.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.