ā10-18-2016 10:46 PM
Is there an easier way to perform nested applet actions i.e how to achieve the outcome using If/else statement in one applet rather nested applets?
event manager applet Shut-NoShut
event track 3 state down
action 10 cli command "en"
action 20 cli command "conf t"
action 30 cli command "interface fa0/0"
action 40 cli command "shut"
action 50 cli command "unshut"
action 60 wait xx
action 70 cli command "event manager applet Reload-Applet"
action 80 cli command "event track 3 state down"
action 90 cli command "end"
action 100 cli command "write memory"
action 110 cli command "action 1 reload"
action 120 cli command "end"
!
event manager applet Router-Up
event track 3 state up
action 10 cli command "en"
action 20 cli command "conf t"
action 30 cli command "no event manager applet Reload-Applet"
action 40 cli command "end"
action 50 cli command "write memory"
action 60 cli command "end"
!
event manager applet WatchDogApplet
event track 3 state down
event timer watchdog time 86400
action 1 syslog msg "Adding a timer to track and reload every 24 hours when there is no Internet"
action 2 reload
action 3 end
ā10-21-2016 05:50 PM
event manager applet WatchDogApplet
event timer watchdog time 86400
action 1 track read 3
action 2 if $_track_state eq "down"
action 3 syslog msg "Watchdog applet - Router reload"
action 4 else
action 5 syslog msg "Watchdog timer will reset - No action required"
action 6 end
ā10-21-2016 09:12 AM
The Reload-Applet policy will not run until track 3 transitions from up to down. Since the shut/no-shut happens before the policy is created, that would have no effect on it. You'd need to do the shut/no-shut again.
ā10-21-2016 06:15 PM
Does this sound right to you ?
event manager applet Shut-NoShut
event track 3 state down
action 100.0 cli command "en"
action 110.0 cli command "conf t"
action 120.0 cli command "interface di0"
action 130.0 cli command "shut"
action 140.0 cli command "no shut"
action 150.0 wait 10
action 160.0 cli command "event manager applet Reload-Applet"
action 170.0 cli command āint di0ā
action 180.0 cli command āshutā
action 190.0 cli command āno shutā
action 200.0 cli command "event manager applet Reload-Applet"
action 210.0 cli command "event track 3 state down"
action 210.1 syslog msg "we are here"
action 210.2 cli command "action 1 reload"
action 210.3 cli command "end"
action 220.0 cli command "write memory"
action 221.1 cli command "end"
ā10-21-2016 07:52 PM
If you expect track 3 to transition to down on its own after registering Reload-Applet, then yes. But I suspect you will find some better solutions to your problem if you carefully study How To Introduce Large Delays In EEM Policies .
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide