27/12/16

Ping host and log output with timestamp

If you have some random network issue (specially on virtual machine) and you have to collect the time when it occur this command line can be helpful for you.

ping host | perl -nle 'BEGIN {$|++} print scalar(localtime), " ", $_' > outputfile

Source: http://stackoverflow.com/questions/10679807/how-to-timestamp-every-ping-result