From 6433ba4ab5865e2c21c95e5903f75785277efca4 Mon Sep 17 00:00:00 2001 From: julmanglano Date: Mon, 11 May 2026 11:28:54 +0200 Subject: [PATCH 1/3] Add aruba_aoscx show module --- .../templates/aruba_aoscx_show_module.textfsm | 25 ++++++++++ ntc_templates/templates/index | 1 + tests/aruba_aoscx/show_module/show_module.raw | 22 ++++++++ tests/aruba_aoscx/show_module/show_module.yml | 50 +++++++++++++++++++ .../aruba_aoscx/show_module/show_module2.raw | 17 +++++++ .../aruba_aoscx/show_module/show_module2.yml | 14 ++++++ 6 files changed, 129 insertions(+) create mode 100644 ntc_templates/templates/aruba_aoscx_show_module.textfsm create mode 100644 tests/aruba_aoscx/show_module/show_module.raw create mode 100644 tests/aruba_aoscx/show_module/show_module.yml create mode 100644 tests/aruba_aoscx/show_module/show_module2.raw create mode 100644 tests/aruba_aoscx/show_module/show_module2.yml diff --git a/ntc_templates/templates/aruba_aoscx_show_module.textfsm b/ntc_templates/templates/aruba_aoscx_show_module.textfsm new file mode 100644 index 0000000000..358c8acb4d --- /dev/null +++ b/ntc_templates/templates/aruba_aoscx_show_module.textfsm @@ -0,0 +1,25 @@ +Value Filldown MODULE_TYPE (Management|Line) +Value Required MODULE (\S+) +Value MODEL (\S+) +Value DESCRIPTION (\S.*\S) +Value Required SERIAL_NUMBER (\S+) +Value STATUS (\S.*\S) + +Start + ^${MODULE_TYPE}\s+Modules\s*$$ -> Header + ^=+\s*$$ + ^\s*$$ + ^. -> Error + +Header + ^=+\s*$$ + ^\s*Product\s+Serial\s*$$ + ^Name\s+Number\s+Description\s+Number\s+Status\s*$$ + ^-+\s+-+\s+-+\s+-+\s+-+\s*$$ -> Rows + ^\s*$$ + ^. -> Error + +Rows + ^${MODULE}\s+${MODEL}\s+${DESCRIPTION}\s{2,}${SERIAL_NUMBER}\s+${STATUS}\s*$$ -> Record + ^\s*$$ -> Start + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 8d4ecac01b..b9e41c25ce 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -122,6 +122,7 @@ aruba_aoscx_show_arp_all-vrfs.textfsm, .*, aruba_aoscx, sh[[ow]] ar[[p]] a[[ll-v aruba_aoscx_show_bfd_all-vrfs.textfsm, .*, aruba_aoscx, sh[[ow]] bf[[d]] a[[ll-vrfs]] aruba_aoscx_show_vsf_detail.textfsm, .*, aruba_aoscx, sh[[ow]] vsf d[[etail]] aruba_aoscx_show_interface.textfsm, .*, aruba_aoscx, sh[[ow]] int[[erface]] +aruba_aoscx_show_module.textfsm, .*, aruba_aoscx, sh[[ow]] mod[[ule]] aruba_aoscx_show_system.textfsm, .*, aruba_aoscx, sh[[ow]] sys[[tem]] aruba_aoscx_show_vlan.textfsm, .*, aruba_aoscx, sh[[ow]] vl[[an]] diff --git a/tests/aruba_aoscx/show_module/show_module.raw b/tests/aruba_aoscx/show_module/show_module.raw new file mode 100644 index 0000000000..890b2f53bc --- /dev/null +++ b/tests/aruba_aoscx/show_module/show_module.raw @@ -0,0 +1,22 @@ +Management Modules +================== + + Product Serial +Name Number Description Number Status +---- ------- -------------------------------------- ---------- ---------------- +1/1 JL658A 6300M 24SFP+ 4SFP56 Swch SG1ABCDEF1 Active (local) +2/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG2ABCDEF2 Ready +3/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG3ABCDEF3 Ready +4/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG4ABCDEF4 Ready + + +Line Modules +============ + + Product Serial +Name Number Description Number Status +---- ------- -------------------------------------- ---------- ---------------- +1/1 JL658A 6300M 24SFP+ 4SFP56 Swch SG1ABCDEF1 Ready +2/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG2ABCDEF2 Ready +3/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG3ABCDEF3 Ready +4/1 JL661A 6300M 48G CL4 PoE 4SFP56 Swch SG4ABCDEF4 Ready diff --git a/tests/aruba_aoscx/show_module/show_module.yml b/tests/aruba_aoscx/show_module/show_module.yml new file mode 100644 index 0000000000..b5c49b10de --- /dev/null +++ b/tests/aruba_aoscx/show_module/show_module.yml @@ -0,0 +1,50 @@ +--- +parsed_sample: + - description: "6300M 24SFP+ 4SFP56 Swch" + model: "JL658A" + module: "1/1" + module_type: "Management" + serial_number: "SG1ABCDEF1" + status: "Active (local)" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "2/1" + module_type: "Management" + serial_number: "SG2ABCDEF2" + status: "Ready" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "3/1" + module_type: "Management" + serial_number: "SG3ABCDEF3" + status: "Ready" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "4/1" + module_type: "Management" + serial_number: "SG4ABCDEF4" + status: "Ready" + - description: "6300M 24SFP+ 4SFP56 Swch" + model: "JL658A" + module: "1/1" + module_type: "Line" + serial_number: "SG1ABCDEF1" + status: "Ready" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "2/1" + module_type: "Line" + serial_number: "SG2ABCDEF2" + status: "Ready" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "3/1" + module_type: "Line" + serial_number: "SG3ABCDEF3" + status: "Ready" + - description: "6300M 48G CL4 PoE 4SFP56 Swch" + model: "JL661A" + module: "4/1" + module_type: "Line" + serial_number: "SG4ABCDEF4" + status: "Ready" diff --git a/tests/aruba_aoscx/show_module/show_module2.raw b/tests/aruba_aoscx/show_module/show_module2.raw new file mode 100644 index 0000000000..b93baa55de --- /dev/null +++ b/tests/aruba_aoscx/show_module/show_module2.raw @@ -0,0 +1,17 @@ + +Management Modules +================== + + Product Serial +Name Number Description Number Status +---- ------- -------------------------------------- ---------- ---------------- +1/1 JL817A 4100i 12G CL4/6 POE 2SFP+ DIN Sw TW1ABCDEF1 Ready + + +Line Modules +============ + + Product Serial +Name Number Description Number Status +---- ------- -------------------------------------- ---------- ---------------- +1/1 JL817A 4100i 12G CL4/6 POE 2SFP+ DIN Sw TW1ABCDEF1 Ready diff --git a/tests/aruba_aoscx/show_module/show_module2.yml b/tests/aruba_aoscx/show_module/show_module2.yml new file mode 100644 index 0000000000..8e5292fd54 --- /dev/null +++ b/tests/aruba_aoscx/show_module/show_module2.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - description: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" + model: "JL817A" + module: "1/1" + module_type: "Management" + serial_number: "TW1ABCDEF1" + status: "Ready" + - description: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" + model: "JL817A" + module: "1/1" + module_type: "Line" + serial_number: "TW1ABCDEF1" + status: "Ready" From cce422c2543580c90c5407d45aa72e42489bacd0 Mon Sep 17 00:00:00 2001 From: julmanglano Date: Wed, 13 May 2026 09:17:10 +0200 Subject: [PATCH 2/3] aruba_aoscx_show_module: rename DESCRIPTION to CARDTYPE and SERIAL_NUMBER to SERIAL per data_model.md --- .../templates/aruba_aoscx_show_module.textfsm | 6 ++-- tests/aruba_aoscx/show_module/show_module.yml | 32 +++++++++---------- .../aruba_aoscx/show_module/show_module2.yml | 8 ++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ntc_templates/templates/aruba_aoscx_show_module.textfsm b/ntc_templates/templates/aruba_aoscx_show_module.textfsm index 358c8acb4d..8d8cf73502 100644 --- a/ntc_templates/templates/aruba_aoscx_show_module.textfsm +++ b/ntc_templates/templates/aruba_aoscx_show_module.textfsm @@ -1,8 +1,8 @@ Value Filldown MODULE_TYPE (Management|Line) Value Required MODULE (\S+) Value MODEL (\S+) -Value DESCRIPTION (\S.*\S) -Value Required SERIAL_NUMBER (\S+) +Value CARDTYPE (\S.*\S) +Value Required SERIAL (\S+) Value STATUS (\S.*\S) Start @@ -20,6 +20,6 @@ Header ^. -> Error Rows - ^${MODULE}\s+${MODEL}\s+${DESCRIPTION}\s{2,}${SERIAL_NUMBER}\s+${STATUS}\s*$$ -> Record + ^${MODULE}\s+${MODEL}\s+${CARDTYPE}\s{2,}${SERIAL}\s+${STATUS}\s*$$ -> Record ^\s*$$ -> Start ^. -> Error diff --git a/tests/aruba_aoscx/show_module/show_module.yml b/tests/aruba_aoscx/show_module/show_module.yml index b5c49b10de..929c03d057 100644 --- a/tests/aruba_aoscx/show_module/show_module.yml +++ b/tests/aruba_aoscx/show_module/show_module.yml @@ -1,50 +1,50 @@ --- parsed_sample: - - description: "6300M 24SFP+ 4SFP56 Swch" + - cardtype: "6300M 24SFP+ 4SFP56 Swch" model: "JL658A" module: "1/1" module_type: "Management" - serial_number: "SG1ABCDEF1" + serial: "SG1ABCDEF1" status: "Active (local)" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "2/1" module_type: "Management" - serial_number: "SG2ABCDEF2" + serial: "SG2ABCDEF2" status: "Ready" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "3/1" module_type: "Management" - serial_number: "SG3ABCDEF3" + serial: "SG3ABCDEF3" status: "Ready" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "4/1" module_type: "Management" - serial_number: "SG4ABCDEF4" + serial: "SG4ABCDEF4" status: "Ready" - - description: "6300M 24SFP+ 4SFP56 Swch" + - cardtype: "6300M 24SFP+ 4SFP56 Swch" model: "JL658A" module: "1/1" module_type: "Line" - serial_number: "SG1ABCDEF1" + serial: "SG1ABCDEF1" status: "Ready" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "2/1" module_type: "Line" - serial_number: "SG2ABCDEF2" + serial: "SG2ABCDEF2" status: "Ready" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "3/1" module_type: "Line" - serial_number: "SG3ABCDEF3" + serial: "SG3ABCDEF3" status: "Ready" - - description: "6300M 48G CL4 PoE 4SFP56 Swch" + - cardtype: "6300M 48G CL4 PoE 4SFP56 Swch" model: "JL661A" module: "4/1" module_type: "Line" - serial_number: "SG4ABCDEF4" + serial: "SG4ABCDEF4" status: "Ready" diff --git a/tests/aruba_aoscx/show_module/show_module2.yml b/tests/aruba_aoscx/show_module/show_module2.yml index 8e5292fd54..ad9c897839 100644 --- a/tests/aruba_aoscx/show_module/show_module2.yml +++ b/tests/aruba_aoscx/show_module/show_module2.yml @@ -1,14 +1,14 @@ --- parsed_sample: - - description: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" + - cardtype: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" model: "JL817A" module: "1/1" module_type: "Management" - serial_number: "TW1ABCDEF1" + serial: "TW1ABCDEF1" status: "Ready" - - description: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" + - cardtype: "4100i 12G CL4/6 POE 2SFP+ DIN Sw" model: "JL817A" module: "1/1" module_type: "Line" - serial_number: "TW1ABCDEF1" + serial: "TW1ABCDEF1" status: "Ready" From 08a15f4de3642bc2f502d1ee9a15456607ebce6e Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Thu, 14 May 2026 20:52:15 -0400 Subject: [PATCH 3/3] Simplify aoscx sh module template * Since the captured data/columns in both sections were the same... * Reduce duplication * Reduce complexity from multiple state transitions --- .../templates/aruba_aoscx_show_module.textfsm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ntc_templates/templates/aruba_aoscx_show_module.textfsm b/ntc_templates/templates/aruba_aoscx_show_module.textfsm index 8d8cf73502..8b0de6a645 100644 --- a/ntc_templates/templates/aruba_aoscx_show_module.textfsm +++ b/ntc_templates/templates/aruba_aoscx_show_module.textfsm @@ -6,20 +6,11 @@ Value Required SERIAL (\S+) Value STATUS (\S.*\S) Start - ^${MODULE_TYPE}\s+Modules\s*$$ -> Header - ^=+\s*$$ - ^\s*$$ - ^. -> Error - -Header + ^${MODULE_TYPE}\s+Modules\s*$$ ^=+\s*$$ ^\s*Product\s+Serial\s*$$ ^Name\s+Number\s+Description\s+Number\s+Status\s*$$ - ^-+\s+-+\s+-+\s+-+\s+-+\s*$$ -> Rows - ^\s*$$ - ^. -> Error - -Rows + ^---+ ^${MODULE}\s+${MODEL}\s+${CARDTYPE}\s{2,}${SERIAL}\s+${STATUS}\s*$$ -> Record - ^\s*$$ -> Start + ^\s*$$ ^. -> Error