question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extreme ERS Netmiko 4 - Pattern not detected: '[>#]' in output.

See original GitHub issue

Hello, I am using a simple script to configure SNMPv3 username and password. With Netmiko 3 it works perfectly but with Netmiko 4 I get an error:

Pattern not detected: ‘[>#]’ in output.

def connect_to_switch(ip, comms):
    print(f"Connecting to {ip}")
    switch = {
        'device_type': 'extreme_ers',
        'host': ip,
        'username': 'USERNAME',
        'password': 'PASSWORD',
        "global_delay_factor": 2
    }
    net_connect = ConnectHandler(**switch)    
    net_connect.special_login_handler()        
     
    for command in comms:
        v = net_connect.send_command(command, expect_string=r'#')
        print(v)
    net_connect.disconnect()
 
 
if __name__ == "__main__":
    # Commands to sent
    commands = ['configure terminal',
                "snmp-server user SNMPUSERNAME sha SECURE_PASS aes SECURE_PASS read-view snmpv1Objs",
                "wr mem",
                ]
 
     
    connect_to_switch('10.10.10.10', commands)
  

Here is the DEBUG log file. The “host1#” is there and it should match the but somehow it does not understand the pattern.

DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: Enter Ctrl-Y to begin. Ethernet Routing Switch 4926GTS-PWR+  Copyright © 1996-2021 Extreme Networks. All rights reserved.  This product is protected by one or more US patents listed  at http://www.extremenetworks.com/patents along with  their foreign counterparts.   HW:01 FW:7.5.0.4 SW:v7.8.4.013************[?25l DEBUG:netmiko:write_channel: b’\x19’ DEBUG:netmiko:read_channel: Last login: – Failed retries since last login: 0 Press ENTER to continue  DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: [?25h host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’\n’ DEBUG:netmiko:read_channel: host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko: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’\n’ DEBUG:netmiko:read_channel:

DEBUG:netmiko:read_channel: host1# DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b’exit\n’ DEBUG:paramiko.transport:EOF in transport thread

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mrkslmcommented, Jun 13, 2022

@ktbyers
Hey Kirk, Tested with my device and it works now!

1reaction
ReK42commented, Jun 9, 2022

Okay, this looks like a Netmiko bug?

Netmiko looks like it was expecting cnrl-y and then username + password.

I am not sure if something changed here on the ERS or if it never really worked.

On all current models the behaviour over SSH is username/password first, then Ctrl+Y, then Enter. This may differ over console connections and some older, end-of-life models but I believe it is true for all ERS models that are still supported by Extreme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Netmiko Pattern Not Detected - Stack Overflow
Pattern not detected: 'Switch\\#' in output. Things you might try to fix this: 1. Explicitly set your pattern using the expect_string ...
Read more >
netmiko.extreme API documentation - GitHub Pages
Netmiko support for Extreme Ethernet Routing Switch. Initialize attributes for establishing connection to target device. :param ip: IP address of target ...
Read more >
netmiko - Bountysource
after upgrade the netmiko module from 2.4.2 to 3.0.0 the "send_command" function, for mikrotik RouterOS device, is not working. The traceback message is ......
Read more >
netmiko · PyPI
#### Execute show commands. ```py output = net_connect.send_command('show ip int brief') print(output) ``` ``` Interface IP-Address ...
Read more >
Github Com Ktbyers Netmiko Issues 1586 - Amarta Karya
Extreme ERS Netmiko 4 - Pattern not detected: '[>#]' in output. Supported Platforms | netmiko; Show commands that prompt for more information |...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found