这篇文章介绍使用python自动获取cisco配置信息
类似智能机器人程序,以聊天对话框的界面显示,通过输入问题、或点击交谈记录中的超链接进行查询,从而获取访客需要了解的资料等信息。系统自动保留用户访问信息及操作记录。后台有详细的设置和查询模块。适用领域:无人职守的客服系统自助问答系统智能机器人开发文档、资源管理系统……基本功能:设置对话界面的显示参数设置各类展示广告根据来访次数显示不同的欢迎词整合其他程序。
4
from netmiko import ConnectHandler
from datetime import datetime
JTN_CORE={"device_type":"cisco_ios","ip":"172.16.5.254","username":"test","password":"#"}
JTS_CORE={"device_type":"cisco_ios","ip":"172.16.4.254","username":"test","password":""}
start_time=datetime.now()
time=str(start_time)
all_devices=[JTN_CORE,JTS_CORE]
all_devices_filename=["JTN_CORE"+time,"JTS_CORE"+time,]
i=0
for a_device in all_devices:
net_connect=ConnectHandler(**a_device)
showrun=str(net_connect.send_command("show run"))
file=all_devices_filename[i]
i=i+1
f=open(file,'w')
f.write(showrun)
f.close
end_time=datetime.now()
total_time=end_time-start_time
print total_time以上就是使用python自动获取cisco配置信息的详细内容,更多请关注php中文网其它相关文章!
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号