cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5733
Views
5
Helpful
3
Replies

Stop running event (manager)

ben
Level 1
Level 1

Is there a way to stop a running event?

I would reload the router in case of connectivity issues, but give you the chance to stop the reload if you're working on it.

fe:

event manager applet Reload-on-vpn-failure
    event track 33 state down
    action 1.0 syslog msg "No remote servers seen for a while"
    action 1.1 syslog msg "Will reload in 60 seconds"
    action 1.2 syslog msg "Cancel this reload with XXX"
    action 1.3 wait 60
    action 1.4 cli command "enable"
    action 1.5 reload

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

First, this applet will not work as written since it will timeout after 20 seconds of waiting.  You'd need to increase the maxrun to something like 70 or 80 for this to work.  Second, you don't need action 1.4.

To stop this applet, you can run the command "event manager scheduler clear ID" or "... clear all".  That said, it will not immediately abort.  It should abort after the wait before the reload.

But I wouldn't use this approach.  I'd use three applets with nesting:

event manager applet check-vpn-failure

 event track 33 state down

 action 1.0 syslog msg "No remote servers seen for a while"

 action 1.1 syslog msg "Will reload in 60 seconds"

 action 1.2 syslog msg "Cancel this reload with 'vpn reload cancel'"

 action 1.3 cli command "enable"

 action 1.4 cli command "config t"

 action 1.5 cli command "event manager applet Reload-on-vpn-failure"

 action 1.6 cli command "event countdown time 60"

 action 1.7 cli command "action 1.0 reload"

 action 1.8 cli command "end"

!

event manager applet abort-reload

 event cli pattern "^vpn reload cancel" enter

 action 1.0 cli command "enable"

 action 2.0 cli command "config t"

 action 3.0 cli command "no event manager applet Reload-on-vpn-failure"

 action 4.0 cli command "end"

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

First, this applet will not work as written since it will timeout after 20 seconds of waiting.  You'd need to increase the maxrun to something like 70 or 80 for this to work.  Second, you don't need action 1.4.

To stop this applet, you can run the command "event manager scheduler clear ID" or "... clear all".  That said, it will not immediately abort.  It should abort after the wait before the reload.

But I wouldn't use this approach.  I'd use three applets with nesting:

event manager applet check-vpn-failure

 event track 33 state down

 action 1.0 syslog msg "No remote servers seen for a while"

 action 1.1 syslog msg "Will reload in 60 seconds"

 action 1.2 syslog msg "Cancel this reload with 'vpn reload cancel'"

 action 1.3 cli command "enable"

 action 1.4 cli command "config t"

 action 1.5 cli command "event manager applet Reload-on-vpn-failure"

 action 1.6 cli command "event countdown time 60"

 action 1.7 cli command "action 1.0 reload"

 action 1.8 cli command "end"

!

event manager applet abort-reload

 event cli pattern "^vpn reload cancel" enter

 action 1.0 cli command "enable"

 action 2.0 cli command "config t"

 action 3.0 cli command "no event manager applet Reload-on-vpn-failure"

 action 4.0 cli command "end"

Thanks already for your response, I'll try it today!

Didn't know the 'cli pattern' event. Open doors for extra stuff. ;)

You  wrote about the maxrun, where can/must I change this? It's not a (clear) action... :$

The maxrun parameter is an argument to the event detector line.