Skip to content
Snippets Groups Projects
Commit 9dd8affa authored by admin's avatar admin
Browse files

A first try for a looking glass tool

parent ca0629bc
Branches
No related merge requests found
import getpass
import sys
import telnetlib
import time
HOST = "localhost"
tn = []
def empty_test(output, i):
if(len(output)>0):
print("Info R",i+1)
print(output)
def telnetCommunication():
for i in range(0,2):
print(i)
tn.append(telnetlib.Telnet(HOST,5000+(i)))
(tn[i]).read_until(b'show')
(tn[i]).write(b'show ip int br\n')
(tn[i]).write(b"\x0D")
output = ((tn[i]).read_very_eager().decode('ascii'))
time.sleep(2)
def telnetUpdates():
while True:
for i in range(0,2):
(tn[i]).read_until(b'')
output = ((tn[i]).read_very_eager().decode('ascii'))
time.sleep(5)
empty_test(output, i)
telnetCommunication()
telnetUpdates()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment