cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
745
Views
5
Helpful
6
Replies

Interface Tracking

RS19
Level 4
Level 4

I have the below query:

- HSRP tracking allows to tracking of the status of the interface status for the line protocol

- Based on that I allows to decrement or increment the priority.

 

Would like to check is there any mechanism by which we can track the interface physical status rather than line protocol.

What  I want to check is that if an interface status is down I want to decrement the HSRP priority. (I don't want to check line protocol status)

 

Router# show interfaces
Ethernet 0 is down, line protocol is down

Let me know if this is possible.

6 Replies 6

Deepak Kumar
VIP Alumni
VIP Alumni

Hi,

You can use the EMM Script. 

 

Reference book for configuration as  https://routerjockey.com/2010/06/14/working-with-the-embedded-event-manager-eem/

 

Regards,

Deepak Kumar

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

Thanks will go through it.

Wanted to check apart from scripting can this be achieved via IOS commands or it is not supported by IOS commands

Hello,

 

Deepak is right, an EEM script is a good idea. I happen to have one on file. You actually need two scripts, one to apply when the interface is down, the other when it is up. 

You can do all this in IOS. The syslog pattern obviously needs to match your own interface (GigabitEthernet0/0 is just an example):

 

event manager applet INT_DOWN_HSRP_PRIO_DOWN
event syslog pattern "%LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "interface GigabitEthernet0/0"
action 4.0 cli command "standby 1 priority 50"
action 5.0 cli command "exit"
action 6.0 cli command "end"

 

event manager applet INT_UP_HSRP_PRIO_UP
event syslog pattern "%LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "interface GigabitEthernet0/0"
action 4.0 cli command "standby 1 priority 150"
action 5.0 cli command "exit"
action 6.0 cli command "end"

Hi Thanks for your inputs.

The below commands which you have shared are all are IOS commands. If I use this then my understanding is that I don't need to use any external scripts to do it.

Request you to please confirm this.

Hi,

Yes, All are IOS commands. There is no need for any other script type. 

 

Regards,

Deepak Kumar

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

The provided solution from the Deepak is correct and best for the IOS. I would like to add single command to make sure your scrip should works fine

 

event manager session cli username   ---> TACACS username if this device added into the TACACS server.

 

action 7.0 cli command "show run | append diskx:HSRP_EEM.txt"  To save the outputs.

 

Regards,

Tayyab  -  www.tayyabmunir.com

***Rate Please ***

*** Please rate all helpful responses and mark solutions***
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card