Thursday, October 18, 2018

Python to crawl through HP switch and set description of interfaces with LLDP switch neighbor names and if the port is a Wireless AP

https://github.com/thewozza/configDescriptions_HP

You could do this by hand but that is super boring.

This script goes through a switch and figures out if the LLDP neighbors are switches, and if they are it writes the neighbor name in the interface description.

If it is an AP it just sets the description to "WirelessAP". This customer has a mix of Meraki and Ubiquiti APs. Meraki APs speak LLDP so that's easy. The Unifi APs do NOT speak LLDP so I pull the MAC table, and do a manufacturer lookup for anything that says "Ubiquiti" and then I mark those ports as "WirelessAP".

Once all the relevant ports have useful descriptions on them, when I add them to the NMS we'll know what is actually happening on the network.

This particular customer has 150+ Procurve APs of varying vintage, and no network management. They're all in one big VLAN on every site, it's kind of a mess but it is a fun project bringing them through the decades of network design one small iteration at a time. I think right now they're in the 90s because we got IP addresses on all the switches, and STP enabled. Whee!



No comments:

Post a Comment