mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
use name from commandline parameter for kvm
This commit is contained in:
parent
8cff506f07
commit
113008b06d
4 changed files with 29 additions and 0 deletions
|
@ -52,6 +52,13 @@ def clean_vm_name(vm_name):
|
|||
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 detect_kvm():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue