Skip to content

Instantly share code, notes, and snippets.

@sheeplogh
Last active December 10, 2015 04:08
Show Gist options
  • Save sheeplogh/4379059 to your computer and use it in GitHub Desktop.
Save sheeplogh/4379059 to your computer and use it in GitHub Desktop.
[shell] Get network throughput (Mbps, Average 10 minutes) on Linux machines from sar.
## Rx
$ LANG=C sudo sar -n DEV | grep eth0 | grep -v Average | awk '{print $1, $5*8/1048576}'
## Tx
$ LANG=C sudo sar -n DEV | grep eth0 | grep -v Average | awk '{print $1, $6*8/1048576}'
# Ex.
$ LANG=C sudo sar -n DEV -f /var/log/sa/sa24 | grep eth0 | grep -v Average | awk '{print $1, $6*8/1048576}'
...
23:20:01 4.32473
23:30:01 3.23028
23:40:01 2.73195
23:50:01 3.35444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment