-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 415 cdp #480
Issue 415 cdp #480
Conversation
Add in the ipv4 version of the ipv6 command "sh ip interface brief" for NXOS. This already existed for IPv6, and for IPv4 in Cisco IOS. Note: "int" works in this command, "interf" is not required.
Update from origin
@bouchardh reported an issue with handling spaces in cdp response Reworked the regex to handle this
Got rid of an extra indent that the editor though would be helpful.
AP000000001 Gig 1/0/46 173 T B I AIR-CAP35 Gig 0 | ||
WAAS0000000 Gig 1/0/1 138 T OE474 InlinePort 1/1/lan | ||
WAAS0000000 Gig 1/0/40 138 H OE474 Gig 1/0 | ||
router.domain.local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these should be on the same line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking at something else and noticed this may be the way the output is provided back. We would need to account for this within the template to make sure the data is what we need.
I will find the example and post it back, but I think it may have been a similar template to this, but different OS.
^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record | ||
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record | ||
|
||
^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*?${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change from \s+ to \s* for L12? If you look at the line with router.domain.local, it isn't captured properly.
After that, I think everything looks good to go.
I'll take a look and retest and go from there. Sorry got busy with other
stuff so hadn't been able to follow up yet.
…On Thu, Oct 17, 2019, 12:14 AM Mikhail Yohman ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In templates/cisco_ios_show_cdp_neighbors.template
<#480 (comment)>
:
>
Start
^Device.*ID -> CDP
CDP
^${NEIGHBOR}$$
- ^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
- ^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
-
+ ^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*?${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record
Can you change from *\s+* to *\s** for L12? If you look at the line with
router.domain.local, it isn't captured properly.
After that, I think everything looks good to go.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#480?email_source=notifications&email_token=AMDYCRU5BD63ON4GJCFKF4LQO7RDZA5CNFSM4I4GJZL2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCIHVLKQ#pullrequestreview-302994858>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMDYCRRFTZ4245AUL2VOKL3QO7RDZANCNFSM4I4GJZLQ>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the BugFix
ISSUE TYPE
COMPONENT
cisco_ios_show_cdp_neighbors
SUMMARY
@bouchardh reported a problem in issue #415 that CDP was not being handled correctly if the platform does not have a space in it. In some cases the platform will have a - instead of a space, or otherwise be a single word. This fixed #415 with new regular expressions.
New templates are added to existing ones to ensure that the old use cases still return the correct results.