<div dir="ltr"><div>Thanks, I will look into sflow. Is it possible to get some basic info through libvirt though about the hypervisor without installing additional software?<br></div><div><br>I was able to dig around a bit and found conn.GetInfo (where conn=libvirt.open("qemu:///system")) which gave me some information on hypervisor memory and cores, nothing on disk though.<br>
</div><div><br>I also found out about <a href="http://dom.info">dom.info</a>() where   dom = conn.lookupByID(id) that gives me information on VM memory and cores.  I don't have storage pools defined, and I am not concerned about them, just need to get total disk space and available disk space on hypervisor. Perhaps I will have to see how sflow get's that information through libvirt if at all through libvirt. I found a 2010 email from <span class=""><em>Daniel</em> P. <em>Berrange</em></span> saying that he believes system stats should not be part of libvirt, so maybe I can't get that information from libvirt.<br>
<br></div><div>Thanks<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 25, 2013 at 4:06 PM, Peter Phaal <span dir="ltr"><<a href="mailto:peter.phaal@gmail.com" target="_blank">peter.phaal@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If you need to continuously track libvirt metrics, you might want to install Host sFlow agents on each of your KVM hypervisors:<div>
<br></div><div><a href="http://host-sflow.sourceforge.net/" target="_blank">http://host-sflow.sourceforge.net/</a><br>
</div><div><br></div><div>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.</div>

<div><br></div><div><a href="http://blog.sflow.com/2012/01/using-ganglia-to-monitor-virtual.html" target="_blank">http://blog.sflow.com/2012/01/using-ganglia-to-monitor-virtual.html</a><br></div><div><br></div><div>Alternatively, you could use the sflowtool to convert sFlow to text and write a Perl/Python/Awk... script to generate your report.</div>

<div><br></div><div><a href="http://blog.sflow.com/2011/12/sflowtool.html" target="_blank">http://blog.sflow.com/2011/12/sflowtool.html</a><br></div><div><br></div><div>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.</div>

<div><br></div><div><a href="http://blog.sflow.com/2010/10/sflowtrend-adds-server-performance.html" target="_blank">http://blog.sflow.com/2010/10/sflowtrend-adds-server-performance.html</a><br></div></div><div class="gmail_extra">
<br><br>
<div class="gmail_quote"><div><div class="h5">On Wed, Sep 25, 2013 at 7:10 AM, Sam Giraffe <span dir="ltr"><<a href="mailto:sam@giraffetech.biz" target="_blank">sam@giraffetech.biz</a>></span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr"><div><div>Hi,<br><br>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. <br>


<br>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.<br>


<br>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.<br><br>Thanks<br></div></div></div>
<br></div></div>_______________________________________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br></blockquote></div><br></div>
</blockquote></div><br></div>