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

cisco_nxos show version - extract serial from "Processor board ID" #813

Merged
merged 15 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion templates/cisco_ios_show_ip_eigrp_neighbors.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Value SEQ_NUM (\d+)

Start
^.*\s+${ADDRESS}\s+${INTERFACE}\s+${HOLD}\s+${UPTIME}\s+${SRTT}\s+${RTO}\s+${Q_CNT}\s+${SEQ_NUM}\s*$$ -> Record
^\s*(?:IP-|)EIGRP(?:-IPv(?:4|6)|)\s+[Nn]eighbors\s+for\s+(?:process\s+|AS\()${AS}(?:\)|)\s*$$
^\s*(IP-|)EIGRP(-IPv[46](:\(\d+\))?|)\s+[Nn]eighbors\s+for\s+(process\s+|AS\()${AS}(\)|)\s*$$
^\s*(IP-|)EIGRP(-IPv[46](:\(\d+\))?|)\s+[Nn]eighbors\s+for\s+(process\s+|AS\()${AS}(\)|)\s+VRF default\s*$$
^\s*$$
^\s*H\s+Address\s+Interface\s+Hold\s+Uptime\s+SRTT\s+RTO\s+Q\s+Seq\s*$$
^\s+\(sec\)\s+\(ms\)\s+Cnt\s+Num\s*$$
Expand Down
5 changes: 2 additions & 3 deletions templates/cisco_nxos_show_cdp_neighbors_detail.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Value REMOTE_PORT (.*)
Value LOCAL_PORT (.*)
Value VERSION (.*)
Value INTERFACE_IP (.*)
Value CAPABILITIES (.*)
Value CAPABILITIES (.*[^\s])

Start
^Device ID:${DEST_HOST}
^System Name: ${SYSNAME}
^Interface address\(es\): -> GetInterfaceIP
^Mgmt address\(es\): -> GetIP
^Platform: ${PLATFORM}, Capabilities: ${CAPABILITIES}
^Platform: ${PLATFORM}, Capabilities: ${CAPABILITIES}\s*$$
^Interface: ${LOCAL_PORT}, Port ID \(outgoing port\): ${REMOTE_PORT}
^Version: -> GetVersion
^----- -> Record
Expand All @@ -26,4 +26,3 @@ GetInterfaceIP

GetVersion
^${VERSION} -> Start

3 changes: 3 additions & 0 deletions templates/cisco_nxos_show_version.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Value OS (\d+.\d+(.+)?)
Value BOOT_IMAGE (.*)
Value PLATFORM (\w+)
Value HOSTNAME (.*)
Value SERIAL (\w+)

