cancel
Showing results for 
Search instead for 
Did you mean: 

XOS show vlan portinfo

XOS show vlan portinfo

Thomas_J_Egger
New Contributor II
Hi all,

are there any plans to implement the command into XOS?

_ToM
28 REPLIES 28

Hey Brian, Welcome to the Hub and EXOS.

Here's an EXOS quick start guide....in case you haven't seen it:
http://learn.extremenetworks.com/rs/extreme/images/Extreme-Networks-Deployment-Jumpstart.pdf

Also, here's a link to GTAC Knowledge.
https://gtacknowledge.extremenetworks.com

There are quite a few articles to help with scripting, etc.

And of course, you've hit on one of the most valuable troubleshooting tools...our community!

You'll find the community is very quick to jump in and help. Really glad you joined us.

Hi Brian,

Dave's script is written in Python, which was initially supported in EXOS 15.6. Unfortunately, the X450a/e switches can only run up to EXOS 15.3, so they will not run Python scripts.

You can do TCL scripting in all versions of EXOS, but I am not sure if there is a TCL version of this script.

-Brandon

Dave_Hammers
Extreme Employee
Came across this while searching for a posting in the Hub. Below is a quick script that sounds like what you wanted.

Starting with 15.6.2 or 15.7.1, you could use the following script:
#!/usr/bin/env python
import exsh
import json

FORMAT = '{prt:<8.8} {vlanType}:{tagged}'
print FORMAT.format(prt='Port', vlanType='untagged',tagged='tagged')
portRslt = exsh.clicmd('debug cfgmgr show next vlan.show_ports_info format portList=* port=None', True)
portDict = json.loads(portRslt)
for row in portDict['data']:
port = row['port']
vlanRslt = json.loads(exsh.clicmd('debug cfgmgr show next vlan.show_ports_info_detail_vlans formatted port={0} vlanIfInstance=None'.format(port), True))
taggedVlan = []
untaggedVlan = []
for vlanRow in vlanRslt['data']:
vid = vlanRow.get('vlanId',None)
if vlanRow['tagStatus'] == '1':
if vid:
taggedVlan.append(vid)
else:
if vid:
untaggedVlan.append(vid)
if len(untaggedVlan) == 0 and len(taggedVlan) == 0:
print FORMAT.format(prt=port, vlanType='none', tagged='')
if len(untaggedVlan):
print FORMAT.format(prt=port, vlanType='untagged', tagged=', '.join(untaggedVlan))
port=''
if len(taggedVlan):
print FORMAT.format(prt=port, vlanType='tagged', tagged=', '.join(taggedVlan))
The output looks like:
X460G2-24t-10G4.35 # run script portvlan.py
Port untagged:tagged
1 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
2 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
3 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
4 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
5 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
6 untagged:1
7 untagged:1
8 untagged:1
9 untagged:1
10 untagged:1
11 untagged:1
12 untagged:1
13 untagged:1
14 untagged:1
15 untagged:1
16 untagged:1
17 untagged:1
18 untagged:1
19 untagged:1
20 untagged:1
21 untagged:1
22 untagged:1
23 untagged:1
24 untagged:1
25 untagged:1
26 untagged:1
27 untagged:1
28 untagged:1
29 untagged:1
30 untagged:1
31 untagged:1
32 untagged:1
33 untagged:1
34 untagged:1

Paul_Russo
Extreme Employee
Hey Ron

We can get that detail but it is in our detail information which provides much more. One thing that can probably be done is to create a script to take the information from all of the commands and put it in one output. When we support Python later this year we will be able to create customer commands to do run multiple commands take the useful information and then provide it in another ourput.

you can do a show vlan port 1-X or show vlan port 1-X detail

P

Thomas_J_Egger
New Contributor II
This is a very nice thing when troubleshooting, take a look on the command, you can find the info in the EOS CLI Guide

_ToM
GTM-P2G8KFN