Below ping command can be used to print the date timestamps during the ping test.
Below is example snippet of above command.
ping <IP> | while read pong; do echo "$(date): $pong"; done
Below is example snippet of above command.
# ping 10.10.10.17 | while read pong; do echo "$(date): $pong"; done
Thu Oct 6 16:11:40 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=1 ttl=64 time=64.2 ms
Thu Oct 6 16:11:41 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=2 ttl=64 time=0.094 ms
Thu Oct 6 16:11:42 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=3 ttl=64 time=0.067 ms
Thu Oct 6 16:11:43 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=4 ttl=64 time=0.100 ms
Thu Oct 6 16:11:44 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=5 ttl=64 time=0.155 ms
Thu Oct 6 16:11:41 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=2 ttl=64 time=0.094 ms
Thu Oct 6 16:11:42 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=3 ttl=64 time=0.067 ms
Thu Oct 6 16:11:43 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=4 ttl=64 time=0.100 ms
Thu Oct 6 16:11:44 EDT 2016: 64 bytes from 10.10.10.10: icmp_seq=5 ttl=64 time=0.155 ms
Products to which Article Applies
All Linux Operating Systems
Additional References
https://gist.github.com/olimortimer/9c6c3cf8d1364f4fe9d2
tarun boyella
No comments:
Post a Comment