From 74f9d59575238cfe1edf8e0e1bbcb3561a3b407b Mon Sep 17 00:00:00 2001 From: Molham Al Nasr Date: Sun, 15 Feb 2026 20:27:22 +0100 Subject: [PATCH 1/4] fix(hp_procurve): add VSF stacking support to show system template (#2282) The hp_procurve_show_system template fails to parse output from switches running in VSF (Virtual Switching Framework) mode. In VSF mode, the output splits into per-member sections with a different field layout than standalone switches. Changes: - Add Filldown to shared fields (NAME, CONTACT, LOCATION, etc.) - Add MEMBER_ID value to identify VSF members - Add split-line matching for Software revision and Base MAC Addr - Add VSF state to capture per-member fields (ROM, serial, MAC, etc.) - Add Required on ROM_VERSION to filter empty EOF records - Add VSF test data with 2-member stack output - Update existing standalone test data with new member_id field Fixes #2282 --- .../templates/hp_procurve_show_system.textfsm | 33 +++++++++---- .../show_system/hp_procurve_show_system.yml | 1 + .../show_system/hp_procurve_show_system2.raw | 35 ++++++++++++++ .../show_system/hp_procurve_show_system2.yml | 46 +++++++++++++++++++ 4 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 tests/hp_procurve/show_system/hp_procurve_show_system2.raw create mode 100644 tests/hp_procurve/show_system/hp_procurve_show_system2.yml diff --git a/ntc_templates/templates/hp_procurve_show_system.textfsm b/ntc_templates/templates/hp_procurve_show_system.textfsm index cc3b743ee4..599eddba75 100644 --- a/ntc_templates/templates/hp_procurve_show_system.textfsm +++ b/ntc_templates/templates/hp_procurve_show_system.textfsm @@ -1,11 +1,12 @@ -Value NAME (\S+) -Value CONTACT (.+) -Value LOCATION (.+) -Value MAC_AGE (\d+) -Value TIMEZONE (\S+) -Value DAYLIGHT_RULE (\S+) -Value SOFTWARE_VERSION (\S+) -Value ROM_VERSION (\S+) +Value Filldown NAME (\S+) +Value Filldown CONTACT (.+) +Value Filldown LOCATION (.+) +Value Filldown MAC_AGE (\d+) +Value Filldown TIMEZONE (\S+) +Value Filldown DAYLIGHT_RULE (\S+) +Value Filldown SOFTWARE_VERSION (\S+) +Value MEMBER_ID (\d+) +Value Required ROM_VERSION (\S+) Value ALLOW_MODS ([Yy]es|[Nn]o) Value MAC_ADDRESS (\S+) Value SERIAL (\S+) @@ -31,6 +32,8 @@ INFO ^\s*Time Zone\s+:\s+${TIMEZONE} ^\s*Daylight Time Rule\s+:\s+${DAYLIGHT_RULE} ^\s*Software revision\s+:\s+${SOFTWARE_VERSION}\s+Base MAC Addr\s+:\s+${MAC_ADDRESS} + ^\s*Software revision\s+:\s+${SOFTWARE_VERSION} + ^\s*Base MAC Addr\s+:\s+${MAC_ADDRESS} ^\s*ROM Version\s+:\s+${ROM_VERSION}\s+Serial Number\s+:\s+${SERIAL} ^\s*Allow V1 Modules\s+:\s+${ALLOW_MODS} ^\s*Up Time\s+:\s+${UPTIME}\s+Memory\s+- Total\s+:\s+${MEM_TOT} @@ -39,4 +42,16 @@ INFO ^\s*Pkts Tx\s+:\s+${PACKETS_TX}\s+Buffers\s+Free\s+:\s+${BUFFERS_FREE} ^\s*Lowest\s+:\s+${BUFFERS_LOWEST} ^\s*Missed\s+:\s+${BUFFERS_MISSED} -> Record - \ No newline at end of file + ^\s*VSF-Member\s*: -> Continue.Record + ^\s*VSF-Member\s*:\s*${MEMBER_ID} -> VSF + +VSF + ^\s*ROM Version\s+:\s+${ROM_VERSION} + ^\s*Up Time\s+:\s+${UPTIME} + ^\s*CPU Util[^:]*:\s+${CPU_UTIL} + ^\s*MAC Addr\s+:\s+${MAC_ADDRESS} + ^\s*Serial Number\s+:\s+${SERIAL} + ^\s*Memory\s+- Total\s+:\s+${MEM_TOT} + ^\s*Free\s+:\s+${MEM_FREE} + ^\s*VSF-Member\s*: -> Continue.Record + ^\s*VSF-Member\s*:\s*${MEMBER_ID} \ No newline at end of file diff --git a/tests/hp_procurve/show_system/hp_procurve_show_system.yml b/tests/hp_procurve/show_system/hp_procurve_show_system.yml index 1335166722..3e00894185 100644 --- a/tests/hp_procurve/show_system/hp_procurve_show_system.yml +++ b/tests/hp_procurve/show_system/hp_procurve_show_system.yml @@ -12,6 +12,7 @@ parsed_sample: mac_age: "300" mem_free: "61,999,280" mem_tot: "128,380,928" + member_id: "" name: "HP_Procurve-01" packets_rx: "39,808,402" packets_tot: "6750" diff --git a/tests/hp_procurve/show_system/hp_procurve_show_system2.raw b/tests/hp_procurve/show_system/hp_procurve_show_system2.raw new file mode 100644 index 0000000000..1e21b69f5d --- /dev/null +++ b/tests/hp_procurve/show_system/hp_procurve_show_system2.raw @@ -0,0 +1,35 @@ + + Status and Counters - General System Information + + System Name : lab-sw-01 + System Contact : IT Support + System Location : Server Room 1 + MAC Age Time (sec) : 300 + + Time Zone : 2 + Daylight Time Rule : Western-Europe + + Software revision : WC.16.11.0027 + Base MAC Addr : a1b2c3-d4e5f6 + + VSF-Member :1 + + ROM Version : WC.16.01.0010 + Up Time : 84 days + CPU Util (%) : 0 + MAC Addr : a1b2c3-d4e5f0 + Serial Number : AB12CDE3FH + Memory - Total : 333,451,776 + Free : 210,899,116 + + + + VSF-Member :2 + + ROM Version : WC.16.01.0010 + Up Time : 84 days + CPU Util (%) : 0 + MAC Addr : a1b2c3-f7e8d9 + Serial Number : AB34CDE5GJ + Memory - Total : 333,451,776 + Free : 227,954,500 diff --git a/tests/hp_procurve/show_system/hp_procurve_show_system2.yml b/tests/hp_procurve/show_system/hp_procurve_show_system2.yml new file mode 100644 index 0000000000..ba65442a46 --- /dev/null +++ b/tests/hp_procurve/show_system/hp_procurve_show_system2.yml @@ -0,0 +1,46 @@ +--- +parsed_sample: + - allow_mods: "" + buffers_free: "" + buffers_lowest: "" + buffers_missed: "" + contact: "IT Support" + cpu_util: "0" + daylight_rule: "Western-Europe" + location: "Server Room 1" + mac_address: "a1b2c3-d4e5f0" + mac_age: "300" + mem_free: "210,899,116" + mem_tot: "333,451,776" + member_id: "1" + name: "lab-sw-01" + packets_rx: "" + packets_tot: "" + packets_tx: "" + rom_version: "WC.16.01.0010" + serial: "AB12CDE3FH" + software_version: "WC.16.11.0027" + timezone: "2" + uptime: "84 days" + - allow_mods: "" + buffers_free: "" + buffers_lowest: "" + buffers_missed: "" + contact: "IT Support" + cpu_util: "0" + daylight_rule: "Western-Europe" + location: "Server Room 1" + mac_address: "a1b2c3-f7e8d9" + mac_age: "300" + mem_free: "227,954,500" + mem_tot: "333,451,776" + member_id: "2" + name: "lab-sw-01" + packets_rx: "" + packets_tot: "" + packets_tx: "" + rom_version: "WC.16.01.0010" + serial: "AB34CDE5GJ" + software_version: "WC.16.11.0027" + timezone: "2" + uptime: "84 days" From 6e8773e3b3431f4576c89885eb7f975de6a88576 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Wed, 11 Mar 2026 20:28:42 -0400 Subject: [PATCH 2/4] Add Error directives to states --- ntc_templates/templates/hp_procurve_show_system.textfsm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ntc_templates/templates/hp_procurve_show_system.textfsm b/ntc_templates/templates/hp_procurve_show_system.textfsm index 599eddba75..9cdc9ac879 100644 --- a/ntc_templates/templates/hp_procurve_show_system.textfsm +++ b/ntc_templates/templates/hp_procurve_show_system.textfsm @@ -23,6 +23,7 @@ Value BUFFERS_MISSED (\d+) Start ^.*Status and Counters -> INFO + ^. -> Error INFO ^\s*System Name\s+:\s+${NAME} @@ -44,6 +45,7 @@ INFO ^\s*Missed\s+:\s+${BUFFERS_MISSED} -> Record ^\s*VSF-Member\s*: -> Continue.Record ^\s*VSF-Member\s*:\s*${MEMBER_ID} -> VSF + ^. -> Error VSF ^\s*ROM Version\s+:\s+${ROM_VERSION} @@ -54,4 +56,5 @@ VSF ^\s*Memory\s+- Total\s+:\s+${MEM_TOT} ^\s*Free\s+:\s+${MEM_FREE} ^\s*VSF-Member\s*: -> Continue.Record - ^\s*VSF-Member\s*:\s*${MEMBER_ID} \ No newline at end of file + ^\s*VSF-Member\s*:\s*${MEMBER_ID} + ^. -> Error \ No newline at end of file From 47be43204b847861b259b7c62ab72fb2580c3a62 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Wed, 11 Mar 2026 20:29:52 -0400 Subject: [PATCH 3/4] Reduce Info state into Start state Consolidate/simplify since there isn't an operational advantage to the extra state. --- ntc_templates/templates/hp_procurve_show_system.textfsm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ntc_templates/templates/hp_procurve_show_system.textfsm b/ntc_templates/templates/hp_procurve_show_system.textfsm index 9cdc9ac879..050f46915a 100644 --- a/ntc_templates/templates/hp_procurve_show_system.textfsm +++ b/ntc_templates/templates/hp_procurve_show_system.textfsm @@ -22,10 +22,7 @@ Value BUFFERS_LOWEST (\d+) Value BUFFERS_MISSED (\d+) Start - ^.*Status and Counters -> INFO - ^. -> Error - -INFO + ^.*Status and Counters ^\s*System Name\s+:\s+${NAME} ^\s*System Contact\s+:\s+${CONTACT} ^\s*System Location\s+:\s+${LOCATION} From d52323a4ddd87b77f6f8f9ed025d968a4a56db14 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:31:42 -0400 Subject: [PATCH 4/4] Replace literal spaces with regex - Replace single literal space with regex for future proofing --- .../templates/hp_procurve_show_system.textfsm | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ntc_templates/templates/hp_procurve_show_system.textfsm b/ntc_templates/templates/hp_procurve_show_system.textfsm index 050f46915a..e0170d48e4 100644 --- a/ntc_templates/templates/hp_procurve_show_system.textfsm +++ b/ntc_templates/templates/hp_procurve_show_system.textfsm @@ -22,22 +22,22 @@ Value BUFFERS_LOWEST (\d+) Value BUFFERS_MISSED (\d+) Start - ^.*Status and Counters - ^\s*System Name\s+:\s+${NAME} - ^\s*System Contact\s+:\s+${CONTACT} - ^\s*System Location\s+:\s+${LOCATION} - ^\s*MAC Age Time[^:]*:\s+${MAC_AGE} - ^\s*Time Zone\s+:\s+${TIMEZONE} - ^\s*Daylight Time Rule\s+:\s+${DAYLIGHT_RULE} - ^\s*Software revision\s+:\s+${SOFTWARE_VERSION}\s+Base MAC Addr\s+:\s+${MAC_ADDRESS} - ^\s*Software revision\s+:\s+${SOFTWARE_VERSION} - ^\s*Base MAC Addr\s+:\s+${MAC_ADDRESS} - ^\s*ROM Version\s+:\s+${ROM_VERSION}\s+Serial Number\s+:\s+${SERIAL} - ^\s*Allow V1 Modules\s+:\s+${ALLOW_MODS} - ^\s*Up Time\s+:\s+${UPTIME}\s+Memory\s+- Total\s+:\s+${MEM_TOT} - ^\s*CPU Util[^:]*:\s+${CPU_UTIL}\s+Free\s+:\s+${MEM_FREE} - ^\s*IP Mgmt\s+- Pkts Rx\s+:\s+${PACKETS_RX}\s+Packet\s+- Total\s+:\s+${PACKETS_TOT} - ^\s*Pkts Tx\s+:\s+${PACKETS_TX}\s+Buffers\s+Free\s+:\s+${BUFFERS_FREE} + ^.*Status\s+and\s+Counters + ^\s*System\s+Name\s+:\s+${NAME} + ^\s*System\s+Contact\s+:\s+${CONTACT} + ^\s*System\s+Location\s+:\s+${LOCATION} + ^\s*MAC\s+Age\s+Time[^:]*:\s+${MAC_AGE} + ^\s*Time\s+Zone\s+:\s+${TIMEZONE} + ^\s*Daylight\s+Time\s+Rule\s+:\s+${DAYLIGHT_RULE} + ^\s*Software\s+revision\s+:\s+${SOFTWARE_VERSION}\s+Base\s+MAC\s+Addr\s+:\s+${MAC_ADDRESS} + ^\s*Software\s+revision\s+:\s+${SOFTWARE_VERSION} + ^\s*Base\s+MAC\s+Addr\s+:\s+${MAC_ADDRESS} + ^\s*ROM\s+Version\s+:\s+${ROM_VERSION}\s+Serial\s+Number\s+:\s+${SERIAL} + ^\s*Allow\s+V1\s+Modules\s+:\s+${ALLOW_MODS} + ^\s*Up\s+Time\s+:\s+${UPTIME}\s+Memory\s+-\s+Total\s+:\s+${MEM_TOT} + ^\s*CPU\s+Util[^:]*:\s+${CPU_UTIL}\s+Free\s+:\s+${MEM_FREE} + ^\s*IP\s+Mgmt\s+-\s+Pkts\s+Rx\s+:\s+${PACKETS_RX}\s+Packet\s+-\s+Total\s+:\s+${PACKETS_TOT} + ^\s*Pkts\s+Tx\s+:\s+${PACKETS_TX}\s+Buffers\s+Free\s+:\s+${BUFFERS_FREE} ^\s*Lowest\s+:\s+${BUFFERS_LOWEST} ^\s*Missed\s+:\s+${BUFFERS_MISSED} -> Record ^\s*VSF-Member\s*: -> Continue.Record @@ -45,12 +45,12 @@ Start ^. -> Error VSF - ^\s*ROM Version\s+:\s+${ROM_VERSION} - ^\s*Up Time\s+:\s+${UPTIME} - ^\s*CPU Util[^:]*:\s+${CPU_UTIL} - ^\s*MAC Addr\s+:\s+${MAC_ADDRESS} - ^\s*Serial Number\s+:\s+${SERIAL} - ^\s*Memory\s+- Total\s+:\s+${MEM_TOT} + ^\s*ROM\s+Version\s+:\s+${ROM_VERSION} + ^\s*Up\s+Time\s+:\s+${UPTIME} + ^\s*CPU\s+Util[^:]*:\s+${CPU_UTIL} + ^\s*MAC\s+Addr\s+:\s+${MAC_ADDRESS} + ^\s*Serial\s+Number\s+:\s+${SERIAL} + ^\s*Memory\s+-\s+Total\s+:\s+${MEM_TOT} ^\s*Free\s+:\s+${MEM_FREE} ^\s*VSF-Member\s*: -> Continue.Record ^\s*VSF-Member\s*:\s*${MEMBER_ID}