From: Quentin Smith Date: Mon, 6 Jan 2014 07:12:40 +0000 (-0500) Subject: Tweak xen_net per comments from achernya X-Git-Tag: 0.0.18~3 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/xvm-munin-config.git/commitdiff_plain/b926c271609257ae8bdb1994cdb14a551f10e9ca Tweak xen_net per comments from achernya --- diff --git a/host/usr/share/xvm-munin-host-config/plugins/xen_net b/host/usr/share/xvm-munin-host-config/plugins/xen_net index 822b3e0..96e2929 100755 --- a/host/usr/share/xvm-munin-host-config/plugins/xen_net +++ b/host/usr/share/xvm-munin-host-config/plugins/xen_net @@ -25,8 +25,9 @@ def live_vms(): def get_dom(domid): data = dict(domid=domid) data['name'] = xsc.read('', '/local/domain/%d/name' % domid) + # /vm contains a path like "/vm/UUID"; strip the "/vm/" data['uuid'] = xsc.read('', '/local/domain/%d/vm' % domid)[4:] - if data['name'][0:2] == 'd_': + if data['name'].startswith('d_'): data['munin_name'] = 'db domid %d' % domid else: data['munin_name'] = data['name'] @@ -77,12 +78,12 @@ if __name__ == '__main__': if cmd == 'config': print """ - graph_title Xen domain network usage - graph_args --base 1000 - graph_vlabel bits in (-) / out (+) per ${graph_period} - graph_info This graph shows how network is utilized by Xen domains. - graph_category network - graph_period second""" + graph_title Xen domain network usage + graph_args --base 1000 + graph_vlabel bits in (-) / out (+) per ${graph_period} + graph_info This graph shows how network is utilized by Xen domains. + graph_category network + graph_period second""" for d in sorted(domains): for direction in ('down', 'up'): key = "%s_%s" % (d, direction)