Skip to content

Conversation

@Ardeck
Copy link
Contributor

@Ardeck Ardeck commented Dec 18, 2025

… options - and add tests

Summary

Update cisco_ios_show_cdp_neighbors_detail.textfsm to handle new format and many new fields

Changes

  • Adjust TextFSM regex for
  • Update ntc_templates/templates/index for correct mapping
  • Add .raw and .yml test cases under tests/cisco_ios/show_cdp_neighbors_detail/

Motivation

Current template is missing many parameters.

Validation

  • Ran poetry run invoke tests locally — all tests pass.
  • Verified parsing against provided .raw samples.

Notes

Scope limited to Cisco IOS show cdp neighbors detail.

@mjbear
Copy link
Collaborator

mjbear commented Dec 18, 2025

@Ardeck
What version of IOS/IOS-XE led to format changes?

While not necessarily "bad", there is quite a bit of change here to the data structure. This non-backwards compatible nature of things constitutes a breaking change (example definition).

We want to also keep in mind to maintain naming parity with LLDP for example.

Admittedly I haven't combed through each piece of your PR yet.

There might be a middle ground where we can reduce the level of incompatibility (as we're a ways off from a major release where breaking changes could be included).

@Ardeck
Copy link
Contributor Author

Ardeck commented Dec 19, 2025

@Ardeck What version of IOS/IOS-XE led to format changes?

While not necessarily "bad", there is quite a bit of change here to the data structure. This non-backwards compatible nature of things constitutes a breaking change (example definition).

We want to also keep in mind to maintain naming parity with LLDP for example.

Admittedly I haven't combed through each piece of your PR yet.

There might be a middle ground where we can reduce the level of incompatibility (as we're a ways off from a major release where breaking changes could be included).

Hello,

I completely understand, I hesitated before touching it but after I started, I tried to get the most of it.
My main struggle was with the management IP incorrectly captured and the Version inside the NEIGHBOR_DESCRIPTION I had to further process when it can be done in one go.

A ) New Format, Values

  • IPv6 was not clearly separated and captured
    I don't know if the old MGMT_address was capturing any IPv6 but in my tests it did not.

-TLV /Power Power is displayed differently, I did not find "Power Available TLV:"
but I guess power is a specific beast

  • new fields are also available depending on the neighbors
    VTP,Duplex,Management IP ....

I am not sure in which version these change was made are the previous template is probably very old.

-Management address section was not captured

B) Values changed
MGMT_ADDRESS changed to MGMT_ADDRESS for two reasons :

  1. it was not matching the management address field
  2. I tried to follow the standardization, Common Capture Groups

It was creating conflicts as Interface IP and Management IP can be different cf. 4.raw
I am not sure how to name INTERFACE_IP, it is called Entries. It closely match the previous MGMT_ADDRESS.

But there is confusion between IPv4 and IPv6
to avoid breaking change.
Value INTERFACE_IP (\d+.\d+.\d+.\d+)
could be rolled back to
Value MGMT_ADDRESS (\d+.\d+.\d+.\d+|\w+.\w+.\w+)

Same the regex for the value can be preswerved to the old values
Value PLATFORM (.)
Value NEIGHBOR_INTERFACE (.
)
Value LOCAL_INTERFACE (.*)
Value CAPABILITIES (.+?)

C) Value removed
Value NEIGHBOR_DESCRIPTION (.*$)

NEIGHBOR_DESCRIPTION is more problematic as I completely rewrote it for several reasons :

  1. it is not a description, it is in the Version section
  2. Many interesting fields can be recovered about the version details

Copy link
Contributor

@jvanderaa jvanderaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the rest of these are making sense on the names, we may have to go update some of the other templates as we get this one merged in.

I'm a little worried about the NEIGHBOR_DESCRIPTION getting broken down, will we need to be updating this template quite a bit as new devices that come online since it is all free form fields.

Value CAPABILITIES (.+?)
Value INTERFACE_IP (\d+\.\d+\.\d+\.\d+)
Value List INTERFACE_IPV6 ([0-9a-fA-F:]+)
Value MGMT_IP_ADDRESS (\d+\.\d+\.\d+\.\d+)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the MGMT_ADDRESS in lock step with LLDP neighbor outputs as well. So that these remain consistent across neighbor templates.

@mjbear mjbear changed the title Fix: cisco_ios show cdp neighbors detail — handle new format and many… Fix new format of cisco_ios show cdp neigh detail Dec 23, 2025
@mjbear
Copy link
Collaborator

mjbear commented Dec 23, 2025

I am not sure in which version these change was made are the previous template is probably very old.

@Ardeck
Ok, what version and platform/model did you notice the change?
I figure this would be an IOS-XE release?

My reason for asking is to see if I have access to hardware that demonstrates these new format changes.

Thank you for details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants