From: Ruben Kerkhof Date: Tue, 9 Dec 2014 16:06:43 +0000 (+0100) Subject: virt plugin: only gather stats for running domains X-Git-Tag: collectd-5.3.2~5^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d6d1fa5855f053f262410e2d42968afa4514990;p=collectd.git virt plugin: only gather stats for running domains Conflicts: src/libvirt.c --- diff --git a/src/libvirt.c b/src/libvirt.c index 1f628792..4ab8bd5c 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -306,6 +306,12 @@ lv_read (void) continue; } + if (info.state != VIR_DOMAIN_RUNNING) + { + /* only gather stats for running domains */ + continue; + } + cpu_submit (info.cpuTime, t, domains[i], "virt_cpu_total"); vinfo = malloc (info.nrVirtCpu * sizeof (vinfo[0]));