Thursday, December 12, 2019

Requesting Assistance with EEM Script for AP

I'm using an EEM script that auto-detects an AP when it's plugged in and configures the port accordingly, that part is working fine. However, I'm trying another one that would reconfigure the port if an AP goes down for longer than 2 minutes but I can't get it to trigger. Any assistance would be greatly appreciated.

Here is the first script:

event manager applet DETECT-LWAP-PORT-CONFIG

event neighbor-discovery interface regexp Ethernet.* cdp add

action 1.0 regexp "(AIR-)" "$_nd_cdp_platform"

action 2.0 if $_regexp_result eq "1"

action 3.0 cli command "config t"

action 4.0 cli command "default interface $_nd_local_intf_name"

action 4.1 cli command "int $_nd_local_intf_name"

action 4.2 cli command "macro apply MACRO-TRUNK-LWAP"

action 5.0 cli command "end"

action 5.1 cli command "write"

action 5.2 syslog msg "EEM script configured AP port and saved config"

action 6.0 end

Here is the second:

conf t

event manager applet undo-AP-port-config authorization bypass

event syslog pattern "LINEPROTO-5-UPDOWN.* changed state to down"

trigger occurs 1 delay 120

action 1.0 regexp "Interface ([,]+)" "$_syslog_msg" match intf

action 2.0 cli command "enable"

action 3.0 cli command "show int $intf | inc Description:"

action 4.0 regexp "-AP" "$_cli_result"

action 5.0 if $_regexp_result eq "1"

action 6.0 continue

action 7.0 cli command "config t"

action 8.0 cli command "default interface $intf"

action 9.0 cli command "interface $intf"

action 12.0 cli command "macro apply MACRO-ACCESS"

action 13.0 cli command "end"

action 14.0 cli command "wr"

action 15.0 cli command "exit"

action 16.0 syslog msg "EEM script undo AP port config and saved config"

action 17.0 end



No comments:

Post a Comment