×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

EEM script to track IP and admin down port

Answered Question
Feb 5th, 2014
User Badges:
  • Cisco Employee,

I have a nexus 5500 switch...i need an EEM script that will track an IP address (6.0.0.5)..and if that IP is not reachable, it will admin down a port on the n5k


Thanks in advance!

Correct Answer by Joe Clarke about 3 years 6 months ago

XR does not yet support applets.  So you will need to use EEM Tcl policies.  Depending on the release of XR, you do have a track event detector.  You can take this applet to http://www.marcuscom.com/convert_applet to convert the applet to Tcl.  That Tcl policy should then be loadable into XR.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Wed, 02/05/2014 - 08:54
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This is not possible on the N5K.  You can track an IP route or an interface, but you cannot track reachability to an IP address like you can with IPSLA on IOS.

shaunwhi Wed, 02/05/2014 - 10:16
User Badges:
  • Cisco Employee,

Joe


How about if i swap the 5Ks with nexus 4500X switches??

Joe Clarke Wed, 02/05/2014 - 10:28
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I don't believe any Nexus switch can do this.  Catalyst, yes, but not Nexus.

shaunwhi Wed, 02/05/2014 - 10:31
User Badges:
  • Cisco Employee,

Sorry typo from my ipad....i meant swap n5k for Catalyst 4500-X...that should be able to do it right? What would my script look like?

Joe Clarke Wed, 02/05/2014 - 10:35
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

On a Cat4K, you can create an IPSLA collector to ping your host, then use tracking to watch it:


event manager applet track-ping

event track 1 state down

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "int gi1/1"

action 4.0 cli command "shut"

action 5.0 cli command "end"

shaunwhi Thu, 02/06/2014 - 08:15
User Badges:
  • Cisco Employee,

Thanks joe! Last question...if i were to do this on XR (ASR9k) how can i do this...i have the IPSLA setup...but dont see how i trigger off of it to run CLI commands...i dont even see how i run CLI commands


Thanks

Correct Answer
Joe Clarke Thu, 02/06/2014 - 10:38
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

XR does not yet support applets.  So you will need to use EEM Tcl policies.  Depending on the release of XR, you do have a track event detector.  You can take this applet to http://www.marcuscom.com/convert_applet to convert the applet to Tcl.  That Tcl policy should then be loadable into XR.

Actions

This Discussion