cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1360
Views
0
Helpful
2
Replies

EEM script is not working

deprasan
Cisco Employee
Cisco Employee
  1. This script is not working with ISR 4321 at remote site, other remote site with same hardware don't have problem.
  2.  Basically BGP attributes with route-maps is changed when there is a syslog message “WEDA Detected Error Rate Too High”. EEM operation gets aborted while WAN-TEST nested applet kicks off.

 

event manager applet AUTO-FAILOVER2 authorization bypass
event syslog pattern ".* WEDA Detected Error Rate Too High" maxrun 300
action 1.0 set MAP_IN2 "1"
action 1.1 set MAP_OUT2 "1"
action 1.2 cli command "enable"
action 1.3 cli command "sh run | i ^router bgp"
action 1.4 regexp "router bgp ([0-9]+)" "$_cli_result" match AS
action 1.5 cli command "sh run | i neighbor .* remote-as 4755$"
action 1.6 foreach _IPS "$_cli_result" "\n"
action 1.7 regexp "neighbor ([A-Za-z0-9/\./-]+) remote-as 4755" "$_IPS" _IPS1 _IPS2
action 1.8 set MAP_IN "0"
action 1.9 set MAP_OUT "0"
action 2.0 cli command "sh run | i neighbor $_IPS2 route-map"
action 2.1 regexp "route-map ([A-Za-z0-9/\d_/-]+) in" "$_cli_result" match MAP_IN
action 2.2 cli command "sh run | i neighbor $_IPS2 route-map"
action 2.3 regexp "route-map ([A-Za-z0-9/\d_/-]+) out" "$_cli_result" match MAP_OUT
action 2.4 set check "$MAP_IN2$MAP_IN"
action 2.5 if $check eq "0WEDA-IN"
action 2.6 set MAP_IN "0"
action 2.7 else
action 2.8 end
action 2.9 if $MAP_IN eq "0"
action 3.0 else
action 3.1 cli command "sh route-map $MAP_IN | i permit"
action 3.2 foreach MAPS "$_cli_result" "\n"
action 3.3 regexp "sequence ([0-9]+)" "$MAPS" match LINE
action 3.4 cli command " conf t"
action 3.5 cli command "route-map $MAP_IN $LINE"
action 3.6 cli command "set local-pref 200"
action 3.7 cli command "set as-path prepend $AS $AS $AS"
action 3.8 cli command "exit"
action 3.9 cli command "exit"
action 4.0 cli command "end"
action 4.1 if $MAP_IN eq "WEDA-IN"
action 4.2 set MAP_IN2 "0"
action 4.3 else
action 4.4 end
action 4.5 end
action 4.6 end
action 4.7 set check2 "$MAP_OUT2$MAP_OUT"
action 4.8 if $check2 eq "0WEDA-OUT"
action 4.9 set MAP_OUT "0"
action 5.0 else
action 5.1 end
action 5.2 if $MAP_OUT eq "0"
action 5.3 else
action 5.4 cli command "sh route-map $MAP_OUT | i permit"
action 5.5 foreach MAPS1 "$_cli_result" "\n"
action 5.6 regexp "sequence ([0-9]+)" "$MAPS1" match LINES
action 5.7 cli command " conf t"
action 5.8 cli command "route-map $MAP_OUT $LINES"
action 5.9 cli command "set as-path prepend $AS $AS $AS"
action 6.0 cli command "exit"
action 6.1 cli command "exit"
action 6.2 cli command "end"
action 6.3 if $MAP_OUT eq "WEDA-OUT"
action 6.4 set MAP_OUT2 "0"
action 6.5 else
action 6.6 end
action 6.7 end
action 6.8 end
action 6.9 end
action 7.0 cli command " conf t"
!
!
action 7.7 cli command "event manager applet WEDA_UP_51 authorization bypass"
action 7.8 cli command "event timer watchdog time 3300 maxrun 300"
action 7.9 cli command "action 1.3 set MAP_IN $MAP_IN"
action 8.0 cli command "action 1.4 set AS $AS"
action 8.1 cli command "exit"
action 8.2 cli command "event manager applet WAN-TEST authorization bypass"
action 8.3 cli command "event none"
action 8.4 cli command "exit"
action 8.5 cli command "ip sla restart 51"
action 8.6 cli command "exit"
action 8.7 cli command "clear ip bgp * in"
action 8.8 cli command "clear ip bgp * out"
action 8.9 syslog msg "WEDA - ERRORS DETECTED ON WAN LINK BY WEDA - TRAFFIC SHIFTED"
action 9.9 exit 0

 

IOS-XE image release is Version 15.5(3)S2

Attached show tech-support

@amol.Telore@contractor.tatacommunications.com

 

 

2 Replies 2

Hello,

 

turn on:

 

debug event manager all

 

and post the output, it usually tells you which line it doesn't like...

Hi Georg, I will ask the customer to collect debugs.