Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

Hall of Fame Super Gold

EEM on port error-disable due to UDLD

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. 

 

 

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

For this, an applet like the

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"

4 REPLIES
Cisco Employee

What syslog message is

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

Hall of Fame Super Gold

Thanks for responding, Joe. 

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.

Cisco Employee

For this, an applet like the

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"

Hall of Fame Super Gold

Thanks, Joe.  I'm going to

Thanks, Joe.  


I'm going to check this out.

325
Views
0
Helpful
4
Replies