Getting guest network counters?

Discussions related to using the OSE version of VirtualBox.
Post Reply
bifrost
Posts: 4
Joined: 27. Dec 2011, 08:55
Primary OS: FreeBSD
VBox Version: OSE self-compiled
Guest OSses: BSD, Linux, Windows

Getting guest network counters?

Post by bifrost »

I'm trying to dig out the network statistics per vm, and I'm having a hard time doing in in what
seems like an elegant way.

I can use VBoxManage to do it:
# VBoxManage debugvm vmXX statistics --pattern "/Devices/E1k0/*"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Statistics>
<Counter c="7647617911" unit="bytes" name="/Devices/E1k0/ReceiveBytes"/>
<Counter c="191139299809" unit="bytes" name="/Devices/E1k0/TransmitBytes"/>
</Statistics>

However, that seems kinda clunky, and I need to know to decypher the network interface name beforehand.
I looked into using vboxshell to see if that would give me an idea how to use the API for this, but it doesn't
seem to report the details. The API does have some documented access for some statistics, but they're not network statistics.

I've googled, but there's not much to report...

any ideas?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: Getting guest network counters?

Post by Technologov »

I did this in my GNS3 Network Simulator code (in VBoxPython), see screenshot:
http://forum.gns3.net/topic3262.html

in general you need to get the bytes, as you did, then MAC addresses to match the vNICs.
Post Reply