ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.62k stars 1.31k forks source link

NAPALM pattern not detected in output: #3336

Closed hfakoor222 closed 1 year ago

hfakoor222 commented 1 year ago

Running some code, I'm getting the router configs from the code, with config = napalm_device.get_config(), but then get a pattern not detected error. Figured I'd give it a shot and see if you could help.

Here's the code: def initialize_device_connections(item):

device_type, device_ip, username, password, secret = item
driver = get_network_driver(device_type)

napalm_device = driver(hostname=device_ip, username=username, password=password, optional_args={ "secret":secret, "expect_string" :None, "global_delay_factor": 50,  "dest_file_system": "disk0:merge_config.txt",   "auto_file_prompt":True, "timeout":20})
print(napalm_device)
napalm_device.open()
print("Device opened")
**config = napalm_device.get_config()
print(config)**
time.sleep(1)
napalm_device.close()
config_table_before[device_ip] = config

It's on a c7200 router in a GNS3 environment. Here is the log: R3# DEBUG:netmiko: Parenthesis found in pattern.

pattern: (#|>)

This can be problemtic when used in read_until_pattern().

You should ensure that you use either non-capture groups i.e. '(?:' or that the parenthesis completely wrap the pattern '(pattern)' DEBUG:netmiko:Pattern found: (#|>) R3# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R3# DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: R3# DEBUG:netmiko:Pattern found: (R3.*) R3# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R3# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R3# DEBUG:netmiko:write_channel: b'show startup-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: how DEBUG:netmiko:read_channel: sta DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: rtu DEBUG:netmiko:read_channel: p DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: -con DEBUG:netmiko:read_channel: fig DEBUG:netmiko:Pattern found: (show\ startup-config) show startup-config DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Using 1631 out of 522232 bytes!

! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname R3 ! boot-start-marker boot-end-marker ! ! logging buffered 50000 enable secret 5 $1$PIrO$di4PffUxHW2iajjh1QLcO. ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 **** ! ! ! ! ! ip tcp synwait-time 5 ip scp server enable ! class-map match-any SSH-Traffic match access-group 101 ! policy-map QoS-Policy class SSH-Traffic priority percent 80 ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex full ! interface Ethernet1/0 ip address 10.0.1.130 255.255.255.128 duplex full service-policy output QoS-Policy ! interface Ethernet1/1 no ip address shutdown duplex full ! interface Ethernet1/2 no ip address shutdown duplex full ! interface Ethernet1/3 ip address 10.0.3.2 255.255.255.128 duplex half service-policy output QoS-Policy ! router ospf 1 router-id 9.9.9.9 network 10.0.1.128 0.0.0.127 area 1 network 10.0.3.0 0.0.0.127 area 1 network 155.5.5.0 0.0.0.127 area 1 ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! access-list 101 permit tcp any any eq 22 access-list 101 permit tcp any eq 22 any ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 exec-timeout 0 0 login local transport input all transport output all ! ! end

R3# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R3# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R3# DEBUG:netmiko:write_channel: b'show running-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: show DEBUG:netmiko:read_channel: runn DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: ing-co DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: f DEBUG:netmiko:read_channel: i DEBUG:netmiko:read_channel: g

DEBUG:netmiko:Pattern found: (show\ running-config) show running-config DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Building configuration...

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:paramiko.transport:EOF in transport thread

hfakoor222 commented 1 year ago

Here is my most recent log: EIGRP1# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: EIGRP1# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is EIGRP1# DEBUG:netmiko:write_channel: b'show running-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: show DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: runni DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: ng- DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: co DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: f DEBUG:netmiko:read_channel: ig DEBUG:netmiko:Pattern found: (show\ running-config) show running-config DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Building configuration...

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\x00' DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Current configuration : 1667 bytes ! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname EIGRP1 ! boot-start-marker boot-end-marker ! ! enable secret 5 $1$H0oR$LeSVu.tEJ3SGfI/qVDpTQ0 ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 **** ! ! ! ! ! ip tcp synwait-time 5 ip scp server enable ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex full ! interface Ethernet1/0 ip address 11.0.1.2 255.255.255.248 duplex full ! interface Ethernet1/1 ip address 11.0.2.2 255.255.255.248 duplex half ! interface Ethernet1/2 ip address 11.0.2.33 255.255.255.248 duplex half ! interface Ethernet1/3 no ip address shutdown duplex full ! ! router eigrp Fakoor ! address-family ipv4 unicast autonomous-system 1 ! topology base redistribute bgp 652 metric 5000 150 255 1 1500 route-map BGP_TO_EIGRP exit-af-topology network 11.0.1.0 0.0.0.7 network 11.0.2.0 0.0.0.7 network 11.0.2.32 0.0.0.7 exit-address-family ! router bgp 652 bgp router-id 51.51.51.51 bgp log-neighbor-changes redistribute eigrp 1 neighbor 11.0.1.1 remote-as 651 ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! ! route-map BGP_TO_EIGRP permit 5 set tag 100 ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 exec-timeout 0 0 login local transport input all transport output all ! ! end

EIGRP1# DEBUG:netmiko:Pattern found: ([>#]) Current configuration : 1667 bytes ! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname EIGRP1 ! boot-start-marker boot-end-marker ! ! enable secret 5 $1$H0oR$LeSVu.tEJ3SGfI/qVDpTQ0 ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 **** ! ! ! ! ! ip tcp synwait-time 5 ip scp server enable ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex full ! interface Ethernet1/0 ip address 11.0.1.2 255.255.255.248 duplex full ! interface Ethernet1/1 ip address 11.0.2.2 255.255.255.248 duplex half ! interface Ethernet1/2 ip address 11.0.2.33 255.255.255.248 duplex half ! interface Ethernet1/3 no ip address shutdown duplex full ! ! router eigrp Fakoor ! address-family ipv4 unicast autonomous-system 1 ! topology base redistribute bgp 652 metric 5000 150 255 1 1500 route-map BGP_TO_EIGRP exit-af-topology network 11.0.1.0 0.0.0.7 network 11.0.2.0 0.0.0.7 network 11.0.2.32 0.0.0.7 exit-address-family ! router bgp 652 bgp router-id 51.51.51.51 bgp log-neighbor-changes redistribute eigrp 1 neighbor 11.0.1.1 remote-as 651 ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! ! route-map BGP_TO_EIGRP permit 5 set tag 100 ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 exec-timeout 0 0 login local transport input all transport output all ! ! end

EIGRP1# DEBUG:netmiko:write_channel: b'exit\n' DEBUG:paramiko.transport:EOF in transport thread Here is the code:

def initialize_device_connections(item, ):

we unpack the .txt file of devices to get the variables below

device_type, device_ip, username, password, secret = item
driver = get_network_driver(device_type) #NAPALMs built-in get_network_driver
print("The driver: " +  str(driver))
print("the secret" + str(secret))
napalm_device = driver(hostname=device_ip, username=username, password=password, optional_args={"inline_transfer":True,"global_delay_factor":15,"secret":secret,"dest_file_system": "disk0:","auto_file_prompt":True}) #the dest_file_system is where you want original configs to be stored for rollback. For Cisco devices make sure to enable SCP, "ip SCP server enable", file transfers in netmiko are done via SCP
#the auto_file_prompt option is to override prompts for file transfers: typically not needed unless set explicitly on the remote device, this overrides it. delay_factor to avoid premature errors. #"expect_string" : "r'\[.*\]"::: "secret":secret
napalm_device.open() #NAPALMs open method
config = napalm_device.get_config()
print("This is config:  " + str(config))
config_table_before[device_ip] = config

Ive tried with and without secret, with and without "expect_string":"EIGRP1#", expect_string"r".*", 2 differenct c7200 images, an IOU image, setting terminal legthn to both 0 and 200 modifying terminal width

hfakoor222 commented 1 year ago

Also here is my configuration: version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname EIGRP1 ! boot-start-marker boot-end-marker ! ! enable secret 5 $1$H0oR$LeSVu.tEJ3SGfI/qVDpTQ0 ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 cisco123 ! ! ! ! ! ip tcp synwait-time 5 ip scp server enable ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex full ! interface Ethernet1/0 ip address 11.0.1.2 255.255.255.248 duplex full ! interface Ethernet1/1 ip address 11.0.2.2 255.255.255.248 duplex half ! interface Ethernet1/2 ip address 11.0.2.33 255.255.255.248 duplex half ! interface Ethernet1/3 no ip address shutdown duplex full ! ! router eigrp Fakoor ! address-family ipv4 unicast autonomous-system 1 ! topology base redistribute bgp 652 metric 5000 150 255 1 1500 route-map BGP_TO_EIGRP exit-af-topology network 11.0.1.0 0.0.0.7 network 11.0.2.0 0.0.0.7 network 11.0.2.32 0.0.0.7 exit-address-family ! router bgp 652 bgp router-id 51.51.51.51 bgp log-neighbor-changes redistribute eigrp 1 neighbor 11.0.1.1 remote-as 651 ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! ! route-map BGP_TO_EIGRP permit 5 set tag 100 ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 exec-timeout 0 0 login local length 300 transport input all transport output all ! ! end

hfakoor222 commented 1 year ago

Here's a good example: code works fine until I do device.commit()

from napalm import get_network_driver import logging logging.basicConfig(filename='fuck.log', level=logging.DEBUG) logger = logging.getLogger("netmiko") secret = "cisco123" def main():

Define the device parameters

device_ip = '10.0.1.1'
device_username = 'cisco'
device_password = 'cisco123'
device_type = 'ios'  #

driver = get_network_driver(device_type)

Connect to the device

device = driver(device_ip, device_username, device_password, optional_args = {"global_delay_factor":8,"dest_file_system":"disk0:","auto_file_prompt": True,})
device.open()
try:
    print("\nDevice Facts:")
    print("-" * 40)
    facts = device.get_facts()
    print(facts)
    config = device.get_config()
    print(config)
    for key, value in facts.items():
        print(f"{key}: {value}")

    # Define the configuration to be merged
    config = "interface Loopback557\n ip address 1.1.1.3 255.255.255.0\n"
    device.load_merge_candidate(config='config')
    print(device.load_merge_candidate)
   # device.commit_config()

as soon as I uncomment this i get an error of the pattern not detected Here is the error log: R4# DEBUG:netmiko:Pattern found: ([>#]) ^@ R4# DEBUG:netmiko:write_channel: b'exit\n' DEBUG:paramiko.transport:EOF in transport thread DEBUG:paramiko.transport:starting thread (client mode): 0xd4b2f7c0 DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_3.3.1 DEBUG:paramiko.transport:Remote version/idstring: SSH-1.99-Cisco-1.25 INFO:paramiko.transport:Connected (version 1.99, client Cisco-1.25) DEBUG:paramiko.transport:=== Key exchange possibilities === DEBUG:paramiko.transport:kex algos: diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 DEBUG:paramiko.transport:server key: ssh-rsa DEBUG:paramiko.transport:client encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc DEBUG:paramiko.transport:server encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc DEBUG:paramiko.transport:client mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 DEBUG:paramiko.transport:server mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 DEBUG:paramiko.transport:client compress: none DEBUG:paramiko.transport:server compress: none DEBUG:paramiko.transport:client lang: DEBUG:paramiko.transport:server lang: DEBUG:paramiko.transport:kex follows: False DEBUG:paramiko.transport:=== Key exchange agreements === DEBUG:paramiko.transport:Kex: diffie-hellman-group-exchange-sha1 DEBUG:paramiko.transport:HostKey: ssh-rsa DEBUG:paramiko.transport:Cipher: aes128-cbc DEBUG:paramiko.transport:MAC: hmac-sha1 DEBUG:paramiko.transport:Compression: none DEBUG:paramiko.transport:=== End of kex handshake === DEBUG:paramiko.transport:Got server p (2048 bits) DEBUG:paramiko.transport:kex engine KexGex specified hash_algo DEBUG:paramiko.transport:Switch to new keys ... DEBUG:paramiko.transport:Adding ssh-rsa host key for 10.0.1.1: b'da4e917ef1db9280a2fc1e585c697bee' DEBUG:paramiko.transport:userauth is OK INFO:paramiko.transport:Authentication (password) successful! DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes DEBUG:paramiko.transport:[chan 0] Max packet out: 4096 bytes DEBUG:paramiko.transport:Secsh channel 0 opened. DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:write_channel: b'terminal width 511\n' DEBUG:netmiko:read_channel: R4#

DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: term DEBUG:netmiko:read_channel: in DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: l w DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: idth DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: 51 DEBUG:netmiko:read_channel: 1 DEBUG:netmiko:Pattern found: (terminal width 511) R4# R4#terminal width 511 DEBUG:netmiko:In disable_paging DEBUG:netmiko:Command: terminal length 0

DEBUG:netmiko:write_channel: b'terminal length 0\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: t DEBUG:netmiko:read_channel: e DEBUG:netmiko:read_channel: rmin DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: l l DEBUG:netmiko:read_channel: e DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: gt DEBUG:netmiko:read_channel: h DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: 0

DEBUG:netmiko:Pattern found: (terminal\ length\ 0) R4#terminal length 0 DEBUG:netmiko: R4#terminal length 0 DEBUG:netmiko:Exiting disable_paging DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Clear buffer detects data in the channel DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Pattern found: (#|>) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Pattern found: (R4.*) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show version\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: h DEBUG:netmiko:read_channel: ow DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: v DEBUG:netmiko:read_channel: er DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: ion DEBUG:netmiko:Pattern found: (show\ version) show version DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S6, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Fri 08-Aug-14 04:05 by prod_rel_team

ROM: ROMMON Emulation Microcode BOOTLDR: 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S6, RELEASE SOFTWARE (fc1)

R4 uptime is 1 hour, 59 minutes System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19 System image file is "tftp://255.255.255.255/unknown" Last reload reason: unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19

This product contains cryptographic features and is subject to United States and local country laws governing import, export, transfer and use. Delivery of Cisco cryptographic products does not imply third-party authority to import, export, distribute or use encryption. Importers, exporters, distributors and users are responsible for compliance with U.S. and local country laws. By using this product you agree to comply with applicable laws and regulations. If you are unable to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at: http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to export@cisco.com.

Cisco 7206VXR (NPE400) processor (revision A) with 491520K/32768K bytes of memory. Processor board ID 4279256517 R7000 CPU at 150MHz, Implementation 39, Rev 2.1, 256KB L2 Cache 6 slot VXR midplane, Version 2.1

Last reset from power-on

PCI bus mb0_mb1 (Slots 0, 1, 3 and 5) has a capacity of 600 bandwidth points. Current configuration on bus mb0_mb1 has a total of 600 bandwidth points. This configuration is within the PCI bus capacity and is supported.

PCI bus mb2 (Slots 2, 4, 6) has a capacity of 600 bandwidth points. Current configuration on bus mb2 has a total of 200 bandwidth points This configuration is within the PCI bus capacity and is supported.

Please refer to the following document "Cisco 7200 Series Port Adaptor Hardware Configuration Guidelines" on Cisco.com http://www.cisco.com for c7200 bandwidth points oversubscription and usage guidelines.

4 FastEthernet interfaces 509K bytes of NVRAM.

131072K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes). 8192K bytes of Flash internal SIMM (Sector size 256K). DEBUG:netmiko:read_channel: Configuration register is 0x2102

R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show hosts\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: how DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: hos DEBUG:netmiko:read_channel: t DEBUG:netmiko:read_channel: s

DEBUG:netmiko:Pattern found: (show\ hosts) show hosts DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Name lookup view: Global Default domain is cisco Name/address lookup uses static mappings

Codes: UN - unknown, EX - expired, OK - OK, ?? - revalidate temp - temporary, perm - permanent NA - Not Applicable None - Not defined

Host Port Flags Age Type Address(es) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show ip interface brief\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: ho DEBUG:netmiko:read_channel: w i DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: p i DEBUG:netmiko:read_channel: nte DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: rfa DEBUG:netmiko:read_channel: ce DEBUG:netmiko:read_channel: b DEBUG:netmiko:read_channel: ri DEBUG:netmiko:read_channel: ef DEBUG:netmiko:Pattern found: (show\ ip\ interface\ brief) show ip interface brief DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Interface IP-Address OK? Method Status Protocol FastEthernet0/0 10.0.1.1 YES NVRAM up up
FastEthernet1/0 10.0.1.129 YES NVRAM up up
FastEthernet2/0 192.168.56.138 YES DHCP up up
FastEthernet3/0 10.0.7.194 YES NVRAM up up
Loopback556 1.1.1.2 YES NVRAM up up
R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show startup-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: how DEBUG:netmiko:read_channel: st DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: rt DEBUG:netmiko:read_channel: up DEBUG:netmiko:read_channel: - DEBUG:netmiko:read_channel: confi DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: g

DEBUG:netmiko:Pattern found: (show\ startup-config) show startup-config DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Using 1848 out of 522232 bytes ! ! Last configuration change at 04:00:42 UTC Sun Nov 12 2023 by cisco ! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname R4 ! boot-start-marker boot-end-marker ! ! enable secret 5 $1$Q3r7$TZY6o75wqAaa4IFdXdI2I1 ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 **** ! ! ! ! ! ip tcp window-size 1000000000 ip tcp synwait-time 5 ip scp server enable ! class-map match-any SSH-Traffic match access-group 101 ! policy-map QoS-Policy class SSH-Traffic priority percent 80 ! ! ! ! ! ! ! ! ! ! interface Loopback556 ip address 1.1.1.2 255.255.255.0 ! interface FastEthernet0/0 ip address 10.0.1.1 255.255.255.128 duplex half service-policy output QoS-Policy ! interface FastEthernet1/0 ip address 10.0.1.129 255.255.255.128 duplex full service-policy output QoS-Policy ! interface FastEthernet2/0 ip address dhcp duplex full ! interface FastEthernet3/0 ip address 10.0.7.194 255.255.255.192 ip ospf 1 area 1 duplex full ! router ospf 1 router-id 6.6.6.6 domain-tag 55 network 10.0.1.0 0.0.0.127 area 1 network 10.0.1.128 0.0.0.127 area 1 network 10.0.7.192 0.0.0.63 area 1 network 155.55.55.0 0.0.0.127 area 0 default-information originate ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ip route 0.0.0.0 0.0.0.0 169.254.152.107 ! access-list 101 permit tcp any any eq 22 ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 privilege level 15 login local length 500 width 500 transport input all transport output all ! ! end

R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show running-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: sh DEBUG:netmiko:read_channel: ow r DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: u DEBUG:netmiko:read_channel: nning-co DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: f DEBUG:netmiko:read_channel: i DEBUG:netmiko:read_channel: g

DEBUG:netmiko:Pattern found: (show\ running-config) show running-config DEBUG:netmiko:read_channel: Building configuration...

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:paramiko.transport:EOF in transport thread

hfakoor222 commented 1 year ago

Here's a good example: code works fine until I do device.commit()

from napalm import get_network_driver import logging logging.basicConfig(filename='fuck.log', level=logging.DEBUG) logger = logging.getLogger("netmiko") secret = "cisco123" def main():

Define the device parameters

device_ip = '10.0.1.1'
device_username = 'cisco'
device_password = 'cisco123'
device_type = 'ios'  #

driver = get_network_driver(device_type)

Connect to the device

device = driver(device_ip, device_username, device_password, optional_args = {"global_delay_factor":8,"dest_file_system":"disk0:","auto_file_prompt": True,})
device.open()
try:
    print("\nDevice Facts:")
    print("-" * 40)
    facts = device.get_facts()
    print(facts)
    config = device.get_config()
    print(config)
    for key, value in facts.items():
        print(f"{key}: {value}")

    # Define the configuration to be merged
    config = "interface Loopback557\n ip address 1.1.1.3 255.255.255.0\n"
    device.load_merge_candidate(config='config')
    print(device.load_merge_candidate)
   # device.commit_config()

as soon as I uncomment this i get an error of the pattern not detected Here is the error log: R4# DEBUG:netmiko:Pattern found: ([>#]) ^@ R4# DEBUG:netmiko:write_channel: b'exit\n' DEBUG:paramiko.transport:EOF in transport thread DEBUG:paramiko.transport:starting thread (client mode): 0xd4b2f7c0 DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_3.3.1 DEBUG:paramiko.transport:Remote version/idstring: SSH-1.99-Cisco-1.25 INFO:paramiko.transport:Connected (version 1.99, client Cisco-1.25) DEBUG:paramiko.transport:=== Key exchange possibilities === DEBUG:paramiko.transport:kex algos: diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 DEBUG:paramiko.transport:server key: ssh-rsa DEBUG:paramiko.transport:client encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc DEBUG:paramiko.transport:server encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc DEBUG:paramiko.transport:client mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 DEBUG:paramiko.transport:server mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 DEBUG:paramiko.transport:client compress: none DEBUG:paramiko.transport:server compress: none DEBUG:paramiko.transport:client lang: DEBUG:paramiko.transport:server lang: DEBUG:paramiko.transport:kex follows: False DEBUG:paramiko.transport:=== Key exchange agreements === DEBUG:paramiko.transport:Kex: diffie-hellman-group-exchange-sha1 DEBUG:paramiko.transport:HostKey: ssh-rsa DEBUG:paramiko.transport:Cipher: aes128-cbc DEBUG:paramiko.transport:MAC: hmac-sha1 DEBUG:paramiko.transport:Compression: none DEBUG:paramiko.transport:=== End of kex handshake === DEBUG:paramiko.transport:Got server p (2048 bits) DEBUG:paramiko.transport:kex engine KexGex specified hash_algo DEBUG:paramiko.transport:Switch to new keys ... DEBUG:paramiko.transport:Adding ssh-rsa host key for 10.0.1.1: b'da4e917ef1db9280a2fc1e585c697bee' DEBUG:paramiko.transport:userauth is OK INFO:paramiko.transport:Authentication (password) successful! DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes DEBUG:paramiko.transport:[chan 0] Max packet out: 4096 bytes DEBUG:paramiko.transport:Secsh channel 0 opened. DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:write_channel: b'terminal width 511\n' DEBUG:netmiko:read_channel: R4#

DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: term DEBUG:netmiko:read_channel: in DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: l w DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: idth DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: 51 DEBUG:netmiko:read_channel: 1 DEBUG:netmiko:Pattern found: (terminal width 511) R4# R4#terminal width 511 DEBUG:netmiko:In disable_paging DEBUG:netmiko:Command: terminal length 0

DEBUG:netmiko:write_channel: b'terminal length 0\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: t DEBUG:netmiko:read_channel: e DEBUG:netmiko:read_channel: rmin DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: l l DEBUG:netmiko:read_channel: e DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: gt DEBUG:netmiko:read_channel: h DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: 0

DEBUG:netmiko:Pattern found: (terminal\ length\ 0) R4#terminal length 0 DEBUG:netmiko: R4#terminal length 0 DEBUG:netmiko:Exiting disable_paging DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Clear buffer detects data in the channel DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Pattern found: (#|>) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:Pattern found: (R4.*) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show version\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: h DEBUG:netmiko:read_channel: ow DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: v DEBUG:netmiko:read_channel: er DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: ion DEBUG:netmiko:Pattern found: (show\ version) show version DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S6, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Fri 08-Aug-14 04:05 by prod_rel_team

ROM: ROMMON Emulation Microcode BOOTLDR: 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S6, RELEASE SOFTWARE (fc1)

R4 uptime is 1 hour, 59 minutes System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19 System image file is "tftp://255.255.255.255/unknown" Last reload reason: unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19

This product contains cryptographic features and is subject to United States and local country laws governing import, export, transfer and use. Delivery of Cisco cryptographic products does not imply third-party authority to import, export, distribute or use encryption. Importers, exporters, distributors and users are responsible for compliance with U.S. and local country laws. By using this product you agree to comply with applicable laws and regulations. If you are unable to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at: http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to export@cisco.com.

Cisco 7206VXR (NPE400) processor (revision A) with 491520K/32768K bytes of memory. Processor board ID 4279256517 R7000 CPU at 150MHz, Implementation 39, Rev 2.1, 256KB L2 Cache 6 slot VXR midplane, Version 2.1

Last reset from power-on

PCI bus mb0_mb1 (Slots 0, 1, 3 and 5) has a capacity of 600 bandwidth points. Current configuration on bus mb0_mb1 has a total of 600 bandwidth points. This configuration is within the PCI bus capacity and is supported.

PCI bus mb2 (Slots 2, 4, 6) has a capacity of 600 bandwidth points. Current configuration on bus mb2 has a total of 200 bandwidth points This configuration is within the PCI bus capacity and is supported.

Please refer to the following document "Cisco 7200 Series Port Adaptor Hardware Configuration Guidelines" on Cisco.com http://www.cisco.com for c7200 bandwidth points oversubscription and usage guidelines.

4 FastEthernet interfaces 509K bytes of NVRAM.

131072K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes). 8192K bytes of Flash internal SIMM (Sector size 256K). DEBUG:netmiko:read_channel: Configuration register is 0x2102

