Skip to content

Commit

Permalink
Enhancement: ASA - Convert show version serial to list (networktocode…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgill298 authored and thomasblass committed Oct 25, 2020
1 parent 7a048e3 commit eca2f43
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 52 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## [1.2.1]
### Fixed for any bug fixes
- [#497] ASA show version: Fix `MAX_INTF` to account for `Unlimited`
- [#497] ASA show version: Fix `HARDWARE` to properly handle trailing commas
### Added for new features
### Changed for changes in existing functionality
- [#497] ASA show version: Change `SERIAL` to be a list for clusters
### Deprecated for soon-to-be removed features
### Removed for now removed features

Expand Down
11 changes: 5 additions & 6 deletions templates/cisco_asa_show_version.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Value COMPILE_DATE (\d+-\w+-\d+)
Value IMAGE (\S+)
Value HOSTNAME (\S+)
Value UPTIME (.+)
Value HARDWARE (.+)
Value HARDWARE (.+?)
Value MODEL (\S+)
Value FLASH (\S+)
Value List INTERFACES (\S+)
Value LICENSE_MODE (.+)
Value LICENSE_STATE (.+)
Value MAX_INTF (\d+)
Value MAX_INTF (\S+)
Value MAX_VLANS (\d+)
Value FAILOVER (\S+)
Value CLUSTER (\S+)
Value SERIAL (\S+)
Value List SERIAL (\S+)
Value LAST_MOD (.+)

Start
Expand All @@ -23,11 +23,10 @@ Start
^Compiled\s+on\s+\w+\s+${COMPILE_DATE}.*
^System image file.+"${IMAGE}"
^${HOSTNAME} up ${UPTIME}
^Hardware:\s+${HARDWARE},
^Hardware:\s+${HARDWARE}
^Hardware:\s+${HARDWARE},?\s*$$
^Model Id:\s+${MODEL}
^Internal.+Flash,\s${FLASH}
^ \d+:.\S+\s${INTERFACES}.*
^\s*\d+:.\S+\s*${INTERFACES}.*
^License mode:\s${LICENSE_MODE}
^.+License State:\s${LICENSE_STATE}
^Maximum Physical.+:\s${MAX_INTF}
Expand Down
54 changes: 27 additions & 27 deletions tests/cisco_asa/show_version/cisco_asa_show_version1.parsed
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
---
parsed_sample:

- version: '9.5(2)204'
device_mgr_version: '7.5(2)'
compile_date: '15-Feb-16'
image: 'boot:/asa952-204-smp-k8.bin'
hostname: 'asa1'
uptime: '41 days 19 hours'
hardware: 'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz'
model: 'ASAv10'
flash: '8192MB'
interfaces:
- 'Management0/0'
- 'GigabitEthernet0/0'
- 'GigabitEthernet0/1'
- 'GigabitEthernet0/2'
- 'GigabitEthernet0/3'
- 'GigabitEthernet0/4'
- 'GigabitEthernet0/5'
- 'GigabitEthernet0/6'
license_mode: 'Smart Licensing'
license_state: 'Unlicensed'
max_intf: '10'
max_vlans: '50'
failover: 'Active/Standby'
cluster: 'Disabled'
serial: '9AT1L9EX0DF'
last_mod: 'ntc at 18:56:48.410 UTC Wed Apr 5 2017'
- version: "9.5(2)204"
device_mgr_version: "7.5(2)"
compile_date: "15-Feb-16"
image: "boot:/asa952-204-smp-k8.bin"
hostname: "asa1"
uptime: "41 days 19 hours"
hardware: "ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz"
model: "ASAv10"
flash: "8192MB"
interfaces:
- "Management0/0"
- "GigabitEthernet0/0"
- "GigabitEthernet0/1"
- "GigabitEthernet0/2"
- "GigabitEthernet0/3"
- "GigabitEthernet0/4"
- "GigabitEthernet0/5"
- "GigabitEthernet0/6"
license_mode: "Smart Licensing"
license_state: "Unlicensed"
max_intf: "10"
max_vlans: "50"
failover: "Active/Standby"
cluster: "Disabled"
serial:
- "9AT1L9EX0DF"
last_mod: "ntc at 18:56:48.410 UTC Wed Apr 5 2017"
37 changes: 18 additions & 19 deletions tests/cisco_asa/show_version/cisco_asa_show_version2.parsed
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
parsed_sample:

- version: '9.8(3)21'
device_mgr_version: '7.8(2)'
compile_date: '07-Aug-18'
image: ''
hostname: 'fw002'
uptime: '114 days 18 hours'
hardware: 'FPR4K-SM-12'
model: ''
flash: ''
interfaces: []
license_mode: 'Smart Licensing'
license_state: ''
max_intf: ''
max_vlans: ''
failover: 'Active/Active'
cluster: 'Enabled'
serial: ''
last_mod: 'thatperson at 09:15:45.959 EST Mon Dec 12 2018'
- version: "9.8(3)21"
device_mgr_version: "7.8(2)"
compile_date: "07-Aug-18"
image: ""
hostname: "fw002"
uptime: "114 days 18 hours"
hardware: "FPR4K-SM-12"
model: ""
flash: ""
interfaces: []
license_mode: "Smart Licensing"
license_state: ""
max_intf: ""
max_vlans: ""
failover: "Active/Active"
cluster: "Enabled"
serial: []
last_mod: "thatperson at 09:15:45.959 EST Mon Dec 12 2018"
35 changes: 35 additions & 0 deletions tests/cisco_asa/show_version/cisco_asa_show_version3.parsed
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
parsed_sample:
- version: "9.9(2)32"
device_mgr_version: "7.9(1)151"
compile_date: "05-Nov-18"
image: "disk0:/asa992-32-lfbff-k8.SPA"
hostname: "ASA2"
uptime: "55 days 9 hours"
hardware: "ASA5516, 8192 MB RAM, CPU Atom C2000 series 2416 MHz, 1 CPU (8 cores)"
model: ""
flash: "8000MB"
interfaces:
- "GigabitEthernet1/1"
- "GigabitEthernet1/2"
- "GigabitEthernet1/3"
- "GigabitEthernet1/4"
- "GigabitEthernet1/5"
- "GigabitEthernet1/6"
- "GigabitEthernet1/7"
- "GigabitEthernet1/8"
- "Internal-Data1/1"
- "Internal-Data1/2"
- "Internal-Control1/1"
- "Internal-Data1/3"
- "Management1/1"
- "Internal-Data1/4"
license_mode: ""
license_state: ""
max_intf: "Unlimited"
max_vlans: "150"
failover: "Active/Active"
cluster: "Enabled"
serial:
- "JAD222605K8"
last_mod: "xxx at 17:31:04.576 CDT Mon Aug 12 2019"
84 changes: 84 additions & 0 deletions tests/cisco_asa/show_version/cisco_asa_show_version3.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
Cisco Adaptive Security Appliance Software Version 9.9(2)32
Firepower Extensible Operating System Version 2.3(1.121)
Device Manager Version 7.9(1)151

Compiled on Mon 05-Nov-18 13:32 PST by builders
System image file is "disk0:/asa992-32-lfbff-k8.SPA"
Config file at boot was "startup-config"

ASA2 up 55 days 9 hours
failover cluster up 87 days 15 hours

Hardware: ASA5516, 8192 MB RAM, CPU Atom C2000 series 2416 MHz, 1 CPU (8 cores)
Internal ATA Compact Flash, 8000MB
BIOS Flash M25P64 @ 0xfed01000, 16384KB

Encryption hardware device : Cisco ASA Crypto on-board accelerator (revision 0x1)
Number of accelerators: 1

1: Ext: GigabitEthernet1/1 : address is 7872.5dce.e58c, irq 255
2: Ext: GigabitEthernet1/2 : address is 7872.5dce.e58d, irq 255
3: Ext: GigabitEthernet1/3 : address is 7872.5dce.e58e, irq 255
4: Ext: GigabitEthernet1/4 : address is 7872.5dce.e58f, irq 255
5: Ext: GigabitEthernet1/5 : address is 7872.5dce.e590, irq 255
6: Ext: GigabitEthernet1/6 : address is 7872.5dce.e591, irq 255
7: Ext: GigabitEthernet1/7 : address is 7872.5dce.e592, irq 255
8: Ext: GigabitEthernet1/8 : address is 7872.5dce.e593, irq 255
9: Int: Internal-Data1/1 : address is 7872.5dce.e58b, irq 255
10: Int: Internal-Data1/2 : address is 0000.0001.0002, irq 0
11: Int: Internal-Control1/1 : address is 0000.0001.0001, irq 0
12: Int: Internal-Data1/3 : address is 0000.0001.0003, irq 0
13: Ext: Management1/1 : address is 7872.5dce.e58b, irq 0
14: Int: Internal-Data1/4 : address is 0000.0100.0001, irq 0

Licensed features for this platform:
Maximum Physical Interfaces : Unlimited perpetual
Maximum VLANs : 150 perpetual
Inside Hosts : Unlimited perpetual
Failover : Active/Active perpetual
Encryption-DES : Enabled perpetual
Encryption-3DES-AES : Enabled perpetual
Security Contexts : 2 perpetual
Carrier : Disabled perpetual
AnyConnect Premium Peers : 4 perpetual
AnyConnect Essentials : Disabled perpetual
Other VPN Peers : 300 perpetual
Total VPN Peers : 300 perpetual
AnyConnect for Mobile : Disabled perpetual
AnyConnect for Cisco VPN Phone : Disabled perpetual
Advanced Endpoint Assessment : Disabled perpetual
Shared License : Disabled perpetual
Total TLS Proxy Sessions : 1000 perpetual
Botnet Traffic Filter : Disabled perpetual
Cluster : Enabled perpetual
Cluster Members : 2 perpetual
VPN Load Balancing : Enabled perpetual


Failover cluster licensed features for this platform:
Maximum Physical Interfaces : Unlimited perpetual
Maximum VLANs : 150 perpetual
Inside Hosts : Unlimited perpetual
Failover : Active/Active perpetual
Encryption-DES : Enabled perpetual
Encryption-3DES-AES : Enabled perpetual
Security Contexts : 4 perpetual
Carrier : Disabled perpetual
AnyConnect Premium Peers : 8 perpetual
AnyConnect Essentials : Disabled perpetual
Other VPN Peers : 300 perpetual
Total VPN Peers : 300 perpetual
AnyConnect for Mobile : Disabled perpetual
AnyConnect for Cisco VPN Phone : Disabled perpetual
Advanced Endpoint Assessment : Disabled perpetual
Shared License : Disabled perpetual
Total TLS Proxy Sessions : 1000 perpetual
Botnet Traffic Filter : Disabled perpetual
Cluster : Enabled perpetual
VPN Load Balancing : Enabled perpetual

Serial Number: JAD222605K8
Configuration register is 0x1
Image type : Release
Key Version : A
Configuration last modified by xxx at 17:31:04.576 CDT Mon Aug 12 2019

0 comments on commit eca2f43

Please sign in to comment.