Munin Xen CPU utilization fixes 0.0.4
authorQuentin Smith <quentin@mit.edu>
Wed, 26 Nov 2008 02:33:57 +0000 (21:33 -0500)
committerQuentin Smith <quentin@mit.edu>
Wed, 26 Nov 2008 02:33:57 +0000 (21:33 -0500)
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
host/usr/share/xvm-munin-host-config/plugins/xen_cpu

index 66db39b..c3c4d4e 100644 (file)
@@ -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 <quentin@mit.edu>  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
index a67a74c..ecb68be 100755 (executable)
@@ -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))