我正在尝试使用 Napalm 使用 python chevron 中的 telnet 连接到 Cisco 路由器,并从 netmiko.ssh 收到错误。
这是我正在使用的片段
from napalm import get_network_driver
driver = get_network_driver('ios')
with driver('ip_address', 'username', 'password', optional_args={'port': 23,'transport': telnet}) as device:
print(device.get_facts())
这是我收到的错误消息:
NAPALM didn't catch this exception. Please, fill a bugfix on https://github.com/napalm-automation/napalm/issues
Don't forget to include this traceback.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python39\lib\site-packages\napalm\base\base.py", line 46, in __enter__
self.open()
File "C:\Program Files\Python39\lib\site-packages\napalm\ios\ios.py", line 169, in open
self.device = self._netmiko_open(
File "C:\Program Files\Python39\lib\site-packages\napalm\base\base.py", line 86, in _netmiko_open
self._netmiko_device = ConnectHandler(
File "C:\Program Files\Python39\lib\site-packages\netmiko\ssh_dispatcher.py", line 312, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\netmiko\cisco\cisco_ios.py", line 17, in __init__
return super().__init__(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 346, in __init__
self._open()
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 351, in _open
self.establish_connection()
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 910, in establish_connection
self.telnet_login()
File "C:\Program Files\Python39\lib\site-packages\netmiko\cisco_base_connection.py", line 171, in telnet_login
raise NetmikoAuthenticationException(msg)
netmiko.ssh_exception.NetmikoAuthenticationException: Login failed: ip_address