R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show hosts\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: how DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: hos DEBUG:netmiko:read_channel: t DEBUG:netmiko:read_channel: s

DEBUG:netmiko:Pattern found: (show\ hosts) show hosts DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Name lookup view: Global Default domain is cisco Name/address lookup uses static mappings

Codes: UN - unknown, EX - expired, OK - OK, ?? - revalidate temp - temporary, perm - permanent NA - Not Applicable None - Not defined

Host Port Flags Age Type Address(es) R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show ip interface brief\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: ho DEBUG:netmiko:read_channel: w i DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: p i DEBUG:netmiko:read_channel: nte DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: rfa DEBUG:netmiko:read_channel: ce DEBUG:netmiko:read_channel: b DEBUG:netmiko:read_channel: ri DEBUG:netmiko:read_channel: ef DEBUG:netmiko:Pattern found: (show\ ip\ interface\ brief) show ip interface brief DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Interface IP-Address OK? Method Status Protocol FastEthernet0/0 10.0.1.1 YES NVRAM up up
FastEthernet1/0 10.0.1.129 YES NVRAM up up
FastEthernet2/0 192.168.56.138 YES DHCP up up
FastEthernet3/0 10.0.7.194 YES NVRAM up up
Loopback556 1.1.1.2 YES NVRAM up up
R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show startup-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: s DEBUG:netmiko:read_channel: how DEBUG:netmiko:read_channel: st DEBUG:netmiko:read_channel: a DEBUG:netmiko:read_channel: rt DEBUG:netmiko:read_channel: up DEBUG:netmiko:read_channel: - DEBUG:netmiko:read_channel: confi DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: g

