简化到Cisco IOS设备的Telnet连接的库
unha的Python项目详细描述
简化到Cisco IOS设备的Telnet连接的库
安装
unha在pypi上发布,在linux/macos和windows上可用,并支持python 3.6+。
$ pip install -U unha
为什么不直接用netmiko呢?
我尽可能使用netmiko。不幸的是,我有一些老的思科设备拒绝 与netmiko合作。我花了很多时间试图让它工作,但最终还是放弃了。
unha是一个后备库,当具有cisco_ios_telnet的netmiko无法连接到 短粗的装置。
通常,我的脚本会尝试使用以下方法连接到设备:
- netmiko,设备类型为cisco_ios
- netmiko,设备类型为cisco_ios_telnet
- UNHA
用法
我试着模仿netmiko的方法。
>>>device=Unha('10.0.0.1','username','password')>>>output=device.send_command('show version')>>>device.send_config_set(['snmp ifmib ifindex persist','snmp-server enable traps cpu threshold'])>>>device.disconnect()