def initIPPOOLS(rconn):
"""????IP?? REDIS???"""
ipNum=len(rconn.keys('IP*'))
if ipNum<IPPOOLNUM:
IPPOOLS=GetIPPOOLS(IPPOOLNUM)
for ipall in IPPOOLS:
try:
ip=ipall.split(':')[0]
port=ipall.split(':')[1]
telnetlib.Telnet(ip,port=port,timeout=2) #????ip????
except:
logger.warning("The ip is not available !( IP:%s )" % ipall)
else:
logger.warning("Get ip Success!( IP:%s )" % ipall)
rconn.set("IP:%s"%(ipall),ipall)
else:
logger.warning("The number of the IP is %s!" % str(ipNum))
评论列表
文章目录