ExtremeSwitching (EXOS)

Expand all | Collapse all

Getting Mac Addresses for Individual Nodes in a Stack - Python Script

  • 1.  Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 15:56
    Working on a python script to automate the commands I use to program some switches. I am trying to come up with a way to determine the MAC addresses of the switches in the stack and input those values into the following commands. - configure stacking node-address aa??cc:dd:ee:ff slot-number <1 - 8>

    - configure stacking node-address aa??cc:dd:ee:ff priority <1 - 100>



    - configure stacking node-address aa??cc:dd:ee:ff master-capability on

    The problems that I am running into specifically are that I need to get and store 3 different MAC addresses (I have 3 switches in this particular stack) and I am not entirely sure how to do that. Also I would be running each of the above commands 3x (once for each switch in the stack.)

    Thank you for any help you can give!



  • 2.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09
    Is there a reason a python array won't work?


  • 3.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09
    Ummmm... Not that I know of I haven't tried that yet! I'll give it a shot.

    Thank you for the suggestion.


  • 4.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09


  • 5.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09
    So I like that idea for the holding of the Mac addresses but I'm still not sure of a way to get the individual MAC's from each switch.


  • 6.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09
    How do you currently get them? If you expect to read them from each member via the cli then you need to look at how python handles IO from a remote session; there should be some baked-in libraries/methods that handle all of the calls for you and you simply need to parse the returns. Another option would be to use an expect script wrapped by python.


  • 7.  RE: Getting Mac Addresses for Individual Nodes in a Stack - Python Script

    Posted 06-05-2018 16:09
    If running EXOS 21.1+, jsonrpc can help. If having XMC 8.0.4+, you can run the script from there.
    I don't understand what is your issue. list, dictionary, variables... all of that is supported.