Start
^\s+(NXOS: version|system:\s+version)\s+${OS}\s*$$
Expand All @@ -14,5 +15,7 @@ Start
^\s+cisco\s+Nexus\s+${PLATFORM}\s+[cC]hassis
^\s+Device\s+name:\s+${HOSTNAME}$$
^\s+cisco\s+.+-${PLATFORM}\s*
# Nexus intel platform uses Board ID as serial/license
^\s*Processor\s[Bb]oard\sID\s+${SERIAL}$$
diepes marked this conversation as resolved.
Show resolved Hide resolved
^Kernel\s+uptime\s+is\s+${UPTIME}
^\s+Reason:\s${LAST_REBOOT_REASON} -> Record
2 changes: 1 addition & 1 deletion templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ cisco_nxos_show_forwarding_adjacency.textfsm, .*, cisco_nxos, sh[[ow]] fo[[rward
cisco_nxos_show_ipv6_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] ipv[[6]] interf[[ace]] b[[rief]]
cisco_nxos_show_port-channel_summary.textfsm, .*, cisco_nxos, sh[[ow]] po[[rt-channel]] sum[[mary]]
cisco_nxos_show_cts_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] cts inte[[rface]] br[[ief]]
cisco_nxos_show_ip_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] ip int[[erface]] b[[rief]]
cisco_nxos_show_ip_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] ip int[[erface]] b[[rief]](?: vrf \S+)?\s*$
cisco_nxos_show_cts_interface_all.textfsm, .*, cisco_nxos, sh[[ow]] ct[[s]] inter[[face]] al[[l]]
cisco_nxos_show_ip_community-list.textfsm, .*, cisco_nxos, sh[[ow]] ip comm[[unity-list]]
cisco_nxos_show_mac_address-table.textfsm, .*, cisco_nxos, sh[[ow]] m[[ac]] addr[[ess-table]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
EIGRP-IPv4 Neighbors for AS(545)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
2 10.205.205.11 Vl624 10 3w2d 4 100 0 13336
0 10.230.205.27 Vl942 13 9w4d 1 100 0 35073
1 10.230.205.23 Vl942 13 15w2d 1 100 0 1051652
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
parsed_sample:
- as: "545"
address: "10.205.205.11"
interface: "Vl624"
hold: "10"
uptime: "3w2d"
srtt: "4"
rto: "100"
q_cnt: "0"
seq_num: "13336"
- as: "545"
address: "10.230.205.27"
interface: "Vl942"
hold: "13"
uptime: "9w4d"
srtt: "1"
rto: "100"
q_cnt: "0"
seq_num: "35073"
- as: "545"
address: "10.230.205.23"
interface: "Vl942"
hold: "13"
uptime: "15w2d"
srtt: "1"
rto: "100"
q_cnt: "0"
seq_num: "1051652"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
EIGRP-IPv4:(535) neighbors for process 535
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 10.120.250.1 Vl250 10 1w0d 3 450 0 17091
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
parsed_sample:
- as: "535"
address: "10.120.250.1"
interface: "Vl250"
hold: "10"
uptime: "1w0d"
srtt: "3"
rto: "450"
q_cnt: "0"
seq_num: "17091"
99 changes: 99 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version4.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Cisco IOS XE Software, Version 16.09.03
Cisco IOS Software [Fuji], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.9.3, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Wed 20-Mar-19 08:02 by mcpre


Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.


ROM: IOS-XE ROMMON
BOOTLDR: System Bootstrap, Version 16.9.1r [FC2], RELEASE SOFTWARE (P)

AKBTESTW01 uptime is 1 year, 22 weeks, 6 days, 9 hours, 38 minutes
Uptime for this control processor is 1 year, 22 weeks, 6 days, 9 hours, 44 minutes
System returned to ROM by Reload Command at 22:09:11 NZST Wed May 1 2019
System restarted at 22:16:13 NZST Wed May 1 2019
System image file is "flash:packages.conf"
Last reload reason: Reload Command



This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.


Technology Package License Information:

------------------------------------------------------------------------------
Technology-package Technology-package
Current Type Next reboot
------------------------------------------------------------------------------
network-advantage Smart License network-advantage
dna-advantage Subscription Smart License dna-advantage


Smart Licensing Status: UNREGISTERED/EVAL EXPIRED

cisco C9500-40X (X86) processor with 1419496K/6147K bytes of memory.
Processor board ID FCW2233FFG3
16 Virtual Ethernet interfaces
96 Ten Gigabit Ethernet interfaces
4 Forty Gigabit Ethernet interfaces
2048K bytes of non-volatile configuration memory.
16777216K bytes of physical memory.
1638400K bytes of Crash Files at crashinfo:.
1638400K bytes of Crash Files at crashinfo-2:.
11264000K bytes of Flash at flash:.
11264000K bytes of Flash at flash-2:.
0K bytes of WebUI ODM Files at webui:.

Base Ethernet MAC Address : 0c:d0:f8:cd:b5:80
Motherboard Assembly Number : 73-18140-03
Motherboard Serial Number : FOC223855F9
Model Revision Number : D0
Motherboard Revision Number : B0
Model Number : C9500-40X
System Serial Number : FCW2233FFG3


Switch Ports Model SW Version SW Image Mode
------ ----- ----- ---------- ---------- ----
* 1 50 C9500-40X 16.9.3 CAT9K_IOSXE INSTALL
2 50 C9500-40X 16.9.3 CAT9K_IOSXE INSTALL


Switch 02
---------
Switch uptime : 1 year, 22 weeks, 6 days, 9 hours, 47 minutes

Base Ethernet MAC Address : 70:35:09:dd:20:00
Motherboard Assembly Number : 73-11122-03
Motherboard Serial Number : FOC234567Y9
Model Revision Number : D0
Motherboard Revision Number : B0
Model Number : C9500-40X
System Serial Number : FCW1234F88V

Configuration register is 0x102
18 changes: 18 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
parsed_sample:
- version: "16.9.3"
rommon: "IOS-XE"
hostname: "AKBTESTW01"
uptime: "1 year, 22 weeks, 6 days, 9 hours, 38 minutes"
reload_reason: "Reload Command"
running_image: "packages.conf"
hardware:
- "C9500-40X"
- "C9500-40X"
serial:
- "FCW2233FFG3"
- "FCW1234F88V"
config_register: "0x102"
mac:
- "0c:d0:f8:cd:b5:80"
- "70:35:09:dd:20:00"
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
----------------------------------------
Device ID:DC3P01SW01.test.co.nz
VTP Management Domain Name:

Interface address(es):
IPv4 Address: 10.115.143.251
Platform: WS-C3560X-24, Capabilities: Switch IGMP Filtering
Interface: mgmt0, Port ID (outgoing port): GigabitEthernet0/20
Holdtime: 134 sec

Version:
Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thu 09-Feb-12 18:32 by prod_rel_team

Advertisement Version: 2

Native VLAN: 143
Duplex: full
Mgmt address(es):
IPv4 Address: 10.115.143.251
----------------------------------------
Device ID:DC3TESTW01-55.test.co.nz(SSI3707070J)
System Name: DC3TESTW01-55

Interface address(es):
IPv4 Address: 10.115.17.253
Platform: N5K-C5548UP, Capabilities: Router Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/1, Port ID (outgoing port): Ethernet1/31
Holdtime: 157 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)

