Skip to content

Ping with timestamp

wordpress meta

title: 'Ping with timestamp'
date: '2017-06-08T07:25:28-05:00'
status: publish
permalink: /ping-with-timestamp
author: admin
excerpt: ''
type: post
id: 1114
category:
    - Uncategorized
tag: []
post_format: []

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