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

Find MAC addresses in cisco IOS show version. #214

Merged
merged 6 commits into from
Jan 21, 2019
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
4 changes: 3 additions & 1 deletion templates/cisco_ios_show_version.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Value RUNNING_IMAGE (\S+)
Value List HARDWARE (\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.*
Expand All @@ -17,11 +18,12 @@ Start
^[Pp]rocessor\s+board\s+ID\s+${SERIAL}
^[Cc]isco\s+${HARDWARE}.+
^[Cc]onfiguration\s+register\s+is\s+${CONFIG_REGISTER}
^Base [Ee]thernet MAC [Aa]ddress\s+:\s+${MAC}
^Switch Port -> Stack


Stack
^[Ss]ystem [Ss]erial [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}
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ parsed_sample:
serial:
- 'CAT1451S15C'
config_register: '0x2102'
mac: []
25 changes: 25 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version1.parsed
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
parsed_sample:

- version: '03.06.05E'
rommon: 'IOS-XE'
hostname: 'city-building-4-sw'
uptime: '28 weeks, 1 day, 7 hours, 54 minutes'
reload_reason: 'Reload Command'
running_image: 'packages.conf'
hardware:
- 'WS-C3850-48U'
- 'WS-C3850-48U'
- 'WS-C3850-48U'
- 'WS-C3850-48U'
serial:
- 'FOC11111111'
- 'FCW22222222'
- 'FCW33333333'
- 'FCW44444444'
config_register: '0x102'
mac:
- 'f8:7b:20:11:aa:80'
- 'f8:7b:20:22:bb:80'
- 'f8:b7:e2:33:cc:00'
- 'f8:b7:e2:44:dd:00'
123 changes: 123 additions & 0 deletions tests/cisco_ios/show_version/cisco_ios_show_version1.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
Cisco IOS Software, IOS-XE Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 03.06.05E RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Thu 02-Jun-16 09:03 by prod_rel_team



Cisco IOS-XE software, Copyright (c) 2005-2015 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.
(http://www.gnu.org/licenses/gpl-2.0.html) 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: CAT3K_CAA Boot Loader (CAT3K_CAA-HBOOT-M) Version 3.58, RELEASE SOFTWARE (P)

city-building-4-sw uptime is 28 weeks, 1 day, 7 hours, 54 minutes
Uptime for this control processor is 28 weeks, 1 day, 8 hours, 0 minutes
System returned to ROM by reload at 04:39:28 AEDT Wed Nov 22 2017
System restarted at 05:00:08 AEDT Wed Nov 22 2017
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.

License Level: Ipbase
License Type: Permanent
Next reload license Level: Ipbase

cisco WS-C3850-48U (MIPS) processor with 4194304K bytes of physical memory.
Processor board ID FOC11111111
2 Virtual Ethernet interfaces
208 Gigabit Ethernet interfaces
16 Ten Gigabit Ethernet interfaces
2048K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
250456K bytes of Crash Files at crashinfo:.
250456K bytes of Crash Files at crashinfo-2:.
252000K bytes of Crash Files at crashinfo-3:.
252000K bytes of Crash Files at crashinfo-4:.
1609272K bytes of Flash at flash:.
1609272K bytes of Flash at flash-2:.
1611414K bytes of Flash at flash-3:.
1611414K bytes of Flash at flash-4:.
0K bytes of Dummy USB Flash at usbflash0:.
0K bytes of Dummy USB Flash at usbflash0-2:.
0K bytes of Dummy USB Flash at usbflash0-3:.
0K bytes of Dummy USB Flash at usbflash0-4:.
0K bytes of at webui:.

Base Ethernet MAC Address : f8:7b:20:11:aa:80
Motherboard Assembly Number : 73-15799-08
Motherboard Serial Number : FOC11122222
Model Revision Number : AB0
Motherboard Revision Number : A0
Model Number : WS-C3850-48U
System Serial Number : FOC11111111


Switch Ports Model SW Version SW Image Mode
------ ----- ----- ---------- ---------- ----
* 1 56 WS-C3850-48U 03.06.05E cat3k_caa-universalk9 INSTALL
2 56 WS-C3850-48U 03.06.05E cat3k_caa-universalk9 INSTALL
3 56 WS-C3850-48U 03.06.05E cat3k_caa-universalk9 INSTALL
4 56 WS-C3850-48U 03.06.05E cat3k_caa-universalk9 INSTALL


Switch 02
---------
Switch uptime : 28 weeks, 1 day, 8 hours, 1 minute
Base Ethernet MAC Address : f8:7b:20:22:bb:80
Motherboard Assembly Number : 73-15799-08
Motherboard Serial Number : FOC22222222
Model Revision Number : AB0
Motherboard Revision Number : A0
Model Number : WS-C3850-48U
System Serial Number : FCW22222222

Switch 03
---------
Switch uptime : 28 weeks, 1 day, 8 hours, 0 minutes
Base Ethernet MAC Address : f8:b7:e2:33:cc:00
Motherboard Assembly Number : 73-15799-08
Motherboard Serial Number : FOC33333333
Model Revision Number : AB0
Motherboard Revision Number : A0
Model Number : WS-C3850-48U
System Serial Number : FCW33333333

Switch 04
---------
Switch uptime : 28 weeks, 1 day, 8 hours, 0 minutes
Base Ethernet MAC Address : f8:b7:e2:44:dd:00
Motherboard Assembly Number : 73-15799-08
Motherboard Serial Number : FOC44444444
Model Revision Number : AB0
Motherboard Revision Number : A0
Model Number : WS-C3850-48U
System Serial Number : FCW44444444

Configuration register is 0x102
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ parsed_sample:
serial:
- 'SSI1289001MH'
config_register: '0x2102'
mac: []