OpenVZ Forum


Home » Mailing lists » Users » Logging traffic stats for VEs
Re: Logging traffic stats for VEs [message #12794 is a reply to message #12791] Wed, 09 May 2007 17:51 Go to previous messageGo to previous message
Thorsten Schifferdeck is currently offline  Thorsten Schifferdeck
Messages: 38
Registered: February 2006
Member
Hi Ian,

a) use the /proc/net/dev of your VE:

# vzctl exec <VEID> grep venet0 /proc/net/dev | cut -d":" -f2 | awk
'{print $1"\n"$9}'

xxx
xxx

b) or, VE has enabled sysfs:

# vzctl exec <VEID> cat /sys/class/net/venet0/statistics/{r,t}x_bytes

xxx
xxx

a) and b) prints netstats of VE-netdev venet0, in and out in bytes, so
you can put these stats in a a rrd or in a sql database, a old howto
which use a) can be found at
http://forum.openvz.org/index.php?t=msg&th=261&start =0&

Hope this helps,
Thorsten Schifferdecker

Ian P. Christian schrieb:
> Hi all,
>
> I need to graph the traffic usage for each VE. I've seen on the wiki
> that I should use iptables for this, but it seems to me that there
> should be some kind of counter as part of the openVZ counters - is there?
>
> My concern with using iptables is that in a situation when you have
> multiple hosts, the VE could be moved around between hosts a fair
> amount, and therefore the iptables counters won't be relevant.
>
> I'm sure someone must have solved this issue before, care to share?
>
> Thanks,
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: VEs and rebooting
Next Topic: About many connections in SMTP
Goto Forum:
  


Current Time: Sun Jul 14 10:23:08 GMT 2024

Total time taken to generate the page: 0.02221 seconds