Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Template - CISCO IOS - Show Module #593

Merged
merged 13 commits into from
Feb 22, 2020
20 changes: 20 additions & 0 deletions templates/cisco_ios_show_module.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Value Key MODULE (\d+)
Value PORT (\d+)
Value CARDTYPE (.+?)
Value MODEL (\S+)
Value SERIAL (\w+)


Start
^Mod\s+Ports\s+Card\s+Type\s+Model\s+Serial -> Status

Status
^-+
^\s*${MODULE}\s+${PORT}\s+${CARDTYPE}\s+${MODEL}\s+${SERIAL}\s*$$ -> Record
^Mod\s+MAC\s+addresses\s+Hw\s+Fw\s+Sw\s+Status -> End
^Mod\s+Sub-Module\s+Model\s+Serial\s+Hw\s+Status -> End
^Mod\s+Online\s+Diag\s+Status -> End
^\s*$$
^. -> Error

End
16 changes: 16 additions & 0 deletions templates/cisco_ios_show_module_online_diag.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Value Key MODULE (\d+)
Value ONLINE_DIAG (\w+)

Start
^Mod\s+Online\s+Diag\s+Status -> Diag

Diag
^-+
^\s*${MODULE}\s+${ONLINE_DIAG} -> Record
^Mod\s+Ports\s+Card\s+Type\s+Model\s+Serial -> End
^Mod\s+MAC\s+addresses\s+Hw\s+Fw\s+Sw\s+Status -> End
^Mod\s+Sub-Module\s+Model\s+Serial\s+Hw\s+Status -> End
^\s*$$
^. -> Error

End
21 changes: 21 additions & 0 deletions templates/cisco_ios_show_module_status.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Value Key MODULE (\d+)
Value MAC_ADDR (\S+\s+to\s+\S+)
Value MOD_HW (\S+)
Value FW (\S+)
Value SW (\S+)
Value STATUS (\w+)


Start
^\s*Mod\s+MAC\saddresses\s+Hw\s+Fw\s+Sw\s+Status\s*$$ -> ModStatus

ModStatus
^-+
^\s*${MODULE}\s+${MAC_ADDR}\s+${MOD_HW}\s+${FW}\s+${SW}\s+${STATUS}\s*$$ -> Record
^Mod\s+Ports\s+Card\s+Type\s+Model\s+Serial -> End
^\s*Mod\s+Sub-Module\s+Model\s+Serial\s+Hw\s+Status\s*$$ -> End
^Mod\s+Online\s+Diag\s+Status -> End
^\s*$$
^. -> Error

End
21 changes: 21 additions & 0 deletions templates/cisco_ios_show_module_submodule.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Value Key MODULE (\d+)
Value SUBMODULE (.+?)
Value SUBMODULE_MODEL (\S+)
Value SUBMODULE_SERIAL (\S+)
Value SUBMODULE_HW (\S+)
Value SUBMODULE_STATUS (\w+)


Start
^\s*Mod\s+Sub-Module\s+Model\s+Serial\s+Hw\s+Status\s*$$ -> SubModule

SubModule
^-+
^\s*${MODULE}\s+${SUBMODULE}\s+${SUBMODULE_MODEL}\s+${SUBMODULE_SERIAL}\s+${SUBMODULE_HW}\s+${SUBMODULE_STATUS}\s*$$ -> Record
^Mod\s+Ports\s+Card\s+Type\s+Model\s+Serial -> End
^Mod\s+MAC\s+addresses\s+Hw\s+Fw\s+Sw\s+Status -> End
^Mod\s+Online\s+Diag\s+Status -> End
^\s*$$
^. -> Error

End
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ cisco_asa_show_arp.textfsm, .*, cisco_asa, sh[[ow]] arp
cisco_asa_show_nat.textfsm, .*, cisco_asa, sh[[ow]] nat
cisco_asa_dir.textfsm, .*, cisco_asa, dir

