Brocade Fibre Channel Networking Community

Expand all | Collapse all

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

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

    Posted 03-08-2019 09:32 AM

    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? 

     

     


    #BrocadeFibreChannelNetworkingCommunity


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

    Posted 03-08-2019 01:07 PM
    1) did you try ssh (or dbclient) admin@switch switchshow | sed ... awk ... tr ... cut ?

    2) since you mention python, did you try pyfos?
    #BrocadeFibreChannelNetworkingCommunity


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

    Posted 03-14-2019 06:25 PM
    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...
    #BrocadeFibreChannelNetworkingCommunity


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

    Posted 03-08-2019 10:33 PM

    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


    #BrocadeFibreChannelNetworkingCommunity


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

    Posted 03-14-2019 06:23 PM
    I believe that should be the option.. however if you have implemented/used REST API, does it collect the AGs as well?
    #BrocadeFibreChannelNetworkingCommunity


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

    Posted 03-15-2019 10:58 AM
    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?
    #BrocadeFibreChannelNetworkingCommunity