cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2711
Views
0
Helpful
6
Replies

Track interface state in IOS XE

Lasha Lomjaria
Level 1
Level 1

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?

 

 

 

1 Accepted Solution

Accepted Solutions

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"

View solution in original post

6 Replies 6

balaji.bandi
Hall of Fame
Hall of Fame

what  version of IOS XE ?

 

is this possible to use track global config.  - is this works for you ?

 

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/eem/configuration/xe-17/eem-xe-17-book/eem-policy-cli.html#GUID-104E218A-4DC3-44B8-9653-E5D863FD9643

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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.

 

 

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 ]

 

“event track” in event manager doesn’t exist, which is what the OP said, so this wouldn’t work.

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"

Thank you! It Worked

Review Cisco Networking for a $25 gift card