Get bandwidth use of a container from within it

The data is in /proc/net/dev

DATA IN:

grep venet0 /proc/net/dev | cut -f2 -d: | awk '{printf"%s",$1}'

DATA OUT:

grep venet0 /proc/net/dev | cut -f2 -d: | awk '{printf"%s",$9}'

References:
http://openvz.org/Monitoring_bandwidth_of_containers
http://forum.openvz.org/index.php?t=msg&th=261&goto=1341&#msg_1341