MRTG is for network monitoring and it can be use to see how much traffic your server or ADSL router actually generated, however it will not tell you how much megabytes or gigabytes the daily traffic was. For all such home user and people having dedicated single Linux box hosted somewhere remote at IDC/ISP there is a tool called vnStat:
- It is a console-base network traffic monitor for Linux (perfect tool for remote Linux box hosted at ISP)
- It keeps a log of daily and monthly network traffic for the selected network interface(s).
- It collects all data from /proc file system it means normal user can monitor traffic (no need to run vnstat as a root user)
- Easy to setup & configure
- Ease of use
Step # 1: Install vnstat
Debian / Ubuntu Linux user can install vnstat using apt-get command, enter:# apt-get install vnstat
Step # 2: Enable vnstat
Once installed, you need to create a database with the following command:# vnstat -u -i eth0Where,
- -u :forces a database update for interface or creates the database if it doesn’t exist
- -i eth0 : use to specify interface
0-55/5 * * * * root /usr/bin/vnstat -uYou do not have to install cronjob yourself; it should be automatically configure by apt-get.
Step # 3 View statistics
Display default traffic statistics$ vnstatDisplay daily traffic statistics
$ vnstat -d
Display monthly traffic statistics:
$ vnstat -mDisplay all time top10 traffic days:
$ vnstat -t
Try help option to get all query options:
$ vnstat --help
No comments:
Post a Comment