Monitor Bandwidth Usage with vnStat
In these days of bandwidth caps and pay-per-kilobyte rates, keeping an eye on your bandwidth usage makes a lot of sense. While there is no lack of bandwidth monitoring utilities, vnStat stands out from the crowd thanks to its ability to store monitoring data in a database and resume monitoring automatically on reboot. This means that once installed and configured, vnStat quietly monitors a specified network interface and saves the collected data. You can then use vnStat's command parameters to view detailed reports of your bandwidth usage.
vnStat is available in the software repositories of many mainstream Linux distributions, so you can easily install it using your distro's package manager. On an Ubuntu-based system, vnStat can be installed using the sudo apt-get install vnstat command. Before you can start using the utility, you must specify the network interface you want vnStat to monitor. First, run the ifconfig command to view a list of all available network interfaces. You can then use the -u and -i parameters to create a database for the specified network interface, for example:
sudo vnstat -u -i wlan0
Once vnstat is configured, it needs some time to collect data. After that you can view the bandwidth usage statistics using the vnstat command. The utility sports a few rather useful parameters, too. The -d ( or --days) parameter displays the daily bandwidth usage, while the -w ( --weeks) and -m ( --months) parameters break down the statistics by week and month. You can view a full list of available parameters using either the vnstat --help or vnstat --longhelp command.
The packaged version of vnStat that is available in your distro's software repositories may not include vnStati -- a nifty utility which can turn dry text-only statistics into nice-looking graphs. In this case, if you want to analyze monitoring data visually, you have to compile vnStat from source. Fortunately, this is a rather straightforward procedure. First of all, make sure that you have all the tools necessary for building software from source. On Ubuntu, you can install them using the sudo apt-get install build-essential command. Next, install the libgd2-noxpm and libgd2-noxpm-dev libraries, using the sudo apt-get install libgd2-noxpm libgd2-noxpm-dev command. Download the latest .tar.gz version of vnStat from the project's Web site and unpack it. Switch to the resulting directory in the terminal and execute the make all command. Finally, run the sudo make install command to install the software. To generate a graph in the PNG format using VnStati, you have to specify at least three parameters: a graph type, a network interface, and the output file. For example, the command below produces a vnstat.png graphics file containing a traffic summary including hourly data using a horizontal layout:
vnstati -vs -i wlan0 -o ~/vnstat.png
Of course, you can use the vstati --help command to view a list of the available parameters.
Additional ToolsThis tool looks great, thanks.
If anyone has additional network monitoring needs, let me suggest this website: http://www.activitymonitori...network_server_monitoring1.php
great tipthank you very much, have been looking for such a program.
was easy to install through ubuntu's apt
I am trying to configure vnstat php fontend (http://www.sqweek.com/sqweek/index.php?p=1) must have for a server
New release targets Linux professionals.
The Fedora project adds Wayland and Gnome 3.22
CeBIT 2017: Open Source Forum Call for Papers
Long-time Linux antagonist joins the revolution.
Major bug affects Debian/Ubuntu distributions.
Canonical releases the minimal edition for embedded devices, Internet of Things, and cloud deployments.
The new release features improvements across the board, from performance to security.
Two out of three of the new members are women.
More than 5,000 people attended the event.
Linux Magazine will include the best of both magazines.