ktbyers / netmiko

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

Autodetect - platform flexibility feature request #3518

Open susanhooks opened 2 weeks ago

susanhooks commented 2 weeks ago

Description of Issue/Question

While using the ssh_autodetect feature of netmiko, I noticed that some devices using XE software were being detected as IOS. From looking at the backend of that package, those platforms are equally weighted, but IOS is selected. I'd like a way to change which platform/vendor name is optionally preferred for ssh autodetect.

Setup

Netmiko version

netmiko==4.3.0

Netmiko device_type (if relevant to the issue)

Cisco WS-C3850-48P XE 16.2

Steps to Reproduce the Issue

autodetect device type using ssh_autodetect

Error Traceback

No error, just unexpected result of being detected as IOS

ktbyers commented 2 weeks ago

One solution that we discussed via Slack:

Another possible solution (easier solution) to the autodetect issue is we add some additional argument that defaults to false--like use_canonical=True and in this case Netmiko would set an IOS-XE device to cisco_xe and generally try to use the most correct answer for returning the device type.

This is probably the easiest way to do it and then we won't break backwards compatibility with other things (which might be expecting the current answer--for example, parsers (ntc-templates, genie), napalm, netbox, nautobot.