cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5272
Views
0
Helpful
52
Replies

EEM script to Reload router 1 Time if Dial Fails

Gerard Roy
Level 2
Level 2

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.

52 Replies 52

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 :)

Yes, fixing that typo will certainly fix the errors you're seeing in the logs.

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

This version should fix the problems you're seeing, and adds the clear line support.

Actually, "clear line" is interactive, so you'll need this version instead.

Whoops, reposted the bad one.

Hi Joe,

New error message :) "Error reading the Channel" - See attached.

Thanks,

Jerry

You're not using my latest version.

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

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.

Here is the latest - Thanks :)

This should do it. I've left the debugging on just to be sure.

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.

Joe,

BTW - what should I remove in the script to disable the bugging you added?

Thanks,

Jerry

This version removes the debug.

Review Cisco Networking for a $25 gift card