Tutorial install vnstat di vps centos 6 32bit

By | March 3, 2014

1. Login menggunakan putty sebagai user root

2. ketik :

wget http://humdi.net/vnstat/vnstat-1.11.tar.gz && tar xzvf vnstat-1.11.tar.gz && cd vnstat-1.11 && make && make install

3. Download dan install daemon

cd /etc/init.d && wget http://humdi.net/vnstat/init.d/centos/vnstat && chmod a+x vnstat && chkconfig --add vnstat

4. Setting vnstat (khusus openvm,XEN tdk perlu)

nano /etc/vnstat.conf

Interface “eth0” rubah jadi Interface “venet0”

5. Cek service

service vnstat start && service vnstat stop && service vnstat restart

6. Install PHP

yum install php php-pear &&  cd && wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz && tar xzvf vnstat_php_frontend-1.5.1.tar.gz && cd vnstat_php_frontend-1.5.1 &&  mkdir /var/www/html/vnstat && cp -r . /var/www/html/vnstat && cd /var/www/html/vnstat

7. edit config.php
nano config.php

Network interface ke venet0

bagian ini juga:

$data_dir = '/var/lib/vnstat/';

Simpan, ctrl + x

8. Adding cron job
cd /var/lib/vnstat

lalu buat config:

nano dump.sh

isikan:
vnstat -u -i venet0vnstat -dumpdb -i venet0 >/var/lib/vnstat/vnstat_dump_venet0

Simpan

9. terakhir :
/bin/sh /var/lib/vnstat/dump.sh

A. To see venet0 stats: # vnstat -i venet0

B. To see daily stats for venet0: # vnstat -i venet0 -d

C. To see hourly network stats: # vnstat -i venet0 -h

D. To see monthly network stats: # vnstat -i venet0 -m

E. To see weekly network stats: # vnstat -i venet0 -w

F. To see top 10 network: # vnstat -t  # vnstat -i venet0 -t

G. To see short output: # vnstat -i venet0 -s

H. To calculate traffic: vnstat -i venet0 -tr

I. To see transfer rate in real time: # vnstat -i venet0 -l

NB : utk vps digital ocean, venet0 diganti ke eth0

 

One thought on “Tutorial install vnstat di vps centos 6 32bit

Leave a Reply

Your email address will not be published. Required fields are marked *