From b2548d3ad88a769b40ea65f7785e80ae7e29273e Mon Sep 17 00:00:00 2001 From: Alejandro Suarez Date: Fri, 5 Jun 2020 15:46:34 -0400 Subject: [PATCH 1/2] Added support for broadcom_icos_show_isdp_neighbors --- .../broadcom_icos_show_isdp_neighbors.textfsm | 18 +++++ templates/index | 1 + .../broadcom_icos_show_isdp_neighbors.raw | 17 +++++ .../broadcom_icos_show_isdp_neighbors.yml | 68 +++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 templates/broadcom_icos_show_isdp_neighbors.textfsm create mode 100644 tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.raw create mode 100644 tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.yml diff --git a/templates/broadcom_icos_show_isdp_neighbors.textfsm b/templates/broadcom_icos_show_isdp_neighbors.textfsm new file mode 100644 index 0000000000..95c2bba73e --- /dev/null +++ b/templates/broadcom_icos_show_isdp_neighbors.textfsm @@ -0,0 +1,18 @@ +Value ID (\S+) +Value INTERFACE (\S+) +Value HOLDTIME (\S+) +Value CAPABILITY ([\w]{1}(?:\s[\w]){0,2}) +Value PLATFORM ((\S+\s\S+)|(\S+)) +Value PORT (.+) + +Start + # Captures show isdp neighbors for: + # Accton AS4610-54P, Accton AS5610-52X, Quanta LY2R, Quanta LB9, DNI AG3448P-R + # Raw data is the same in the case of all those devices + ^Capability\sCodes: + ^\s+\S+ + ^\s*Device\s+ID\s+Intf\s+Holdtime\s+Capability\s+Platform\s+Port\s+ID$$ + ^-+ + ^\s*${ID}\s+${INTERFACE}\s+${HOLDTIME}\s+${CAPABILITY}\s+${PLATFORM}\s+${PORT} -> Record + ^\s*$$ + ^. -> Error \ No newline at end of file diff --git a/templates/index b/templates/index index 9af34272f3..063b0bcd67 100644 --- a/templates/index +++ b/templates/index @@ -68,6 +68,7 @@ avaya_ers_show_mlt.textfsm, .*, avaya_ers, sh[[ow]] ml[[t]] avaya_vsp_show_software.textfsm, .*, avaya_vsp, sho[[w]] so[[ftware]] broadcom_icos_show_mac-address-table.textfsm, .*, broadcom_icos, sh[[ow]] mac[[-adress-table]] +broadcom_icos_show_isdp_neighbors.textfsm, .*, broadcom_icos, sh[[ow]] is[[dp]] n[[eighbors]] broadcom_icos_show_version.textfsm, .*, broadcom_icos, sh[[ow]] ver[[sion]] brocade_fastiron_show_lldp_neighbors_detail.textfsm, .*, brocade_fastiron, sh[[ow]] ll[[dp]] n[[eighbors]] d[[etail]] diff --git a/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.raw b/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.raw new file mode 100644 index 0000000000..f237c655cd --- /dev/null +++ b/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.raw @@ -0,0 +1,17 @@ + +Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge, + S - Switch, H - Host, I - IGMP, r - Repeater + +Device ID Intf Holdtime Capability Platform Port ID +------------------------ --------- --------- ---------- ---------------- --------- +AP00-1-00001 0/1 173 T B I cisco AIR-CAP270 GigabitEt +AP00-2-00002 0/2 139 T B I cisco AIR-CAP270 GigabitEt +AP00-15-00050D 0/3 127 R T cisco AIR-AP3802 GigabitEt +AP00-1-00115F 0/4 170 R T cisco AIR-AP3802 GigabitEt +AP00-22-01665A 0/5 143 R T cisco AIR-AP3802 GigabitEt +dev1-df-loc-sw000001 0/35 161 R BCM-56340 0/1 +dev2-dd-loc-sw000001 0/37 178 R BCM-56340 0/1 +dev3-ds-loc-sw000001 0/39 157 R BCM-56340 0/1 +dev4-da-loc-sw000001 0/43 179 R BCM-56340 0/1 +dev5-ab-loc-sw0001 0/49 154 R AS5610-52X 0/1 +dev6-aa-loc-sw0002 0/50 158 R AS5610-52X 0/1 diff --git a/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.yml b/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.yml new file mode 100644 index 0000000000..041d1d11dc --- /dev/null +++ b/tests/broadcom_icos/show_isdp_neighbors/broadcom_icos_show_isdp_neighbors.yml @@ -0,0 +1,68 @@ +--- +parsed_sample: + - id: "AP00-1-00001" + interface: "0/1" + holdtime: "173" + capability: "T B I" + platform: "cisco AIR-CAP270" + port: "GigabitEt" + - id: "AP00-2-00002" + interface: "0/2" + holdtime: "139" + capability: "T B I" + platform: "cisco AIR-CAP270" + port: "GigabitEt" + - id: "AP00-15-00050D" + interface: "0/3" + holdtime: "127" + capability: "R T" + platform: "cisco AIR-AP3802" + port: "GigabitEt" + - id: "AP00-1-00115F" + interface: "0/4" + holdtime: "170" + capability: "R T" + platform: "cisco AIR-AP3802" + port: "GigabitEt" + - id: "AP00-22-01665A" + interface: "0/5" + holdtime: "143" + capability: "R T" + platform: "cisco AIR-AP3802" + port: "GigabitEt" + - id: "dev1-df-loc-sw000001" + interface: "0/35" + holdtime: "161" + capability: "R" + platform: "BCM-56340" + port: "0/1" + - id: "dev2-dd-loc-sw000001" + interface: "0/37" + holdtime: "178" + capability: "R" + platform: "BCM-56340" + port: "0/1" + - id: "dev3-ds-loc-sw000001" + interface: "0/39" + holdtime: "157" + capability: "R" + platform: "BCM-56340" + port: "0/1" + - id: "dev4-da-loc-sw000001" + interface: "0/43" + holdtime: "179" + capability: "R" + platform: "BCM-56340" + port: "0/1" + - id: "dev5-ab-loc-sw0001" + interface: "0/49" + holdtime: "154" + capability: "R" + platform: "AS5610-52X" + port: "0/1" + - id: "dev6-aa-loc-sw0002" + interface: "0/50" + holdtime: "158" + capability: "R" + platform: "AS5610-52X" + port: "0/1" From 928e904a91884ca2222fd845d3d6fea22f5a73e4 Mon Sep 17 00:00:00 2001 From: Alejandro Suarez Date: Sat, 6 Jun 2020 09:01:13 -0400 Subject: [PATCH 2/2] Fix for https://github.com/networktocode/ntc-templates/pull/748 --- templates/broadcom_icos_show_isdp_neighbors.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/broadcom_icos_show_isdp_neighbors.textfsm b/templates/broadcom_icos_show_isdp_neighbors.textfsm index 95c2bba73e..8c468de32d 100644 --- a/templates/broadcom_icos_show_isdp_neighbors.textfsm +++ b/templates/broadcom_icos_show_isdp_neighbors.textfsm @@ -10,7 +10,7 @@ Start # Accton AS4610-54P, Accton AS5610-52X, Quanta LY2R, Quanta LB9, DNI AG3448P-R # Raw data is the same in the case of all those devices ^Capability\sCodes: - ^\s+\S+ + ^\s+\S+\s+- ^\s*Device\s+ID\s+Intf\s+Holdtime\s+Capability\s+Platform\s+Port\s+ID$$ ^-+ ^\s*${ID}\s+${INTERFACE}\s+${HOLDTIME}\s+${CAPABILITY}\s+${PLATFORM}\s+${PORT} -> Record