cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
2196
Views
0
Helpful
1
Replies

EEM Script to set interface passive

Malick Ndiaye
Level 1
Level 1

Hello All,

I am running OSPF in my domain. I want to put an interface in the passive state after a flap or multiple flaps. For example, if I get a log that states:

2012 Sep  1 00:08:47 %ETHPORT-5-IF_DOWN_LINK_FAILURE: Interface Ethernet1/44 is down (Link failure)

to be able to perform:

enable

conf t

interface Ethernet1/44

ip ospf passive-interface

end wr

FYI this concerns a Nexus 3K running NX-OS 5.0(3)U3(2).

Thanks for your help.

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

I haven't used EEM on the 3K yet.  However, I think it has similar support to the 7K, so this should work:

event manager applet ethport override __ethpm_link_flap
   event policy-default count 2 time 1000
   action 1 cli conf t
   action 2 cli int $interface
   action 3 cli ip ospf passive-interface
   action 4 cli end

You can't use syslog here since you can't parse the message to get the interface.  While you could using Python or Tcl to do this, executing scripts out of EEM applets is not officially supported.  So this applet should set an interface that flaps twice within 1000 seconds to be an OSPF passive interface.

Review Cisco Networking for a $25 gift card