2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

fixed regex for "vm_name" resolv, so VMs with dash in the name will be

displayed correctly
This commit is contained in:
Stanislav Kopp 2015-05-21 15:40:11 +02:00
parent 8537e6fd02
commit 5715bb2408
4 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ def find_vm_names(pids):
result = {} result = {}
for pid in pids: for pid in pids:
cmdline = open("/proc/%s/cmdline" % pid, "r") 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 return result
def list_pids(): def list_pids():

View File

@ -85,7 +85,7 @@ def find_vm_names(pids):
result = {} result = {}
for pid in pids: for pid in pids:
cmdline = open("/proc/%s/cmdline" % pid, "r") 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 return result
def list_pids(): def list_pids():

View File

@ -82,7 +82,7 @@ def find_vm_names(pids):
result = {} result = {}
for pid in pids: for pid in pids:
cmdline = open("/proc/%s/cmdline" % pid, "r") 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 return result
def list_pids(): def list_pids():

View File

@ -84,7 +84,7 @@ def find_vm_names(pids):
result = {} result = {}
for pid in pids: for pid in pids:
cmdline = open("/proc/%s/cmdline" % pid, "r") 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 return result
def get_vm_mac(pid): def get_vm_mac(pid):