[libvirt-users] Collecting system stats

Peter Phaal peter.phaal at gmail.com
Wed Sep 25 23:06:08 UTC 2013


If you need to continuously track libvirt metrics, you might want to
install Host sFlow agents on each of your KVM hypervisors:

http://host-sflow.sourceforge.net/

The Host sFlow agent is a lightweight daemon that links to the libvirt
library on the hypervisor and sends hypervisor and VM metrics using the
sFlow protocol to a central collector. You could use an sFlow analyzer like
Ganglia to record and display the metrics.

http://blog.sflow.com/2012/01/using-ganglia-to-monitor-virtual.html

Alternatively, you could use the sflowtool to convert sFlow to text and
write a Perl/Python/Awk... script to generate your report.

http://blog.sflow.com/2011/12/sflowtool.html

Are you also using Open vSwitch? I you are, the Host sFlow agent can
configure sFlow monitoring to add statistics for each of the vNICs as well
as packet flows between the VMs etc.

http://blog.sflow.com/2010/10/sflowtrend-adds-server-performance.html


On Wed, Sep 25, 2013 at 7:10 AM, Sam Giraffe <sam at giraffetech.biz> wrote:

> Hi,
>
> I am trying to create a report across all my KVM hypervisors using libvirt
> API and I need some assistance in figuring out the right API calls. My
> report will contain the total available memory, CPU, disk across all
> hypervisors, versus the amount used by the virtual machines. This report
> will help figure out if we are running low on hypervisor disk, CPU or
> memory and if we need to add more.
>
> I can't find the libvirt API call to get system info, such as total memory
> in the system, free memory, total disk space, available disk space, etc.
> There is virDomainInfo which shows memory total and free about a particular
> VM, I guess I can use active/inactive domain list and then use
> virDomainInfo on each of the VM's, but that does not give me hypervisor
> stats. I am wondering if I will have to enable SNMP and use that to get
> hypervisors stats.
>
> I am creating this report remotely on a reporting machine which will
> connect to each hypervisor using the libvirt API using one of the remote
> libvirt connections available.
>
> Thanks
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130925/2ff621d2/attachment.htm>


More information about the libvirt-users mailing list