Go Job Hunting at the LQ Job Marketplace
Go Back > Blogs
User Name



Server latency

Posted 10-27-2011 at 09: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.

for x in;do echo -n "[$x]: "; ping -c 1 $x | head -n 2 | tail -n 1 | awk '{split($8,arr,"=")} END{print arr[2],$9}';done
[]: 0.576 ms
[]: 6.23 ms
You can put as many servers or IPs as you want in the for loop to get a comparison....
Senior Member
Posted in Uncategorized
Views 584 Comments 0 sag47 is offline

Network usage on a single device and log diving

Posted 09-27-2011 at 03:57 PM by sag47
Updated 09-29-2011 at 09:30 AM by sag47
Tags networking

I wanted to know the received network usage on a device in kB so this one liner was produced for the desired result.
while true; do y=`ifconfig eth0 | grep RX\ bytes| sed -e 's/.*bytes\://' -e 's/\ .*//'`; sleep 1; x=`ifconfig eth0 | grep RX\ bytes| sed -e 's/.*bytes\://' -e 's/\ .*//'`; echo $(((x-y)/1024)); done
Press Ctrl+C to stop analyzing the network traffic on that device.

Here's another one liner of me looking through multiple log locations.
Senior Member
Posted in Uncategorized
Views 664 Comments 0 sag47 is offline


All times are GMT -5. The time now is 04:13 AM.

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