Header Only - DO NOT REMOVE - Extreme Networks

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


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.

6 replies

Did you see the other post about using UPM scripting.
https://community.extremenetworks.com/extreme/topics/upm_configure_port_dispay_string_based_on_lldp_...
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?
Userlevel 4
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
Buiosu wrote:

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

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.
Userlevel 4
Buiosu wrote:

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

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
Userlevel 5
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

Reply