LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > sag47
User Name
Password

Notices


Rate this Entry

Server latency

Posted 10-27-2011 at 08:26 AM by sag47

I wanted a quick and dirty way to determine server latency on my Kubuntu machine. This just parses simple output from ping and provides only the time values.

Code:
for x in drexel.edu google.com;do echo -n "[$x]: "; ping -c 1 $x | head -n 2 | tail -n 1 | awk '{split($8,arr,"=")} END{print arr[2],$9}';done
Output
Code:
[drexel.edu]: 0.576 ms
[google.com]: 6.23 ms
You can put as many servers or IPs as you want in the for loop to get a comparison. Just simple little interesting statistic.

SAM
Posted in Uncategorized
Views 1770 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 09:53 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration