cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
859
Views
0
Helpful
1
Replies

EEM Script issues?

zr2lang
Level 1
Level 1

Hello,

I am trying automate an  EEM Script to shutdown a BDI interface after all Controllers T1 interface's are disconnected. Pleas see attached config.

 

Thanks

 

event manager applet PRI-DOWN
event syslog pattern "%CONTROLLER-5-UPDOWN: Controller T1 [012]/[0-3]/[0-7], changed state to down"
action 1.02 if 0/1/1 eq down
action 1.03 if 0/1/2 eq down
action 1.04 if 0/1/3 eq down
action 1.05 if 0/1/4 eq down
action 1.06 if 0/1/5 eq down
action 1.07 if 0/1/6 eq down
action 1.08 if 0/1/7 eq down
action 1.09 if 0/2/0 eq down
action 1.10 if 0/2/1 eq down
action 1.11 if 0/2/2 eq down
action 1.12 if 0/2/3 eq down
action 1.13 if 0/2/4 eq down
action 1.14 if 0/2/5 eq down
action 1.15 if 0/2/6 eq down
action 1.16 if 0/2/7 eq down
action 1.17 if 0/3/0 eq down
action 1.18 if 0/3/1 eq down
action 1.19 if 0/3/2 eq down
action 1.20 if 0/3/3 eq down
action 1.21 if 0/3/4 eq down
action 1.22 if 0/3/5 eq down
action 1.23 if 0/3/6 eq down
action 1.24 if 0/3/7 eq down
action 1.25 if 1/0/0 eq down
action 1.26 if 1/0/1 eq down
action 1.27 if 1/0/2 eq down
action 1.28 if 1/0/3 eq down
action 1.29 if 1/0/4 eq down
action 1.30 if 1/0/5 eq down
action 1.31 if 1/0/6 eq down
action 1.32 if 1/0/7 eq down
action 1.33 if 2/0/0 eq down
action 1.34 if 2/0/1 eq down
action 1.35 if 2/0/2 eq down
action 1.36 if 2/0/3 eq down
action 2.0 cli command "enable"
action 2.1 cli command "configure terminal"
action 2.2 cli command "int bdi100"
action 2.3 cli command "shut"
action 2.4 end


event manager applet PRI-UP
event syslog pattern "%CONTROLLER-5-UPDOWN: Controller T1 [012]/[0-3]/[0-7], changed state to up"
action 1.01 if 0/1/0 eq up
action 1.02 if 0/1/1 eq up
action 1.03 if 0/1/2 eq up
action 1.04 if 0/1/3 eq up
action 1.05 if 0/1/4 eq up
action 1.06 if 0/1/5 eq up
action 1.07 if 0/1/6 eq up
action 1.08 if 0/1/7 eq up
action 1.09 if 0/2/0 eq up
action 1.10 if 0/2/1 eq up
action 1.11 if 0/2/2 eq up
action 1.12 if 0/2/3 eq up
action 1.13 if 0/2/4 eq up
action 1.14 if 0/2/5 eq up
action 1.15 if 0/2/6 eq up
action 1.16 if 0/2/7 eq up
action 1.17 if 0/3/0 eq up
action 1.18 if 0/3/1 eq up
action 1.19 if 0/3/2 eq up
action 1.20 if 0/3/3 eq up
action 1.21 if 0/3/4 eq up
action 1.22 if 0/3/5 eq up
action 1.23 if 0/3/6 eq up
action 1.24 if 0/3/7 eq up
action 1.25 if 1/0/0 eq up
action 1.26 if 1/0/1 eq up
action 1.27 if 1/0/2 eq up
action 1.28 if 1/0/3 eq up
action 1.29 if 1/0/4 eq up
action 1.30 if 1/0/5 eq up
action 1.31 if 1/0/6 eq up
action 1.32 if 1/0/7 eq up
action 1.33 if 2/0/0 eq up
action 1.34 if 2/0/1 eq up
action 1.35 if 2/0/2 eq up
action 1.36 if 2/0/3 eq up
action 2.0 cli command "enable"
action 2.1 cli command "configure terminal"
action 2.2 cli command "int bdi100"
action 2.3 cli command "no shut"
action 2.4 end

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

This configuration is invalid.  Once you detect your trigger syslog message, you'll need to run a CLI command (or perhaps multiple CLI commands) to determine the state of all of the controller interfaces (and this will involve some regular expression parsing of the output).  Then you can perform your logic if all are down or all are up.

If the T1 controller interfaces show up under "show interfaces" you could use a trick like "show ip int bri" to show them with their status, include only those that are T1 interfaces and then search the output for "down" (in the case of your "up" applet) or "up" (in the case of your "down" applet).

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: