From 2290fd850511983051297b068f0b4f3d5547d0ed Mon Sep 17 00:00:00 2001 From: julmanglano Date: Mon, 4 May 2026 16:41:44 +0200 Subject: [PATCH 1/2] hp_procurve_show_lldp_info_local-device: new template --- ...ocurve_show_lldp_info_local-device.textfsm | 32 +++++++++++++++++++ ntc_templates/templates/index | 1 + .../show_lldp_info_local-device.raw | 22 +++++++++++++ .../show_lldp_info_local-device.yml | 11 +++++++ .../show_lldp_info_local-device2.raw | 27 ++++++++++++++++ .../show_lldp_info_local-device2.yml | 11 +++++++ 6 files changed, 104 insertions(+) create mode 100644 ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm create mode 100644 tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.raw create mode 100644 tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml create mode 100644 tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.raw create mode 100644 tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml diff --git a/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm b/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm new file mode 100644 index 0000000000..d58745acd2 --- /dev/null +++ b/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm @@ -0,0 +1,32 @@ +Value CHASSIS_TYPE (\S.*\S) +Value CHASSIS_ID (\S.*\S) +Value SYSTEM_NAME (\S+) +Value SYSTEM_DESCRIPTION (\S.*\S) +Value MODEL (\S+) +Value CAPABILITIES_SUPPORTED (\S.*\S) +Value CAPABILITIES_ENABLED (\S.*\S) +Value MGMT_ADDRESS_TYPE (\S+) +Value MGMT_ADDRESS (\S+) + +Start + ^\s*LLDP\s+Local\s+Device\s+Information\s*$$ + ^\s*Chassis\s+Type\s*:\s+${CHASSIS_TYPE}\s*$$ + ^\s*Chassis\s+Id\s*:\s+${CHASSIS_ID}\s*$$ + ^\s*System\s+Name\s*:\s+${SYSTEM_NAME}\s*$$ + ^\s*System\s+Description\s*:\s+(?:ProCurve|HP|Aruba)\s+${MODEL}\s+${SYSTEM_DESCRIPTION}\s*$$ + ^\s*System\s+Description\s*:\s+${SYSTEM_DESCRIPTION}\s*$$ + ^\s*System\s+Capabilities\s+Supported\s*:\s+${CAPABILITIES_SUPPORTED}\s*$$ + ^\s*System\s+Capabilities\s+Enabled\s*:\s+${CAPABILITIES_ENABLED}\s*$$ + ^\s*Management\s+Address\s*:\s*$$ + ^\s+Type\s*:\s*${MGMT_ADDRESS_TYPE}\s*$$ + ^\s+Address\s*:\s*${MGMT_ADDRESS}\s*$$ + ^\s*LLDP\s+Port\s+Information\s*$$ -> Record PortSection + ^\s*$$ + ^. -> Error + +PortSection + ^\s*Port\s+PortType\s+PortId\s+PortDesc\s*$$ + ^\s*-+\s+-+\s+-+\s+-+\s*$$ + ^\s*\S+\s+\S+\s+\S+\s+\S+\s*$$ + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 8d4ecac01b..83b1c5e192 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -690,6 +690,7 @@ hp_comware_display_arp.textfsm, .*, hp_comware, di[[splay]] a[[rp]] hp_procurve_show_lldp_info_remote-device_detail.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] ll[[dp]] i[[nfo]] r[[emote-device]] .+ hp_procurve_show_lldp_info_remote-device.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] ll[[dp]] i[[nfo]] r[[emote-device]] +hp_procurve_show_lldp_info_local-device.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] ll[[dp]] i[[nfo]] l[[ocal-device]] hp_procurve_show_cdp_neighbors_detail.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] cd[[p]] nei[[ghbors]] d[[etail]] hp_procurve_show_interfaces_brief.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] int[[erfaces]] b[[rief]] hp_procurve_show_port-security.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] port-s[[ecurity]] diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.raw b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.raw new file mode 100644 index 0000000000..869fb87aa1 --- /dev/null +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.raw @@ -0,0 +1,22 @@ + LLDP Local Device Information + + Chassis Type : mac-address + Chassis Id : 548028-aabbcf + System Name : SWITCH-1 + System Description : Aruba JL255A 2930F-24G-PoE+-4SFP+ Switch, revision W... + System Capabilities Supported: bridge, router + System Capabilities Enabled: bridge + + Management Address : + Type: ipv4 + Address: 192.0.2.1 + + LLDP Port Information + + Port PortType PortId PortDesc + -------- -------- -------- -------- + 1/1 local 1 1/1 + 1/2 local 2 1/2 + 1/25 local 25 1/25 + 2/1 local 54 2/1 + 3/28 local 134 3/28 diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml new file mode 100644 index 0000000000..c62a754ad2 --- /dev/null +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml @@ -0,0 +1,11 @@ +--- +parsed_sample: + - capabilities_enabled: "bridge" + capabilities_supported: "bridge, router" + chassis_id: "548028-aabbcf" + chassis_type: "mac-address" + mgmt_address: "192.0.2.1" + mgmt_address_type: "ipv4" + model: "JL255A" + system_description: "2930F-24G-PoE+-4SFP+ Switch, revision W..." + system_name: "SWITCH-1" diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.raw b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.raw new file mode 100644 index 0000000000..2e7643c236 --- /dev/null +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.raw @@ -0,0 +1,27 @@ + LLDP Local Device Information + + Chassis Type : mac-address + Chassis Id : 54 80 28 aa bb cd + System Name : SWITCH-2 + System Description : HP J9774A 2530-8G-PoEP Switch, revision YA.16.10.002... + System Capabilities Supported: bridge + System Capabilities Enabled: bridge + + Management Address : + Type: ipv4 + Address: 192.0.2.2 + + LLDP Port Information + + Port PortType PortId PortDesc + -------- -------- -------- -------- + 1 local 1 1 + 2 local 2 2 + 3 local 3 3 + 4 local 4 4 + 5 local 5 5 + 6 local 6 6 + 7 local 7 7 + 8 local 8 8 + 9 local 9 9 + 10 local 10 10 diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml new file mode 100644 index 0000000000..217ec1ad26 --- /dev/null +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml @@ -0,0 +1,11 @@ +--- +parsed_sample: + - capabilities_enabled: "bridge" + capabilities_supported: "bridge" + chassis_id: "54 80 28 aa bb cd" + chassis_type: "mac-address" + mgmt_address: "192.0.2.2" + mgmt_address_type: "ipv4" + model: "J9774A" + system_description: "2530-8G-PoEP Switch, revision YA.16.10.002..." + system_name: "SWITCH-2" From ccbafd38aed96dd58b1c97465b42a342a5ce564b Mon Sep 17 00:00:00 2001 From: julmanglano Date: Tue, 12 May 2026 18:09:52 +0200 Subject: [PATCH 2/2] hp_procurve_show_lldp_info_local-device: rename CAPABILITIES_ENABLED to CAPABILITIES for cross-template consistency --- .../templates/hp_procurve_show_lldp_info_local-device.textfsm | 4 ++-- .../show_lldp_info_local-device.yml | 2 +- .../show_lldp_info_local-device2.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm b/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm index d58745acd2..aca43e4117 100644 --- a/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm +++ b/ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm @@ -4,7 +4,7 @@ Value SYSTEM_NAME (\S+) Value SYSTEM_DESCRIPTION (\S.*\S) Value MODEL (\S+) Value CAPABILITIES_SUPPORTED (\S.*\S) -Value CAPABILITIES_ENABLED (\S.*\S) +Value CAPABILITIES (\S.*\S) Value MGMT_ADDRESS_TYPE (\S+) Value MGMT_ADDRESS (\S+) @@ -16,7 +16,7 @@ Start ^\s*System\s+Description\s*:\s+(?:ProCurve|HP|Aruba)\s+${MODEL}\s+${SYSTEM_DESCRIPTION}\s*$$ ^\s*System\s+Description\s*:\s+${SYSTEM_DESCRIPTION}\s*$$ ^\s*System\s+Capabilities\s+Supported\s*:\s+${CAPABILITIES_SUPPORTED}\s*$$ - ^\s*System\s+Capabilities\s+Enabled\s*:\s+${CAPABILITIES_ENABLED}\s*$$ + ^\s*System\s+Capabilities\s+Enabled\s*:\s+${CAPABILITIES}\s*$$ ^\s*Management\s+Address\s*:\s*$$ ^\s+Type\s*:\s*${MGMT_ADDRESS_TYPE}\s*$$ ^\s+Address\s*:\s*${MGMT_ADDRESS}\s*$$ diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml index c62a754ad2..42964a20a3 100644 --- a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml @@ -1,6 +1,6 @@ --- parsed_sample: - - capabilities_enabled: "bridge" + - capabilities: "bridge" capabilities_supported: "bridge, router" chassis_id: "548028-aabbcf" chassis_type: "mac-address" diff --git a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml index 217ec1ad26..d38082cecb 100644 --- a/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml +++ b/tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml @@ -1,6 +1,6 @@ --- parsed_sample: - - capabilities_enabled: "bridge" + - capabilities: "bridge" capabilities_supported: "bridge" chassis_id: "54 80 28 aa bb cd" chassis_type: "mac-address"