(Updated 1.1.2008 for version 1.6 and later)


'I don't read manuals' install
::::::::::::::::::::::::::::::

 Run as root:

     make && make install ; vnstat --testkernel && vnstat -u -i eth0


Installing as root
::::::::::::::::::

 First login as root and run the following command:

     make && make install

 If there was no errors, vnStat should now be installed (warnings aren't
 aren't considered as errors). During version 1.0 it became clear that some
 kernels are broken and don't provide to correct boot time for the system.
 vnStat requires this information so there's a test to see if the kernel is
 working correctly.

     vnstat --testkernel

 The only way to fix a faulty kernel (afaik) is to compile/install a newer
 one. Next every interface that should be monitored needs to be introduced
 to vnStat. Replace 'eth0' in the command with any available interface if
 needed.

     vnstat -u -i eth0

 Repeat that for every other interface you wish to use. After that wait
 for about 10 kB of network traffic (and 5 min for the next cron update).

     vnstat

 Now you should get some stats about your network usage. See the config
 file /etc/vnstat.conf for interface and other settings.


Installing without root access
::::::::::::::::::::::::::::::

 This install method is a little bit more complicated but shouldn't be
 impossible. :) First compile the binary.

     make

 If there was no errors, copy src/vnstat to some directory included in your
 $PATH (~/bin/ is an example) and make the database directory.

     cp src/vnstat ~/bin/
     cp cfg/vnstat.conf ~/.vnstatrc
     mkdir ~/.vnstat

 During version 1.0 it became clear that some kernels are broken and don't
 provide to correct boot time for the system. vnStat requires this information
 so there's a test to see if the kernel is working correctly.

     vnstat --testkernel

 If this gives 'command not found' then check your $PATH. The only way to fix
 a faulty kernel (afaik) is to compile/install a newer one. This can't be done
 without the root account so you'll have to solve this problem with your
 sysadmin if the kernel is broken.

 Now open the config file ~/.vnstatrc with your favorite text editor and locate
 the following line:
 
     DatabaseDir "/var/lib/vnstat"

 and replace it with
 
     DatabaseDir "/pathtomyhomedir/.vnstat"

 and save the file. If you are unsure about you homedir path execute
 
     cd ; pwd

 The ouput should tell your homedir. 

 Next every interface that should be monitored needs to be introduced
 to vnStat. Replace 'eth0' in the command with any available interface if
 needed.

     vnstat -u -i eth0

 Repeat that for every other interface you wish to use. Now it's time to add
 a crontab entry for vnStat. Do that by executing the command 'crontab -e'
 and add the following line (without leading spaces, remember to change the
 path):

     */5 * * * * ~/bin/vnstat -u

 If you found yourself using a strange editor then 'man vi' should help.
 After that wait for about 10 kB of network traffic (and 5 min for the
 next cron update).

     vnstat

 Now you should get some stats about your network usage. See the config
 file ~/.vnstatrc for interface and other settings.
