mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
kvm_net: remove unused function 'find_vms_tap'
This commit is contained in:
parent
db211fc72f
commit
e87d3a6b3c
1 changed files with 0 additions and 20 deletions
|
@ -103,26 +103,6 @@ def list_pids():
|
||||||
pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", 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():
|
|
||||||
''' Check if kvm is installed
|
|
||||||
@return a list of pids from running kvm
|
|
||||||
'''
|
|
||||||
result = []
|
|
||||||
tap = ""
|
|
||||||
mac = ""
|
|
||||||
kvm = Popen("ip a | grep -A 1 tap | awk '{print $2}' | grep -v '^$'", shell=True, stdout=PIPE)
|
|
||||||
res = kvm.communicate()[0].split('\n')
|
|
||||||
for line in res:
|
|
||||||
try:
|
|
||||||
if len(line) > 0:
|
|
||||||
if re.match(r"^tap.*", line):
|
|
||||||
tap = re.sub(r"(tap[^:]+):", r"\1", line)
|
|
||||||
else:
|
|
||||||
result.append(tap)
|
|
||||||
except Exception as inst:
|
|
||||||
continue
|
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue