[Wylug-discuss] vnstat, cron, or how to monitor network traffic volumes when on virgin media

Tim Waters (chippy) chippy2005 at gmail.com
Sat Nov 22 23:24:42 UTC 2008


Hey there,

What I want to do is keep track of how much I download / upload within
certain hours because my ISP,  Virgin Media has a traffic management
policy [1]. Which can be a pain if I'm downloading distros to test
out, etc.

I've installed vnstat [2] successfully and it's working fine. When it
is installed, it installs a cron entry in cron.d so that it updates
(vnstat -u) every five minutes.
0-55/5 *	* * *	root	if [ -x /usr/bin/vnstat ] && [ `ls
/var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi

I'm only interested in monitoring between 10am -3pm and 4pm- 9pm, so
probably I'd want it reset at 4pm and 10am every day. I'm not too sure
about cron however, or vnstat really.

How can I do this with cron?
Options: I guess I'd use would be vnstat --reset
but what about vnstat --disable eth0?

Or, do people have better / nicer solutions for the same problem?

Cheers!

Tim

[1] http://www.virginmedia.com/help/traffic-management.php
[2] http://humdi.net/vnstat/



More information about the Wylug-discuss mailing list