diff --git a/plugins/libvirt/kvm_cpu b/plugins/libvirt/kvm_cpu index d8ec7934..81e6cc75 100755 --- a/plugins/libvirt/kvm_cpu +++ b/plugins/libvirt/kvm_cpu @@ -75,7 +75,7 @@ def list_pids(): ''' Find the pid of kvm processes @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() def fetch(vms): diff --git a/plugins/libvirt/kvm_io b/plugins/libvirt/kvm_io index 065f1a19..ac072025 100755 --- a/plugins/libvirt/kvm_io +++ b/plugins/libvirt/kvm_io @@ -92,7 +92,7 @@ def list_pids(): ''' Find the pid of kvm processes @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() if __name__ == "__main__": diff --git a/plugins/libvirt/kvm_mem b/plugins/libvirt/kvm_mem index 66e7f399..14de0275 100755 --- a/plugins/libvirt/kvm_mem +++ b/plugins/libvirt/kvm_mem @@ -89,7 +89,7 @@ def list_pids(): ''' Find the pid of kvm processes @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() if __name__ == "__main__": diff --git a/plugins/libvirt/kvm_net b/plugins/libvirt/kvm_net index dfe2cd79..bca7b7f3 100755 --- a/plugins/libvirt/kvm_net +++ b/plugins/libvirt/kvm_net @@ -63,8 +63,8 @@ def fetch(vms): f = open("/proc/net/dev", "r") for line in f.readlines(): if tap in line: - print "%s_in.value %s" % (vms[pid], re.sub(r"%s:"%tap, "", line.split()[0])) - print "%s_out.value %s" % (vms[pid], line.split()[8]) + print "%s_in.value %s" % (vms[pid], line.split()[1]) + print "%s_out.value %s" % (vms[pid], line.split()[9]) break except Exception as inst: print inst @@ -100,7 +100,7 @@ def list_pids(): ''' Find the pid of kvm processes @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() def find_vms_tap():