From 0e3a37c0643ef2fcb17883b78881f63ca16ea459 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Tue, 25 Nov 2008 21:33:57 -0500 Subject: [PATCH] Munin Xen CPU utilization fixes rrdtool and thus Munin can't handle floating point DERIVE or COUNTER sources, so convert to microseconds before passing to Munin. svn path=/trunk/packages/xvm-munin-config/; revision=1777 --- debian/changelog | 6 ++++++ .../share/xvm-munin-host-config/plugins/xen_cpu | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 66db39b..c3c4d4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xvm-munin-config (0.0.4) unstable; urgency=low + + * Pass microseconds to Munin and display as percentages on graph + + -- Quentin Smith Tue, 25 Nov 2008 21:31:07 -0500 + xvm-munin-config (0.0.3) unstable; urgency=low * Fix xen_cpu script to leave out hyphens from UUID diff --git a/host/usr/share/xvm-munin-host-config/plugins/xen_cpu b/host/usr/share/xvm-munin-host-config/plugins/xen_cpu index a67a74c..ecb68be 100755 --- a/host/usr/share/xvm-munin-host-config/plugins/xen_cpu +++ b/host/usr/share/xvm-munin-host-config/plugins/xen_cpu @@ -36,6 +36,7 @@ def getDomains(): ret[d['uuid'].replace('-', '_')] = {'name': d['name_label'], 'cpu_time': sum(metrics[d['metrics']]['VCPUs_utilisation'].values()), 'domid': d['domid'], + 'uuid': d['uuid'], } return ret else: @@ -44,6 +45,7 @@ def getDomains(): ret[sxp.child_value(d, 'uuid', 'NONE').replace('-', '_')] = {'name': sxp.child_value(d, 'name', 'UNKNOWN'), 'cpu_time': sxp.child_value(d, 'cpu_time', 0.0), 'domid': sxp.child_value(d, 'domid', -1), + 'uuid': sxp.child_value(d, 'uuid', 'NONE'), } return ret @@ -69,9 +71,10 @@ graph_period second""" print "%s.max 5000" % d print "%s.min 0" % d print "%s.type DERIVE" % d - print "%s.info %s" % (d, name) + print "%s.info %s" % (d, domains[d]['uuid']) + print "%s.cdef %s,10000,/" % (d, d) sys.exit(0) domains = getDomains() for d in sorted(domains): - print "%s.value %s" % (d, domains[d]['cpu_time']) + print "%s.value %s" % (d, long(domains[d]['cpu_time']*1000000)) -- 1.7.9.5