Friday, August 31, 2018

Cisco EEM Scripting Help

I've been trying to see if EEM scripting could be used for dynamic port configurations for Access Points.

Fortunately, a script that configures a port based on CDP add event works great. Now I'm attempting to implement a script that resets a port configuration to "standard" if the AP is removed. However I'm running into a fun little issue.

When APs are installing new code (or for other reasons I'm not aware) the APs CDP relationship gets wonky. The AP of course could reboot (which registers as a CDP delete) and the port is put back as standard. Then CDP add hits the port and the switch should be configured back to the AP config. But somewhere along the way, the add/delete process gets kind of messed up and I end up with an AP with a non-AP port config.

Here's the script in question

event manager applet port-reset authorization bypass description "Reset configuration of port when AP is removed" event neighbor-discovery interface regexp <regex for port range> cdp delete action 1 cli "commands for configuring the port" 

My thoughts are I need to make the script wait for a number of minutes, then check the port CDP a second time (after the initial CDP event) to validate if the there's an AP on the port. Of course if an AP is detected, exit the script with no action, but if there isn't a CDP entry, change the port configurations.

Does anyone know if this possible in EEM?



No comments:

Post a Comment