Compiling & Installing vnstat-1.10

Run the following commands to install vnstat. This will also configure vnstat to listen on eth0 and start automatically on boot.

This was done in CentOS5.4, but it should also work for any *NIX based machines.

Note: You may want to check on the vnstat website for the latest build. At the time of this writing, the latest version is 1.10.
Note2: The following example will configure vnstat on eth0; You may want to change this if you are on a OpenVZ VPS to venet0.

wget http://humdi.net/vnstat/vnstat-1.10.tar.gz
tar -xzf vnstat-1.10.tar.gz
cd vnstat-1.10
make
make install
vnstat --testkernel
/bin/cp examples/init.d/centos/vnstat /etc/init.d/vnstat
ln -s /etc/init.d/vnstat /etc/rc3.d/S40vnstat
vnstat -u -i eth0
/etc/init.d/vnstat start

Leave a Reply

Your email address will not be published.