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

John Cooper john at choffee.co.uk
Thu Nov 27 09:20:18 UTC 2008


On Sat, Nov 22, 2008 at 11:24:40PM +0000, Tim Waters (chippy) wrote:
> 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.

Ah it is always a comprimise between cost and service! You may also want
to have a look at ntop as it collects quite detailed statistics and can
do some clever reporting on them.
> 
> 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.

You could change the crontab so that it only records in these times

0-55/5 10-14,16-20 * * * 

Running "man 5 crontab" will give you more detail about the format of
the crontab file.

But I don't really know anything about vnstat so you may want to ask on
their mailing list.

john

-- 
John Cooper
http://choffee.co.uk/



More information about the Wylug-discuss mailing list