Cisco SG300 series breaking on SSH connection
See original GitHub issueHello @ktbyers
Thanks for the amazing open source project that NetMiko is. 👍
I would like to get some help on the following issue:
I have a very simple script trying to copy the config of a Cisco SG300 device. My code (I have verbose enabled on Netmiko):
if Device_Model_List[i] == "Cisco":
#create profile for Juniper for NetMiko
provision_router_object = {
'device_type': 'cisco_ios',
'ip': Public_IP_List[i],
'username': User_List[i],
'password': Password_List[i],
'port': SSH_Port_List[i],
'global_delay_factor': 1,
'verbose': true,
}
print(provision_router_object)
provision_router = ConnectHandler(**provision_router_object)
output = provision_router.send_command("show running-config")
file_name = Name_List[i] + '-' + str(date)
path = "/Users/sam/Documents/Backup_Router/" + Customer_List[i] + "/" + Customer_Site[i] + "/"
print(path)
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(os.path.join(path,file_name),"w") as file_:
file_.write(output)
And here’s the verbose + error I am getting:
SSH connection established to 184.68.129.6:2210
Interactive SSH session established
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/paramiko/channel.py", line 613, in recv
out = self.in_buffer.read(nbytes, self.timeout)
File "/usr/local/lib/python3.5/site-packages/paramiko/buffered_pipe.py", line 160, in read
raise PipeTimeout()
paramiko.buffered_pipe.PipeTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 387, in read_until_pattern
output += self.remote_conn.recv(MAX_BUFFER).decode('utf-8', 'ignore')
File "/usr/local/lib/python3.5/site-packages/paramiko/channel.py", line 615, in recv
raise socket.timeout()
socket.timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sam/Documents/git/OPS/ops/python/router_backup/Backup_Test.py", line 56, in <module>
provision_router = ConnectHandler(**provision_router_object)
File "/usr/local/lib/python3.5/site-packages/netmiko/ssh_dispatcher.py", line 84, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 69, in __init__
self.session_preparation()
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 83, in session_preparation
self.disable_paging()
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 212, in disable_paging
output = self.read_until_prompt()
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 374, in read_until_prompt
return self.read_until_pattern()
File "/usr/local/lib/python3.5/site-packages/netmiko/base_connection.py", line 393, in read_until_pattern
raise NetMikoTimeoutException("Timed-out reading channel, data not available.")
netmiko.ssh_exception.NetMikoTimeoutException: Timed-out reading channel, data not available.
I’m running the latest version of Netmiko and Paramiko. It is working perfect with Juniper devices.
UPDATE: I have tried my script using a truly Cisco IOS device line and it works with no problem. So I believe the issue is the compatibility with the Cisco SG line. I have also tried to make Paramiko works with this Cisco SG device but it hangs on the connection and never times out. Hope this info will help.
Would you have any idea on whaw to try next?
Thank you so much.
Sam.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@samulord Initial work on driver for SG300 is here:
https://github.com/ktbyers/netmiko/commit/c28db41981c3e5b6b2cceec034041d307ad4e573
Will try to get to this in dev_1_0 release (i.e. add support for SG300)