forked from networktocode/ntc-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW TEMPLATE: Cisco IOS - show switch detail (networktocode#491)
- Loading branch information
1 parent
a7c4739
commit ffc56e7
Showing
7 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
16
templates/cisco_ios_show_switch_detail_stack_ports.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/cisco_ios/show_switch_detail/cisco_ios_show_switch_detail1.parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
13 changes: 13 additions & 0 deletions
13
tests/cisco_ios/show_switch_detail/cisco_ios_show_switch_detail1.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
33 changes: 33 additions & 0 deletions
33
tests/cisco_ios/show_switch_detail/cisco_ios_show_switch_detail2.parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
16 changes: 16 additions & 0 deletions
16
tests/cisco_ios/show_switch_detail/cisco_ios_show_switch_detail2.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |