For more details, please see ourCookie Policy.


Fibre Channel (SAN)

Reply
Occasional Contributor
Posts: 5
Registered: ‎03-08-2019

Collect Switch port WWPNs from 100s of Switches using CLI - python

Hello,

 

I am trying to develop a python script to collect switchshow or portshow output which includes reflecting WWPNs for F-Ports from more than 400 switches...

 

I don't understand why in the world, Brocade CLI doesn't allow SED/AWK/TR/CUT but with limited options with GREP and for NPIV, it gets ugly. I am using paramiko to make the ssh connections and generate bulk of data from more than 400 switches. However, is there a easy command then portshow/switchshow to get the reflecting switch port WWPNs or better way to collect such data through CLI? 

 

 

Highlighted
Frequent Contributor
Posts: 103
Registered: ‎01-19-2018

Re: Collect Switch port WWPNs from 100s of Switches using CLI - python

1) did you try ssh (or dbclient) admin@switch switchshow | sed ... awk ... tr ... cut ?

2) since you mention python, did you try pyfos?
New Contributor
Posts: 3
Registered: ‎10-04-2018

Re: Collect Switch port WWPNs from 100s of Switches using CLI - python

If the switches are being managed with Brocade Network Advisor (BNA) the best option is to use BNA REST API. You can get all the info conveniently in 1 place and even when new switches are added your script can take notice of them without any further effort.

Regards

Joachim Gann

Occasional Contributor
Posts: 5
Registered: ‎03-08-2019

Re: Collect Switch port WWPNs from 100s of Switches using CLI - python

I believe that should be the option.. however if you have implemented/used REST API, does it collect the AGs as well?
Occasional Contributor
Posts: 5
Registered: ‎03-08-2019

Re: Collect Switch port WWPNs from 100s of Switches using CLI - python

Yes, i tried ssh as you mentioned and used sed/awk/tr etc.. but it will over head with multiple commands of portshow etc.. and pyfos has FOS version limitation...
Occasional Contributor
Posts: 5
Registered: ‎03-08-2019

Re: Collect Switch port WWPNs from 100s of Switches using CLI - python

Nevermind, I tried and it works... however.. it's extremely slow

I am looping on Switches and getting the switch keys, i am looping on fcports and then getting fcpkey, i am looping on enddevices for each port ... it takes more than 14-15 hours for ~400 switches...

is there a better way to get all port reflecting WWPNs (enddevice WWNs) from all switches /ag?

Join the Broadcom Support Community

Get quick and easy access to valuable resources across the Broadcom Community Network.