cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

Byron_Morales
New Contributor II
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 6

StephanH
Valued Contributor III
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
Regards Stephan

Tomasz
Valued Contributor II
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 port ). Also device-undetected trigger with another script should be there so once a device goes away port alias turns blank.

HTH,
Tomasz

Tomasz
Valued Contributor II
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

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.
GTM-P2G8KFN