From 48257ed45cebb39446675a7c1ea3b117fc153792 Mon Sep 17 00:00:00 2001 From: Jacob McGill Date: Sun, 20 Jan 2019 19:55:59 -0800 Subject: [PATCH] EOS SHOW MODULE: Add new template (#343) --- templates/arista_eos_show_module.template | 25 +++ templates/index | 1 + .../arista_eos_show_module.template.parsed | 168 ++++++++++++++++++ .../arista_eos_show_module.template.raw | 44 +++++ 4 files changed, 238 insertions(+) create mode 100644 templates/arista_eos_show_module.template create mode 100644 tests/arista_eos/show_module/arista_eos_show_module.template.parsed create mode 100644 tests/arista_eos/show_module/arista_eos_show_module.template.raw diff --git a/templates/arista_eos_show_module.template b/templates/arista_eos_show_module.template new file mode 100644 index 0000000000..c2eee3f750 --- /dev/null +++ b/templates/arista_eos_show_module.template @@ -0,0 +1,25 @@ +Value MODULE (\S+) +Value PORTS (\d+) +Value CARD (.+?) +Value TYPE (\S+) +Value MODEL (\S+) +Value SERIAL_NUM (\S+) +Value Fillup MAC_ADDRESS_START (.+?) +Value Fillup MAC_ADDRESS_END (.+?) +Value Fillup HW_VER (\S+) +Value Fillup SW_VER (\S+|\s+) +Value Fillup STATUS (\S+) +Value Fillup UPTIME (.+) + +Start + ^-.+ + ^Module\s+Ports\s+Card\s+Type\s+Model\s+Serial\s+No\.\s*$$ + ^${MODULE}\s+${PORTS}\s+${CARD}\s+${TYPE}\s+${MODEL}\s+${SERIAL_NUM}\s*$$ -> Record + ^Module\s+MAC\s+addresses\s+Hw\s+Sw\s*$$ + ^${MODULE}\s+(?:${MAC_ADDRESS_START}\s+-\s+${MAC_ADDRESS_END})?\s+${HW_VER}(\s+${SW_VER})?\s*$$ + ^Module\s+Status\s+Uptime\s*$$ + ^${MODULE}\s+${STATUS}(\s+${UPTIME})?\s*$$ + ^\s*$$ + ^. -> Error "LINE NOT FOUND" + +EOF diff --git a/templates/index b/templates/index index 246e0c6d05..2ff0d7b822 100644 --- a/templates/index +++ b/templates/index @@ -42,6 +42,7 @@ arista_eos_show_ip_route.template, .*, arista_eos, sh[[ow]] i[[p]] rou[[te]] arista_eos_show_version.template, .*, arista_eos, sh[[ow]] ver[[sion]] arista_eos_show_ip_arp.template, .*, arista_eos, sh[[ow]] i[[p]] ar[[p]] arista_eos_show_ip_bgp.template, .*, arista_eos, sh[[ow]] i[[p]] bg[[p]] +arista_eos_show_module.template, .*, arista_eos, sh[[ow]] modu[[le]] arista_eos_bash_df_-h.template, .*, arista_eos, bas[[h]] d[[f]] [[-h]] arista_eos_show_clock.template, .*, arista_eos, sh[[ow]] clo[[ck]] arista_eos_dir_flash.template, .*, arista_eos, dir fl[[ash:]] diff --git a/tests/arista_eos/show_module/arista_eos_show_module.template.parsed b/tests/arista_eos/show_module/arista_eos_show_module.template.parsed new file mode 100644 index 0000000000..719b4943fa --- /dev/null +++ b/tests/arista_eos/show_module/arista_eos_show_module.template.parsed @@ -0,0 +1,168 @@ +--- +parsed_sample: +- module : '1' + ports : '3' + card : 'DCS-7500-SUP2' + type : 'Supervisor' + model : 'DCS-7500-SUP2' + serial_num : 'XX16380393' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : '3' + ports : '144' + card : '36-port QSFP100' + type : 'Linecard' + model : '7500R-36CQ-LC' + serial_num : 'XX16340219' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : '4' + ports : '144' + card : '36-port QSFP100' + type : 'Linecard' + model : '7500R-36CQ-LC' + serial_num : 'XX16364164' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : '5' + ports : '144' + card : '36-port QSFP100' + type : 'Linecard' + model : '7500R-36CQ-LC' + serial_num : 'XX16364166' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : '6' + ports : '144' + card : '36-port QSFP100' + type : 'Linecard' + model : '7500R-36CQ-LC' + serial_num : 'XX16351233' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : '7' + ports : '144' + card : '36-port QSFP100' + type : 'Linecard' + model : '7500R2-36CQ-LC' + serial_num : 'XX17341299' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric1' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16472732' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric2' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16472587' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric3' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16320292' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric4' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16320357' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric5' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16320439' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' + + +- module : 'Fabric6' + ports : '0' + card : 'DCS-7508R' + type : 'Fabric' + model : '7508R-FM' + serial_num : 'XX16320585' + mac_address_start : '44:4c:a8:e6:17:5e' + mac_address_end: '44:4c:a8:e6:17:5f' + hw_ver : '14.20' + sw_ver : '4.19.5M' + status : 'Ok' + uptime : '74 days, 0:25:22' \ No newline at end of file diff --git a/tests/arista_eos/show_module/arista_eos_show_module.template.raw b/tests/arista_eos/show_module/arista_eos_show_module.template.raw new file mode 100644 index 0000000000..02542653cf --- /dev/null +++ b/tests/arista_eos/show_module/arista_eos_show_module.template.raw @@ -0,0 +1,44 @@ +Module Ports Card Type Model Serial No. +------- ----- ------------------------ -------------- ----------- +1 3 DCS-7500-SUP2 Supervisor DCS-7500-SUP2 XX16380393 +3 144 36-port QSFP100 Linecard 7500R-36CQ-LC XX16340219 +4 144 36-port QSFP100 Linecard 7500R-36CQ-LC XX16364164 +5 144 36-port QSFP100 Linecard 7500R-36CQ-LC XX16364166 +6 144 36-port QSFP100 Linecard 7500R-36CQ-LC XX16351233 +7 144 36-port QSFP100 Linecard 7500R2-36CQ-LC XX17341299 +Fabric1 0 DCS-7508R Fabric 7508R-FM XX16472732 +Fabric2 0 DCS-7508R Fabric 7508R-FM XX16472587 +Fabric3 0 DCS-7508R Fabric 7508R-FM XX16320292 +Fabric4 0 DCS-7508R Fabric 7508R-FM XX16320357 +Fabric5 0 DCS-7508R Fabric 7508R-FM XX16320439 +Fabric6 0 DCS-7508R Fabric 7508R-FM XX16320585 + +Module MAC addresses Hw Sw +------- ------------------------------------- ----- ------- +1 44:4c:a8:e6:17:5e - 44:4c:a8:e6:17:5f 14.20 4.19.5M +3 44:4c:a8:e2:d0:28 - 44:4c:a8:e2:d0:b7 13.00 +4 44:4c:a8:ee:a9:2c - 44:4c:a8:ee:a9:bb 13.00 +5 44:4c:a8:ee:97:2c - 44:4c:a8:ee:97:bb 13.00 +6 44:4c:a8:ee:2f:1c - 44:4c:a8:ee:2f:ab 13.00 +7 28:99:3a:a4:01:58 - 28:99:3a:a4:01:e7 12.01 +Fabric1 12.03 +Fabric2 12.03 +Fabric3 12.03 +Fabric4 12.03 +Fabric5 12.03 +Fabric6 12.03 + +Module Status Uptime +------- ------ ---------------- +1 Active +3 Ok 74 days, 0:25:22 +4 Ok 74 days, 0:25:22 +5 Ok 74 days, 0:25:22 +6 Ok 74 days, 0:25:22 +7 Ok 74 days, 0:25:22 +Fabric1 Ok 74 days, 0:25:22 +Fabric2 Ok 74 days, 0:25:22 +Fabric3 Ok 74 days, 0:25:22 +Fabric4 Ok 74 days, 0:25:22 +Fabric5 Ok 74 days, 0:25:22 +Fabric6 Ok 74 days, 0:25:22 \ No newline at end of file