11-02-2009 03:16 PM
We have a script we use to track objects and if access to these objects fails we reload the router 1 time (see it below). We want to now apply the same script in a different capacity for another customer for dial. If the router fails to connect after trying to round robin thru 4 toll free 800 numbers then reload the router.
event manager applet vpn_tunnel_rebooter
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet vpn_tunnel_unreachable"
action 4.0 cli command "end"
action 5.0 cli command "write mem"
action 6.0 reload
!
event manager applet vpn_tunnel_up
event track 456 state up
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "event manager applet vpn_tunnel_unreachable"
action 004 cli command "event track 456 state down"
action 005 cli command "action 1.0 policy vpn_tunnel_rebooter"
action 006 cli command "end"
Any ideas on how we might accomplish this? I have very little EEM experience :)
1) Current Object tracking tracks 3 objects, If access to all three is down we go into a 180 sec delay down timer. If they remain down we switch over to dial backup.
2) We round robin between 4 dial numbers and if access to all 4 fails, we want to reload router "ONE" time
3) When it comes back up and objects are still unavailable we attempt to dial the 4 numbers again and if it also fails to connect "DO NOT" reload this time.
11-05-2009 04:39 PM
I found the error in the script. There was an extra "t" near the "proc get_curr_states { output numbers } {" line and am now testing again. I will update you once I find the results :)
11-05-2009 10:23 PM
Yes, fixing that typo will certainly fix the errors you're seeing in the logs.
11-09-2009 02:42 PM
Hi There (sorry I never got your first name :), We have a new error message: "Failed to find 18667143757 in output of "show dial"". I don't fully understand why we get this since I can see the string so I was hoping you would have another look. Also, can you add one more requirement? Can you add a "Clear Line 1" at the start of the script just to be sure the line is not hung? (see very bottom of file)
It has never rebooted yet and I am assuming becuse it has not been able to "see" the "Failed to find 18667143757" line.
I have attached a debug file for your reference.
Thanks again for your awesome scripting.
Jerry
11-09-2009 02:55 PM
This version should fix the problems you're seeing, and adds the clear line support.
11-09-2009 05:44 PM
Actually, "clear line" is interactive, so you'll need this version instead.
11-09-2009 05:46 PM
11-09-2009 05:55 PM
11-09-2009 06:02 PM
You're not using my latest version.
11-10-2009 10:21 AM
Hi Joe,
What is the logic behind when this should reload? I disconnected the phone line and then disabled the uplink to the internet on Fa0 and the object tracking went into delay down and attempted to fail over to dial as it should. It cycled thru all 4 numbers and never reloaded the 1811. I let it continue a couple more complete cycles but it never reloaded. I have attached the logs.
Thanks,
Jerry
11-10-2009 10:36 AM
According to this, the reload should have happened. Here is a version with some debugging added so I can see what's going on. Install this version, and also enable "debug event manager tcl commands" and get the output of "show event manager policy registered" when the main link is down. Repeat the test, and post the new log.
11-10-2009 11:47 AM
11-10-2009 11:57 AM
11-10-2009 12:42 PM
Excellent - it works!!!! Just awesome! You are the MAN! You do not know how much this is appreciated - again - THANK YOU.
I have attached 2 files for your review. One is the successful reload and the second is the success-after-reload because I wanted to make sure it did not reload a second time.
11-10-2009 01:49 PM
Joe,
BTW - what should I remove in the script to disable the bugging you added?
Thanks,
Jerry
11-10-2009 02:36 PM
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