Link to home
Start Free TrialLog in
Avatar of Richard_Eustace
Richard_Eustace

asked on

Ping time stamp

Hi

I am running the line Ping <Address> -t > Pingtest.txt from the command line of a WIN NT Server and I want to be able to add a Time stamp to each ping so I can look in the  log at a specified time and see what the ping was.

Avatar of defore
defore

ping 4.2.2.2 -t -s 4 > ping.txt

Thanks
Steven
Avatar of Richard_Eustace

ASKER

I tried

ping greenmile -t -s 4 > ping.txt

and got

Pinging greenmile.Kainos.com [10.0.4.139] with 32 bytes of data:

Reply from 10.0.4.139: bytes=32 time<10ms TTL=128

    Timestamp: 10.0.4.139 : 3406857986

Reply from 10.0.4.139: bytes=32 time<10ms TTL=128

    Timestamp: 10.0.4.139 : 3038021378


The number does not look like a time, I would lihe a time stamp like 12/03/2002 12:30:33
ASKER CERTIFIED SOLUTION
Avatar of JimmyPop
JimmyPop

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
The timestamp you see, ie 3406857986, is in Universal Time; basically the way Unix determines time. To my knowledge, there is no switch available to the ping command that would convert it into "human readable" format.

Perhaps your best bet is to use:
date [enter] (displays current date)
time [enter] (displays current time)
ping greenmile -t (if you want a continuous ping)
time [enter] (displays current time)

Ping is basically used for measuring host response in milliseconds (1/1000 of a second). It would be impossible to timestamp anything that takes less that 1000ms since that would equate to less that 1 second; which is the maximum accuracy supported by system clocks. You would need something more accurate that would produce something like the following: 03/14/02 03:14:52.189, displaying the fractions of a second.
You may be interested in a utility such as Ping Plotter (http://www.pingplotter.com) to get the details you require.
I Would need  perl script for Ping with Date and time stamp