ExtremeCloud IQ- Site Engine & Extreme Management Center

Expand all | Collapse all

Script that sets port alias based on LLDP; Update Alias if device moved.

  • 1.  Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 11:33
    Anyone come up with a good idea for automating port aliases?
    Being able to run a script on the that sets port description based on lldp would be useful.
    Or if a device gets moved having a way to move the alias with the device would be useful.



  • 2.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 13:18


  • 3.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 13:19
    You can use TCL or Python scripts in EXOS to do show lldp for each port (or IMO better for all ports at once), and then take the Neighbor System-Name from $CLI.OUT variable (that needs some parsing definitely, perhaps you would feel better with Python scripts instead of TCL) and issue configure port display-string for each port. That would be a one-shot port alias syncing.

    I believe it could also work with a UPM script with an LLDP trigger (configure upm event device-detect profile [u] port ). Also device-undetected trigger with another script should be there so once a device goes away port alias turns blank.

    HTH,
    Tomasz


  • 4.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 20:36
    Hello Byron,

    another approach can be to use XMC (if available).

    Because you wrote you have some experience with TCL it's a good starting point.
    You can write a TCP script to ask the switches for LLDP infos ( simplified do an "show lldp neighbour detail") via cli and parse the output.

    In an second step wrote the infos back as port alias via CLI.

    This can be done in one script. No UPM needed. Only CLI knowledge and a little bit TCL for parsing.

    One big advantage of XMC is you do not need to transport the script to every switch. Just do it centrally. Select all of you switches and start the script.

    Best regards
    Stephan


  • 5.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 13:18
    Hi Ed,

    I've never used UPM scripting before. Is there a document for the syntax or variables that can be used to create a UPM script?


  • 6.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 13:19
    Nice thanks Tomasz. I've made a few simple TCL's before, no python scripts or UPM's although but I can usually put something together if there's an example I can work off of.


  • 7.  RE: Script that sets port alias based on LLDP; Update Alias if device moved.

    Posted 09-25-2018 13:19
    I believe Ed's link to another topic is a good starting point for this kind of UPM, take also care about scripting and UPM chapters here: https://documentation.extremenetworks.com/exos_22.5/EXOS_User_Guide_22_5.pdf

    Regards,
    Tomasz