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

Fix#788 ios show int fc #839

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 13 additions & 4 deletions templates/cisco_ios_show_interfaces_status.textfsm
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
Value PORT (\S+)
Value NAME (.+?)
Value STATUS (err-disabled|disabled|connected|notconnect|inactive)
Value STATUS (err-disabled|disabled|connected|notconnect|inactive|up|down)
Value VLAN (\S+)
Value DUPLEX (\S+)
Value SPEED (\S+)
Value TYPE (.*)
Value MODE (\S+)
diepes marked this conversation as resolved.
Show resolved Hide resolved

Start
^Port -> Begin
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
# Capture time-stamp if vty line has command time-stamping turned on
^Time\s+source\s+is
^-{50,99}\s*$$
diepes marked this conversation as resolved.
Show resolved Hide resolved
^Port\s+Name\s+Status\s+Vlan\s+Duplex\s+Speed\s+Type -> Interfaces
^\s*$$
^.* -> Error
diepes marked this conversation as resolved.
Show resolved Hide resolved

Begin
Interfaces
#Match fc...
^\s*${PORT}\s+is\s+${STATUS}\s+Port\s+mode\s+is\s+${MODE}\s*$$ -> Record
^\s*${PORT}\s+${STATUS}\s+${VLAN}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}$$ -> Record
^\s*${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}$$ -> Record
^-{50,99}\s*$$
diepes marked this conversation as resolved.
Show resolved Hide resolved
^\s*$$
^.* -> Error
diepes marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,129 +7,148 @@ parsed_sample:
duplex: "auto"
speed: "auto"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/2"
name: "AccessPoint"
status: "connected"
vlan: "8"
duplex: "a-full"
speed: "a-1000"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/3"
name: "John's Office"
status: "notconnect"
vlan: "1"
duplex: "auto"
speed: "auto"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/4"
name: "SingleName"
status: "connected"
vlan: "1"
duplex: "a-full"
speed: "a-100"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/5"
name: "Dashed-Name"
status: "connected"
vlan: "1000"
duplex: "a-full"
speed: "a-1000"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/6"
name: "Spaced Example"
status: "connected"
vlan: "8"
duplex: "a-full"
speed: "a-100"
type: "10/100/1000BaseTX"
mode: ""
- port: "Gi1/0/7"
name: "Trunk Example"
status: "connected"
vlan: "trunk"
duplex: "a-full"
speed: "a-1000"
type: "1000BaseSX SFP"
mode: ""
- port: "Gi1/0/8"
name: "SFP Not Present"
status: "notconnect"
vlan: "1"
duplex: "auto"
speed: "auto"
type: "Not Present"
mode: ""
- port: "Gi1/0/9"
name: "SFP Not Present"
status: "notconnect"
vlan: "1"
duplex: "auto"
speed: "auto"
type: "Not Present"
mode: ""
- port: "Gi1/0/10"
name: "Management"
status: "notconnect"
vlan: "routed"
duplex: "auto"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/11"
name: "2960S Port"
status: "notconnect"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/12"
name: "Half Duplex 2950"
status: "notconnect"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/13"
name: "Half Duplex 2950-S"
status: "notconnect"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/14"
name: "Half Duplex 2950-S"
status: "notconnect"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "Not Present"
mode: ""
- port: "Gi1/0/15"
name: "Multi Space to the"
status: "notconnect"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/16"
name: "Multi Space to the"
status: "err-disabled"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Gi1/0/17"
name: "Multi Space"
status: "disabled"
vlan: "16"
duplex: "a-half"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Fa1/6"
name: "test"
status: "notconnect"
vlan: "1"
duplex: "auto"
speed: "auto"
type: "10/100BaseTX"
mode: ""
- port: "Po1"
name: "ethchl"
status: "connected"
vlan: "trunk"
duplex: "a-full"
speed: "a-1000"
type: ""
mode: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

