【发布时间】:2018-09-20 10:38:03
【问题描述】:
我需要在启用模式下在 ios 设备(3750-switch)上执行命令
给定:IP,用户名,密码,协议是telnet,启用密码 模块:netmiko
挑战:登录设备 -> 启用启用模式 -> 执行命令 我需要有关在设备上触发启用模式的语法帮助 启用密码是针对机密的。
触发启用模式的函数是 device.enable() 但我可能错了。
from netmiko import ConnectHandler
cisco_3x={
'device_type': 'cisco_ios_telnet',
'ip': 'address',
'username': 'xxx',
'password': 'xxx',
'secret': 'xxx',
}
mansingh=ConnectHandler(**cisco_3x)
mansingh.enable()
output=mansingh.send_command("show running")
print output
【问题讨论】:
-
是的,这是正确的做法。
标签: python networking