[libvirt-users] Getting CPU and memory usage statistics for the host

Guido Winkelmann guido-libvi at unknownsite.de
Wed Jan 19 16:18:02 UTC 2011


I have noticed that virt-manager has the ability to show me the current cpu- and 
memory-usage of both the host and running guest machines.

How does it do that?

I could make good use of that information myself in the client applications I'm 
writing, however, from what I can see on 
http://libvirt.org/html/libvirt-libvirt.html, I have no idea how to go about 
getting it from libvirt. In fact, before I've seen virt-manager, I just assumed 
libvirt cannot do that at all, and was planning to manually ssh to the host and 
read statistics from /proc when I'd need them.

I've tried looking at the virt-manager source code to find out how to do this, 
but it appears I would have to learn Python first in order to understand it.

Could someone please give me some pointers?



More information about the libvirt-users mailing list