netmiko: Netmiko | Error: Telnet login failed:
Excuse my indentation, I have this script because my devices have different login credentials-
This script works fine, except when it gets to telnet section, it unable to login to devices, I this on multiple devices but it gives this error Error: Telnet login failed: [ipaddress]
import netmiko
from netmiko import ConnectHandler
from operator import itemgetter
from time import sleep
try:
net_connect = ConnectHandler(device_type='cisco_ios_ssh', ip=ip, username=username1, password=password1, secret=password1)
connection_protocol = 'ssh'
except:
try:
net_connect = ConnectHandler(device_type='cisco_ios_ssh', ip=ip, username=username2, password=password2, secret=password2)
connection_protocol = 'ssh'
except:
try:
net_connect = ConnectHandler(device_type='cisco_ios_telnet', ip=ip, username=username1, password=password1, port=23, verbose=False)
connection_protocol = 'telnet'
except Exception as e:
print "Error: " + str(e)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (10 by maintainers)
Thanks!! Adding
global_delay_factorsolved my connection failed issue with napalm.This is my code snippet: