diff options
author | Guido Günther <agx@sigxcpu.org> | 2008-10-31 11:49:07 +0100 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2008-10-31 12:15:20 +0100 |
commit | 14b10dec02c4319f1e15d845966b0554f3accccd (patch) | |
tree | 68fd7762fff788b79a8c6fb061ae0d3fa5300a80 /libvirt-mem | |
parent | 7858c461651c341537c158ffee1475251c880b0e (diff) |
exclude dom0 from memory graph
it's only confusing compared to other hypervisors
Diffstat (limited to 'libvirt-mem')
-rw-r--r-- | libvirt-mem | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libvirt-mem b/libvirt-mem index 6dfb9a0..0c2073c 100644 --- a/libvirt-mem +++ b/libvirt-mem @@ -61,6 +61,8 @@ total_pc.critical 95""" % dict(hostname=hostname) except libvirt.libvirtError, err: print >>sys.stderr, "Id: %s: %s" % (id, err) continue + if name == "Domain-0": + continue print "%s_mem.label %s" % (canon(name), name) print "%s_mem.type GAUGE" % canon(name) print "%s_mem.min 0" % canon(name) @@ -87,11 +89,11 @@ def fetch_values(uri): except libvirt.libvirtError, err: print >>sys.stderr, "Id: %s: %s" % (id, err) continue + if name == "Domain-0": + continue mem = dom.info()[2] * 1024 print "%s_mem.value %d" % (canon(name), mem) - # ignore Xen's Dom0 when calcualting memory total and percentage - if name != "Domain-0": - total += mem + total += mem print "total.value %d" % total print "total_pc.value %.0f" % (100.0 * total / float(hostmem)) return 0 |