mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
prevent duplicate graphs and unify line style
This commit is contained in:
parent
113008b06d
commit
00f8fce4f8
2 changed files with 2 additions and 8 deletions
|
@ -33,12 +33,11 @@ graph_args --base 1024
|
|||
print "%s_read.label %s" % (vm, vm)
|
||||
print "%s_read.type COUNTER" % vm
|
||||
print "%s_read.min 0" % vm
|
||||
print "%s_read.draw LINE1" % vm
|
||||
print "%s_read.info I/O used by virtual machine %s" % (vm, vm)
|
||||
print "%s_read.graph no" % vm
|
||||
print "%s_write.label %s" % (vm, vm)
|
||||
print "%s_write.type COUNTER" % vm
|
||||
print "%s_write.min 0" % vm
|
||||
print "%s_write.draw LINE1" % vm
|
||||
print "%s_write.negative %s_read" % (vm, vm)
|
||||
print "%s_write.info I/O used by virtual machine %s" % (vm, vm)
|
||||
|
||||
|
@ -51,14 +50,12 @@ def clean_vm_name(vm_name):
|
|||
suffix = os.getenv('vmsuffix')
|
||||
if suffix:
|
||||
vm_name = re.sub(suffix,'',vm_name)
|
||||
|
||||
parts = vm_name.split('\x00')
|
||||
if (parts[0].endswith('kvm')):
|
||||
try:
|
||||
return parts[parts.index('-name')+1]
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return re.sub(r"[^a-zA-Z0-9_]", "_", vm_name)
|
||||
|
||||
def fetch(vms):
|
||||
|
|
|
@ -82,12 +82,11 @@ def config(vm_names):
|
|||
print("%s_in.label %s" % (vm, vm))
|
||||
print("%s_in.type COUNTER" % vm)
|
||||
print("%s_in.min 0" % vm)
|
||||
print("%s_in.draw LINE2" % vm)
|
||||
print("%s_in.graph no" % vm)
|
||||
print("%s_out.negative %s_in" % (vm, vm))
|
||||
print("%s_out.label %s" % (vm, vm))
|
||||
print("%s_out.type COUNTER" % vm)
|
||||
print("%s_out.min 0" % vm)
|
||||
print("%s_out.draw LINE2" % vm)
|
||||
|
||||
|
||||
def clean_vm_name(vm_name):
|
||||
|
@ -100,14 +99,12 @@ def clean_vm_name(vm_name):
|
|||
suffix = os.getenv("vmsuffix")
|
||||
if suffix:
|
||||
vm_name = re.sub(suffix, "", vm_name)
|
||||
|
||||
parts = vm_name.split('\x00')
|
||||
if (parts[0].endswith('kvm')):
|
||||
try:
|
||||
return parts[parts.index('-name')+1]
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return re.sub(r"[^a-zA-Z0-9_]", "_", vm_name)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue