From 611eda8a4fea83c3cde9b98a74ca397600ba5e70 Mon Sep 17 00:00:00 2001 From: eperpinya Date: Thu, 28 Nov 2024 17:07:46 +0100 Subject: [PATCH 01/17] New template for Alcatel AOS: `show lldp remote-system` --- ...lcatel_aos_show_lldp_remote-system.textfsm | 49 ++++++++ ntc_templates/templates/index | 1 + .../show_lldp_remote-system_R6.raw | 73 ++++++++++++ .../show_lldp_remote-system_R6.yml | 86 ++++++++++++++ .../show_lldp_remote-system_R8.raw | 62 ++++++++++ .../show_lldp_remote-system_R8.yml | 107 ++++++++++++++++++ 6 files changed, 378 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm create mode 100644 tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.raw create mode 100644 tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml create mode 100644 tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw create mode 100644 tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm new file mode 100644 index 0000000000..5f732002f3 --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -0,0 +1,49 @@ +Value Filldown PORT ((\d+\/?)+) +Value Required CHASSIS (\S+) +Value Required MAC_PORT (\S+) +Value REMOTE_ID (.*?) +Value CHASSIS_SUBTYPE (.*?) +Value PORT_SUBTYPE (.*?) +Value PORT_DESCRIPTION (.*?) +Value SYSTEM_NAME (.*?) +Value SYSTEM_DESCRIPTION (.*?) +Value CAPABILITIES_SUPPORTED (.*?) +Value CAPABILITIES_ENABLED (.*?) +Value MANAGEMENT_IP_ADDRESS (.*?) +Value MED_DEVICE_TYPE (.*?) +Value MED_CAPABILITIES (.*?) +Value MED_EXTENSION_TLVS_PRESENT (.*?) +Value MED_POWER_TYPE (.*?) +Value MED_POWER_SOURCE (.*?) +Value MED_POWER_PRIORITY (.*?) +Value MED_POWER_VALUE (.*?) +Value REMOTE_PORT_MAC_PHY_AUTONEG (.*?) +Value MAU_TYPE (.*?) + +Start + ^\s*Remote\s*LLDP\s*nearest-bridge\s*Agents\s*on\s*Local\s*Port\s*${PORT}:\s*$$ + ^\s*Remote \s*LLDP\s*Agents\s*on\s*Local\s*Slot\/Port\s*${PORT}:\s*$$ + ^\s*$$ -> LLDP + ^.*?$$ -> Error + +LLDP + ^\s*Chassis\s*${CHASSIS},\s*Port\s*${MAC_PORT}:\s*$$ + ^\s*Remote\s*ID\s*=\s*${REMOTE_ID}(?:,)?\s*$$ + ^\s*Chassis\s*Subtype\s*=\s*${CHASSIS_SUBTYPE}(?:,)?\s*$$ + ^\s*Port\s*Subtype\s*=\s*${PORT_SUBTYPE}(?:,)?\s*$$ + ^\s*Port\s*Description\s*=\s*${PORT_DESCRIPTION}(?:,)?\s*$$ + ^\s*System\s*Name\s*=\s*${SYSTEM_NAME}(?:,)?\s*$$ + ^\s*System\s*Description\s*=\s*(\(null\)|${SYSTEM_DESCRIPTION})(?:,)?\s*$$ + ^\s*Capabilities\s*Supported\s*=\s*${CAPABILITIES_SUPPORTED}(?:,)?\s*$$ + ^\s*Capabilities\s*Enabled\s*=\s*${CAPABILITIES_ENABLED}(?:,)?\s*$$ + ^\s*Management\s*IP\s*Address\s*=\s*${MANAGEMENT_IP_ADDRESS}(?:,)?\s*$$ + ^\s*MED\s*Device\s*Type\s*=\s*${MED_DEVICE_TYPE}(?:,)?\s*$$ + ^\s*MED\s*Capabilities\s*=\s*${MED_CAPABILITIES}(?:,)?\s*$$ + ^\s*MED\s*Extension\s*TLVs\s*Present\s*=\s*${MED_EXTENSION_TLVS_PRESENT}(?:,)?\s*$$ + ^\s*MED\s*Power\s*Type\s*=\s*${MED_POWER_TYPE}(?:,)?\s*$$ + ^\s*MED\s*Power\s*Source\s*=\s*${MED_POWER_SOURCE}(?:,)?\s*$$ + ^\s*MED\s*Power\s*Priority\s*=\s*${MED_POWER_PRIORITY}(?:,)?\s*$$ + ^\s*MED\s*Power\s*Value\s*=\s*${MED_POWER_VALUE}(?:,)?\s*$$ + ^\s*Remote\s*port\s*MAC\/PHY\s*AutoNeg\s*=\s*${REMOTE_PORT_MAC_PHY_AUTONEG}(?:,)?\s*$$ + ^\s*Mau\s*Type\s*=\s*${MAU_TYPE}(?:,)?\s*$$ + ^\s*$$ -> Record Start \ No newline at end of file diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 83e36c7cd5..ca274c499a 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -11,6 +11,7 @@ # Template, Hostname, Platform, Command +alcatel_aos_show_lldp_remote-system.textfsm, .*, alcatel_aos, sh[[ow]] lldp r[[emote-system]] alcatel_aos_show_mac-address-table.textfsm, .*, alcatel_aos, sh[[ow]] (mac-a[[ddress-table]]|mac-l[[earning]]) alcatel_aos_show_port-security.textfsm, .*, alcatel_aos, sh[[ow]] port-[[security]] alcatel_aos_show_vlan_port.textfsm, .*, alcatel_aos, sh[[ow]] vl[[an]] (p[[ort]]|m[[embers]]) diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.raw b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.raw new file mode 100644 index 0000000000..9efc084ee5 --- /dev/null +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.raw @@ -0,0 +1,73 @@ +Remote LLDP Agents on Local Slot/Port 1/1: + + Chassis aa:aa:aa:aa:aa:aa, Port bb:bb:bb:bb:bb:bb: + Remote ID = 1, + Chassis Subtype = 1 (MAC Address), + Port Subtype = 1 (MAC address), + Port Description = Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094, + System Name = AP, + System Description = Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10, + Capabilities Supported = Bridge WLAN AP Router Station Only, + Capabilities Enabled = Bridge WLAN AP Router, + Management IP Address = 1.1.1.1, + MED Device Type = Network Connectivity, + MED Capabilities = Capabilities | Power via MDI-PD(33), + MED Extension TLVs Present = Network Policy| Inventory, + MED Power Type = PD Device, + MED Power Source = PSE and Local, + MED Power Priority = Low, + MED Power Value = 25.4 W + +Remote LLDP Agents on Local Slot/Port 1/2: + + Chassis aa:aa:aa:aa:aa:aa, Port bb:bb:bb:bb:bb:bb: + Remote ID = 1, + Chassis Subtype = 1 (MAC Address), + Port Subtype = 1 (MAC address), + Port Description = Alcatel-Lucent Enterprise OAW-AP1321 eth1, + System Name = AP, + System Description = Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10, + Capabilities Supported = Bridge WLAN AP Router Station Only, + Capabilities Enabled = Bridge WLAN AP Router, + Management IP Address = 1.1.1.1, + MED Device Type = Network Connectivity, + MED Capabilities = Capabilities | Power via MDI-PD(33), + MED Extension TLVs Present = Network Policy| Inventory, + MED Power Type = PD Device, + MED Power Source = PSE and Local, + MED Power Priority = Low, + MED Power Value = 25.4 W, + Remote port MAC/PHY AutoNeg = Supported Enabled Capability 0x8336, + Mau Type = 1000BaseTFD - Four-pair Category 5 UTP full duplex mode + +Remote LLDP Agents on Local Slot/Port 1/3: + + Chassis aa:aa:aa:aa:aa:aa, Port bb:bb:bb:bb:bb:bb: + Remote ID = 1, + Chassis Subtype = 1 (MAC Address), + Port Subtype = 1 (MAC address), + Port Description = Alcatel-Lucent Enterprise OAW-AP1361 eth0, + System Name = AP, + System Description = Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10, + Capabilities Supported = Bridge WLAN AP Router Station Only, + Capabilities Enabled = Bridge WLAN AP Router, + Management IP Address = 1.1.1.1, + MED Device Type = Network Connectivity, + MED Capabilities = Capabilities | Power via MDI-PD(33), + MED Extension TLVs Present = Network Policy| Inventory, + Remote port MAC/PHY AutoNeg = Supported Enabled Capability 0x8337, + Mau Type = 1000BaseTFD - Four-pair Category 5 UTP full duplex mode + +Remote LLDP Agents on Local Slot/Port 1/4: + + Chassis aa:aa:aa:aa:aa:aa, Port 1001: + Remote ID = 123, + Chassis Subtype = 1 (MAC Address), + Port Subtype = 1 (Locally assigned), + Port Description = Alcatel-Lucent OS6860 GNI 1/1/1, + System Name = SW, + System Description = (null), + Capabilities Supported = Bridge Router, + Capabilities Enabled = Bridge Router, + Management IP Address = 1.1.1.1 + diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml new file mode 100644 index 0000000000..fd7a45d89f --- /dev/null +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -0,0 +1,86 @@ +--- +parsed_sample: + - capabilities_enabled: "Bridge WLAN AP Router" + capabilities_supported: "Bridge WLAN AP Router Station Only" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "1 (MAC Address)" + mac_port: "bb:bb:bb:bb:bb:bb" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "Capabilities | Power via MDI-PD(33)" + med_device_type: "Network Connectivity" + med_extension_tlvs_present: "Network Policy| Inventory" + med_power_priority: "Low" + med_power_source: "PSE and Local" + med_power_type: "PD Device" + med_power_value: "25.4 W" + port: "1/1" + port_description: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" + port_subtype: "1 (MAC address)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" + system_name: "AP" + - capabilities_enabled: "Bridge WLAN AP Router" + capabilities_supported: "Bridge WLAN AP Router Station Only" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "1 (MAC Address)" + mac_port: "bb:bb:bb:bb:bb:bb" + management_ip_address: "1.1.1.1" + mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" + med_capabilities: "Capabilities | Power via MDI-PD(33)" + med_device_type: "Network Connectivity" + med_extension_tlvs_present: "Network Policy| Inventory" + med_power_priority: "Low" + med_power_source: "PSE and Local" + med_power_type: "PD Device" + med_power_value: "25.4 W" + port: "1/2" + port_description: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" + port_subtype: "1 (MAC address)" + remote_id: "1" + remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" + system_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" + system_name: "AP" + - capabilities_enabled: "Bridge WLAN AP Router" + capabilities_supported: "Bridge WLAN AP Router Station Only" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "1 (MAC Address)" + mac_port: "bb:bb:bb:bb:bb:bb" + management_ip_address: "1.1.1.1" + mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" + med_capabilities: "Capabilities | Power via MDI-PD(33)" + med_device_type: "Network Connectivity" + med_extension_tlvs_present: "Network Policy| Inventory" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/3" + port_description: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" + port_subtype: "1 (MAC address)" + remote_id: "1" + remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" + system_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" + system_name: "AP" + - capabilities_enabled: "Bridge Router" + capabilities_supported: "Bridge Router" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "1 (MAC Address)" + mac_port: "1001" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/4" + port_description: "Alcatel-Lucent OS6860 GNI 1/1/1" + port_subtype: "1 (Locally assigned)" + remote_id: "123" + remote_port_mac_phy_autoneg: "" + system_description: "" + system_name: "SW" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw new file mode 100644 index 0000000000..a613365e2b --- /dev/null +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw @@ -0,0 +1,62 @@ +Remote LLDP nearest-bridge Agents on Local Port 1/1/1: + + Chassis aa:aa:aa:aa:aa:aa, Port 1025: + Remote ID = 1, + Chassis Subtype = 2 (MAC Address), + Port Subtype = 3 (Locally assigned), + Port Description = Alcatel-Lucent Enterprise 1/1, + System Name = SW, + System Description = (null), + Capabilities Supported = none supported, + Capabilities Enabled = none enabled, + Management IP Address = 1.1.1.1, + Remote port default vlan = 1 + +Remote LLDP nearest-bridge Agents on Local Port 1/1/2: + + Chassis aa:aa:aa:aa:aa:aa, Port 1025: + Remote ID = 1, + Chassis Subtype = 2 (MAC Address), + Port Subtype = 3 (Locally assigned), + Port Description = Alcatel-Lucent OS6360 GNI 1/1/1, + System Name = SW, + System Description = (null), + Capabilities Supported = Bridge Router, + Capabilities Enabled = Bridge Router, + Management IP Address = 1.1.1.1 + +Remote LLDP nearest-bridge Agents on Local Port 1/1/3: + + Chassis aa:aa:aa:aa:aa:aa, Port Vlan_1_things: + Remote ID = 1, + Chassis Subtype = 2 (MAC Address), + Port Subtype = 3 (Interface name), + Port Description = (null), + System Name = SomeSystem_that_has_FW, + System Description = Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4, + Capabilities Supported = Bridge Router, + Capabilities Enabled = Router, + Management IP Address = 1.1.1.1 + + + Chassis bb:bb:bb:bb:bb:bb, Port Vlan_2_more_things: + Remote ID = 1, + Chassis Subtype = 2 (MAC Address), + Port Subtype = 3 (Interface name), + Port Description = (null), + System Name = SomeSystem_that_has_FW, + System Description = Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4, + Capabilities Supported = Bridge Router, + Capabilities Enabled = Router, + Management IP Address = 1.1.1.1 + + + Chassis cc:cc:cc:cc:cc:cc, Port sfp-sfpplus1: + Remote ID = 1, + Chassis Subtype = 2 (MAC Address), + Port Subtype = 3 (Interface name), + Port Description = (null), + System Name = SomeSystem_that_has_FW, + System Description = Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4, + Capabilities Supported = Bridge Router, + Capabilities Enabled = Router \ No newline at end of file diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml new file mode 100644 index 0000000000..51e15e2258 --- /dev/null +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -0,0 +1,107 @@ +--- +parsed_sample: + - capabilities_enabled: "none enabled" + capabilities_supported: "none supported" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "2 (MAC Address)" + mac_port: "1025" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/1/1" + port_description: "Alcatel-Lucent Enterprise 1/1" + port_subtype: "3 (Locally assigned)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "" + system_name: "SW" + - capabilities_enabled: "Bridge Router" + capabilities_supported: "Bridge Router" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "2 (MAC Address)" + mac_port: "1025" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/1/2" + port_description: "Alcatel-Lucent OS6360 GNI 1/1/1" + port_subtype: "3 (Locally assigned)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "" + system_name: "SW" + - capabilities_enabled: "Router" + capabilities_supported: "Bridge Router" + chassis: "aa:aa:aa:aa:aa:aa" + chassis_subtype: "2 (MAC Address)" + mac_port: "Vlan_1_things" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/1/3" + port_description: "(null)" + port_subtype: "3 (Interface name)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + system_name: "SomeSystem_that_has_FW" + - capabilities_enabled: "Router" + capabilities_supported: "Bridge Router" + chassis: "bb:bb:bb:bb:bb:bb" + chassis_subtype: "2 (MAC Address)" + mac_port: "Vlan_2_more_things" + management_ip_address: "1.1.1.1" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/1/3" + port_description: "(null)" + port_subtype: "3 (Interface name)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + system_name: "SomeSystem_that_has_FW" + - capabilities_enabled: "Router" + capabilities_supported: "Bridge Router" + chassis: "cc:cc:cc:cc:cc:cc" + chassis_subtype: "2 (MAC Address)" + mac_port: "sfp-sfpplus1" + management_ip_address: "" + mau_type: "" + med_capabilities: "" + med_device_type: "" + med_extension_tlvs_present: "" + med_power_priority: "" + med_power_source: "" + med_power_type: "" + med_power_value: "" + port: "1/1/3" + port_description: "(null)" + port_subtype: "3 (Interface name)" + remote_id: "1" + remote_port_mac_phy_autoneg: "" + system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + system_name: "SomeSystem_that_has_FW" From 2feeb4dfe223c7e9eccd604a7e1617cac12e4106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Fri, 29 Nov 2024 09:51:04 +0100 Subject: [PATCH 02/17] Update ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com> --- .../templates/alcatel_aos_show_lldp_remote-system.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 5f732002f3..c2e5614f9f 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -1,4 +1,4 @@ -Value Filldown PORT ((\d+\/?)+) +Value Filldown PORT (\S+) Value Required CHASSIS (\S+) Value Required MAC_PORT (\S+) Value REMOTE_ID (.*?) From 2f788970206e391fc647e6ff60180e62ff81eb6a Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:36:20 -0500 Subject: [PATCH 03/17] Fix up white space matching * Remove actual space (and supplant with \s+) * Replace \s* with more proper \s+ where there will be one or more spaces --- ...lcatel_aos_show_lldp_remote-system.textfsm | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index c2e5614f9f..c21410197a 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -21,29 +21,29 @@ Value REMOTE_PORT_MAC_PHY_AUTONEG (.*?) Value MAU_TYPE (.*?) Start - ^\s*Remote\s*LLDP\s*nearest-bridge\s*Agents\s*on\s*Local\s*Port\s*${PORT}:\s*$$ - ^\s*Remote \s*LLDP\s*Agents\s*on\s*Local\s*Slot\/Port\s*${PORT}:\s*$$ + ^\s*Remote\s+LLDP\s+nearest-bridge\s+Agents\s+on\s+Local\s+Port\s+${PORT}:\s*$$ + ^\s*Remote\s+LLDP\s+Agents\s+on\s+Local\s+Slot\/Port\s+${PORT}:\s*$$ ^\s*$$ -> LLDP ^.*?$$ -> Error LLDP - ^\s*Chassis\s*${CHASSIS},\s*Port\s*${MAC_PORT}:\s*$$ - ^\s*Remote\s*ID\s*=\s*${REMOTE_ID}(?:,)?\s*$$ - ^\s*Chassis\s*Subtype\s*=\s*${CHASSIS_SUBTYPE}(?:,)?\s*$$ - ^\s*Port\s*Subtype\s*=\s*${PORT_SUBTYPE}(?:,)?\s*$$ - ^\s*Port\s*Description\s*=\s*${PORT_DESCRIPTION}(?:,)?\s*$$ - ^\s*System\s*Name\s*=\s*${SYSTEM_NAME}(?:,)?\s*$$ - ^\s*System\s*Description\s*=\s*(\(null\)|${SYSTEM_DESCRIPTION})(?:,)?\s*$$ - ^\s*Capabilities\s*Supported\s*=\s*${CAPABILITIES_SUPPORTED}(?:,)?\s*$$ - ^\s*Capabilities\s*Enabled\s*=\s*${CAPABILITIES_ENABLED}(?:,)?\s*$$ - ^\s*Management\s*IP\s*Address\s*=\s*${MANAGEMENT_IP_ADDRESS}(?:,)?\s*$$ - ^\s*MED\s*Device\s*Type\s*=\s*${MED_DEVICE_TYPE}(?:,)?\s*$$ - ^\s*MED\s*Capabilities\s*=\s*${MED_CAPABILITIES}(?:,)?\s*$$ - ^\s*MED\s*Extension\s*TLVs\s*Present\s*=\s*${MED_EXTENSION_TLVS_PRESENT}(?:,)?\s*$$ - ^\s*MED\s*Power\s*Type\s*=\s*${MED_POWER_TYPE}(?:,)?\s*$$ - ^\s*MED\s*Power\s*Source\s*=\s*${MED_POWER_SOURCE}(?:,)?\s*$$ - ^\s*MED\s*Power\s*Priority\s*=\s*${MED_POWER_PRIORITY}(?:,)?\s*$$ - ^\s*MED\s*Power\s*Value\s*=\s*${MED_POWER_VALUE}(?:,)?\s*$$ - ^\s*Remote\s*port\s*MAC\/PHY\s*AutoNeg\s*=\s*${REMOTE_PORT_MAC_PHY_AUTONEG}(?:,)?\s*$$ - ^\s*Mau\s*Type\s*=\s*${MAU_TYPE}(?:,)?\s*$$ - ^\s*$$ -> Record Start \ No newline at end of file + ^\s*Chassis\s+${CHASSIS},\s+Port\s+${MAC_PORT}:\s*$$ + ^\s*Remote\s+ID\s+=\s+${REMOTE_ID}(?:,)?\s*$$ + ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE}(?:,)?\s*$$ + ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE}(?:,)?\s*$$ + ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION}(?:,)?\s*$$ + ^\s*System\s+Name\s+=\s+${SYSTEM_NAME}(?:,)?\s*$$ + ^\s*System\s+Description\s+=\s+(\(null\)|${SYSTEM_DESCRIPTION})(?:,)?\s*$$ + ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED}(?:,)?\s*$$ + ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED}(?:,)?\s*$$ + ^\s*Management\s+IP\s+Address\s+=\s+${MANAGEMENT_IP_ADDRESS}(?:,)?\s*$$ + ^\s*MED\s+Device\s+Type\s+=\s+${MED_DEVICE_TYPE}(?:,)?\s*$$ + ^\s*MED\s+Capabilities\s+=\s+${MED_CAPABILITIES}(?:,)?\s*$$ + ^\s*MED\s+Extension\s+TLVs\s+Present\s+=\s+${MED_EXTENSION_TLVS_PRESENT}(?:,)?\s*$$ + ^\s*MED\s+Power\s+Type\s+=\s+${MED_POWER_TYPE}(?:,)?\s*$$ + ^\s*MED\s+Power\s+Source\s+=\s+${MED_POWER_SOURCE}(?:,)?\s*$$ + ^\s*MED\s+Power\s+Priority\s+=\s+${MED_POWER_PRIORITY}(?:,)?\s*$$ + ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE}(?:,)?\s*$$ + ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG}(?:,)?\s*$$ + ^\s*Mau\s+Type\s+=\s+${MAU_TYPE}(?:,)?\s*$$ + ^\s*$$ -> Record Start From 823d6bb60209ea01451778b097b68124d83c10bc Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:45:50 -0500 Subject: [PATCH 04/17] Remove unneeded question mark in Error directive --- .../templates/alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index c21410197a..0b85beb7b7 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -24,7 +24,7 @@ Start ^\s*Remote\s+LLDP\s+nearest-bridge\s+Agents\s+on\s+Local\s+Port\s+${PORT}:\s*$$ ^\s*Remote\s+LLDP\s+Agents\s+on\s+Local\s+Slot\/Port\s+${PORT}:\s*$$ ^\s*$$ -> LLDP - ^.*?$$ -> Error + ^.*$$ -> Error LLDP ^\s*Chassis\s+${CHASSIS},\s+Port\s+${MAC_PORT}:\s*$$ @@ -46,4 +46,4 @@ LLDP ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE}(?:,)?\s*$$ ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG}(?:,)?\s*$$ ^\s*Mau\s+Type\s+=\s+${MAU_TYPE}(?:,)?\s*$$ - ^\s*$$ -> Record Start + ^\s*$$ -> Record Start \ No newline at end of file From c0a24a5aa287177cf66905639de79635e1751139 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:51:29 -0500 Subject: [PATCH 05/17] Remove unneeded non-capturing group (ending comma) --- ...lcatel_aos_show_lldp_remote-system.textfsm | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 0b85beb7b7..52289e4e8e 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -28,22 +28,22 @@ Start LLDP ^\s*Chassis\s+${CHASSIS},\s+Port\s+${MAC_PORT}:\s*$$ - ^\s*Remote\s+ID\s+=\s+${REMOTE_ID}(?:,)?\s*$$ - ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE}(?:,)?\s*$$ - ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE}(?:,)?\s*$$ - ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION}(?:,)?\s*$$ - ^\s*System\s+Name\s+=\s+${SYSTEM_NAME}(?:,)?\s*$$ - ^\s*System\s+Description\s+=\s+(\(null\)|${SYSTEM_DESCRIPTION})(?:,)?\s*$$ - ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED}(?:,)?\s*$$ - ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED}(?:,)?\s*$$ - ^\s*Management\s+IP\s+Address\s+=\s+${MANAGEMENT_IP_ADDRESS}(?:,)?\s*$$ - ^\s*MED\s+Device\s+Type\s+=\s+${MED_DEVICE_TYPE}(?:,)?\s*$$ - ^\s*MED\s+Capabilities\s+=\s+${MED_CAPABILITIES}(?:,)?\s*$$ - ^\s*MED\s+Extension\s+TLVs\s+Present\s+=\s+${MED_EXTENSION_TLVS_PRESENT}(?:,)?\s*$$ - ^\s*MED\s+Power\s+Type\s+=\s+${MED_POWER_TYPE}(?:,)?\s*$$ - ^\s*MED\s+Power\s+Source\s+=\s+${MED_POWER_SOURCE}(?:,)?\s*$$ - ^\s*MED\s+Power\s+Priority\s+=\s+${MED_POWER_PRIORITY}(?:,)?\s*$$ - ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE}(?:,)?\s*$$ - ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG}(?:,)?\s*$$ - ^\s*Mau\s+Type\s+=\s+${MAU_TYPE}(?:,)?\s*$$ + ^\s*Remote\s+ID\s+=\s+${REMOTE_ID},?\s*$$ + ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE},?\s*$$ + ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ + ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION},?\s*$$ + ^\s*System\s+Name\s+=\s+${SYSTEM_NAME},?\s*$$ + ^\s*System\s+Description\s+=\s+(\(null\)|${SYSTEM_DESCRIPTION}),?\s*$$ + ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED},?\s*$$ + ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED},?\s*$$ + ^\s*Management\s+IP\s+Address\s+=\s+${MANAGEMENT_IP_ADDRESS},?\s*$$ + ^\s*MED\s+Device\s+Type\s+=\s+${MED_DEVICE_TYPE},?\s*$$ + ^\s*MED\s+Capabilities\s+=\s+${MED_CAPABILITIES},?\s*$$ + ^\s*MED\s+Extension\s+TLVs\s+Present\s+=\s+${MED_EXTENSION_TLVS_PRESENT},?\s*$$ + ^\s*MED\s+Power\s+Type\s+=\s+${MED_POWER_TYPE},?\s*$$ + ^\s*MED\s+Power\s+Source\s+=\s+${MED_POWER_SOURCE},?\s*$$ + ^\s*MED\s+Power\s+Priority\s+=\s+${MED_POWER_PRIORITY},?\s*$$ + ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE},?\s*$$ + ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG},?\s*$$ + ^\s*Mau\s+Type\s+=\s+${MAU_TYPE},?\s*$$ ^\s*$$ -> Record Start \ No newline at end of file From 1500018370c5f34726f0899b7a4dc5ec5fe37085 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:09:00 -0500 Subject: [PATCH 06/17] Convert many fields to one or more character --- ...lcatel_aos_show_lldp_remote-system.textfsm | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 52289e4e8e..467f67385b 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -1,24 +1,25 @@ Value Filldown PORT (\S+) Value Required CHASSIS (\S+) Value Required MAC_PORT (\S+) -Value REMOTE_ID (.*?) -Value CHASSIS_SUBTYPE (.*?) -Value PORT_SUBTYPE (.*?) -Value PORT_DESCRIPTION (.*?) -Value SYSTEM_NAME (.*?) -Value SYSTEM_DESCRIPTION (.*?) -Value CAPABILITIES_SUPPORTED (.*?) -Value CAPABILITIES_ENABLED (.*?) -Value MANAGEMENT_IP_ADDRESS (.*?) -Value MED_DEVICE_TYPE (.*?) -Value MED_CAPABILITIES (.*?) -Value MED_EXTENSION_TLVS_PRESENT (.*?) -Value MED_POWER_TYPE (.*?) -Value MED_POWER_SOURCE (.*?) -Value MED_POWER_PRIORITY (.*?) -Value MED_POWER_VALUE (.*?) -Value REMOTE_PORT_MAC_PHY_AUTONEG (.*?) -Value MAU_TYPE (.*?) +# question mark in many regexes so we don't capture the optional trailing comma +Value REMOTE_ID (.+?) +Value CHASSIS_SUBTYPE (.+?) +Value PORT_SUBTYPE (.+?) +Value PORT_DESCRIPTION (.+?) +Value SYSTEM_NAME (.+?) +Value SYSTEM_DESCRIPTION (.+?) +Value CAPABILITIES_SUPPORTED (.+?) +Value CAPABILITIES_ENABLED (.+?) +Value MANAGEMENT_IP_ADDRESS (.+?) +Value MED_DEVICE_TYPE (.+?) +Value MED_CAPABILITIES (.+?) +Value MED_EXTENSION_TLVS_PRESENT (.+?) +Value MED_POWER_TYPE (.+?) +Value MED_POWER_SOURCE (.+?) +Value MED_POWER_PRIORITY (.+?) +Value MED_POWER_VALUE (.+?) +Value REMOTE_PORT_MAC_PHY_AUTONEG (.+?) +Value MAU_TYPE (.+?) Start ^\s*Remote\s+LLDP\s+nearest-bridge\s+Agents\s+on\s+Local\s+Port\s+${PORT}:\s*$$ From de2e6202f2d1e522e4670fd5b4dc5c16f717c322 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:18:54 -0500 Subject: [PATCH 07/17] Normalize to NEIGHBOR_DESCRIPTION --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 467f67385b..41c1810e85 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -7,7 +7,7 @@ Value CHASSIS_SUBTYPE (.+?) Value PORT_SUBTYPE (.+?) Value PORT_DESCRIPTION (.+?) Value SYSTEM_NAME (.+?) -Value SYSTEM_DESCRIPTION (.+?) +Value NEIGHBOR_DESCRIPTION (.+?) Value CAPABILITIES_SUPPORTED (.+?) Value CAPABILITIES_ENABLED (.+?) Value MANAGEMENT_IP_ADDRESS (.+?) @@ -34,7 +34,7 @@ LLDP ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION},?\s*$$ ^\s*System\s+Name\s+=\s+${SYSTEM_NAME},?\s*$$ - ^\s*System\s+Description\s+=\s+(\(null\)|${SYSTEM_DESCRIPTION}),?\s*$$ + ^\s*System\s+Description\s+=\s+(\(null\)|${NEIGHBOR_DESCRIPTION}),?\s*$$ ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED},?\s*$$ ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED},?\s*$$ ^\s*Management\s+IP\s+Address\s+=\s+${MANAGEMENT_IP_ADDRESS},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index fd7a45d89f..18f13cee76 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -14,12 +14,12 @@ parsed_sample: med_power_source: "PSE and Local" med_power_type: "PD Device" med_power_value: "25.4 W" + neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" port: "1/1" port_description: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" @@ -35,12 +35,12 @@ parsed_sample: med_power_source: "PSE and Local" med_power_type: "PD Device" med_power_value: "25.4 W" + neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" port: "1/2" port_description: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" - system_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" @@ -56,12 +56,12 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" port: "1/3" port_description: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" - system_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" system_name: "AP" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" @@ -77,10 +77,10 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "" port: "1/4" port_description: "Alcatel-Lucent OS6860 GNI 1/1/1" port_subtype: "1 (Locally assigned)" remote_id: "123" remote_port_mac_phy_autoneg: "" - system_description: "" system_name: "SW" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 51e15e2258..a206dfbc7d 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -14,12 +14,12 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "" port: "1/1/1" port_description: "Alcatel-Lucent Enterprise 1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "" system_name: "SW" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" @@ -35,12 +35,12 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "" port: "1/1/2" port_description: "Alcatel-Lucent OS6360 GNI 1/1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "" system_name: "SW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" @@ -56,12 +56,12 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" @@ -77,12 +77,12 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" @@ -98,10 +98,10 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" system_name: "SomeSystem_that_has_FW" From eeba51c42e25f6619b01ddf5ced52ac5d03535cf Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:25:09 -0500 Subject: [PATCH 08/17] Normalize to CHASSIS_ID --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 41c1810e85..ea04d4a646 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -1,5 +1,5 @@ Value Filldown PORT (\S+) -Value Required CHASSIS (\S+) +Value Required CHASSIS_ID (\S+) Value Required MAC_PORT (\S+) # question mark in many regexes so we don't capture the optional trailing comma Value REMOTE_ID (.+?) @@ -28,7 +28,7 @@ Start ^.*$$ -> Error LLDP - ^\s*Chassis\s+${CHASSIS},\s+Port\s+${MAC_PORT}:\s*$$ + ^\s*Chassis\s+${CHASSIS_ID},\s+Port\s+${MAC_PORT}:\s*$$ ^\s*Remote\s+ID\s+=\s+${REMOTE_ID},?\s*$$ ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE},?\s*$$ ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index 18f13cee76..2ebf394ea1 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -2,7 +2,7 @@ parsed_sample: - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" @@ -23,7 +23,7 @@ parsed_sample: system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" @@ -44,7 +44,7 @@ parsed_sample: system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" @@ -65,7 +65,7 @@ parsed_sample: system_name: "AP" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" mac_port: "1001" management_ip_address: "1.1.1.1" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index a206dfbc7d..e5970247ba 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -2,7 +2,7 @@ parsed_sample: - capabilities_enabled: "none enabled" capabilities_supported: "none supported" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" mac_port: "1025" management_ip_address: "1.1.1.1" @@ -23,7 +23,7 @@ parsed_sample: system_name: "SW" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" mac_port: "1025" management_ip_address: "1.1.1.1" @@ -44,7 +44,7 @@ parsed_sample: system_name: "SW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" - chassis: "aa:aa:aa:aa:aa:aa" + chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" mac_port: "Vlan_1_things" management_ip_address: "1.1.1.1" @@ -65,7 +65,7 @@ parsed_sample: system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" - chassis: "bb:bb:bb:bb:bb:bb" + chassis_id: "bb:bb:bb:bb:bb:bb" chassis_subtype: "2 (MAC Address)" mac_port: "Vlan_2_more_things" management_ip_address: "1.1.1.1" @@ -86,7 +86,7 @@ parsed_sample: system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" - chassis: "cc:cc:cc:cc:cc:cc" + chassis_id: "cc:cc:cc:cc:cc:cc" chassis_subtype: "2 (MAC Address)" mac_port: "sfp-sfpplus1" management_ip_address: "" From f903b2f874081e0e1b74797ac97b16fb531e3dad Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:27:43 -0500 Subject: [PATCH 09/17] Normalize PORT to LOCAL_INTERFACE --- .../alcatel_aos_show_lldp_remote-system.textfsm | 6 +++--- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index ea04d4a646..cc5ea0e780 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -1,4 +1,4 @@ -Value Filldown PORT (\S+) +Value Filldown LOCAL_INTERFACE (\S+) Value Required CHASSIS_ID (\S+) Value Required MAC_PORT (\S+) # question mark in many regexes so we don't capture the optional trailing comma @@ -22,8 +22,8 @@ Value REMOTE_PORT_MAC_PHY_AUTONEG (.+?) Value MAU_TYPE (.+?) Start - ^\s*Remote\s+LLDP\s+nearest-bridge\s+Agents\s+on\s+Local\s+Port\s+${PORT}:\s*$$ - ^\s*Remote\s+LLDP\s+Agents\s+on\s+Local\s+Slot\/Port\s+${PORT}:\s*$$ + ^\s*Remote\s+LLDP\s+nearest-bridge\s+Agents\s+on\s+Local\s+Port\s+${LOCAL_INTERFACE}:\s*$$ + ^\s*Remote\s+LLDP\s+Agents\s+on\s+Local\s+Slot\/Port\s+${LOCAL_INTERFACE}:\s*$$ ^\s*$$ -> LLDP ^.*$$ -> Error diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index 2ebf394ea1..c8a50f9fc6 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -4,6 +4,7 @@ parsed_sample: capabilities_supported: "Bridge WLAN AP Router Station Only" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" + local_interface: "1/1" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" mau_type: "" @@ -15,7 +16,6 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" - port: "1/1" port_description: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" port_subtype: "1 (MAC address)" remote_id: "1" @@ -25,6 +25,7 @@ parsed_sample: capabilities_supported: "Bridge WLAN AP Router Station Only" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" + local_interface: "1/2" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" @@ -36,7 +37,6 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" - port: "1/2" port_description: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" port_subtype: "1 (MAC address)" remote_id: "1" @@ -46,6 +46,7 @@ parsed_sample: capabilities_supported: "Bridge WLAN AP Router Station Only" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" + local_interface: "1/3" mac_port: "bb:bb:bb:bb:bb:bb" management_ip_address: "1.1.1.1" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" @@ -57,7 +58,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" - port: "1/3" port_description: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" port_subtype: "1 (MAC address)" remote_id: "1" @@ -67,6 +67,7 @@ parsed_sample: capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" + local_interface: "1/4" mac_port: "1001" management_ip_address: "1.1.1.1" mau_type: "" @@ -78,7 +79,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" - port: "1/4" port_description: "Alcatel-Lucent OS6860 GNI 1/1/1" port_subtype: "1 (Locally assigned)" remote_id: "123" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index e5970247ba..88b65e112e 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -4,6 +4,7 @@ parsed_sample: capabilities_supported: "none supported" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" + local_interface: "1/1/1" mac_port: "1025" management_ip_address: "1.1.1.1" mau_type: "" @@ -15,7 +16,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" - port: "1/1/1" port_description: "Alcatel-Lucent Enterprise 1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" @@ -25,6 +25,7 @@ parsed_sample: capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" + local_interface: "1/1/2" mac_port: "1025" management_ip_address: "1.1.1.1" mau_type: "" @@ -36,7 +37,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" - port: "1/1/2" port_description: "Alcatel-Lucent OS6360 GNI 1/1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" @@ -46,6 +46,7 @@ parsed_sample: capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" + local_interface: "1/1/3" mac_port: "Vlan_1_things" management_ip_address: "1.1.1.1" mau_type: "" @@ -57,7 +58,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" - port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" @@ -67,6 +67,7 @@ parsed_sample: capabilities_supported: "Bridge Router" chassis_id: "bb:bb:bb:bb:bb:bb" chassis_subtype: "2 (MAC Address)" + local_interface: "1/1/3" mac_port: "Vlan_2_more_things" management_ip_address: "1.1.1.1" mau_type: "" @@ -78,7 +79,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" - port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" @@ -88,6 +88,7 @@ parsed_sample: capabilities_supported: "Bridge Router" chassis_id: "cc:cc:cc:cc:cc:cc" chassis_subtype: "2 (MAC Address)" + local_interface: "1/1/3" mac_port: "sfp-sfpplus1" management_ip_address: "" mau_type: "" @@ -99,7 +100,6 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" - port: "1/1/3" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" From 2d90f6ea41a9a95ed0dae54b86bde65a4663e009 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:29:30 -0500 Subject: [PATCH 10/17] Normalize SYSTEM_NAME to NEIGHBOR_NAME --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index cc5ea0e780..af98897880 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -6,7 +6,7 @@ Value REMOTE_ID (.+?) Value CHASSIS_SUBTYPE (.+?) Value PORT_SUBTYPE (.+?) Value PORT_DESCRIPTION (.+?) -Value SYSTEM_NAME (.+?) +Value NEIGHBOR_NAME (.+?) Value NEIGHBOR_DESCRIPTION (.+?) Value CAPABILITIES_SUPPORTED (.+?) Value CAPABILITIES_ENABLED (.+?) @@ -33,7 +33,7 @@ LLDP ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE},?\s*$$ ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION},?\s*$$ - ^\s*System\s+Name\s+=\s+${SYSTEM_NAME},?\s*$$ + ^\s*System\s+Name\s+=\s+${NEIGHBOR_NAME},?\s*$$ ^\s*System\s+Description\s+=\s+(\(null\)|${NEIGHBOR_DESCRIPTION}),?\s*$$ ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED},?\s*$$ ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index c8a50f9fc6..882499cba2 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -16,11 +16,11 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" + neighbor_name: "AP" port_description: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" chassis_id: "aa:aa:aa:aa:aa:aa" @@ -37,11 +37,11 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" + neighbor_name: "AP" port_description: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" - system_name: "AP" - capabilities_enabled: "Bridge WLAN AP Router" capabilities_supported: "Bridge WLAN AP Router Station Only" chassis_id: "aa:aa:aa:aa:aa:aa" @@ -58,11 +58,11 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" + neighbor_name: "AP" port_description: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" - system_name: "AP" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" @@ -79,8 +79,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_name: "SW" port_description: "Alcatel-Lucent OS6860 GNI 1/1/1" port_subtype: "1 (Locally assigned)" remote_id: "123" remote_port_mac_phy_autoneg: "" - system_name: "SW" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 88b65e112e..8047c94bc5 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -16,11 +16,11 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_name: "SW" port_description: "Alcatel-Lucent Enterprise 1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "SW" - capabilities_enabled: "Bridge Router" capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" @@ -37,11 +37,11 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_name: "SW" port_description: "Alcatel-Lucent OS6360 GNI 1/1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "SW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" chassis_id: "aa:aa:aa:aa:aa:aa" @@ -58,11 +58,11 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_name: "SomeSystem_that_has_FW" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" chassis_id: "bb:bb:bb:bb:bb:bb" @@ -79,11 +79,11 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_name: "SomeSystem_that_has_FW" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "SomeSystem_that_has_FW" - capabilities_enabled: "Router" capabilities_supported: "Bridge Router" chassis_id: "cc:cc:cc:cc:cc:cc" @@ -100,8 +100,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_name: "SomeSystem_that_has_FW" port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" - system_name: "SomeSystem_that_has_FW" From 3e8d9e91432bd788f9fe5749fad91fdfd825d743 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:36:43 -0500 Subject: [PATCH 11/17] Discard null and normalize to NEIGHBOR_INTERFACE --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index af98897880..ff5eb487ed 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -5,7 +5,7 @@ Value Required MAC_PORT (\S+) Value REMOTE_ID (.+?) Value CHASSIS_SUBTYPE (.+?) Value PORT_SUBTYPE (.+?) -Value PORT_DESCRIPTION (.+?) +Value NEIGHBOR_INTERFACE (.+?) Value NEIGHBOR_NAME (.+?) Value NEIGHBOR_DESCRIPTION (.+?) Value CAPABILITIES_SUPPORTED (.+?) @@ -32,7 +32,7 @@ LLDP ^\s*Remote\s+ID\s+=\s+${REMOTE_ID},?\s*$$ ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE},?\s*$$ ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ - ^\s*Port\s+Description\s+=\s+${PORT_DESCRIPTION},?\s*$$ + ^\s*Port\s+Description\s+=\s+(\(null\)|${NEIGHBOR_INTERFACE}),?\s*$$ ^\s*System\s+Name\s+=\s+${NEIGHBOR_NAME},?\s*$$ ^\s*System\s+Description\s+=\s+(\(null\)|${NEIGHBOR_DESCRIPTION}),?\s*$$ ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index 882499cba2..3836c2bb68 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -16,8 +16,8 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" + neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" neighbor_name: "AP" - port_description: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -37,8 +37,8 @@ parsed_sample: med_power_type: "PD Device" med_power_value: "25.4 W" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" + neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" neighbor_name: "AP" - port_description: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" @@ -58,8 +58,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" + neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" neighbor_name: "AP" - port_description: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" port_subtype: "1 (MAC address)" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" @@ -79,8 +79,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_interface: "Alcatel-Lucent OS6860 GNI 1/1/1" neighbor_name: "SW" - port_description: "Alcatel-Lucent OS6860 GNI 1/1/1" port_subtype: "1 (Locally assigned)" remote_id: "123" remote_port_mac_phy_autoneg: "" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 8047c94bc5..5d6401f0e0 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -16,8 +16,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_interface: "Alcatel-Lucent Enterprise 1/1" neighbor_name: "SW" - port_description: "Alcatel-Lucent Enterprise 1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -37,8 +37,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "" + neighbor_interface: "Alcatel-Lucent OS6360 GNI 1/1/1" neighbor_name: "SW" - port_description: "Alcatel-Lucent OS6360 GNI 1/1/1" port_subtype: "3 (Locally assigned)" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -58,8 +58,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" - port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -79,8 +79,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" - port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -100,8 +100,8 @@ parsed_sample: med_power_type: "" med_power_value: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" + neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" - port_description: "(null)" port_subtype: "3 (Interface name)" remote_id: "1" remote_port_mac_phy_autoneg: "" From 8497b442ba8e7ba084e99d460d7aae04ebcdacc8 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:44:08 -0500 Subject: [PATCH 12/17] Normalize to MGMT_ADDRESS --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index ff5eb487ed..bfd2b202cc 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -10,7 +10,7 @@ Value NEIGHBOR_NAME (.+?) Value NEIGHBOR_DESCRIPTION (.+?) Value CAPABILITIES_SUPPORTED (.+?) Value CAPABILITIES_ENABLED (.+?) -Value MANAGEMENT_IP_ADDRESS (.+?) +Value MGMT_ADDRESS (.+?) Value MED_DEVICE_TYPE (.+?) Value MED_CAPABILITIES (.+?) Value MED_EXTENSION_TLVS_PRESENT (.+?) @@ -37,7 +37,7 @@ LLDP ^\s*System\s+Description\s+=\s+(\(null\)|${NEIGHBOR_DESCRIPTION}),?\s*$$ ^\s*Capabilities\s+Supported\s+=\s+${CAPABILITIES_SUPPORTED},?\s*$$ ^\s*Capabilities\s+Enabled\s+=\s+${CAPABILITIES_ENABLED},?\s*$$ - ^\s*Management\s+IP\s+Address\s+=\s+${MANAGEMENT_IP_ADDRESS},?\s*$$ + ^\s*Management\s+IP\s+Address\s+=\s+${MGMT_ADDRESS},?\s*$$ ^\s*MED\s+Device\s+Type\s+=\s+${MED_DEVICE_TYPE},?\s*$$ ^\s*MED\s+Capabilities\s+=\s+${MED_CAPABILITIES},?\s*$$ ^\s*MED\s+Extension\s+TLVs\s+Present\s+=\s+${MED_EXTENSION_TLVS_PRESENT},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index 3836c2bb68..3a0acc0042 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -6,7 +6,6 @@ parsed_sample: chassis_subtype: "1 (MAC Address)" local_interface: "1/1" mac_port: "bb:bb:bb:bb:bb:bb" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -15,6 +14,7 @@ parsed_sample: med_power_source: "PSE and Local" med_power_type: "PD Device" med_power_value: "25.4 W" + mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" neighbor_name: "AP" @@ -27,7 +27,6 @@ parsed_sample: chassis_subtype: "1 (MAC Address)" local_interface: "1/2" mac_port: "bb:bb:bb:bb:bb:bb" - management_ip_address: "1.1.1.1" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -36,6 +35,7 @@ parsed_sample: med_power_source: "PSE and Local" med_power_type: "PD Device" med_power_value: "25.4 W" + mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" neighbor_name: "AP" @@ -48,7 +48,6 @@ parsed_sample: chassis_subtype: "1 (MAC Address)" local_interface: "1/3" mac_port: "bb:bb:bb:bb:bb:bb" - management_ip_address: "1.1.1.1" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -57,6 +56,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" neighbor_name: "AP" @@ -69,7 +69,6 @@ parsed_sample: chassis_subtype: "1 (MAC Address)" local_interface: "1/4" mac_port: "1001" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "" med_device_type: "" @@ -78,6 +77,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6860 GNI 1/1/1" neighbor_name: "SW" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 5d6401f0e0..40d5962724 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -6,7 +6,6 @@ parsed_sample: chassis_subtype: "2 (MAC Address)" local_interface: "1/1/1" mac_port: "1025" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "" med_device_type: "" @@ -15,6 +14,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent Enterprise 1/1" neighbor_name: "SW" @@ -27,7 +27,6 @@ parsed_sample: chassis_subtype: "2 (MAC Address)" local_interface: "1/1/2" mac_port: "1025" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "" med_device_type: "" @@ -36,6 +35,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6360 GNI 1/1/1" neighbor_name: "SW" @@ -48,7 +48,6 @@ parsed_sample: chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" mac_port: "Vlan_1_things" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "" med_device_type: "" @@ -57,6 +56,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" @@ -69,7 +69,6 @@ parsed_sample: chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" mac_port: "Vlan_2_more_things" - management_ip_address: "1.1.1.1" mau_type: "" med_capabilities: "" med_device_type: "" @@ -78,6 +77,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" @@ -90,7 +90,6 @@ parsed_sample: chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" mac_port: "sfp-sfpplus1" - management_ip_address: "" mau_type: "" med_capabilities: "" med_device_type: "" @@ -99,6 +98,7 @@ parsed_sample: med_power_source: "" med_power_type: "" med_power_value: "" + mgmt_address: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" From 2eca66dfa30a012e81e262035d65a2c7223d0d57 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:49:40 -0500 Subject: [PATCH 13/17] Add Error directive to LLDP state --- .../templates/alcatel_aos_show_lldp_remote-system.textfsm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index bfd2b202cc..edf914ade3 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -46,5 +46,7 @@ LLDP ^\s*MED\s+Power\s+Priority\s+=\s+${MED_POWER_PRIORITY},?\s*$$ ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE},?\s*$$ ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG},?\s*$$ + ^\s*Remote\s+port\s+default\s+vlan ^\s*Mau\s+Type\s+=\s+${MAU_TYPE},?\s*$$ - ^\s*$$ -> Record Start \ No newline at end of file + ^\s*$$ -> Record Start + ^.*$$ -> Error \ No newline at end of file From a4d355faedc3e012fb2ae76cbc13073c8c52effb Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:54:15 -0500 Subject: [PATCH 14/17] Normalize Power priority, source, and type --- ...lcatel_aos_show_lldp_remote-system.textfsm | 12 ++++---- .../show_lldp_remote-system_R6.yml | 24 +++++++-------- .../show_lldp_remote-system_R8.yml | 30 +++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index edf914ade3..7e23046b85 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -14,9 +14,9 @@ Value MGMT_ADDRESS (.+?) Value MED_DEVICE_TYPE (.+?) Value MED_CAPABILITIES (.+?) Value MED_EXTENSION_TLVS_PRESENT (.+?) -Value MED_POWER_TYPE (.+?) -Value MED_POWER_SOURCE (.+?) -Value MED_POWER_PRIORITY (.+?) +Value POWER_DEVICE_TYPE (.+?) +Value POWER_SOURCE (.+?) +Value POWER_PRIORITY (.+?) Value MED_POWER_VALUE (.+?) Value REMOTE_PORT_MAC_PHY_AUTONEG (.+?) Value MAU_TYPE (.+?) @@ -41,9 +41,9 @@ LLDP ^\s*MED\s+Device\s+Type\s+=\s+${MED_DEVICE_TYPE},?\s*$$ ^\s*MED\s+Capabilities\s+=\s+${MED_CAPABILITIES},?\s*$$ ^\s*MED\s+Extension\s+TLVs\s+Present\s+=\s+${MED_EXTENSION_TLVS_PRESENT},?\s*$$ - ^\s*MED\s+Power\s+Type\s+=\s+${MED_POWER_TYPE},?\s*$$ - ^\s*MED\s+Power\s+Source\s+=\s+${MED_POWER_SOURCE},?\s*$$ - ^\s*MED\s+Power\s+Priority\s+=\s+${MED_POWER_PRIORITY},?\s*$$ + ^\s*MED\s+Power\s+Type\s+=\s+${POWER_DEVICE_TYPE},?\s*$$ + ^\s*MED\s+Power\s+Source\s+=\s+${POWER_SOURCE},?\s*$$ + ^\s*MED\s+Power\s+Priority\s+=\s+${POWER_PRIORITY},?\s*$$ ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE},?\s*$$ ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG},?\s*$$ ^\s*Remote\s+port\s+default\s+vlan diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index 3a0acc0042..c7d7d4c835 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -10,15 +10,15 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_priority: "Low" - med_power_source: "PSE and Local" - med_power_type: "PD Device" med_power_value: "25.4 W" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" neighbor_name: "AP" port_subtype: "1 (MAC address)" + power_device_type: "PD Device" + power_priority: "Low" + power_source: "PSE and Local" remote_id: "1" remote_port_mac_phy_autoneg: "" - capabilities_enabled: "Bridge WLAN AP Router" @@ -31,15 +31,15 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_priority: "Low" - med_power_source: "PSE and Local" - med_power_type: "PD Device" med_power_value: "25.4 W" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" neighbor_name: "AP" port_subtype: "1 (MAC address)" + power_device_type: "PD Device" + power_priority: "Low" + power_source: "PSE and Local" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" - capabilities_enabled: "Bridge WLAN AP Router" @@ -52,15 +52,15 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" neighbor_name: "AP" port_subtype: "1 (MAC address)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" - capabilities_enabled: "Bridge Router" @@ -73,14 +73,14 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6860 GNI 1/1/1" neighbor_name: "SW" port_subtype: "1 (Locally assigned)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "123" remote_port_mac_phy_autoneg: "" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 40d5962724..b142851c7f 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -10,15 +10,15 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent Enterprise 1/1" neighbor_name: "SW" port_subtype: "3 (Locally assigned)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" - capabilities_enabled: "Bridge Router" @@ -31,15 +31,15 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6360 GNI 1/1/1" neighbor_name: "SW" port_subtype: "3 (Locally assigned)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" - capabilities_enabled: "Router" @@ -52,15 +52,15 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" port_subtype: "3 (Interface name)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" - capabilities_enabled: "Router" @@ -73,15 +73,15 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" port_subtype: "3 (Interface name)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" - capabilities_enabled: "Router" @@ -94,14 +94,14 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_priority: "" - med_power_source: "" - med_power_type: "" med_power_value: "" mgmt_address: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" neighbor_name: "SomeSystem_that_has_FW" port_subtype: "3 (Interface name)" + power_device_type: "" + power_priority: "" + power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" From 48bdd2d5da9554a90705d295120001e40056c66e Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:58:47 -0500 Subject: [PATCH 15/17] Normalize MED_POWER_VALUE to POWER_REQUESTED --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index 7e23046b85..f476ba281e 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -17,7 +17,7 @@ Value MED_EXTENSION_TLVS_PRESENT (.+?) Value POWER_DEVICE_TYPE (.+?) Value POWER_SOURCE (.+?) Value POWER_PRIORITY (.+?) -Value MED_POWER_VALUE (.+?) +Value POWER_REQUESTED (.+?) Value REMOTE_PORT_MAC_PHY_AUTONEG (.+?) Value MAU_TYPE (.+?) @@ -44,7 +44,7 @@ LLDP ^\s*MED\s+Power\s+Type\s+=\s+${POWER_DEVICE_TYPE},?\s*$$ ^\s*MED\s+Power\s+Source\s+=\s+${POWER_SOURCE},?\s*$$ ^\s*MED\s+Power\s+Priority\s+=\s+${POWER_PRIORITY},?\s*$$ - ^\s*MED\s+Power\s+Value\s+=\s+${MED_POWER_VALUE},?\s*$$ + ^\s*MED\s+Power\s+Value\s+=\s+${POWER_REQUESTED},?\s*$$ ^\s*Remote\s+port\s+MAC\/PHY\s+AutoNeg\s+=\s+${REMOTE_PORT_MAC_PHY_AUTONEG},?\s*$$ ^\s*Remote\s+port\s+default\s+vlan ^\s*Mau\s+Type\s+=\s+${MAU_TYPE},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index c7d7d4c835..e286ac4db7 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -10,7 +10,6 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_value: "25.4 W" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1201H 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1201H eth0-4094" @@ -18,6 +17,7 @@ parsed_sample: port_subtype: "1 (MAC address)" power_device_type: "PD Device" power_priority: "Low" + power_requested: "25.4 W" power_source: "PSE and Local" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -31,7 +31,6 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_value: "25.4 W" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1321 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1321 eth1" @@ -39,6 +38,7 @@ parsed_sample: port_subtype: "1 (MAC address)" power_device_type: "PD Device" power_priority: "Low" + power_requested: "25.4 W" power_source: "PSE and Local" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8336" @@ -52,7 +52,6 @@ parsed_sample: med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" med_extension_tlvs_present: "Network Policy| Inventory" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Alcatel-Lucent Enterprise OAW-AP1361 1.0.0.10" neighbor_interface: "Alcatel-Lucent Enterprise OAW-AP1361 eth0" @@ -60,6 +59,7 @@ parsed_sample: port_subtype: "1 (MAC address)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "Supported Enabled Capability 0x8337" @@ -73,7 +73,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6860 GNI 1/1/1" @@ -81,6 +80,7 @@ parsed_sample: port_subtype: "1 (Locally assigned)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "123" remote_port_mac_phy_autoneg: "" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index b142851c7f..09dfb885c3 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -10,7 +10,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent Enterprise 1/1" @@ -18,6 +17,7 @@ parsed_sample: port_subtype: "3 (Locally assigned)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -31,7 +31,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "" neighbor_interface: "Alcatel-Lucent OS6360 GNI 1/1/1" @@ -39,6 +38,7 @@ parsed_sample: port_subtype: "3 (Locally assigned)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -52,7 +52,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" @@ -60,6 +59,7 @@ parsed_sample: port_subtype: "3 (Interface name)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -73,7 +73,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "1.1.1.1" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" @@ -81,6 +80,7 @@ parsed_sample: port_subtype: "3 (Interface name)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" @@ -94,7 +94,6 @@ parsed_sample: med_capabilities: "" med_device_type: "" med_extension_tlvs_present: "" - med_power_value: "" mgmt_address: "" neighbor_description: "Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4" neighbor_interface: "" @@ -102,6 +101,7 @@ parsed_sample: port_subtype: "3 (Interface name)" power_device_type: "" power_priority: "" + power_requested: "" power_source: "" remote_id: "1" remote_port_mac_phy_autoneg: "" From 838e412862150e4565abc4048e2fd84c180e75d3 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:03:12 -0500 Subject: [PATCH 16/17] Normalize MAC_PORT to MAC_ADDRESS --- .../alcatel_aos_show_lldp_remote-system.textfsm | 4 ++-- .../show_lldp_remote-system_R6.yml | 8 ++++---- .../show_lldp_remote-system_R8.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index f476ba281e..a33fa71d4a 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -1,6 +1,6 @@ Value Filldown LOCAL_INTERFACE (\S+) Value Required CHASSIS_ID (\S+) -Value Required MAC_PORT (\S+) +Value Required MAC_ADDRESS (\S+) # question mark in many regexes so we don't capture the optional trailing comma Value REMOTE_ID (.+?) Value CHASSIS_SUBTYPE (.+?) @@ -28,7 +28,7 @@ Start ^.*$$ -> Error LLDP - ^\s*Chassis\s+${CHASSIS_ID},\s+Port\s+${MAC_PORT}:\s*$$ + ^\s*Chassis\s+${CHASSIS_ID},\s+Port\s+${MAC_ADDRESS}:\s*$$ ^\s*Remote\s+ID\s+=\s+${REMOTE_ID},?\s*$$ ^\s*Chassis\s+Subtype\s+=\s+${CHASSIS_SUBTYPE},?\s*$$ ^\s*Port\s+Subtype\s+=\s+${PORT_SUBTYPE},?\s*$$ diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml index e286ac4db7..b1031747e0 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R6.yml @@ -5,7 +5,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" local_interface: "1/1" - mac_port: "bb:bb:bb:bb:bb:bb" + mac_address: "bb:bb:bb:bb:bb:bb" mau_type: "" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -26,7 +26,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" local_interface: "1/2" - mac_port: "bb:bb:bb:bb:bb:bb" + mac_address: "bb:bb:bb:bb:bb:bb" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -47,7 +47,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" local_interface: "1/3" - mac_port: "bb:bb:bb:bb:bb:bb" + mac_address: "bb:bb:bb:bb:bb:bb" mau_type: "1000BaseTFD - Four-pair Category 5 UTP full duplex mode" med_capabilities: "Capabilities | Power via MDI-PD(33)" med_device_type: "Network Connectivity" @@ -68,7 +68,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "1 (MAC Address)" local_interface: "1/4" - mac_port: "1001" + mac_address: "1001" mau_type: "" med_capabilities: "" med_device_type: "" diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml index 09dfb885c3..c1c69c075a 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.yml @@ -5,7 +5,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" local_interface: "1/1/1" - mac_port: "1025" + mac_address: "1025" mau_type: "" med_capabilities: "" med_device_type: "" @@ -26,7 +26,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" local_interface: "1/1/2" - mac_port: "1025" + mac_address: "1025" mau_type: "" med_capabilities: "" med_device_type: "" @@ -47,7 +47,7 @@ parsed_sample: chassis_id: "aa:aa:aa:aa:aa:aa" chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" - mac_port: "Vlan_1_things" + mac_address: "Vlan_1_things" mau_type: "" med_capabilities: "" med_device_type: "" @@ -68,7 +68,7 @@ parsed_sample: chassis_id: "bb:bb:bb:bb:bb:bb" chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" - mac_port: "Vlan_2_more_things" + mac_address: "Vlan_2_more_things" mau_type: "" med_capabilities: "" med_device_type: "" @@ -89,7 +89,7 @@ parsed_sample: chassis_id: "cc:cc:cc:cc:cc:cc" chassis_subtype: "2 (MAC Address)" local_interface: "1/1/3" - mac_port: "sfp-sfpplus1" + mac_address: "sfp-sfpplus1" mau_type: "" med_capabilities: "" med_device_type: "" From e753c0f72e4531e6b30b2b4049923576c9777b35 Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:45:58 -0500 Subject: [PATCH 17/17] Apply suggestions from code review --- .../templates/alcatel_aos_show_lldp_remote-system.textfsm | 2 +- .../show_lldp_remote-system/show_lldp_remote-system_R8.raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm index a33fa71d4a..245bdd0485 100644 --- a/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_lldp_remote-system.textfsm @@ -49,4 +49,4 @@ LLDP ^\s*Remote\s+port\s+default\s+vlan ^\s*Mau\s+Type\s+=\s+${MAU_TYPE},?\s*$$ ^\s*$$ -> Record Start - ^.*$$ -> Error \ No newline at end of file + ^.*$$ -> Error diff --git a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw index a613365e2b..721fe6ad47 100644 --- a/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw +++ b/tests/alcatel_aos/show_lldp_remote-system/show_lldp_remote-system_R8.raw @@ -59,4 +59,4 @@ Remote LLDP nearest-bridge Agents on Local Port 1/1/3: System Name = SomeSystem_that_has_FW, System Description = Mikrotik RouterOS 1.1 (stable) Jan/1/2000 01:01:01 RB1100AHx4, Capabilities Supported = Bridge Router, - Capabilities Enabled = Router \ No newline at end of file + Capabilities Enabled = Router