Skip to content
New issue

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

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

Already on GitHub? # to your account

Updates to include capture on single word, no number model number #781

Merged
merged 1 commit into from
Jul 20, 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
12 changes: 6 additions & 6 deletions templates/cisco_ios_show_version.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ Value HOSTNAME (\S+)
Value UPTIME (.+)
Value RELOAD_REASON (.+?)
Value RUNNING_IMAGE (\S+)
Value List HARDWARE (\S+\d\S+)
Value List HARDWARE (\S+|\S+\d\S+)
Value List SERIAL (\S+)
Value CONFIG_REGISTER (\S+)
Value List MAC ([0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5})

Start
^.*Software\s.+\),\sVersion\s${VERSION},*\s+RELEASE.*
^ROM: ${ROMMON}
^ROM:\s+${ROMMON}
^\s*${HOSTNAME}\s+uptime\s+is\s+${UPTIME}
^[sS]ystem\s+image\s+file\s+is\s+"(.*?):${RUNNING_IMAGE}"
^(?:[lL]ast\s+reload\s+reason:|System\s+returned\s+to\s+ROM\s+by)\s+${RELOAD_REASON}\s*$$
^[Pp]rocessor\s+board\s+ID\s+${SERIAL}
^[Cc]isco\s+${HARDWARE}.+
^[Cc]isco\s+${HARDWARE}\s+\(.+\).+
^[Cc]onfiguration\s+register\s+is\s+${CONFIG_REGISTER}
^Base [Ee]thernet MAC [Aa]ddress\s+:\s+${MAC}
^Switch Port -> Stack
^Base\s+[Ee]thernet\s+MAC\s+[Aa]ddress\s+:\s+${MAC}
^Switch\s+Port -> Stack
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is


Stack
^[Ss]ystem [Ss]erial [Nn]umber\s+:\s+${SERIAL}
^[Ss]ystem\s+[Ss]erial\s+[Nn]umber\s+:\s+${SERIAL}
^[Mm]odel\s+[Nn]umber\s+:\s+${HARDWARE}\s*
^[Cc]onfiguration\s+register\s+is\s+${CONFIG_REGISTER}
^Base [Ee]thernet MAC [Aa]ddress\s+:\s+${MAC}
43 changes: 43 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version3.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.8(3)M2, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Thu 28-Mar-19 14:06 by prod_rel_team


ROM: Bootstrap program is IOSv

rtr-01 uptime is 1 week, 3 days, 16 hours, 11 minutes
System returned to ROM by reload
System image file is "flash0:/vios-adventerprisek9-m"
Last reload reason: Unknown reason



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.

Cisco IOSv (revision 1.0) with with 460137K/62464K bytes of memory.
Processor board ID 991UCMIHG4UAJ1J010CQG
4 Gigabit Ethernet interfaces
DRAM configuration is 72 bits wide with parity disabled.
256K bytes of non-volatile configuration memory.
2097152K bytes of ATA System CompactFlash 0 (Read/Write)
0K bytes of ATA CompactFlash 1 (Read/Write)
11217K bytes of ATA CompactFlash 2 (Read/Write)
0K bytes of ATA CompactFlash 3 (Read/Write)



Configuration register is 0x0
14 changes: 14 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- version: "15.8(3)M2"
rommon: "Bootstrap"
hostname: "rtr-01"
uptime: "1 week, 3 days, 16 hours, 11 minutes"
reload_reason: "Unknown reason"
running_image: "/vios-adventerprisek9-m"
hardware:
- "IOSv"
serial:
- "991UCMIHG4UAJ1J010CQG"
config_register: "0x0"
mac: []