[collectd] collectd libvirtstats plugin (version 1, for discussion only)

Richard W.M. Jones rjones at redhat.com
Mon Nov 5 15:00:12 CET 2007


Attached is a plugin allowing collectd to use libvirt to collect CPU, 
disk and network statistics for domains.  There are a few problems with 
it at the moment, described below.

Firstly just to say that this is a patch against the released collectd 
4.2.0.  I need to pull out the GIT repository and rebase the patch 
against that.  Any other comments, most welcome!

Usage
-----

With this patch you should be able to collect stats by adding the 
following to your collectd.conf file:

LoadPlugin libvirtstats

<Plugin libvirtstats>
         Connection "xen:///"
</Plugin>

'collectd' only needs to be running on the host.  It uses libvirt to 
collect stats for each guest, via mechanisms in the hypervisor or host 
operating system.

Requirements
------------

libvirt >= 0.3.3 and libxml2.  The configure file should auto-detect the 
requirements and configure libvirtstats plugin only if they are available.

Problems
--------

I can't seem to get the ignorelist to do anything at all.  It seems like 
it includes all the domains and devices, no matter what I specify in the 
configuration file and what the state of IgnoreSelected is set to.

In the types.db, I have set the max for virt_cpu_total to be 
256,000,000,000.  The max CPU usage for a single CPU is 1 billion 
nanoseconds per second, but virt_cpu_total is for all CPUs in the 
system, and there could be (in theory) an unlimited number of CPUs, so 
an unlimited max.  Therefore I have assumed here that max CPUs = 256.

I'm using CSV output, which works, but it seems to report the aggregate 
counter values instead of the differences.  Is that to be expected?

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd-libvirtstats-1.patch
Type: text/x-patch
Size: 34152 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20071105/e877fd10/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20071105/e877fd10/attachment-0003.bin 


More information about the collectd mailing list