cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2324
Views
0
Helpful
4
Replies

EEM on port error-disable due to UDLD

Leo Laohoo
Hall of Fame
Hall of Fame

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. 

 

 

1 Accepted Solution

Accepted Solutions

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"

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

What syslog message is generated when the ports go into err-disable.

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.

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"

Thanks, Joe.  


I'm going to check this out.

Review Cisco Networking for a $25 gift card