DEBUG:netmiko:Pattern found: (show\ startup-config) show startup-config DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Using 1848 out of 522232 bytes ! ! Last configuration change at 04:00:42 UTC Sun Nov 12 2023 by cisco ! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname R4 ! boot-start-marker boot-end-marker ! ! enable secret 5 $1$Q3r7$TZY6o75wqAaa4IFdXdI2I1 ! no aaa new-model no ip icmp rate-limit unreachable ! ! ! ! ! ! no ip domain lookup ip domain name cisco ip cef no ipv6 cef ! ! multilink bundle-name authenticated ! ! archive path disk0: ! ! ! ! ! username cisco privilege 15 password 0 **** ! ! ! ! ! ip tcp window-size 1000000000 ip tcp synwait-time 5 ip scp server enable ! class-map match-any SSH-Traffic match access-group 101 ! policy-map QoS-Policy class SSH-Traffic priority percent 80 ! ! ! ! ! ! ! ! ! ! interface Loopback556 ip address 1.1.1.2 255.255.255.0 ! interface FastEthernet0/0 ip address 10.0.1.1 255.255.255.128 duplex half service-policy output QoS-Policy ! interface FastEthernet1/0 ip address 10.0.1.129 255.255.255.128 duplex full service-policy output QoS-Policy ! interface FastEthernet2/0 ip address dhcp duplex full ! interface FastEthernet3/0 ip address 10.0.7.194 255.255.255.192 ip ospf 1 area 1 duplex full ! router ospf 1 router-id 6.6.6.6 domain-tag 55 network 10.0.1.0 0.0.0.127 area 1 network 10.0.1.128 0.0.0.127 area 1 network 10.0.7.192 0.0.0.63 area 1 network 155.55.55.0 0.0.0.127 area 0 default-information originate ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ip route 0.0.0.0 0.0.0.0 169.254.152.107 ! access-list 101 permit tcp any any eq 22 ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous stopbits 1 line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous stopbits 1 line vty 0 4 privilege level 15 login local length 500 width 500 transport input all transport output all ! ! end