--------------------------------------------------------------------------------
Port Name Status Vlan Duplex Speed Type
--------------------------------------------------------------------------------
fc2/1 is up Port mode is NP
fc2/2 is up Port mode is NP
fc2/3 is up Port mode is NP
fc2/4 is up Port mode is NP
fc2/5 is down (SFP not present)
diepes marked this conversation as resolved.
Show resolved Hide resolved
fc2/6 is down (SFP not present)
Eth1/1 XXXXXXX1_bond1_Act connected 111 full 1000 SFP-1000BAS
Eth1/2 XXXXXXX3_bond1_Act connected 112 full 1000 SFP-1000BAS
Eth1/3 YYYYYYYY1_ha1 connected 115 full 1000 SFP-1000BAS
Eth1/4 ZZZZZZZZZZZZZ1_tru connected trunk full 10G 10Gbase-SR
Eth1/5 ZZZZZZZZZZZZZ1_tru connected trunk full 10G 10Gbase-SR
Eth1/6 AAAAAAAAA1_po2 connected trunk full 1000 SFP-1000BAS
Eth1/7 BBBBBBBB10-1 connected 4093 full 10G Fabric Exte
Eth1/8 BBBBBBBB10-1 connected 4093 full 10G Fabric Exte
Eth1/9 BBBBBBBB11-1 connected 4093 full 10G Fabric Exte
Eth1/10 BBBBBBBB11-1 connected 4093 full 10G Fabric Exte
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
parsed_sample:
- port: "fc2/1"
name: ""
status: "up"
vlan: ""
duplex: ""
speed: ""
type: ""
mode: "NP"
- port: "fc2/2"
name: ""
status: "up"
vlan: ""
duplex: ""
speed: ""
type: ""
mode: "NP"
- port: "fc2/3"
name: ""
status: "up"
vlan: ""
duplex: ""
speed: ""
type: ""
mode: "NP"
- port: "fc2/4"
name: ""
status: "up"
vlan: ""
duplex: ""
speed: ""
type: ""
mode: "NP"
- port: "fc2/5"
name: "is"
status: "down"
vlan: "(SFP"
duplex: "not"
speed: "present)"
type: ""
mode: ""
- port: "fc2/6"
name: "is"
status: "down"
vlan: "(SFP"
duplex: "not"
speed: "present)"
type: ""
mode: ""
- port: "Eth1/1"
name: "XXXXXXX1_bond1_Act"
status: "connected"
vlan: "111"
duplex: "full"
speed: "1000"
type: "SFP-1000BAS"
mode: ""
- port: "Eth1/2"
name: "XXXXXXX3_bond1_Act"
status: "connected"
vlan: "112"
duplex: "full"
speed: "1000"
type: "SFP-1000BAS"
mode: ""
- port: "Eth1/3"
name: "YYYYYYYY1_ha1"
status: "connected"
vlan: "115"
duplex: "full"
speed: "1000"
type: "SFP-1000BAS"
mode: ""
- port: "Eth1/4"
name: "ZZZZZZZZZZZZZ1_tru"
status: "connected"
vlan: "trunk"
duplex: "full"
speed: "10G"
type: "10Gbase-SR"
mode: ""
- port: "Eth1/5"
name: "ZZZZZZZZZZZZZ1_tru"
status: "connected"
vlan: "trunk"
duplex: "full"
speed: "10G"
type: "10Gbase-SR"
mode: ""
- port: "Eth1/6"
name: "AAAAAAAAA1_po2"
status: "connected"
vlan: "trunk"
duplex: "full"
speed: "1000"
type: "SFP-1000BAS"
mode: ""
- port: "Eth1/7"
name: "BBBBBBBB10-1"
status: "connected"
vlan: "4093"
duplex: "full"
speed: "10G"
type: "Fabric Exte"
mode: ""
- port: "Eth1/8"
name: "BBBBBBBB10-1"
status: "connected"
vlan: "4093"
duplex: "full"
speed: "10G"
type: "Fabric Exte"
mode: ""
- port: "Eth1/9"
name: "BBBBBBBB11-1"
status: "connected"
vlan: "4093"
duplex: "full"
speed: "10G"
type: "Fabric Exte"
mode: ""
- port: "Eth1/10"
name: "BBBBBBBB11-1"
status: "connected"
vlan: "4093"
duplex: "full"
speed: "10G"
type: "Fabric Exte"
mode: ""