I can see the data transferred (internet Download/Upload) in the current session from the System Monitor. But I want something that keeps track of all the data transferred and I can see how much data was used in a month or two. Preferably a GUI tool.
Install vnstat
Now you want to configure your interface
i.e
Now to see the usage type
vnstat
in terminalOutput:
Note:
To see the monthly status alone type
vnstat -m
to see the daily status typevnstat -d
#vnStat - Light Weight Console-based Network Monitor
vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources.
In this tutorial we'll review:
#Features
#Installation
nvStat is in the official repositories so no need to link to a new ppa. To install create a Terminal instance using Ctrl+Alt+T and type at the prompt:
After installation, keep your Terminal open for the following sections. There is no need to reboot.
#Configuration
Pick a preferred network interface and edit the Interface variable in the
/etc/vnstat.conf
accordingly. To the list all interfaces available to vnstat, use:To start monitoring a particular interface you must initialize a database first. Each interface needs its own database. The command to initialize one for the eth0 interface is:
#Start Systemd Service
After introducing the interface(s) and checking the config file. You can start the monitoring process via
systemd
:To make this service permanent use:
From now on
vnstat
will be gathering network usage in the background using such a small percentage of CPU it doesn't show up on conky's (system monitor's) top 9 list of processes (on my machine).#Usage (from Command Line)
Query the network traffic:
Viewing live network traffic usage:
To find more options, use:
#Monthly Totals
To see monthly totals, use:
#Conky example
Conky is a popular light-weight System Monitor used across many Linux distributions. You can vnStat bandwidth totals to your conky display like this:
Note when picture was taken
Yesterday
was Sunday which explains why the Weekly total is less.The conky code to achieve this is:
To save space on my narrow window I used "G" instead of "GiB", "M" instead of "MiB", etc. If you have more screen realestate change
substr ($10, 1, 1)
to$10
and the same for$9
.You may have to change
eth0
towlan0
oreth1
, etc. depending on your network name reported byifconfig
.If you like a nice GUI try NTM - Network Traffic Monitor. It's not in the repos but you can easily download a deb package from their website: http://netramon.sourceforge.net/eng/index.html
Should work for all *buntu variants.
Features: