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

EEM CLI Commands not executed

wmeeren
Level 1
Level 1

Hello all,

I have a strange thing happening. I want to run an EEM applet that will remove two BGP network statements when a BGP neighbor goes down. The equipment is an ASR1002, running IOS-XE. There is also AAA using an external Radius server configured on the router.

The equipment is already in production, so it is not easy to test things. First I wait for a syslog message that the neighbor is down. Then I want to execute some CLI commands. I configured the following:

event manager applet TEST-1
 event syslog pattern "%BGP-5-ADJCHANGE: neighbor a.b.c.d vpn vrf XXX Down"
 action 1.0 cli command "enable"
 action 2.0 cli command "config term"
 action 3.0 cli command "router bgp 23456"
 action 4.0 cli command "address-family ipv4"
 action 5.0 cli command "no network a.b.c.d mask 255.255.255.255"
 action 6.0 cli command "no network a.b.c.e mask 255.255.255.255"

When I shut down the LAN interface, the neighbor goes down, the applet is triggered, I see that, but the networks are not removed from the config. Have I forgotten something?

1 Reply 1

devils_advocate
Level 7
Level 7

If using AAA, the EEM script needs a username as below:

event manager session cli username [USERNAME]

As far as I understand, it doesn't actually do the Authentication part of AAA (hence no password needed) but it does make sure the username has the Authorisation permissions to run the CLI commands.