Search This Blog

Sunday, 17 October 2010

Cisco 1841 EEM command not executing

I have a configuration on Cisco 1841 routers that perform a failover for dynamic NAT if one DSL circuit fails, using a IP SLA Track I have a ping set to a IP such as via one interface and if this ping drops then this calls an EEM applet to clear down the NAT translations and the secondary route for takes over and a route map handles the PAT for the clients.

Well the problem was that the failover was working correctly but when the EEM applet fired it did not clear the NAT translations, if I ran the command manually from EXEC mode then I could see the NAT translations rebuild on the failover DSL interface and the Internet was available to the clients again.

Digging around on the EEM I found a debug command to debug the EEM events

debug event manager action cli

Now when I tried my failover by administratively shutting down interface atm0/0/0.1 I could see the events occur in the logs. Now I could see clearly that the cli command starts in USER mode and hence cannot complete a EXEC mode command! All it needed was a new line to add enable to pass the cli command into EXEC mode. The EEM applet is below to show this

event manager applet failover
event track 1 state any
action 1.0 cli command "enable"
action 1.1 cli command "clear ip nat translation *"

By using enable and entering EXEC mode the command completes and the NAT translations are rebuilt in under three pings!

No comments:

Post a Comment