Ping replacement that shows real time

ping

Is there a ping replacement that will display the system's date/time in addition to the round trip time and sequence number? I would prefer a tool that runs on Linux, but if there is a cli tool I can run on Windows that would be good too.

There is a system which users are reporting is intermittently pausing. This doesn't seem to happen at any consistent time. I haven't been able to get the reporting user to tell when it happened with enough specificity to be able to correlate the pause to any logs.

One of the techs left a ping running against the host for a day. The round trip time got pretty large at one point in time. I am trying to figure out when exactly this happens so I can narrow down which log entries I should be looking at, and possibly correlate this pause with other data I might be able to collect with performance logs, device logs and so on.

64 bytes from 10.2.4.241: icmp_seq=1825 ttl=64 time=0.321 ms
64 bytes from 10.2.4.241: icmp_seq=1826 ttl=64 time=0.371 ms
64 bytes from 10.2.4.241: icmp_seq=1827 ttl=64 time=13937.638 ms
64 bytes from 10.2.4.241: icmp_seq=1828 ttl=64 time=12937.526 ms
64 bytes from 10.2.4.241: icmp_seq=1829 ttl=64 time=11937.392 ms
64 bytes from 10.2.4.241: icmp_seq=1830 ttl=64 time=10937.275 ms
...
64 bytes from 10.2.4.241: icmp_seq=1840 ttl=64 time=936.073 ms
64 bytes from 10.2.4.241: icmp_seq=1841 ttl=64 time=0.410 ms

Best Answer

You can add timestamps using perl like this:

ping 127.0.0.1 | perl -pe 'BEGIN {use POSIX;} print strftime("%Y-%m-%d %H:%M:%S ", localtime)'
Related Topic