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 Linux distro is optimzed for gaming..
Latest version includes improved security, virtualization, and remote control.
Version 16 of the popular Linux desktop reveals new tools, edge-snapping, and performance improvements.
Symantec says Linux-Darlloz burrows in through PHP.
Dell renews its quest for the ultimate developer machine.
Innovative back door looks like normal SSH traffic.
One of CeBITs most successful forums opens the new year with a new name. The popular Open Source Forum continues in 2014 under the name Special Conference: Open Source. This year, the forum will be bigger and offer a wider range of possibilities for sponsors.
New release offers better graphics drivers and expands filesystem support.
New mail protocol will shut out the NSA and prevent snooping on metadata.
A new web application helps users visualize distributed denial-of-service attacks.