05-28-2014 03:41 PM
I would like to ask from the EEM community for some assistance in regards to crafting an EEM script for an ME-3800X. We have one or two appliances whereby the only uplink (TenGigabitEthernet0/1 and/or TenGigabitEthernet0/2) goes into error-disable and caused by UDLD. What I am looking for is a script to do the following:
1. If the ports TenGigabitEthernet0/1 and/or TenGigabitEthernet0/2 goes into error-disable caused by UDLD or link-flap then disable the port, wait for 5 seconds, enable the port;
2. Wait for 15 seconds and send an email.
I only want this EEM to work on the TenGigabitEthernet interfaces and I do not want the EEM script to do this on the access ports.
Error-disable recovery is a global option and there's no option to limit on a per-interface level.
Thank you in advance.
Solved! Go to Solution.
06-01-2014 05:40 PM
For this, an applet like the following should work:
event manager applet udld-recover
event syslog pattern "Te0/[12], unidirectional link detected" maxrun 50
action 1.0 regexp "(Te0/[12])," $_syslog_msg match intf
action 2.0 cli command "enable"
action 3.0 cli command "udld reset"
action 4.0 wait 30
action 5.0 mail from "user@example.com" to "user@example.com" subject "UDLD Reset" server "10.1.1.1" body "UDLD has been reset after $intf when err-disable"
06-01-2014 02:19 PM
What syslog message is generated when the ports go into err-disable.
06-01-2014 03:30 PM
Thanks for responding, Joe.
We were not able to take down the error messages but I believe they error messages could be:
%UDLD-4-UDLD_PORT_DISABLED: UDLD disabled interface Te0/2, unidirectional link detected %PM-4-ERR_DISABLE: udld error detected on Te0/2, putting Te0/2 in err-disable state
Could an EEM script be created when an error message or an event of "unidirectional link detected
" occurs, do the following:
1. In privilege mode, issue the command "udld reset".
2. Wait for 30 seconds and then send an email.
Thanks for your assistance and support, Joe.
06-01-2014 05:40 PM
For this, an applet like the following should work:
event manager applet udld-recover
event syslog pattern "Te0/[12], unidirectional link detected" maxrun 50
action 1.0 regexp "(Te0/[12])," $_syslog_msg match intf
action 2.0 cli command "enable"
action 3.0 cli command "udld reset"
action 4.0 wait 30
action 5.0 mail from "user@example.com" to "user@example.com" subject "UDLD Reset" server "10.1.1.1" body "UDLD has been reset after $intf when err-disable"
06-01-2014 10:29 PM
Thanks, Joe.
I'm going to check this out.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide