Skip to content

Commit

Permalink
NEW TEMPLATE: Cisco IOS - show switch detail (networktocode#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgill298 authored and charlesmonson committed Oct 11, 2019
1 parent a7c4739 commit ffc56e7
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 0 deletions.
23 changes: 23 additions & 0 deletions templates/cisco_ios_show_switch_detail.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Value Key SWITCH (\d+)
Value ROLE (\w+)
Value MAC_ADDRESS (\S+)
Value PRIORITY (\d+)
Value VERSION (\S+)
Value STATE (.+?)

Start
^Switch/Stack
^\s+H/W\s+Current\s*$$
^Switch#\s+Role\s+Mac\s+Address\s+Priority\s+Version\s+State\s*$$
^\s*-+ -> Status
^\s*$$
^. -> Error

Status
^\*?\s*${SWITCH}\s+${ROLE}\s+${MAC_ADDRESS}\s+${PRIORITY}\s+${VERSION}\s+${STATE}\s*$$ -> Record
^\s*Stack\s+Port\s+Status -> Stack
^\s*$$
^. -> Error

Stack
^.
16 changes: 16 additions & 0 deletions templates/cisco_ios_show_switch_detail_stack_ports.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Value Key SWITCH (\d+)
Value STATUS1 (\w+)
Value STATUS2 (\w+)
Value NEIGHBOR1 (\w+)
Value NEIGHBOR2 (\w+)


Start
^\s*Stack\s+Port\s+Status\s+Neighbors\s*$$ -> Stack

Stack
^\s*Switch#\s+Port\s+1\s+Port\s+2\s+Port\s+1\s+Port\s+2\s*$$
^-+$$
^\s*${SWITCH}\s+${STATUS1}\s+${STATUS2}\s+${NEIGHBOR1}\s+${NEIGHBOR2}\s*$$ -> Record
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ cisco_asa_show_name.template, .*, cisco_asa, sh[[ow]] nam[[e]]
cisco_asa_show_nat.template, .*, cisco_asa, sh[[ow]] nat
cisco_asa_dir.template, .*, cisco_asa, dir

cisco_ios_show_switch_detail.template:cisco_ios_show_switch_detail_stack_ports.template, .*, cisco_ios, sh[[ow]] sw[[itch]] d[[etail]]
cisco_ios_show_running-config_partition_access-list.template, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] a[[ccess-list]]
cisco_ios_show_running-config_partition_route-map.template, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] route-[[map]]
cisco_ios_show_capability_feature_routing.template, .*, cisco_ios, sh[[ow]] cap[[ability]] f[[eature]] r[[outing]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
parsed_sample:

- switch: "1"
role: "Master"
mac_address: "a0e0.af1d.bb80"
priority: "1"
version: "3"
state: "Ready"
status1: "Down"
status2: "Down"
neighbor1: "None"
neighbor2: "None"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Switch/Stack Mac Address : a0e0.af1d.bb80
H/W Current
Switch# Role Mac Address Priority Version State
----------------------------------------------------------
*1 Master a0e0.af1d.bb80 1 3 Ready



Stack Port Status Neighbors
Switch# Port 1 Port 2 Port 1 Port 2
--------------------------------------------------------
1 Down Down None None

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
parsed_sample:

- switch: "1"
role: "Master"
mac_address: "4c4e.3573.ac00"
priority: "15"
version: "3"
state: "Ready"
status1: "Ok"
status2: "Ok"
neighbor1: "3"
neighbor2: "2"
- switch: "2"
role: "Member"
mac_address: "4c4e.3573.7b00"
priority: "8"
version: "3"
state: "Ready"
status1: "Ok"
status2: "Ok"
neighbor1: "1"
neighbor2: "3"
- switch: "3"
role: "Member"
mac_address: "4c4e.3573.ac80"
priority: "7"
version: "3"
state: "Ready"
status1: "Ok"
status2: "Ok"
neighbor1: "2"
neighbor2: "1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Switch/Stack Mac Address : 4c4e.3573.ac00
H/W Current
Switch# Role Mac Address Priority Version State
----------------------------------------------------------
*1 Master 4c4e.3573.ac00 15 3 Ready
2 Member 4c4e.3573.7b00 8 3 Ready
3 Member 4c4e.3573.ac80 7 3 Ready



Stack Port Status Neighbors
Switch# Port 1 Port 2 Port 1 Port 2
--------------------------------------------------------
1 Ok Ok 3 2
2 Ok Ok 1 3
3 Ok Ok 2 1

0 comments on commit ffc56e7

Please # to comment.