快速登录网络设备,,用于快速登录路由器,交换
快速登录网络设备,,用于快速登录路由器,交换
用于快速登录路由器,交换机等网络设备,从文本文件读取设备名字和 IP,和SecureCRT配合,输入设备hostname后即可登录设备,具有自动校验功能。
#$language = "Python"#$interface = "1.0"f = open('d:\\SWICI.txt','a+')ff = f.read().split('\\n')sw0 = crt.Dialog.Prompt("Input your SW CI:")for i in range(0,len(ff)): row = ff[i].split(',') if (row[0] == sw0): ip = row[1] crt.Screen.Send("ssh username@%s" %ip) if (crt.Screen.WaitForString("assword:",5) == True): if(crt.Screen.WaitForString("%s" %sw0,20) == True): break else: crt.Dialog.MessageBox("Attention !\\nYou've logined a wrong place !") break else: crt.Dialog.MessageBox("Can't login !\\nPlease check your IP !") break if (i == len(ff)-1): crt.Dialog.MessageBox("There's no SW found !") breakf.close()#该片段来自于http://byrx.net
相关内容
- Python异步任务队列,python异步队列,很多场景为了不阻塞
- linux命令行下字典,使用有道API,linuxapi,Linux命令行下的
- Python 定时运行脚本,Python运行脚本,#coding=utf-
- python打开url并按指定快大写读取网页内容,pythonurl,im
- python正则表达式提取网页URL,python正则表达式,import r
- 用python实现IEEE 802.3以太网帧封,python802.3,在Debian的环境
- python根据出生日期计算年龄的代码,python出生日期计算
- python中获得int的最大值,pythonint最大值,python中可以通过
- matplotlib, 对之前所画图形的美化,matplotlib所画,1.之前在
- 蒙特卡罗法计算圆周率,蒙特卡罗计算圆周率,蒙特卡罗
评论关闭