From 767a89e30f778d5792f77e1744f1b28a82767af8 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 9 Oct 2020 00:38:17 +1300 Subject: [PATCH 01/13] cisco_nxos_show_version.textfsm update, scrape SERIAL form show ver, end on -> Error, match all junk in between. --- templates/cisco_nxos_show_version.textfsm | 65 ++++++++++-- .../show_version/cisco_nxos_show_version.yml | 1 + .../show_version/cisco_nxos_show_version1.yml | 1 + .../show_version/cisco_nxos_show_version2.yml | 1 + .../show_version/cisco_nxos_show_version3.raw | 99 +++++++++++++++++++ .../show_version/cisco_nxos_show_version3.yml | 16 +++ 6 files changed, 177 insertions(+), 6 deletions(-) create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index cb7bf0749c..c7768b5664 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -1,12 +1,16 @@ -Value UPTIME ((\d+\s\w+.s.,?\s?){4}) +Value UPTIME ((\d+\s\w+(\(s\))?(,\s)?){4,5}) Value LAST_REBOOT_REASON (.+) -Value OS (\d+.\d+(.+)?) +Value OS (\d+\..*) Value BOOT_IMAGE (.*) -Value PLATFORM (\w+) +Value PLATFORM ([\w-]+) Value HOSTNAME (.*) +Value SERIAL (\w+) + Start - ^\s+(NXOS: version|system:\s+version)\s+${OS}\s*$$ + ^\s*(NXOS:|system:|Cisco IOS XE Software,)\s+[Vv]ersion:?\s+${OS}$$ + # Skip duplicate half version + ^\s+System version: ^\s+(NXOS|kickstart)\s+image\s+file\s+is:\s+${BOOT_IMAGE}\s*$$ ^\s+cisco\s+${PLATFORM}\s+[cC]hassis ^\s+cisco\s+Nexus\d+\s+${PLATFORM} @@ -14,5 +18,54 @@ Start ^\s+cisco\s+Nexus\s+${PLATFORM}\s+[cC]hassis ^\s+Device\s+name:\s+${HOSTNAME}$$ ^\s+cisco\s+.+-${PLATFORM}\s* - ^Kernel\s+uptime\s+is\s+${UPTIME} - ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record + # Nexus intel platform uses Board ID as serial/license + ^\s*Processor\s[Bb]oard\sID\s+${SERIAL}$$ + ## Stack info 2nd switch + ^System Serial Number\s+:\s+${SERIAL}$$ -> Record + ^Kernel\s+uptime\s+is\s+${UPTIME}\s*$$ + ^Uptime\s+for\s+this\s+control\s+processor\s+is\s+${UPTIME}\s*$$ + ^${HOSTNAME}\s+uptime\s+is\s+${UPTIME}\s*$$ + # For nexus 2nd switch there is space behind uptime :() + ^Switch uptime\s+:\s${UPTIME}\s*$$ + ^\s*Model Number\s+:\s+${PLATFORM} + # Junk Cat9K + ^Cisco\s(IOS|Nexus)\s.+Software + ^cisco\s.*X86 + ^(TAC|Technical)\s[Ss]upport:\shttp + ^Documents:\shttp + ^export@cisco.com. + ^(Compiled|All rights reserved.)\s.+$$ + ^.*(licenses, such as|such license|License Information) + ^.*(licensed under|\sGNU|\s\(?GPL|licenses.(l?gpl|old-)|Smart Licens) + ^.*License.+(is available at) + #^Cisco IOS-XE\s.+Copyright\s.+$$ + ^(documentation or|or the|BOOTLDR:)\s.+$$ + ^([Ss]oftware\.?|Hardware|ROM: IOS-XE ROMMON)$$ + ^\s+(BIOS|kickstart|PE|system):\s+version + ^\s+(BIOS|NXOS|kickstart|system)\scompile\stime: + ^\s*(Intel|bootflash:\s|Last reset|Service:) + ^\s*(Core\s)?[Pp]lugin + ^\s*(Active\sPackages:|Technology-package|Current\s+Type) + ^.*([Cc]opyrights?|rights reserved|GPL.+Version|License Notice|applicable URL provided).+$$ + ^.*(ABSOLUTELY NO WARRANTY|there is no warranty|limited to warranties).+$$ + ^(System restarted at|System image file is|System returned to ROM by)\s.+$$ + ^\s+(system|kickstart)\simage\sfile\sis:\s + ^(This product contains cryptographic|States and local)\s.+$$ + ^.*(third[-\s]part(y|ies)|users are responsible|local country laws|applicable laws|local laws|require further assistance)\s.+$$ + ^.*(cryptographic products|local (country\s)?laws[\.,]|export\/crypto).+$$ + ^\s*(Reason:|Last reload reason:)\s${LAST_REBOOT_REASON} + # Junk, CAT9K + ^\d+\s(Virtual|(Ten|Forty)\sGigabit)\sEthernet interfaces + ^.*bytes\sof.*(memory|[Ff]lash|webui) + ^.*[Cc]rash\sFiles + ^Base\sEthernet\sMAC + ^(Motherboard|Model) (Assembly|Serial|Revision) Number + ^Switch Ports Model\s+SW Version\s+SW Image\s+Mode + ^\*?\s+\d+\s\d+\s+[\w-]+\s+[\d\.]+\s + ^Switch\s\d+ + ^\s+Power Sequencer Firmware: + ^\s+Module\s(\d|not detected) + ^.+Microcontroller Firmware: + ^Configuration register is + ^[\s-]*$$ + ^.+ -> Error \ No newline at end of file diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version.yml index 5b0509266f..aa0db339df 100644 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version.yml +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version.yml @@ -6,3 +6,4 @@ parsed_sample: boot_image: "bootflash:///n9000-dk9.6.1.2.I3.1.bin" platform: "C9396PX" hostname: "N9K1" + serial: "SAL1819S6LU" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version1.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version1.yml index 26ccb1b5d2..1f26b1137d 100644 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version1.yml +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version1.yml @@ -6,3 +6,4 @@ parsed_sample: boot_image: "/bootflash/aci-n9000-dk9.14.0.1h.bin" platform: "C9396PX" hostname: "Leaf-101" + serial: "SAL1909A8CT" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version2.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version2.yml index e6e6aa8667..41cdf083c5 100644 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version2.yml +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version2.yml @@ -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" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw new file mode 100644 index 0000000000..098ffcf933 --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw @@ -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:9: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 diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml new file mode 100644 index 0000000000..d080c5af32 --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml @@ -0,0 +1,16 @@ +--- +parsed_sample: + - uptime: "1 year, 22 weeks, 6 days, 9 hours, 44 minutes" + last_reboot_reason: "Reload Command" + os: "16.09.03" + boot_image: "" + platform: "C9500-40X" + hostname: "AKBTESTW01" + serial: "FCW2233FFG3" + - boot_image: "" + hostname: "" + last_reboot_reason: "" + os: "" + serial: "FCW1234F88V" + platform: "C9500-40X" + uptime: "1 year, 22 weeks, 6 days, 9 hours, 47 minutes" From 7dd8dd27577b52f5fc812433d344b5cb451814ab Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 9 Oct 2020 00:43:32 +1300 Subject: [PATCH 02/13] templates/cisco_nxos_show_version.textfsm add new line to end --- templates/cisco_nxos_show_version.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index c7768b5664..fd9651d37c 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -68,4 +68,4 @@ Start ^.+Microcontroller Firmware: ^Configuration register is ^[\s-]*$$ - ^.+ -> Error \ No newline at end of file + ^.+ -> Error From fed4669b434b19184c2160d05f75e9cf3bd2e566 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 18:30:25 +1300 Subject: [PATCH 03/13] cisco_ios_show_ip_eigrp_neighbors fix match "VRF default" --- .../cisco_ios_show_ip_eigrp_neighbors.textfsm | 3 +- .../cisco_ios_show_ip_eigrp_neighbors2.raw | 6 ++++ .../cisco_ios_show_ip_eigrp_neighbors2.yml | 29 +++++++++++++++++++ .../cisco_ios_show_ip_eigrp_neighbors3.raw | 4 +++ .../cisco_ios_show_ip_eigrp_neighbors3.yml | 11 +++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.raw create mode 100644 tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.yml create mode 100644 tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.raw create mode 100644 tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.yml diff --git a/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm b/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm index db6d66b26b..326de045ce 100644 --- a/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm +++ b/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm @@ -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}(\)|)\sVRF default*$$ ^\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*$$ diff --git a/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.raw b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.raw new file mode 100644 index 0000000000..3d96e1aae2 --- /dev/null +++ b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.raw @@ -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 diff --git a/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.yml b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.yml new file mode 100644 index 0000000000..1952b1362b --- /dev/null +++ b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors2.yml @@ -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" diff --git a/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.raw b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.raw new file mode 100644 index 0000000000..9a355162b9 --- /dev/null +++ b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.raw @@ -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 diff --git a/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.yml b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.yml new file mode 100644 index 0000000000..168595aa22 --- /dev/null +++ b/tests/cisco_ios/show_ip_eigrp_neighbors/cisco_ios_show_ip_eigrp_neighbors3.yml @@ -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" From e5e5e4c4f784e48c3852b7e2de2ee5fcf2bf2bac Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 18:32:27 +1300 Subject: [PATCH 04/13] cisco_nxos_show_cdp_neighbors_detail remove extra space at end of capabilities match --- ...sco_nxos_show_cdp_neighbors_detail.textfsm | 4 +- .../cisco_nxos_show_cdp_neighbors_detail1.raw | 82 +++++++++++++++++++ .../cisco_nxos_show_cdp_neighbors_detail1.yml | 38 +++++++++ 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.raw create mode 100644 tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.yml diff --git a/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm b/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm index 2fea1622e7..edfadff140 100644 --- a/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm +++ b/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm @@ -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 diff --git a/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.raw b/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.raw new file mode 100644 index 0000000000..a817bdff60 --- /dev/null +++ b/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.raw @@ -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 \ No newline at end of file diff --git a/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.yml b/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.yml new file mode 100644 index 0000000000..eeac035473 --- /dev/null +++ b/tests/cisco_nxos/show_cdp_neighbors_detail/cisco_nxos_show_cdp_neighbors_detail1.yml @@ -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" From 01d6113ed15544b59b2773aa6b433013fd68969e Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 18:35:24 +1300 Subject: [PATCH 05/13] cisco_nxos_show_version match more junk output to enable ^.+ -> Error match --- templates/cisco_nxos_show_version.textfsm | 6 ++- .../show_version/cisco_nxos_show_version4.raw | 46 +++++++++++++++++++ .../show_version/cisco_nxos_show_version4.yml | 9 ++++ .../show_version/cisco_nxos_show_version5.raw | 44 ++++++++++++++++++ .../show_version/cisco_nxos_show_version5.yml | 9 ++++ 5 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version4.raw create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version4.yml create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw create mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index fd9651d37c..a35a02a429 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -41,11 +41,11 @@ Start #^Cisco IOS-XE\s.+Copyright\s.+$$ ^(documentation or|or the|BOOTLDR:)\s.+$$ ^([Ss]oftware\.?|Hardware|ROM: IOS-XE ROMMON)$$ - ^\s+(BIOS|kickstart|PE|system):\s+version + ^\s+(BIOS|kickstart|PE|system|loader|uC):\s+version ^\s+(BIOS|NXOS|kickstart|system)\scompile\stime: ^\s*(Intel|bootflash:\s|Last reset|Service:) ^\s*(Core\s)?[Pp]lugin - ^\s*(Active\sPackages:|Technology-package|Current\s+Type) + ^\s*(Active\sPackage|Technology-package|Current\s+Type) ^.*([Cc]opyrights?|rights reserved|GPL.+Version|License Notice|applicable URL provided).+$$ ^.*(ABSOLUTELY NO WARRANTY|there is no warranty|limited to warranties).+$$ ^(System restarted at|System image file is|System returned to ROM by)\s.+$$ @@ -64,7 +64,9 @@ Start ^\*?\s+\d+\s\d+\s+[\w-]+\s+[\d\.]+\s ^Switch\s\d+ ^\s+Power Sequencer Firmware: + ^\s+power-seq:\sModule ^\s+Module\s(\d|not detected) + ^\s+SFP\suC: ^.+Microcontroller Firmware: ^Configuration register is ^[\s-]*$$ diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version4.raw b/tests/cisco_nxos/show_version/cisco_nxos_show_version4.raw new file mode 100644 index 0000000000..2050da2dd1 --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version4.raw @@ -0,0 +1,46 @@ +Cisco Nexus Operating System (NX-OS) Software +TAC support: http://www.cisco.com/tac +Copyright (C) 2002-2016, Cisco and/or its affiliates. +All rights reserved. +The copyrights to certain works contained in this software are +owned by other third parties and used and distributed under their own +licenses, such as open source. This software is provided "as is," and unless +otherwise stated, there is no warranty, express or implied, including but not +limited to warranties of merchantability and fitness for a particular purpose. +Certain components of this software are licensed under +the GNU General Public License (GPL) version 2.0 or +GNU General Public License (GPL) version 3.0 or the GNU +Lesser General Public License (LGPL) Version 2.1 or +Lesser General Public License (LGPL) Version 2.0. +A copy of each such license is available at +http://www.opensource.org/licenses/gpl-2.0.php and +http://opensource.org/licenses/gpl-3.0.html and +http://www.opensource.org/licenses/lgpl-2.1.php and +http://www.gnu.org/licenses/old-licenses/library.txt. + +Software + BIOS: version 07.51 + NXOS: version 7.0(3)I4(3) + BIOS compile time: 02/15/2016 + NXOS image file is: bootflash:///nxos.7.0.3.I4.3.bin + NXOS compile time: 9/2/2016 3:00:00 [09/02/2016 23:19:13] + + +Hardware + cisco Nexus9000 C9372PX chassis + Intel(R) Core(TM) i3- CPU @ 2.50GHz with 16401548 kB of memory. + Processor Board ID SAL2211QQWS + + Device name: obttestw02 + bootflash: 21693714 kB +Kernel uptime is 670 day(s), 6 hour(s), 34 minute(s), 1 second(s) + +Last reset + Reason: Unknown + System version: 7.0(3)I4(3) + Service: + +plugin + Core Plugin, Ethernet Plugin + +Active Package(s): diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version4.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version4.yml new file mode 100644 index 0000000000..eabf815c96 --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version4.yml @@ -0,0 +1,9 @@ +--- +parsed_sample: + - uptime: "670 day(s), 6 hour(s), 34 minute(s), 1 second(s)" + last_reboot_reason: "Unknown" + os: "7.0(3)I4(3)" + boot_image: "bootflash:///nxos.7.0.3.I4.3.bin" + platform: "C9372PX" + hostname: "obttestw02" + serial: "SAL2211QQWS" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw new file mode 100644 index 0000000000..379e5a125d --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw @@ -0,0 +1,44 @@ +Cisco Nexus Operating System (NX-OS) Software +TAC support: http://www.cisco.com/tac +Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html +Copyright (c) 2002-2013, Cisco Systems, Inc. All rights reserved. +The copyrights to certain works contained herein are owned by +other third parties and are used and distributed under license. +Some parts of this software are covered under the GNU Public +License. A copy of the license is available at +http://www.gnu.org/licenses/gpl.html. + +Software + BIOS: version 3.6.0 + loader: version N/A + kickstart: version 5.2(1)N1(4) + system: version 5.2(1)N1(4) + power-seq: Module 1: version v1.0 + Module 3: version v5.0 + uC: version v1.2.0.1 + SFP uC: Module 1: v1.0.0.0 + BIOS compile time: 05/09/2012 + kickstart image file is: bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin + kickstart compile time: 3/19/2013 3:00:00 [03/19/2013 23:12:59] + system image file is: bootflash:///n5000-uk9.5.2.1.N1.4.bin + system compile time: 3/19/2013 3:00:00 [03/20/2013 01:10:47] + + +Hardware + cisco Nexus5548 Chassis ("O2 32X10GE/Modular Universal Platform Supervisor") + Intel(R) Xeon(R) CPU with 8263848 kB of memory. + Processor Board ID FOC171737PL + + Device name: DC2TESTSW01-55 + bootflash: 2007040 kB + +Kernel uptime is 311 day(s), 0 hour(s), 27 minute(s), 35 second(s) + +Last reset at 629197 usecs after Thu Dec 5 15:17:54 2019 + + Reason: Reset triggered due to HA policy of Reset + System version: 5.2(1)N1(4) + Service: __inst_001__eigrp hap reset + +plugin + Core Plugin, Ethernet Plugin diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml new file mode 100644 index 0000000000..904e5047a9 --- /dev/null +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml @@ -0,0 +1,9 @@ +--- +parsed_sample: + - uptime: "311 day(s), 0 hour(s), 27 minute(s), 35 second(s)" + last_reboot_reason: "Reset triggered due to HA policy of Reset" + os: "5.2(1)N1(4)" + boot_image: "bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin" + platform: "Nexus5548" + hostname: "DC2TESTSW01-55" + serial: "FOC171737PL" From 80217366a7d7828bbb8fc58449d8bc0ee53ee674 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 18:36:57 +1300 Subject: [PATCH 06/13] index cisco_nxos_show_ip_interface_brief add match for vrf <> to be parsed by same template --- templates/index | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index b/templates/index index e8d0038387..53774bff8c 100644 --- a/templates/index +++ b/templates/index @@ -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]] From 7bfe540f271b78d78a9ffba76172b87d6c02bc80 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 18:38:11 +1300 Subject: [PATCH 07/13] cisco_nxos_show_ip_interface_brief_vrf_all add test case for new index match + vrf all --- .../cisco_nxos_show_ip_interface_brief_vrf_all.raw | 6 ++++++ .../cisco_nxos_show_ip_interface_brief_vrf_all.yml | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.raw create mode 100644 tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.yml diff --git a/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.raw b/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.raw new file mode 100644 index 0000000000..712c8a0c59 --- /dev/null +++ b/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.raw @@ -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 diff --git a/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.yml b/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.yml new file mode 100644 index 0000000000..0341032c16 --- /dev/null +++ b/tests/cisco_nxos/show_ip_interface_brief/cisco_nxos_show_ip_interface_brief_vrf_all.yml @@ -0,0 +1,8 @@ +--- +parsed_sample: + - vrf: "management" + intf: "mgmt0" + ipaddr: "10.205.143.20" + status: "admin-up" + link: "link-up" + proto: "protocol-up" From 00bb5c0c8faab5188c9486c130dbf0dca4c3fdb4 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 20:30:32 +1300 Subject: [PATCH 08/13] implemented fixes suggested with 1st PR --- templates/cisco_nxos_show_version.textfsm | 44 ------ .../show_version/cisco_ios_show_version4.raw | 99 ++++++++++++ .../show_version/cisco_ios_show_version4.yml | 18 +++ .../show_version/cisco_nxos_show_version3.raw | 143 ++++++------------ .../show_version/cisco_nxos_show_version3.yml | 21 +-- .../show_version/cisco_nxos_show_version5.raw | 44 ------ .../show_version/cisco_nxos_show_version5.yml | 9 -- 7 files changed, 168 insertions(+), 210 deletions(-) create mode 100644 tests/cisco_ios/show_version/cisco_ios_show_version4.raw create mode 100644 tests/cisco_ios/show_version/cisco_ios_show_version4.yml delete mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw delete mode 100644 tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index a35a02a429..ee77c76b49 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -9,8 +9,6 @@ Value SERIAL (\w+) Start ^\s*(NXOS:|system:|Cisco IOS XE Software,)\s+[Vv]ersion:?\s+${OS}$$ - # Skip duplicate half version - ^\s+System version: ^\s+(NXOS|kickstart)\s+image\s+file\s+is:\s+${BOOT_IMAGE}\s*$$ ^\s+cisco\s+${PLATFORM}\s+[cC]hassis ^\s+cisco\s+Nexus\d+\s+${PLATFORM} @@ -28,46 +26,4 @@ Start # For nexus 2nd switch there is space behind uptime :() ^Switch uptime\s+:\s${UPTIME}\s*$$ ^\s*Model Number\s+:\s+${PLATFORM} - # Junk Cat9K - ^Cisco\s(IOS|Nexus)\s.+Software - ^cisco\s.*X86 - ^(TAC|Technical)\s[Ss]upport:\shttp - ^Documents:\shttp - ^export@cisco.com. - ^(Compiled|All rights reserved.)\s.+$$ - ^.*(licenses, such as|such license|License Information) - ^.*(licensed under|\sGNU|\s\(?GPL|licenses.(l?gpl|old-)|Smart Licens) - ^.*License.+(is available at) - #^Cisco IOS-XE\s.+Copyright\s.+$$ - ^(documentation or|or the|BOOTLDR:)\s.+$$ - ^([Ss]oftware\.?|Hardware|ROM: IOS-XE ROMMON)$$ - ^\s+(BIOS|kickstart|PE|system|loader|uC):\s+version - ^\s+(BIOS|NXOS|kickstart|system)\scompile\stime: - ^\s*(Intel|bootflash:\s|Last reset|Service:) - ^\s*(Core\s)?[Pp]lugin - ^\s*(Active\sPackage|Technology-package|Current\s+Type) - ^.*([Cc]opyrights?|rights reserved|GPL.+Version|License Notice|applicable URL provided).+$$ - ^.*(ABSOLUTELY NO WARRANTY|there is no warranty|limited to warranties).+$$ - ^(System restarted at|System image file is|System returned to ROM by)\s.+$$ - ^\s+(system|kickstart)\simage\sfile\sis:\s - ^(This product contains cryptographic|States and local)\s.+$$ - ^.*(third[-\s]part(y|ies)|users are responsible|local country laws|applicable laws|local laws|require further assistance)\s.+$$ - ^.*(cryptographic products|local (country\s)?laws[\.,]|export\/crypto).+$$ ^\s*(Reason:|Last reload reason:)\s${LAST_REBOOT_REASON} - # Junk, CAT9K - ^\d+\s(Virtual|(Ten|Forty)\sGigabit)\sEthernet interfaces - ^.*bytes\sof.*(memory|[Ff]lash|webui) - ^.*[Cc]rash\sFiles - ^Base\sEthernet\sMAC - ^(Motherboard|Model) (Assembly|Serial|Revision) Number - ^Switch Ports Model\s+SW Version\s+SW Image\s+Mode - ^\*?\s+\d+\s\d+\s+[\w-]+\s+[\d\.]+\s - ^Switch\s\d+ - ^\s+Power Sequencer Firmware: - ^\s+power-seq:\sModule - ^\s+Module\s(\d|not detected) - ^\s+SFP\suC: - ^.+Microcontroller Firmware: - ^Configuration register is - ^[\s-]*$$ - ^.+ -> Error diff --git a/tests/cisco_ios/show_version/cisco_ios_show_version4.raw b/tests/cisco_ios/show_version/cisco_ios_show_version4.raw new file mode 100644 index 0000000000..f71d5b9e03 --- /dev/null +++ b/tests/cisco_ios/show_version/cisco_ios_show_version4.raw @@ -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 diff --git a/tests/cisco_ios/show_version/cisco_ios_show_version4.yml b/tests/cisco_ios/show_version/cisco_ios_show_version4.yml new file mode 100644 index 0000000000..38ad8334dd --- /dev/null +++ b/tests/cisco_ios/show_version/cisco_ios_show_version4.yml @@ -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" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw index 098ffcf933..379e5a125d 100644 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.raw @@ -1,99 +1,44 @@ -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:9: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 +Cisco Nexus Operating System (NX-OS) Software +TAC support: http://www.cisco.com/tac +Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html +Copyright (c) 2002-2013, Cisco Systems, Inc. All rights reserved. +The copyrights to certain works contained herein are owned by +other third parties and are used and distributed under license. +Some parts of this software are covered under the GNU Public +License. A copy of the license is available at +http://www.gnu.org/licenses/gpl.html. + +Software + BIOS: version 3.6.0 + loader: version N/A + kickstart: version 5.2(1)N1(4) + system: version 5.2(1)N1(4) + power-seq: Module 1: version v1.0 + Module 3: version v5.0 + uC: version v1.2.0.1 + SFP uC: Module 1: v1.0.0.0 + BIOS compile time: 05/09/2012 + kickstart image file is: bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin + kickstart compile time: 3/19/2013 3:00:00 [03/19/2013 23:12:59] + system image file is: bootflash:///n5000-uk9.5.2.1.N1.4.bin + system compile time: 3/19/2013 3:00:00 [03/20/2013 01:10:47] + + +Hardware + cisco Nexus5548 Chassis ("O2 32X10GE/Modular Universal Platform Supervisor") + Intel(R) Xeon(R) CPU with 8263848 kB of memory. + Processor Board ID FOC171737PL + + Device name: DC2TESTSW01-55 + bootflash: 2007040 kB + +Kernel uptime is 311 day(s), 0 hour(s), 27 minute(s), 35 second(s) + +Last reset at 629197 usecs after Thu Dec 5 15:17:54 2019 + + Reason: Reset triggered due to HA policy of Reset + System version: 5.2(1)N1(4) + Service: __inst_001__eigrp hap reset + +plugin + Core Plugin, Ethernet Plugin diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml index d080c5af32..904e5047a9 100644 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml +++ b/tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml @@ -1,16 +1,9 @@ --- parsed_sample: - - uptime: "1 year, 22 weeks, 6 days, 9 hours, 44 minutes" - last_reboot_reason: "Reload Command" - os: "16.09.03" - boot_image: "" - platform: "C9500-40X" - hostname: "AKBTESTW01" - serial: "FCW2233FFG3" - - boot_image: "" - hostname: "" - last_reboot_reason: "" - os: "" - serial: "FCW1234F88V" - platform: "C9500-40X" - uptime: "1 year, 22 weeks, 6 days, 9 hours, 47 minutes" + - uptime: "311 day(s), 0 hour(s), 27 minute(s), 35 second(s)" + last_reboot_reason: "Reset triggered due to HA policy of Reset" + os: "5.2(1)N1(4)" + boot_image: "bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin" + platform: "Nexus5548" + hostname: "DC2TESTSW01-55" + serial: "FOC171737PL" diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw deleted file mode 100644 index 379e5a125d..0000000000 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.raw +++ /dev/null @@ -1,44 +0,0 @@ -Cisco Nexus Operating System (NX-OS) Software -TAC support: http://www.cisco.com/tac -Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html -Copyright (c) 2002-2013, Cisco Systems, Inc. All rights reserved. -The copyrights to certain works contained herein are owned by -other third parties and are used and distributed under license. -Some parts of this software are covered under the GNU Public -License. A copy of the license is available at -http://www.gnu.org/licenses/gpl.html. - -Software - BIOS: version 3.6.0 - loader: version N/A - kickstart: version 5.2(1)N1(4) - system: version 5.2(1)N1(4) - power-seq: Module 1: version v1.0 - Module 3: version v5.0 - uC: version v1.2.0.1 - SFP uC: Module 1: v1.0.0.0 - BIOS compile time: 05/09/2012 - kickstart image file is: bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin - kickstart compile time: 3/19/2013 3:00:00 [03/19/2013 23:12:59] - system image file is: bootflash:///n5000-uk9.5.2.1.N1.4.bin - system compile time: 3/19/2013 3:00:00 [03/20/2013 01:10:47] - - -Hardware - cisco Nexus5548 Chassis ("O2 32X10GE/Modular Universal Platform Supervisor") - Intel(R) Xeon(R) CPU with 8263848 kB of memory. - Processor Board ID FOC171737PL - - Device name: DC2TESTSW01-55 - bootflash: 2007040 kB - -Kernel uptime is 311 day(s), 0 hour(s), 27 minute(s), 35 second(s) - -Last reset at 629197 usecs after Thu Dec 5 15:17:54 2019 - - Reason: Reset triggered due to HA policy of Reset - System version: 5.2(1)N1(4) - Service: __inst_001__eigrp hap reset - -plugin - Core Plugin, Ethernet Plugin diff --git a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml b/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml deleted file mode 100644 index 904e5047a9..0000000000 --- a/tests/cisco_nxos/show_version/cisco_nxos_show_version5.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -parsed_sample: - - uptime: "311 day(s), 0 hour(s), 27 minute(s), 35 second(s)" - last_reboot_reason: "Reset triggered due to HA policy of Reset" - os: "5.2(1)N1(4)" - boot_image: "bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin" - platform: "Nexus5548" - hostname: "DC2TESTSW01-55" - serial: "FOC171737PL" From d0ad229b98ae264187538044f4566ede2c35462c Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 20:47:17 +1300 Subject: [PATCH 09/13] cisco_nxos_show_version.textfsm revert IOS XE match but leave SERIAL --- templates/cisco_nxos_show_version.textfsm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index ee77c76b49..69198a90a2 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -1,14 +1,13 @@ -Value UPTIME ((\d+\s\w+(\(s\))?(,\s)?){4,5}) +Value UPTIME ((\d+\s\w+.s.,?\s?){4}) Value LAST_REBOOT_REASON (.+) -Value OS (\d+\..*) +Value OS (\d+.\d+(.+)?) Value BOOT_IMAGE (.*) -Value PLATFORM ([\w-]+) +Value PLATFORM (\w+) Value HOSTNAME (.*) Value SERIAL (\w+) - Start - ^\s*(NXOS:|system:|Cisco IOS XE Software,)\s+[Vv]ersion:?\s+${OS}$$ + ^\s+(NXOS: version|system:\s+version)\s+${OS}\s*$$ ^\s+(NXOS|kickstart)\s+image\s+file\s+is:\s+${BOOT_IMAGE}\s*$$ ^\s+cisco\s+${PLATFORM}\s+[cC]hassis ^\s+cisco\s+Nexus\d+\s+${PLATFORM} From 71864910ceb217b044d4c336c76147e917e88736 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 21:03:18 +1300 Subject: [PATCH 10/13] cisco_nxos_show_version.textfsm revert more of the unneccesary changes leaving only uptime. --- templates/cisco_nxos_show_version.textfsm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index 69198a90a2..7567428cb3 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -17,12 +17,5 @@ Start ^\s+cisco\s+.+-${PLATFORM}\s* # Nexus intel platform uses Board ID as serial/license ^\s*Processor\s[Bb]oard\sID\s+${SERIAL}$$ - ## Stack info 2nd switch - ^System Serial Number\s+:\s+${SERIAL}$$ -> Record - ^Kernel\s+uptime\s+is\s+${UPTIME}\s*$$ - ^Uptime\s+for\s+this\s+control\s+processor\s+is\s+${UPTIME}\s*$$ - ^${HOSTNAME}\s+uptime\s+is\s+${UPTIME}\s*$$ - # For nexus 2nd switch there is space behind uptime :() - ^Switch uptime\s+:\s${UPTIME}\s*$$ - ^\s*Model Number\s+:\s+${PLATFORM} - ^\s*(Reason:|Last reload reason:)\s${LAST_REBOOT_REASON} + ^Kernel\s+uptime\s+is\s+${UPTIME} + ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record \ No newline at end of file From f41cff4d4db63f8b3b1f732b89c15b38a80fecb1 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Fri, 23 Oct 2020 21:04:36 +1300 Subject: [PATCH 11/13] cisco_nxos_show_version.textfsm add missing newline at end of file --- templates/cisco_nxos_show_version.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cisco_nxos_show_version.textfsm b/templates/cisco_nxos_show_version.textfsm index 7567428cb3..890e785091 100755 --- a/templates/cisco_nxos_show_version.textfsm +++ b/templates/cisco_nxos_show_version.textfsm @@ -18,4 +18,4 @@ Start # Nexus intel platform uses Board ID as serial/license ^\s*Processor\s[Bb]oard\sID\s+${SERIAL}$$ ^Kernel\s+uptime\s+is\s+${UPTIME} - ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record \ No newline at end of file + ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record From 319e6b51c9d868b15c4f0dc3222fb9deb457849b Mon Sep 17 00:00:00 2001 From: Pieter Date: Mon, 16 Nov 2020 20:44:02 +1300 Subject: [PATCH 12/13] Update templates/cisco_nxos_show_cdp_neighbors_detail.textfsm accept review suggestion, match multiple spaces not just one. Co-authored-by: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> --- templates/cisco_nxos_show_cdp_neighbors_detail.textfsm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm b/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm index edfadff140..49e43e5ebd 100644 --- a/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm +++ b/templates/cisco_nxos_show_cdp_neighbors_detail.textfsm @@ -13,7 +13,7 @@ Start ^System Name: ${SYSNAME} ^Interface address\(es\): -> GetInterfaceIP ^Mgmt address\(es\): -> GetIP - ^Platform: ${PLATFORM}, Capabilities: ${CAPABILITIES}\s?$$ + ^Platform: ${PLATFORM}, Capabilities: ${CAPABILITIES}\s*$$ ^Interface: ${LOCAL_PORT}, Port ID \(outgoing port\): ${REMOTE_PORT} ^Version: -> GetVersion ^----- -> Record @@ -26,4 +26,3 @@ GetInterfaceIP GetVersion ^${VERSION} -> Start - From 36bb0fb6591a1d2db5c4fc675b70c66090f2a902 Mon Sep 17 00:00:00 2001 From: Pieter Date: Mon, 16 Nov 2020 20:44:52 +1300 Subject: [PATCH 13/13] Update templates/cisco_ios_show_ip_eigrp_neighbors.textfsm match multiple spaces not just one. Co-authored-by: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> --- templates/cisco_ios_show_ip_eigrp_neighbors.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm b/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm index 326de045ce..27bd2ee71f 100644 --- a/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm +++ b/templates/cisco_ios_show_ip_eigrp_neighbors.textfsm @@ -11,7 +11,7 @@ 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[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}(\)|)\sVRF default*$$ + ^\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*$$