6,534
edits
Changes
m
VE->CT
== Introduction ==
Traffic accounting in OpenVZ can be done through data collection against <code>/proc/net/dev</code> in the individual containers on a [[HN]].
== Prerequisites ==
# Parse out the inbound/outbound traffic and assign them to the corresponding variables
eval `/usr/sbin/vzctl exec $veid "grep venet0 /proc/net/dev" | \
awk -F: '{print $2}' | awk '{printf"VEINCTIN=%-15d\nVEOUTnCTOUT=%-15d\n", $1, $9}'`
# Send the data to the corresponding RRD time with (N)now as the update time
/usr/bin/rrdtool update $RRDFILE N:$VEINCTIN:$VEOUTCTOUT
done
</source>