Fix xen_cpu monitoring script to not use hyphens in UUID
authorEvan Broder <broder@mit.edu>
Wed, 26 Nov 2008 00:09:50 +0000 (19:09 -0500)
committerEvan Broder <broder@mit.edu>
Wed, 26 Nov 2008 00:09:50 +0000 (19:09 -0500)
svn path=/trunk/packages/xvm-munin-config/; revision=1774

debian/changelog
host/usr/share/xvm-munin-host-config/plugins/xen_cpu

index 46ddb36..82cfc0b 100644 (file)
@@ -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 <broder@mit.edu>  Tue, 25 Nov 2008 19:07:44 -0500
+
 xvm-munin-config (0.0.2) unstable; urgency=low
 
   [ Quentin Smith ]
index 41472db..a67a74c 100755 (executable)
@@ -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':