R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel: R4# DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is R4# DEBUG:netmiko:write_channel: b'show running-config\n' DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: sh DEBUG:netmiko:read_channel: ow r DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: u DEBUG:netmiko:read_channel: nning-co DEBUG:netmiko:read_channel: n DEBUG:netmiko:read_channel: f DEBUG:netmiko:read_channel: i DEBUG:netmiko:read_channel: g

DEBUG:netmiko:Pattern found: (show\ running-config) show running-config DEBUG:netmiko:read_channel: Building configuration...

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:paramiko.transport:EOF in transport thread

Here is the log on the cisco device: Nov 12 04:14:29.659: %SYS-5-CONFIG_I: Configured from console by cisco on vty0 (192.168.56.1) but no commit

hfakoor222 commented 1 year ago

Here is the traceback: Traceback (most recent call last): File " Routing_Updater\new_test.py", line 40, in main() File Routing_Updater\new_test.py", line 32, in main device.commit_config() File "\Routing_Updater\lib\site-packages\napalm\ios\ios.py", line 539, in commit_config self._gen_rollback_cfg() File "Python_Scripting\Routing_Updater\lib\site-packages\napalm\ios\ios.py", line 467, in wrapper return f(self, *args, *kwargs) File "Python_Scripting\Routing_Updater\lib\site-packages\napalm\ios\ios.py", line 832, in _gen_rollback_cfg self.device.send_command(cmd) File "\Python_Scripting\Routing_Updater\lib\site-packages\netmiko\utilities.py", line 592, in wrapper_decorator return func(self, args, **kwargs) File "\Python_Scripting\Routing_Updater\lib\site-packages\netmiko\base_connection.py", line 1721, in send_command raise ReadTimeout(msg) netmiko.exceptions.ReadTimeout: Pattern not detected: 'R4\#' in output.

