mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Merge pull request #511 from icyground/master
Fixing Regexp for kvm plugins to be aware of underscores in vm names
This commit is contained in:
commit
d33fcd5598
@ -68,7 +68,7 @@ def find_vm_names(pids):
|
||||
result = {}
|
||||
for pid in pids:
|
||||
cmdline = open("/proc/%s/cmdline" % pid, "r")
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
return result
|
||||
|
||||
def list_pids():
|
||||
@ -99,3 +99,4 @@ if __name__ == "__main__":
|
||||
fetch(find_vm_names(list_pids()))
|
||||
else:
|
||||
fetch(find_vm_names(list_pids()))
|
||||
|
||||
|
@ -85,7 +85,7 @@ def find_vm_names(pids):
|
||||
result = {}
|
||||
for pid in pids:
|
||||
cmdline = open("/proc/%s/cmdline" % pid, "r")
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
return result
|
||||
|
||||
def list_pids():
|
||||
|
@ -82,7 +82,7 @@ def find_vm_names(pids):
|
||||
result = {}
|
||||
for pid in pids:
|
||||
cmdline = open("/proc/%s/cmdline" % pid, "r")
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
return result
|
||||
|
||||
def list_pids():
|
||||
|
@ -84,7 +84,7 @@ def find_vm_names(pids):
|
||||
result = {}
|
||||
for pid in pids:
|
||||
cmdline = open("/proc/%s/cmdline" % pid, "r")
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_]*)\x00\-.*$",r"\1", cmdline.readline()))
|
||||
return result
|
||||
|
||||
def get_vm_mac(pid):
|
||||
|
Loading…
Reference in New Issue
Block a user