Skip to content

Commit

Permalink
New template: cisco_xr_show_inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
lamiskin committed Jan 16, 2024
1 parent 3e6c58c commit 80f6b7e
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ntc_templates/templates/cisco_xr_show_inventory.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Value NAME (.*)
Value DESCR (.*)
Value PID (([\S+]+|.*))
Value VID (\S+)
Value SN ([\w+\d+]+)

Start
^\S{3}\s+\S{3}\s+\d{1,2}\s+\d+:\d+:\d+
^NAME:\s+"${NAME}",\s+DESCR:\s+"${DESCR}"
^PID\:\s+${PID}\s+,\s+VID\:\s+${VID}\s*\,\s+SN\:\s+${SN} -> Record
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ cisco_xr_show_bfd_sessions.textfsm, .*, cisco_xr, sh[[ow]] bf[[d]] sess[[ions]]
cisco_xr_show_drops_np_all.textfsm, .*, cisco_xr, sh[[ow]] drops np all
cisco_xr_show_pim_neighbor.textfsm, .*, cisco_xr, sh[[ow]] pi[[m]] neigh[[bor]]
cisco_xr_show_interfaces.textfsm, .*, cisco_xr, sh[[ow]] inte[[rfaces]]
cisco_xr_show_inventory.textfsm, .*, cisco_xr, sh[[ow]] inv[[entory]]
cisco_xr_admin_show_vm.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] vm
cisco_xr_show_ip_route.textfsm, .*, cisco_xr, sh[[ow]] (?:ip )?ro[[ute]]
cisco_xr_show_version.textfsm, .*, cisco_xr, sh[[ow]] ver[[sion]]
Expand Down
43 changes: 43 additions & 0 deletions tests/cisco_xr/show_inventory/cisco_xr_show_inventory_01.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Tue Jan 16 13:30:53.501 AEST

NAME: "Rack 0", DESCR: "Cisco 8200 2RU 32x400G QSFP56-DD w/IOS XR HBM MACsec"
PID: 8202-32FH-M , VID: V03, SN: FLM27ABCDEF

NAME: "0/RP0/CPU0", DESCR: "Cisco 8200 2RU 32x400G QSFP56-DD w/IOS XR HBM MACsec"
PID: 8202-32FH-M , VID: V03, SN: FLM27ZBCDEF

NAME: "FourHundredGigE0/0/0/0", DESCR: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
PID: QDD-400G-LR4-S , VID: V01 , SN: INL26ABCAUG

NAME: "FourHundredGigE0/0/0/28", DESCR: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
PID: QDD-400G-LR4-S , VID: V01 , SN: INL2ABCDEFG

NAME: "FourHundredGigE0/0/0/29", DESCR: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
PID: QDD-400G-LR4-S , VID: V01 , SN: INL261ABCDE

NAME: "HundredGigE0/0/0/30", DESCR: "Non-Cisco QSFP28 100G CWDM4 MSA WITH FEC Pluggable Optics Module"
PID: Q.161HG.2.C , VID: 01, SN: F78AAB5

NAME: "HundredGigE0/0/0/31", DESCR: "Non-Cisco QSFP28 100G CWDM4 MSA WITH FEC Pluggable Optics Module"
PID: Q.161HG.2.C , VID: 01, SN: F78AAB6

NAME: "0/FB0", DESCR: "Cisco 8000 Series Fan Controller Board on 8202-32FH-M"
PID: 8202-32FH-M[FB] , VID: N/A, SN: FLM2ZABCDEF

NAME: "0/FT0", DESCR: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
PID: FAN-PI-V3 , VID: V01, SN: DCH27ABCDEF

NAME: "0/FT1", DESCR: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
PID: FAN-PI-V3 , VID: V01, SN: DCH27BBCDEF

NAME: "0/FT2", DESCR: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
PID: FAN-PI-V3 , VID: V01, SN: DCH27CBCDEF

NAME: "0/FT3", DESCR: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
PID: FAN-PI-V3 , VID: V01, SN: DCH27DBCDEF

NAME: "0/PM0", DESCR: "2000W AC Power Module with Port-side Air Intake"
PID: PSU2KW-ACPI , VID: V01 , SN: POG27DBCDEF

NAME: "0/PM1", DESCR: "2000W AC Power Module with Port-side Air Intake"
PID: PSU2KW-ACPI , VID: V01 , SN: POG27ABCDEF
72 changes: 72 additions & 0 deletions tests/cisco_xr/show_inventory/cisco_xr_show_inventory_01.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
parsed_sample:
- descr: "Cisco 8200 2RU 32x400G QSFP56-DD w/IOS XR HBM MACsec"
name: "Rack 0"
pid: "8202-32FH-M"
sn: "FLM27ABCDEF"
vid: "V03"
- descr: "Cisco 8200 2RU 32x400G QSFP56-DD w/IOS XR HBM MACsec"
name: "0/RP0/CPU0"
pid: "8202-32FH-M"
sn: "FLM27ZBCDEF"
vid: "V03"
- descr: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
name: "FourHundredGigE0/0/0/0"
pid: "QDD-400G-LR4-S"
sn: "INL26ABCAUG"
vid: "V01"
- descr: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
name: "FourHundredGigE0/0/0/28"
pid: "QDD-400G-LR4-S"
sn: "INL2ABCDEFG"
vid: "V01"
- descr: "Cisco QSFPDD 400G LR4 Pluggable Optics Module"
name: "FourHundredGigE0/0/0/29"
pid: "QDD-400G-LR4-S"
sn: "INL261ABCDE"
vid: "V01"
- descr: "Non-Cisco QSFP28 100G CWDM4 MSA WITH FEC Pluggable Optics Module"
name: "HundredGigE0/0/0/30"
pid: "Q.161HG.2.C"
sn: "F78AAB5"
vid: "01"
- descr: "Non-Cisco QSFP28 100G CWDM4 MSA WITH FEC Pluggable Optics Module"
name: "HundredGigE0/0/0/31"
pid: "Q.161HG.2.C"
sn: "F78AAB6"
vid: "01"
- descr: "Cisco 8000 Series Fan Controller Board on 8202-32FH-M"
name: "0/FB0"
pid: "8202-32FH-M[FB]"
sn: "FLM2ZABCDEF"
vid: "N/A"
- descr: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
name: "0/FT0"
pid: "FAN-PI-V3"
sn: "DCH27ABCDEF"
vid: "V01"
- descr: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
name: "0/FT1"
pid: "FAN-PI-V3"
sn: "DCH27BBCDEF"
vid: "V01"
- descr: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
name: "0/FT2"
pid: "FAN-PI-V3"
sn: "DCH27CBCDEF"
vid: "V01"
- descr: "Cisco Fixed Routers V3 Fan with Port-side Air Intake"
name: "0/FT3"
pid: "FAN-PI-V3"
sn: "DCH27DBCDEF"
vid: "V01"
- descr: "2000W AC Power Module with Port-side Air Intake"
name: "0/PM0"
pid: "PSU2KW-ACPI"
sn: "POG27DBCDEF"
vid: "V01"
- descr: "2000W AC Power Module with Port-side Air Intake"
name: "0/PM1"
pid: "PSU2KW-ACPI"
sn: "POG27ABCDEF"
vid: "V01"

0 comments on commit 80f6b7e

Please sign in to comment.