MEWBIES@:  Facebook  Twitter  G+  YouTube  DeviantArt  Forum  Wall
 SHARE:
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌                     -   MONITOR BANDWIDTH   -                           █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ VNSTAT:                                                                    ▐▌
 █ ```````                                                                    ▐▌
 █ I love vnStat. As per their man page: "vnStat is a console-based network   ▐▌
 █ traffic monitor. It keeps a log of hourly, daily and monthly network       ▐▌
 █ traffic  for the selected interface(s). However, it isn't a packet sniffer.▐▌
 █ The traffic information is analyzed from the proc(5) filesystem. That way  ▐▌
 █ vnStat can be used even without root permissions."                         ▐▌
 █ Their website is HERE.                                                     ▐▌
 █                                                                            ▐▌
 █ INSTALL & USAGE VNSTAT:                                                    ▐▌
 █ ```````````````````````                                                    ▐▌
 █ su                                                                         ▐▌
 █ aptitude install vnstat                                                    ▐▌
 █                                                                            ▐▌
 █ Then you need to to tell vnstat the name of the network interface you want ▐▌
 █ to monitor; usually eth0 or eth1. To find out the name of yours, will be   ▐▌
 █ at the top left of this list (cmd for root only):                          ▐▌
 █ ifconfig                                                                   ▐▌
 █ Mine is eth1, so then to inform vnstat and create a cron job for it to run ▐▌
 █ to collect traffic data continuously:                                      ▐▌
 █ vnstat -u -i eth1                                                          ▐▌
 █ exit                                                                       ▐▌
 █ Done :) Now give it an hour or so to collect some data then:               ▐▌
 █ vnstat                                                                     ▐▌
 █ While waiting; read - for all the options:                                 ▐▌
 █ man vnstat                                                                 ▐▌
 █ (hit enter key to scroll page down, type q to quit man windows)            ▐▌
 █ Examples (as per man):                                                     ▐▌
 █ Show traffic for the last 24 hours:                                        ▐▌
 █ vnstat -h                                                                  ▐▌
 █ Show traffic for days:                                                     ▐▌
 █ vnstat -d                                                                  ▐▌
 █ To show traffic for 7 days, current and previous week:                     ▐▌
 █ vnstat -w                                                                  ▐▌
 █ Show traffic for months:                                                   ▐▌
 █ vnstat -m                                                                  ▐▌
 █ Show all time top10 traffic days:                                          ▐▌
 █ vnstat -t                                                                  ▐▌
 █                                                                            ▐▌
 █ NOTES:                                                                     ▐▌
 █ ``````                                                                     ▐▌
 █ Since my interface is eth1 to run the cmd vnstat -l, real time stats, I    ▐▌
 █ need to do it like this:                                                   ▐▌
 █ vnstat -l -i eth1                                                          ▐▌
 █                                                                            ▐▌
 █ And same for -tr (Calculate how much traffic goes through the selected     ▐▌
 █ interface during the given time seconds. The time will be 5 seconds if a   ▐▌
 █ number parameter isn't included.):                                         ▐▌
 █ vnstat -tr -i eth1                                                         ▐▌
 █ or for 10 seconds:                                                         ▐▌
 █ vnstat -tr 10 -i eth1                                                      ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ WEB BASED TRAFFIC MONITOR NTOP:                                            ▐▌
 █ ```````````````````````````````                                            ▐▌
 █ If you want your traffic monitoring to output to a webpage - ntop. PDF     ▐▌
 █ manual HERE and HERE  more information about nTop.                         ▐▌
 █                                                                            ▐▌
 █ Side note: I want to also give darkstat a try HERE. If I do I'll add it to ▐▌
 █ this tutorial. They even have an "unofficial Windows port of darkstat" as  ▐▌
 █ well :). Anyways back to nTop:                                             ▐▌
 █                                                                            ▐▌
 █ Pros: Has a nice full output. Has a lot of support and documentation. Easy ▐▌
 █ to install. Comes with login protection for all pages if you choose. Very  ▐▌
 █ customizable via the admin page.                                           ▐▌
 █ Cons: It feels heavy and is slow loading; but this isn't a console based   ▐▌
 █ monitor :p ).                                                              ▐▌
 █                                                                            ▐▌
 █ INSTALL NTOP LINUX:                                                        ▐▌
 █ ```````````````````                                                        ▐▌
 █ Get their manual; link above. In the manual will be instructions if you    ▐▌
 █ want to compile it yourself as well.                                       ▐▌
 █ su                                                                         ▐▌
 █ aptitude install ntop                                                      ▐▌
 █ ntop --set-admin-password                                                  ▐▌
 █ you'll be prompted twice for it.                                           ▐▌
 █                                                                            ▐▌
 █ Start ntop:                                                                ▐▌
 █ ntop -u ntop -d                                                            ▐▌
 █                                                                            ▐▌
 █ This will reply something like this:                                       ▐▌
 █ Wed Jul 29 11:43:22 2009  NOTE: Interface merge enabled by default         ▐▌
 █ Wed Jul 29 11:43:22 2009  Initializing gdbm databases                      ▐▌
 █ Wed Jul 29 11:43:22 2009  ntop v.3.3                                       ▐▌
 █ Wed Jul 29 11:43:22 2009  Configured on Aug  6 2008 15:54:13, built on Aug ▐▌
 █ 6 2008 15:54:33.                                                           ▐▌
 █ Wed Jul 29 11:43:22 2009  Copyright 1998-2007 by Luca Deri deri@ntop.org   ▐▌
 █ Wed Jul 29 11:43:22 2009  Get the freshest ntop from http://www.ntop.org/  ▐▌
 █ Wed Jul 29 11:43:22 2009  NOTE: ntop is running from 'ntop'                ▐▌
 █ Wed Jul 29 11:43:22 2009  NOTE: (but see warning on man page for the       ▐▌
 █ --instance parameter)                                                      ▐▌
 █ Wed Jul 29 11:43:22 2009  NOTE: ntop libraries are in '/usr/lib'           ▐▌
 █ Wed Jul 29 11:43:22 2009  Initializing ntop                                ▐▌
 █ Wed Jul 29 11:43:22 2009  Checking eth1 for additional devices             ▐▌
 █ Wed Jul 29 11:43:22 2009  Resetting traffic statistics for device eth1     ▐▌
 █ Wed Jul 29 11:43:22 2009  Initializing device eth1 (0)                     ▐▌
 █ Wed Jul 29 11:43:22 2009  DLT: Device 0 [eth1] is 1, mtu 1514, header 14   ▐▌
 █ Wed Jul 29 11:43:22 2009  Initializing gdbm databases                      ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: Loading MAC address table.               ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: Checking for MAC address table file      ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: File '/etc/ntop/specialMAC.txt' does not ▐▌
 █ need to be reloaded                                                        ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: ntop continues ok                        ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: Checking for MAC address table file      ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: File '/etc/ntop/oui.txt' does not need   ▐▌
 █ to be reloaded                                                             ▐▌
 █ Wed Jul 29 11:43:22 2009  VENDOR: ntop continues ok                        ▐▌
 █ Wed Jul 29 11:43:22 2009  Fingerprint: Loading signature file              ▐▌
 █ Wed Jul 29 11:43:22 2009  Fingerprint: Checking for Fingerprint file...    ▐▌
 █ file                                                                       ▐▌
 █ Wed Jul 29 11:43:22 2009  Fingerprint: Loading file                        ▐▌
 █ '/etc/ntop/etter.finger.os'                                                ▐▌
 █ Wed Jul 29 11:43:22 2009  Fingerprint: ...loaded 1765 records              ▐▌
 █ Wed Jul 29 11:43:22 2009  INIT: Parent process is exiting (this is normal) ▐▌
 █ PTy11062a:~# Wed Jul 29 11:43:22 2009  INIT: Bye bye: I'm becoming a       ▐▌
 █ daemon...                                                                  ▐▌
 █                                                                            ▐▌
 █ Hit enter key to return to your shell window.                              ▐▌
 █ exit                                                                       ▐▌
 █ Done :) nTop will now run at start up.                                     ▐▌
 █                                                                            ▐▌
 █ To stop, restart or stop it (su) /etc/init.d/ntop start|stop|restart       ▐▌
 █ For all options:                                                           ▐▌
 █ su                                                                         ▐▌
 █ ntop -h                                                                    ▐▌
 █ exit                                                                       ▐▌
 █                                                                            ▐▌
 █ or                                                                         ▐▌
 █ man ntop                                                                   ▐▌
 █                                                                            ▐▌
 █ Now go here to see: http://yoursite.com:3000 (this will be:                ▐▌
 █ trafficStats.html) wait for it to load...                                  ▐▌
 █                                                                            ▐▌
 █ NOTES:                                                                     ▐▌
 █ ``````                                                                     ▐▌
 █ To view it running do: netstat -tulpn | grep :3000                         ▐▌
 █ To view all active Internet connections: netstat -antp                     ▐▌
 █                                                                            ▐▌
 █ I don't like it naked out there so I'm going to add login to access all of ▐▌
 █ nTop pages:                                                                ▐▌
 █ Login to your nTop Admin control panel. Name is: admin Pass is of course   ▐▌
 █ what you set earlier.                                                      ▐▌
 █ Admin/Configure/Protect URL's/ towards the bottom of that page select 'Add ▐▌
 █ URL'                                                                       ▐▌
 █ Then I leave the path window blank and Hit the 'Add URL' button to have    ▐▌
 █ all pages protected.                                                       ▐▌
 █ Done.                                                                      ▐▌
 █                                                                            ▐▌
 █ //----------------------------------------------------------------------   ▐▌
 █                                                                            ▐▌
 █ If you find mistakes, have suggestions, and or questions please post at    ▐▌
 █ mewbies forum HERE - thank you.                                            ▐▌
 █                                                                            ▐▌
 █ Last update on 29 Jul '09                                                  ▐▌
 █                                                                            ▐▌
 █▌                                                                           █▌
  █▌                          -   mewbies.com   -                            █▌
   █▌                                                                       █▌
    ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██