Ping with timestamp

Ping with timestamp

Since I am always looking for my notes I am adding this snippet here for reference. Handy for checking the time a reboot takes for example.

$ ping server1 | xargs -L 1 -I '{}' date '+%Y-%m-%d %H:%M:%S: {}'
2017-06-08 07:13:21: PING server1 (10.1.10.31) 56(84) bytes of data.
2017-06-08 07:13:21: 64 bytes from 10.1.10.31 (10.1.10.31): icmp_seq=1 ttl=246 time=113 ms
2017-06-08 07:13:22: 64 bytes from 10.1.10.31 (10.1.10.31): icmp_seq=2 ttl=246 time=112 ms
2017-06-08 07:13:23: 64 bytes from 10.1.10.31 (10.1.10.31): icmp_seq=3 ttl=246 time=112 ms
2017-06-08 07:13:24: 64 bytes from 10.1.10.31 (10.1.10.31): icmp_seq=4 ttl=246 time=111 ms

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.