Koozali.org: home of the SME Server

vnstat

Offline Nokia390

  • ****
  • 88
  • +0/-0
vnstat
« 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)

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: vnstat
« Reply #1 on: April 30, 2009, 02:33:53 AM »
Hi, did you create the db file?
Code: [Select]
vnstat -u -i eth1

Offline Nokia390

  • ****
  • 88
  • +0/-0
Re: vnstat
« Reply #2 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
« Last Edit: April 30, 2009, 11:40:28 AM by Nokia390 »

Offline Nokia390

  • ****
  • 88
  • +0/-0
Re: vnstat
« Reply #3 on: April 30, 2009, 05:19:56 PM »
it works, put the cron job

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: vnstat
« Reply #4 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

Offline Nokia390

  • ****
  • 88
  • +0/-0
Re: vnstat
« Reply #5 on: May 02, 2009, 12:36:53 AM »
thanks