cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1537
Views
1
Helpful
1
Replies

Python-Increase the read_timeout to a larger value

ajunair
Level 1
Level 1

When I run the below code getting the read timeout error, need expert advice

Things you might try to fix this:

  1. Adjust the regex pattern to better identify the terminating string. Note, in
    many situations the pattern is automatically based on the network device's prompt.
  2. Increase the read_timeout to a larger value.

 

from netmiko import ConnectHandler



device = { 'device_type': 'cisco_ios', "ip": "10.154.12.11", "username": "johor", "password": "MA1776",}

net_connect = ConnectHandler(**device)

ntp_config = ['clock timezone UTC 0',]

output = net_connect.send_config_set(ntp_config, read_timeout=90.0)

print(output)

net_connect.disconnect()

 

 

 

1 Reply 1

M02@rt37
VIP
VIP

Hello @ajunair,

Does the device's prompt correctly identified by Netmiko?

You can try specifying the prompt manually by setting the device_type to the correct value and adding the [global_delay_factor] parameter to the [ConnectHandler] function call.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
Review Cisco Networking for a $25 gift card