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

cisco_nxos_show_interface_brief does not deal with pvlan and fabric interfaces #472

Closed
htr2 opened this issue Sep 23, 2019 · 0 comments · Fixed by #479
Closed

cisco_nxos_show_interface_brief does not deal with pvlan and fabric interfaces #472

htr2 opened this issue Sep 23, 2019 · 0 comments · Fixed by #479

Comments

@htr2
Copy link

htr2 commented Sep 23, 2019

ISSUE TYPE
  • Bug Report
TEMPLATE USING

Value INTERFACE ([\w+/]+)
Value VRF (\S+)
Value STATUS (up|down)
Value IP (\d+.\d+.\d+.\d+)
Value SPEED (\S+)
Value MTU (\d+)
Value VLAN ([\d+--]+)
Value TYPE (\S+)
Value MODE (routed|access|trunk)
Value REASON (\S+((\s\w+)+)?)
Value PORTCH (\S+)
Value DESCRIPTION (\S+((\s\w+)+)?)

Start
^Port\s+VRF\s+Status\s+IP\s+Address\s+Speed\s+MTU -> Management
^Interface\s+Ch\s+ -> Ethernet
^Interface\s+Status\s+Description -> Loopback
^Interface\s+Secondary\s+VLAN(Type)\s+Status\s+Reason -> VLAN

Management
^${INTERFACE}\s+${VRF}\s+${STATUS}\s+${IP}\s+${SPEED}\s+${MTU} -> Record
^Ethernet\s+VLAN\s+Type\s+Mode\s+Status\s+Reason\s+Speed\s+Port -> Start

Ethernet
^${INTERFACE}\s+${VLAN}\s+${TYPE}\s+${MODE}\s+${STATUS}\s+${REASON}\s+${SPEED}\s+${PORTCH} -> Record
^Interface\s+Status\s+Description -> Start

Loopback
^${INTERFACE}\s+${STATUS}\s+${DESCRIPTION} -> Record
^Interface\s+Secondary\s+VLAN(Type)\s+Status\s+Reason -> Start

VLAN
^${INTERFACE}\s+${TYPE}\s+${STATUS}\s+${REASON} -> Record

SAMPLE COMMAND OUTPUT

sh int brief | i pvlan

Eth108/1/8 1 eth pvlan down Link not connected 1000(D) --
Eth116/1/4 1 eth pvlan up none 1000(D) --
....

sh int brief | i fabric
Eth1/1 1 eth fabric up none 10G(D) 125
Eth1/2 1 eth fabric up none 10G(D) 125
....

sh int brief | i fabric
Eth107/1/30 911 eth access up none 1000(D) --
Eth107/1/31 1102 eth trunk up none 1000(D) --

SUMMARY

The template file cisco_nxos_show_interface_brief does not cover all the possible options (admitted fabric and pvlan are rather legacy)

for me seem to work was to add pvlan and fabric (fex fabric) to Value MODE (routed|access|trunk) as such:
Value MODE (routed|access|trunk|pvlan|fabric)

STEPS TO REPRODUCE

output = """
... --------------------------------------------------------------------------------
... Ethernet VLAN Type Mode Status Reason Speed Port
... Interface Ch #
... --------------------------------------------------------------------------------
... Eth1/36 1 eth fabric up none 10G(D) 127
... Eth1/37 1 eth fabric up none 10G(D) 128
... Eth1/38 1 eth fabric up none 10G(D) 128
... Eth1/39 1 eth fabric down Administratively down 10G(D) --
... Eth1/40 1 eth fabric down Administratively down 10G(D) --
... Eth1/41 1 eth fabric up none 10G(D) 130
... Eth1/42 1 eth fabric up none 10G(D) 130
... Eth1/43 1 eth fabric up none 10G(D) 131
... Eth1/44 1 eth fabric up none 10G(D) 131
... Eth1/45 1 eth trunk up none 10G(D) 202
... Eth1/46 1 eth trunk up none 10G(D) 200
... Eth1/47 1 eth fabric up none 10G(D) 124
... Eth1/48 1 eth fabric up none 10G(D) 124
... Eth131/1/1 702 eth pvlan down Link not connected 1000(D) --
... Eth131/1/2 1 eth pvlan down Link not connected 1000(D) --
... Eth131/1/3 1 eth pvlan down Link not connected 1000(D) --
... Eth131/1/4 1 eth pvlan down Link not connected 1000(D) --
... Eth131/1/6 1 eth pvlan down Link not connected 1000(D) --
... """

parsed = parse_output(platform="cisco_nxos", command="show interface brief", data=output)
pprint(parsed)
[
{
'interface': 'Eth1/45',
'vrf': '',
'status': 'up',
'ip': '',
'speed': '10G(D)',
'mtu': '',
'vlan': '1',
'type': 'eth',
'mode': 'trunk',
'reason': 'none',
'portch': '202',
'description': ''
},
{
'interface': 'Eth1/46',
'vrf': '',
'status': 'up',
'ip': '',
'speed': '10G(D)',
'mtu': '',
'vlan': '1',
'type': 'eth',
'mode': 'trunk',
'reason': 'none',
'portch': '200',
'description': ''
}
]

EXPECTED RESULTS

structured data for all port types including pvlan and fabric

ACTUAL RESULTS

structured data for known port types: routed|access|trunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant