def FetchCiscoLSDB(globals):
sys.stderr.write('fetch cisco LSDB')
LSADB = {}
for r in controlport:
sys.stderr.write('Fetch ' + r + '\n')
tn = telnetlib.Telnet(LXCIP, controlport[r])
LoginToRouter(r, tn)
CLIoutput = ""
for lsatype in ["router", "network"]:
#print "XXXXXXXXXXXXfetch" + lsatype
tn.write("show ip ospf database %s \n\r" % lsatype )
CLIoutput += tn.read_until("#")
tn.read_very_eager()
print "*******************" + str(r) + "**************"
print CLIoutput
print "--------------------------------------------"
LSADB[r] = ParseCLIoutput(CLIoutput,globals)
tn.close()
return LSADB
评论列表
文章目录