cisco_ios_show_module.textfsm:cisco_ios_show_module_status.textfsm:cisco_ios_show_module_submodule.textfsm:cisco_ios_show_module_online_diag.textfsm, .*, cisco_ios, sh[[ow]] mod[[ule]]
cisco_ios_show_switch_detail.textfsm:cisco_ios_show_switch_detail_stack_ports.textfsm, .*, cisco_ios, sh[[ow]] sw[[itch]] d[[etail]]
cisco_ios_show_running-config_partition_access-list.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] a[[ccess-list]]
cisco_ios_show_running-config_partition_route-map.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] route-[[map]]
Expand Down
37 changes: 37 additions & 0 deletions tests/cisco_ios/show_module/cisco_ios_show_module1.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Mod Ports Card Type Model Serial No.
--- ----- -------------------------------------- ------------------ -----------
1 16 CEF720 16 port 10GE WS-X6816-10GE SAL11111111
2 24 CEF720 24 port 1000mb SFP WS-X6724-SFP SAL22222222
3 48 CEF720 48 port 10/100/1000mb Ethernet WS-X6748-GE-TX SAL33333333
4 16 CEF720 16 port 10GE WS-X6816-10GE SAL44444444
5 5 Supervisor Engine 2T 10GE w/ CTS (Acti VS-SUP2T-10G SAL55555555
6 5 Supervisor Engine 2T 10GE w/ CTS (Hot) VS-SUP2T-10G SAL66666666

Mod MAC addresses Hw Fw Sw Status
--- ---------------------------------- ------ ------------ ------------ -------
1 aaaa.aaaa.0000 to aaaa.aaaa.ffff 2.1 12.2(18r)S1 15.2(1)SY5 Ok
2 bbbb.bbbb.0000 to bbbb.bbbb.ffff 2.5 12.2(14r)S5 15.2(1)SY5 Ok
3 cccc.cccc.0000 to cccc.cccc.ffff 2.5 12.2(14r)S5 15.2(1)SY5 Ok
4 dddd.dddd.0000 to dddd.dddd.ffff 2.3 12.2(18r)S1 15.2(1)SY5 Ok
5 eeee.eeee.0000 to eeee.eeee.ffff 1.5 12.2(50r)SYS 15.2(1)SY5 Ok
6 ffff.ffff.0000 to ffff.ffff.ffff 1.5 12.2(50r)SYS 15.2(1)SY5 Ok

Mod Sub-Module Model Serial Hw Status
---- --------------------------- ------------------ ----------- ------- -------
1 Distributed Forwarding Card WS-F6K-DFC4-E SMD11111111 1.2 Ok
2 Centralized Forwarding Card WS-F6700-CFC SMD22222222 3.1 Ok
3 Centralized Forwarding Card WS-F6700-CFC SMD33333333 3.1 Ok
4 Distributed Forwarding Card WS-F6K-DFC4-E SMD44444444 1.2 Ok
5 Policy Feature Card 4 VS-F6K-PFC4 SMD55555555 2.1 Ok
5 CPU Daughterboard VS-F6K-MSFC5 SMD66666666 2.0 Ok
6 Policy Feature Card 4 VS-F6K-PFC4 SMD77777777 2.1 Ok
6 CPU Daughterboard VS-F6K-MSFC5 SMD88888888 2.0 Ok

Mod Online Diag Status
---- -------------------
1 Pass
2 Pass
3 Pass
4 Pass
5 Pass
6 Pass
98 changes: 98 additions & 0 deletions tests/cisco_ios/show_module/cisco_ios_show_module1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
parsed_sample:
- module: "1"
port: "16"
cardtype: "CEF720 16 port 10GE"
model: "WS-X6816-10GE"
serial: "SAL11111111"
mac_addr: "aaaa.aaaa.0000 to aaaa.aaaa.ffff"
mod_hw: "2.1"
fw: "12.2(18r)S1"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Distributed Forwarding Card"
submodule_model: "WS-F6K-DFC4-E"
submodule_serial: "SMD11111111"
submodule_hw: "1.2"
submodule_status: "Ok"
online_diag: "Pass"
- module: "2"
port: "24"
cardtype: "CEF720 24 port 1000mb SFP"
model: "WS-X6724-SFP"
serial: "SAL22222222"
mac_addr: "bbbb.bbbb.0000 to bbbb.bbbb.ffff"
mod_hw: "2.5"
fw: "12.2(14r)S5"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Centralized Forwarding Card"
submodule_model: "WS-F6700-CFC"
submodule_serial: "SMD22222222"
submodule_hw: "3.1"
submodule_status: "Ok"
online_diag: "Pass"
- module: "3"
port: "48"
cardtype: "CEF720 48 port 10/100/1000mb Ethernet"
model: "WS-X6748-GE-TX"
serial: "SAL33333333"
mac_addr: "cccc.cccc.0000 to cccc.cccc.ffff"
mod_hw: "2.5"
fw: "12.2(14r)S5"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Centralized Forwarding Card"
submodule_model: "WS-F6700-CFC"
submodule_serial: "SMD33333333"
submodule_hw: "3.1"
submodule_status: "Ok"
online_diag: "Pass"
- module: "4"
port: "16"
cardtype: "CEF720 16 port 10GE"
model: "WS-X6816-10GE"
serial: "SAL44444444"
mac_addr: "dddd.dddd.0000 to dddd.dddd.ffff"
mod_hw: "2.3"
fw: "12.2(18r)S1"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Distributed Forwarding Card"
submodule_model: "WS-F6K-DFC4-E"
submodule_serial: "SMD44444444"
submodule_hw: "1.2"
submodule_status: "Ok"
online_diag: "Pass"
- module: "5"
port: "5"
cardtype: "Supervisor Engine 2T 10GE w/ CTS (Acti"
model: "VS-SUP2T-10G"
serial: "SAL55555555"
mac_addr: "eeee.eeee.0000 to eeee.eeee.ffff"
mod_hw: "1.5"
fw: "12.2(50r)SYS"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Policy Feature Card 4"
submodule_model: "VS-F6K-PFC4"
submodule_serial: "SMD55555555"
submodule_hw: "2.1"
submodule_status: "Ok"
online_diag: "Pass"
- module: "6"
port: "5"
cardtype: "Supervisor Engine 2T 10GE w/ CTS (Hot)"
model: "VS-SUP2T-10G"
serial: "SAL66666666"
mac_addr: "ffff.ffff.0000 to ffff.ffff.ffff"
mod_hw: "1.5"
fw: "12.2(50r)SYS"
sw: "15.2(1)SY5"
status: "Ok"
submodule: "Policy Feature Card 4"
submodule_model: "VS-F6K-PFC4"
submodule_serial: "SMD77777777"
submodule_hw: "2.1"
submodule_status: "Ok"
online_diag: "Pass"