Riaan's SysAdmin Blog

My tips, howtos, gotchas, snippets and stuff. Use at your own risk!

Uncategorized

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

admin

Bio Info for Riaan