Get network transfer information from linux
Whilst attempting to find some information for a project necessary on calculating (guesstimating) a budget for bandwidth used by a machine in the cloud I had to know where we were with current usage.
Unfortunately the cloud services this VM sits in don't have any method exposed to show my usage and as such I turned to AskJeeves to find out some linux tools to help me out.
First off the rank is vnStat which seems to be part of most of my Ubuntu boxes after looking at a few of them.
Actually, that's the only necessary tool I used to get my data.
By invoking vnstat with no parameters I got a nice printout of:
~$ vnstat
Database updated: Mon Sep 4 00:17:31 2017
ens3 since 05/22/2017
rx: 1.25 TiB tx: 21.85 TiB total: 23.10 TiB
monthly
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
Aug '17 194.53 GiB | 6.19 TiB | 6.38 TiB | 20.47 Mbit/s
Sep '17 25.83 GiB | 362.41 GiB | 388.23 GiB | 12.51 Mbit/s
------------------------+-------------+-------------+---------------
estimated 257.22 GiB | 3.52 TiB | 3.78 TiB |
daily
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
yesterday 18.93 GiB | 69.44 GiB | 88.37 GiB | 8.58 Mbit/s
today 441.58 MiB | 22.13 GiB | 22.56 GiB | 180.08 Mbit/s
------------------------+-------------+-------------+---------------
estimated 36.48 GiB | 1.83 TiB | 1.87 TiB |
Unfortunately the cloud services this VM sits in don't have any method exposed to show my usage and as such I turned to AskJeeves to find out some linux tools to help me out.
First off the rank is vnStat which seems to be part of most of my Ubuntu boxes after looking at a few of them.
Actually, that's the only necessary tool I used to get my data.
By invoking vnstat with no parameters I got a nice printout of:
~$ vnstat
Database updated: Mon Sep 4 00:17:31 2017
ens3 since 05/22/2017
rx: 1.25 TiB tx: 21.85 TiB total: 23.10 TiB
monthly
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
Aug '17 194.53 GiB | 6.19 TiB | 6.38 TiB | 20.47 Mbit/s
Sep '17 25.83 GiB | 362.41 GiB | 388.23 GiB | 12.51 Mbit/s
------------------------+-------------+-------------+---------------
estimated 257.22 GiB | 3.52 TiB | 3.78 TiB |
daily
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
yesterday 18.93 GiB | 69.44 GiB | 88.37 GiB | 8.58 Mbit/s
today 441.58 MiB | 22.13 GiB | 22.56 GiB | 180.08 Mbit/s
------------------------+-------------+-------------+---------------
estimated 36.48 GiB | 1.83 TiB | 1.87 TiB |
Further to this data I found the -m parameter gave me all recorded months.
~$ vnstat -m
ens3 / monthly
month rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
May '17 133.81 GiB | 4.15 TiB | 4.28 TiB | 13.72 Mbit/s
Jun '17 232.61 GiB | 5.80 TiB | 6.03 TiB | 19.97 Mbit/s
Jul '17 691.91 GiB | 5.36 TiB | 6.03 TiB | 19.35 Mbit/s
Aug '17 194.53 GiB | 6.19 TiB | 6.38 TiB | 20.47 Mbit/s
Sep '17 74.13 GiB | 2.69 TiB | 2.77 TiB | 46.19 Mbit/s
------------------------+-------------+-------------+---------------
estimated 373.56 GiB | 13.57 TiB | 13.94 TiB |
Perfect tool!
Comments
Post a Comment