Advertisement Version: 2

Native VLAN: 1
Duplex: full
Physical Location: DC3, Sydney DC Rack P1, RU36
Mgmt address(es):
IPv4 Address: 10.115.143.120
----------------------------------------
Device ID:DC3TESTW02.test.co.nz(SSI11111D2M)
System Name: DC3TESTW02

Interface address(es):
IPv4 Address: 10.115.143.21
Platform: N5K-C5020P-BF, Capabilities: Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/21, Port ID (outgoing port): Ethernet1/21
Holdtime: 157 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)

Advertisement Version: 2

Native VLAN: 1
Duplex: full
Physical Location: DC3 , Melbourne
Mgmt address(es):
IPv4 Address: 10.115.143.21
----------------------------------------
Device ID:DC3TESTW02.test.co.nz(SSI44444D2M)
System Name: DC3TESTW02

Interface address(es):
IPv4 Address: 10.115.143.21
Platform: N5K-C5020P-BF, Capabilities: Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/22, Port ID (outgoing port): Ethernet1/22
Holdtime: 157 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)

Advertisement Version: 2

Native VLAN: 1
Duplex: full
Physical Location: DC3 , Melbourne
Mgmt address(es):
IPv4 Address: 10.115.143.21
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
parsed_sample:
- dest_host: "DC3P01SW01.test.co.nz"
local_port: "mgmt0"
mgmt_ip: "10.115.143.251"
platform: "WS-C3560X-24"
remote_port: "GigabitEthernet0/20"
sysname: ""
version: "Cisco IOS Software, C3560E Software (C3560E-UNIVERSALK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)"
interface_ip: "10.115.143.251"
capabilities: "Switch IGMP Filtering"
- dest_host: "DC3TESTW01-55.test.co.nz(SSI3707070J)"
local_port: "Ethernet1/1"
mgmt_ip: "10.115.143.120"
platform: "N5K-C5548UP"
remote_port: "Ethernet1/31"
sysname: "DC3TESTW01-55"
version: "Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)"
interface_ip: "10.115.17.253"
capabilities: "Router Switch IGMP Filtering Supports-STP-Dispute"
- dest_host: "DC3TESTW02.test.co.nz(SSI11111D2M)"
local_port: "Ethernet1/21"
mgmt_ip: "10.115.143.21"
platform: "N5K-C5020P-BF"
remote_port: "Ethernet1/21"
sysname: "DC3TESTW02"
version: "Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)"
interface_ip: "10.115.143.21"
capabilities: "Switch IGMP Filtering Supports-STP-Dispute"
- dest_host: "DC3TESTW02.test.co.nz(SSI44444D2M)"
local_port: "Ethernet1/22"
mgmt_ip: "10.115.143.21"
platform: "N5K-C5020P-BF"
remote_port: "Ethernet1/22"
sysname: "DC3TESTW02"
version: "Cisco Nexus Operating System (NX-OS) Software, Version 5.2(1)N1(4)"
interface_ip: "10.115.143.21"
capabilities: "Switch IGMP Filtering Supports-STP-Dispute"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
IP Interface Status for VRF "default"(1)
Interface IP Address Interface Status

IP Interface Status for VRF "management"(2)
Interface IP Address Interface Status
mgmt0 10.205.143.20 protocol-up/link-up/admin-up
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
parsed_sample:
- vrf: "management"
intf: "mgmt0"
ipaddr: "10.205.143.20"
status: "admin-up"
link: "link-up"
proto: "protocol-up"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ parsed_sample:
boot_image: "bootflash:///n9000-dk9.6.1.2.I3.1.bin"
platform: "C9396PX"
hostname: "N9K1"
serial: "SAL1819S6LU"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ parsed_sample:
boot_image: "/bootflash/aci-n9000-dk9.14.0.1h.bin"
platform: "C9396PX"
hostname: "Leaf-101"
serial: "SAL1909A8CT"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ parsed_sample:
boot_image: "bootflash:///n5000-uk9-kickstart.7.1.4.N1.1.bin"
platform: "5596"
hostname: "IEDP02-N5K-SW01"
serial: "FOC17153X08"
Loading