From 1f7c4a26d30b4b66a8e2f861170b02246a8db14d Mon Sep 17 00:00:00 2001 From: itdependsnetworks Date: Wed, 9 Aug 2017 00:37:53 -0400 Subject: [PATCH 1/4] Fix CDP to work with 3 capablities in cdp output --- templates/cisco_ios_show_cdp_neighbors.template | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/cisco_ios_show_cdp_neighbors.template b/templates/cisco_ios_show_cdp_neighbors.template index 1cfe394ba7..b1ca8ce6b2 100644 --- a/templates/cisco_ios_show_cdp_neighbors.template +++ b/templates/cisco_ios_show_cdp_neighbors.template @@ -1,6 +1,7 @@ Value NEIGHBOR (\S+) +Value Required NEIGHBOR (\S+) Value LOCAL_INTERFACE (\S+\s\S+) -Value CAPABILITY ([\w\s]+?) +Value CAPABILITY (\w.+?) Value PLATFORM (\S+\s\S+|\S+) Value NEIGHBOR_INTERFACE (\S+\s\S+) @@ -8,4 +9,6 @@ Start ^Device.*ID -> CDP CDP - ^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s{2}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record + ^${NEIGHBOR}$$ + ^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s{2}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record + ^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s{2}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record From a50b6fa447ebc2092a25da3aa14a04fe399df250 Mon Sep 17 00:00:00 2001 From: itdependsnetworks Date: Wed, 9 Aug 2017 00:59:12 -0400 Subject: [PATCH 2/4] un needed update --- templates/cisco_ios_show_cdp_neighbors.template | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cisco_ios_show_cdp_neighbors.template b/templates/cisco_ios_show_cdp_neighbors.template index b1ca8ce6b2..09285ad5cc 100644 --- a/templates/cisco_ios_show_cdp_neighbors.template +++ b/templates/cisco_ios_show_cdp_neighbors.template @@ -12,3 +12,4 @@ CDP ^${NEIGHBOR}$$ ^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s{2}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record ^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s{2}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record + From 6332f07d436c855091707e1eddbd1fb1bc03665c Mon Sep 17 00:00:00 2001 From: itdependsnetworks Date: Thu, 31 Aug 2017 13:16:19 -0400 Subject: [PATCH 3/4] remove duplicate neighbor --- templates/cisco_ios_show_cdp_neighbors.template | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/cisco_ios_show_cdp_neighbors.template b/templates/cisco_ios_show_cdp_neighbors.template index 09285ad5cc..c4344ad347 100644 --- a/templates/cisco_ios_show_cdp_neighbors.template +++ b/templates/cisco_ios_show_cdp_neighbors.template @@ -1,4 +1,3 @@ -Value NEIGHBOR (\S+) Value Required NEIGHBOR (\S+) Value LOCAL_INTERFACE (\S+\s\S+) Value CAPABILITY (\w.+?) From 2c633e16870fe3453ab42a8e0b8cac5a970089ea Mon Sep 17 00:00:00 2001 From: itdependsnetworks Date: Thu, 31 Aug 2017 14:49:22 -0400 Subject: [PATCH 4/4] fix for single capablity --- templates/cisco_ios_show_cdp_neighbors.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cisco_ios_show_cdp_neighbors.template b/templates/cisco_ios_show_cdp_neighbors.template index c4344ad347..74e2d5d545 100644 --- a/templates/cisco_ios_show_cdp_neighbors.template +++ b/templates/cisco_ios_show_cdp_neighbors.template @@ -1,6 +1,6 @@ Value Required NEIGHBOR (\S+) Value LOCAL_INTERFACE (\S+\s\S+) -Value CAPABILITY (\w.+?) +Value CAPABILITY (\w.*?) Value PLATFORM (\S+\s\S+|\S+) Value NEIGHBOR_INTERFACE (\S+\s\S+)