05-20-2022 02:17 AM - edited 05-20-2022 02:18 AM
Hello,
I would like to configure event manager with interface state tracking. When certain interface state changes to "down" I want to automatically shutdown the interface.
I have script that does this but on IOS. IOS XE doesn't have "event track 55 state down" command.
track 55 interface Twe2/0/16 line-protocol
event manager applet Shutdown_Twe2/0/16
event track 55 state down
action 1.0 syslog msg "Shutting Down Twe2/0/16 - Reason: Line Protocol Down"
action 2.0 cli command "enable"
action 3.0 cli command "config t"
action 4.0 cli command "interface Twe2/0/16"
action 5.0 cli command "shut"
action 6.0 cli command "end"
action 7.0 syslog msg "Shutdown_Twe2/0/16 script ran successfully"
any recommendations how to do this?
Solved! Go to Solution.
05-20-2022 02:47 AM
Hello,
the easiest would probably be to just match on syslog pattern instead of tracking:
event manager applet Shutdown_Twe2/0/16
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface TwentyGigabitEthernet2/0/16, changed state to down"
action 1.0 cli command "enable"
action 2.0 syslog msg "Shutting Down Twe2/0/16 - Reason: Line Protocol Down"
action 3.0 cli command "config t"
action 4.0 cli command "interface Twe2/0/16"
action 5.0 cli command "shut"
action 6.0 cli command "end"
action 7.0 syslog msg "Shutdown_Twe2/0/16 script ran successfully"
05-20-2022 02:26 AM
what version of IOS XE ?
is this possible to use track global config. - is this works for you ?
05-20-2022 02:36 AM
Thanks for the reply!
Version: IOS XE 16.12.3a
In global config it is possible to use "track 55 interface TwentyFiveGigE2/0/16 line-protocol" command. I have already configured it.
But after that you have to define which object to use for event to occur:
1. configured event manager applet:
event manager applet Shutdown_Twe2/0/16
2. Tried to configure event tracking, but I get error, because there is no such command in IOS XE:
event track 55 state down
HQ-Core(config-applet)#event track 55 state down
^
% Invalid input detected at '^' marker.
05-20-2022 02:44 AM - edited 05-20-2022 02:48 AM
They changed how to do it:
SUMMARY STEPS
• enable
• configure terminal
• track object-number stub-object
• default-state {up | down }
• exit
• event manager applet applet-name
• event [label ] track object-number [state {up | down | any }]
• action label track set object-number state {up | down }
• action label track read object-number
• end
• show track [object-number [brief ]
01-14-2024 07:33 AM
“event track” in event manager doesn’t exist, which is what the OP said, so this wouldn’t work.
05-20-2022 02:47 AM
Hello,
the easiest would probably be to just match on syslog pattern instead of tracking:
event manager applet Shutdown_Twe2/0/16
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface TwentyGigabitEthernet2/0/16, changed state to down"
action 1.0 cli command "enable"
action 2.0 syslog msg "Shutting Down Twe2/0/16 - Reason: Line Protocol Down"
action 3.0 cli command "config t"
action 4.0 cli command "interface Twe2/0/16"
action 5.0 cli command "shut"
action 6.0 cli command "end"
action 7.0 syslog msg "Shutdown_Twe2/0/16 script ran successfully"
05-20-2022 03:01 AM - edited 05-20-2022 03:09 AM
Thank you! It Worked
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