netmiko icon indicating copy to clipboard operation
netmiko copied to clipboard

Autodetect - platform flexibility feature request

Open susanhooks opened this issue 1 year ago • 1 comments
trafficstars

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

susanhooks avatar Oct 31 '24 15:10 susanhooks

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.

ktbyers avatar Oct 31 '24 16:10 ktbyers

This should be fixed as we adjusted the priority to have IOS-XE at 99 priority and IOS at 95 priority.

Let me know if there are still issues or things that need fixed here.

ktbyers avatar Apr 26 '25 01:04 ktbyers

Happy to close this. Working as expected, thanks!

susanhooks avatar Apr 26 '25 01:04 susanhooks