Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Nokia390 on April 30, 2009, 12:44:26 AM

Title: vnstat
Post by: Nokia390 on April 30, 2009, 12:44:26 AM
hi all
i have a problem with vnstat
it works only eth0, eth1 (external) apeers but 0 trafic.
thanks
(sme - server and gateway)
Title: Re: vnstat
Post by: Franco on April 30, 2009, 02:33:53 AM
Hi, did you create the db file?
Code: [Select]
vnstat -u -i eth1
Title: Re: vnstat
Post by: Nokia390 on April 30, 2009, 10:15:53 AM
yes, i do
vnstat -u -i eth0
vnstat -u -i eth1
and in the moment apeers both trafic.
the only way its make a cron job, every hour with:
vnstat -u -i eth0
vnstat -u -i eth1
and it works
thanks
Title: Re: vnstat
Post by: Nokia390 on April 30, 2009, 05:19:56 PM
it works, put the cron job
Title: Re: vnstat
Post by: Franco on April 30, 2009, 05:28:27 PM
When you install the application, it automatically installs the cron job.
All you have to do is add the interface to the database using the above commands.
After that you can see what the captured traffic was:
Code: [Select]
router:~# vnstat --help
 vnStat 1.6 by Teemu Toivola <tst at iki dot fi>

         -q,  --query          query database
         -h,  --hours          show hours
         -d,  --days           show days
         -m,  --months         show months
         -w,  --weeks          show weeks
         -t,  --top10          show top10
         -s,  --short          use short output
         -u,  --update         update database
         -i,  --iface          select interface (default: eth0)
         -?,  --help           short help
         -v,  --version        show version
         -tr, --traffic        calculate traffic
         -l,  --live           show transfer rate in real time

See also "--longhelp" for complete options list and "man vnstat".
router:~# cat /etc/cron.d/vnstat
# /etc/cron.d/vnstat: crontab entries for the vnstat package

0-55/5 *        * * *   root    if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi
Title: Re: vnstat
Post by: Nokia390 on May 02, 2009, 12:36:53 AM
thanks