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

Merge pull request #878 from janegilv/master

Fix kvm_ plugins
This commit is contained in:
sumpfralle 2017-10-01 13:23:42 +02:00 committed by GitHub
commit 8e7e009f90
4 changed files with 6 additions and 6 deletions

View File

@ -75,7 +75,7 @@ def list_pids():
''' Find the pid of kvm processes ''' Find the pid of kvm processes
@return a list of pids from running kvm @return a list of pids from running kvm
''' '''
pid = Popen("pidof qemu-system-x86_64", shell=True, stdout=PIPE) pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
return pid.communicate()[0].split() return pid.communicate()[0].split()
def fetch(vms): def fetch(vms):

View File

@ -92,7 +92,7 @@ def list_pids():
''' Find the pid of kvm processes ''' Find the pid of kvm processes
@return a list of pids from running kvm @return a list of pids from running kvm
''' '''
pid = Popen("pidof qemu-system-x86_64", shell=True, stdout=PIPE) pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
return pid.communicate()[0].split() return pid.communicate()[0].split()
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -89,7 +89,7 @@ def list_pids():
''' Find the pid of kvm processes ''' Find the pid of kvm processes
@return a list of pids from running kvm @return a list of pids from running kvm
''' '''
pid = Popen("pidof qemu-system-x86_64", shell=True, stdout=PIPE) pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
return pid.communicate()[0].split() return pid.communicate()[0].split()
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -63,8 +63,8 @@ def fetch(vms):
f = open("/proc/net/dev", "r") f = open("/proc/net/dev", "r")
for line in f.readlines(): for line in f.readlines():
if tap in line: if tap in line:
print "%s_in.value %s" % (vms[pid], re.sub(r"%s:"%tap, "", line.split()[0])) print "%s_in.value %s" % (vms[pid], line.split()[1])
print "%s_out.value %s" % (vms[pid], line.split()[8]) print "%s_out.value %s" % (vms[pid], line.split()[9])
break break
except Exception as inst: except Exception as inst:
print inst print inst
@ -100,7 +100,7 @@ def list_pids():
''' Find the pid of kvm processes ''' Find the pid of kvm processes
@return a list of pids from running kvm @return a list of pids from running kvm
''' '''
pid = Popen("pidof qemu-system-x86_64", shell=True, stdout=PIPE) pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
return pid.communicate()[0].split() return pid.communicate()[0].split()
def find_vms_tap(): def find_vms_tap():