01-14-2019 11:18 PM - edited 03-08-2019 05:02 PM
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)
Let me know if this is possible.
01-14-2019 11:50 PM
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
01-15-2019 12:48 AM
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
01-15-2019 12:53 AM
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"
01-15-2019 05:30 PM
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.
01-20-2019 09:14 PM
Hi,
Yes, All are IOS commands. There is no need for any other script type.
Regards,
Deepak Kumar
01-20-2019 10:14 PM
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 ***
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide