Bandwidth consumption statistics using vnstat
In some cases (for example,. mobile Internet, where you pay for the transfer of), good to have control over the amount of data sent and downloaded. May be helpful for programs that use statistics to create links.
Among these, mention may be m.in. vnStat, darkstat lub ntop. Personally I liked the first one - simple to configure, designed without unnecessary complications, easily be used to present data in a chosen manner, data shows almost on a regular basis (a maximum delay of a few minutes).
Installation and Configuration
First of all, you will need a package:
1 | vnstat |
Additionally - if we are interested in statistics in graphic form - you can later install package:
1 | vnstati |
Below you how to install the Centosa7
Repozytorum charge EPEL and upgrading the system:
1 2 | yum -y install epel-release yum -y update |
Then install the package:
1 | yum -y install vnstat |
Run it on your system:
1 2 3 | systemctl start vnstat systemctl enable vnstat chkconfig vnstat on |
Below a few shortcut commands:
### daily Stats ###
1 | vnstat -d |
### monthly statistics ###
1 | vnstat -m |
### live Stats ###
1 | vnstat --live |
### Help ###
1 | vnstat --help |
Install additional video overlay:
charge
1 | wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz |
Unpack the directory and move to: /var / www / html /:
1 2 | tar xzf vnstat_php_frontend-1.5.1.tar.gz mv vnstat_php_frontend-1.5.1 /var/www/html/ |
Edit config.php file:
1 2 3 4 | $language = 'en'; $iface_list = array('eth0', 'sixxs'); $iface_title['eth0'] = 'Public Interface'; $vnstat_bin = '/usr/bin/vnstat'; |