Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

EEM script to Reload router 1 Time if Dial Fails

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.

  • Network Management
52 REPLIES
Cisco Employee

Re: EEM script to Reload router 1 Time if Dial Fails

What version of code does this need to work with?

New Member

Re: EEM script to Reload router 1 Time if Dial Fails

Hi there,

We have Version 12.4(15)T7

c181x-adventerprisek9-mz.124-15.T7.bin

Thanks for your support!

Cisco Employee

Re: EEM script to Reload router 1 Time if Dial Fails

Okay, so Tcl will be required here. Please provide a flow chart of the process that you want to occur. I've got a good idea of what needs to happen when the problem is first encountered, but I'm not clear exactly what you want to do after the reboot.

New Member

Re: EEM script to Reload router 1 Time if Dial Fails

Some background on why this is required:

We have found a known issue with the cisco 1811 built in modem where if the router attempts to dial when the phone line has been unplugged or interrupted (SR: 612816679 - a fax or phone is attached to same line) the router will never connect via dial until the router is recycled. We have cleared the line, shut and no shut the dialer and async interfaces and nothing works. ONLY way is to be sure the phone line is plugged into the v.92 port and reload. From there on out it will dial faithfully until the next disconnect on interruption.

Flow - Not sure of all the logic here so please correct as you see fit.

1) Router is up and is tracking three objects - if access to any one object or 2 objects fails - do nothing. If access to all three objects fails - ip sla will kick in delay down timer of 180 seconds. If access to objects recovers before timing out, restore tracking to up and cancel delay down.

2) If delay down timer expires with no object recovery - attempt to dial as normal.

3) Router will round robin between 4 known 800 numbers and if it fails to connect on all 4 tries, reload the router.

4) When router comes back up and tracking still shows down, have it continue to cycle thru the 800 numbers and attempt to dial as it would have done normally but do not reboot again.

5) After a reload and dialup started to work, router should disconnect from dialed 800 number. Reset the reload once script back to a ready state.

Cisco Employee

Re: EEM script to Reload router 1 Time if Dial Fails

Okay, more questions.

1. I assume you already have the IP SLA collector and tracking statements working correctly? A show run would be helpful.

2. No problem here. The policy will trigger off the tracked object which ANDs together the other tracked objects. If that ANDed tracked object goes down, the EEM policy will fire. What commands are required to switch to dial backup?

3. How does one know if all four numbers failed?

4. Once 3 is answered, this is not a problem.

5. No problem.

New Member

Re: EEM script to Reload router 1 Time if Dial Fails

1. I assume you already have the IP SLA collector and tracking statements working correctly? A show run would be helpful.

Yes, IP Sla works and show run attached :)

2. No problem here. The policy will trigger off the tracked object which ANDs together the other tracked objects. If that ANDed tracked object goes down, the EEM policy will fire. What commands are required to switch to dial backup?

Not sure what you asking here. Interesting traffic is acl 101 and is triggered when an IPsec tunnel needs to be built out the dialer interface and the default route of 0.0.0.0 is now known via this interface (broadband is down)

3. How does one know if all four numbers failed?

See attached file that shows the normal failures. I believe the TTY1: Modem: (unknown)->HANGUP would be an indication that the modem has to be reset.

4. Once 3 is answered, this is not a problem.

5. No problem.

You do not know how much we appreciate this. Thanks Again. We Owe You!

Cisco Employee

Re: EEM script to Reload router 1 Time if Dial Fails

So, nothing really needs to be done to switch to dial backup, right? That is, tracked object 456 will go down, then the DHCP-added route will be dropped, thus making the Dialer route more desirable. The EEM policy should also watch tracked object 456 then.

Will you be leaving debugging enabled forever?

New Member

Re: EEM script to Reload router 1 Time if Dial Fails

Yes exactly, routes would be removed and 456 down is correct.

Good Point - we would not want to leave debugging on. Can we leave all debugging off and continually do a show dialer to get what you would need to key off of? There will be 4 dial strings a successes column and a Failures column. If the failures column increments 1 higher using the attempted calls dial string, transition thru remaining three strings so you have had all 4 strings increment by one failure and then reboot.

Cisco Employee

Re: EEM script to Reload router 1 Time if Dial Fails

Okay, I'm almost done. I just need to right one more policy to disarm the dial backup watch if the dial backup comes up. What syslog messages do you get when dial backup comes up as it should?

1927
Views
0
Helpful
52
Replies
This widget could not be displayed.