LAST EDIT: Saturday, January 17th, 2009

vnStat Network Traffic Monitor

vnStat is a network traffic monitor. It is ideal for maintaining a log of bandwidth usage, this is particularly useful when you using a metered Internet connection.

Installing vnStat

Using Ubuntu, vnStat can be installed with the following terminal command:

sudo apt-get install vnstat

Set-up vnStat

Once installed, run the following terminal command to make the application's directories writeable:

sudo chmod o+x /usr/bin/vnstat && sudo chmod o+wx /var/lib/vnstat/

Finally, define the network interface you would like to log with the following command. The example below lists ppp0 which is my USB mobile broadband modem, you can change this to match your system's network interface. i.e. eth0, wlan0 etc.

vnstat -u -i ppp0

Using vnStat

Once the set-up is complete, reports/logs can viewed in a number of ways. The default "Daily" report can be viewed simply by entering the command:

vnstat

Details about other reports can be seen by entering the command:

vnstat --help

Example report

The following is an example of a vnStat daily report:

corenominal@kermit:~$ vnstat
Database updated: Thu Jan  1 16:15:01 2009

    ppp0

       received:      82.63 MB (93.2%)
    transmitted:       6.54 MB (6.8%)
          total:      89.16 MB

                    rx     |     tx     |  total
    -----------------------+------------+-----------
        today     82.63 MB |    6.54 MB |   89.16 MB
    -----------------------+------------+-----------
    estimated       120 MB |       8 MB |     128 MB

Tagged with: software, vnstat


4 Responses to “vnStat Network Traffic Monitor”

  1. bamber ward wrote,

    I have ubuntu 9-10/ I installed vnstat but kept on getting unble to read or write message. I tried various chmod commands on /var/lib/vnstat but did not think of doing anything to /usr/bin/vnstat. Your set-up advice ended hours of trying. Thank you.

  2. IslandLinux wrote,

    How are you finding the ppp0 interface when the modem is not plugged in?

  3. Philip wrote,

    @IslandLinux, I am curious, why do you ask?

  4. Xaw wrote,

    Thanks, follow the instruction, tryed it and hola it work thank again!

Add Your Comment

Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.