Things you might try to fix this:

  1. Explicitly set your pattern using the expect_string argument.
  2. Increase the read_timeout to a larger value.

You can also look at the Netmiko session_log or debug log for more information.

hfakoor222 commented 1 year ago

Okay one more thing I noticed: With this code I'm getting a config file error. I think this may be the cause. from napalm import get_network_driver import logging logging.basicConfig(filename='fuck.log', level=logging.DEBUG) logger = logging.getLogger("netmiko") secret = "cisco123" def main():

Define the device parameters

device_ip = '10.0.1.130'
device_username = 'cisco'
device_password = 'cisco123'
device_type = 'ios'  #

driver = get_network_driver(device_type)

Connect to the device

device = driver(device_ip, device_username, device_password, optional_args = {"global_delay_factor":8,"dest_file_system":"disk0:","auto_file_prompt":True,"secret":secret,"inline_transfer":True})
device.open()

print("\nDevice Facts:")
print("-" * 40)
facts = device.get_facts()
print(facts)
config = device.get_config()
print(config)
# for key, value in facts.items():
#     print(f"{key}: {value}")

# Define the configuration to be merged
config = "interface Loopback5111\n ip address 1.1.1.51 255.255.255.0"
device.load_merge_candidate(config=config)
print(device.load_merge_candidate)

config = device.get_config()
print(config)
choice = input("Commit? (Y|N)")
if choice.lower()== "y":
    device.commit_config()
device.close()

if name == "main": main()

Here's what the traceback states: raceback (most recent call last): , line 43, in main() File " line 37, in main device.commit_config() File " output += self.device.save_config() File ", line 61, in save_config return super().save_config( File ", line 254, in save_config output = self._send_command_str( File ", line 1743, in _send_command_str output = self.send_command(*args, *kwargs) File , line 592, in wrapper_decorator return func(self, args, **kwargs) File ", line 1721, in send_command raise ReadTimeout(msg) netmiko.exceptions.ReadTimeout: Pattern not detected: 'R3\#' in output.

here is the error on the router: %PARSER-4-BADCFG: Unexpected end of configuration file.

hfakoor222 commented 1 year ago

It was writing the configs in as strings surrounded by quotes:

"Interface Loopback 100".

Enable ip scp server and set term length to 0, while reformatting the disk.

hfakoor222 commented 1 year ago

It was writing the configs in as strings surrounded by quotes:

"Interface Loopback 100".

Enable ip scp server and set term length to 0, while reformatting the disk.