We help IT Professionals succeed at work.

CAPTURE PING OUTPUT

Lesd0
Lesd0 asked
on
I want to run a constant ping on a router for 72 hours and capture the output with time and date in a txt file
Comment
Watch Question

Mike ThomasConsultant
Top Expert 2010

Commented:
Something like this would do it.

ping -t > c:\pingoutput.txt

Possibly

ping -t >> c:\pingoutput.txt
(to append)

give it a go now, you will manually have to stop the ping mind.

Author

Commented:
Thanks thats worked
Is there any way of putting a time stamp on it?
Mike ThomasConsultant
Top Expert 2010

Commented:
An incrimental time stamp throughout the log you mean? not possible with the command line tool afaik

There may be a third party tool that can do that though, i will have a look and see what i can find

Author

Commented:
An incrimental time stamp throughout so I can go away and forget about it until monday is what I am after.  Thanks
Consultant
Top Expert 2010
Commented:
del ping.txt
:start
echo %date%%time >>ping.txt
ping -n 1 servername |find /i "packets" >>ping.txt

goto start

replace servername with you server name
if you're looking for errors look for 100% loss in the ping.txt file

Author

Commented:
Perfect for what I need