Link to home
Start Free TrialLog in
Avatar of IT CAMPER
IT CAMPERFlag for United States of America

asked on

Customized fping command

I currently use an fping command in a batch file that writes all output to a text file. I want to tweak it to write only errors such as no responses or request time outs. Here is my current batch command.

fping 8.8.8.8 -T -c -L ping_google.txt
Avatar of Bill Prew
Bill Prew

I don't think there's any way to do that.  There is no option on fping  to only report errors, and it writes all it's output to STDOUT.  STDERR is not used for missing hosts, etc.  So no way to filter based on output handle.

I would say you would have to capture the output of errors and succeeds, and then run then through another filter, maybe findstr  or a grep port and select just what you want that way.


»bp
Avatar of IT CAMPER

ASKER

Bill, could you write me a script that takes the text file from fping and outputs only the errors to another text file?
In your original post, you indicated you used the following command:

fping 8.8.8.8 -T -c -L ping_google.txt

In looking at the full help info for fping on Windows, I don't see an option of -L.  Also, what is the ping_google.txt file for, you don't seem to be using that in any way?

Also, you are using -c so you are doing a continuous ping.  As such, no output from the command could be processed while it is running, so I'm wondering how you envision this all fitting together?


»bp
Okay, scratch that comment / question about the -L option, I see that was added in v3, I was using an older version here.  I assume you are using v3, not v4?

Do you have example logs that contain the errors you want to filter out?  I suspect there could be a number of different errors and not sure I will know what they are for your use cases.


»bp
Correct, I am using v3 and ping_google.txt is the output file that fping is writing to, as an example. The only error I am encountering right now is the usual 'request timed out' error. I haven't checked but is there an option for fping to output the date as well as time? When I run fping, sometimes it might stay running for a few days so knowing the date is helpful.

15:41:27.671 : 8.8.8.8: request timed out
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bill, you are always spot on with my needs. You have been for many years! Thanks!
Great, glad that was helpful, thanks for the feedback.


»bp