From 1622ca7a11d28993d4b5652fb2603cdfa6ef0b5a Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 25 Nov 2008 19:09:50 -0500 Subject: [PATCH] Fix xen_cpu monitoring script to not use hyphens in UUID svn path=/trunk/packages/xvm-munin-config/; revision=1774 --- debian/changelog | 6 ++++++ .../share/xvm-munin-host-config/plugins/xen_cpu | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 46ddb36..82cfc0b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xvm-munin-config (0.0.3) unstable; urgency=low + + * Fix xen_cpu script to leave out hyphens from UUID + + -- Evan Broder Tue, 25 Nov 2008 19:07:44 -0500 + xvm-munin-config (0.0.2) unstable; urgency=low [ Quentin Smith ] 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 41472db..a67a74c 100755 --- a/host/usr/share/xvm-munin-host-config/plugins/xen_cpu +++ b/host/usr/share/xvm-munin-host-config/plugins/xen_cpu @@ -33,18 +33,18 @@ def getDomains(): domains = server.xenapu.VM.get_all_records() metrics = server.xenapi.VM_metrics.get_all_records() for d in domains.values(): - ret[d['uuid']] = {'name': d['name_label'], - 'cpu_time': sum(metrics[d['metrics']]['VCPUs_utilisation'].values()), - 'domid': d['domid'], - } + ret[d['uuid'].replace('-', '_')] = {'name': d['name_label'], + 'cpu_time': sum(metrics[d['metrics']]['VCPUs_utilisation'].values()), + 'domid': d['domid'], + } return ret else: domains = server.xend.domains_with_state(True, 'all', True) for d in domains: - ret[sxp.child_value(d, 'uuid', 'NONE')] = {'name': sxp.child_value(d, 'name', 'UNKNOWN'), - 'cpu_time': sxp.child_value(d, 'cpu_time', 0.0), - 'domid': sxp.child_value(d, 'domid', -1), - } + 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), + } return ret if cmd == 'config': -- 1.7.9.5