cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4371
Views
0
Helpful
5
Replies

Running a loop TCL script

uranthaci
Level 1
Level 1

Hi All,

I was wondering if its safe running a script on a endless loop?

Reason is, I want to monitor my network outages and other network problems in real time, and also get notified right away. But im not sure how the router will handle this loop script, because the script will never end, it will always stay online and checking and therefore probably would eat much more memory than if the script would have been terminated?

An example of the script would be: ping the gateway1, analyse the results from a long perspective of time , check for  gateway2 in the mean time and compare it with gateway1 etc etc..

Has anyone came across to something similar, or has more information about this ,would be much appreciated.

1 Accepted Solution

Accepted Solutions

You lose a VTY line while the script runs (since you will be using CLI), but other than that, it's much safer than a long-running tclsh script.

View solution in original post

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

A tclsh script would not be a good choice for this.  You could have a very long-running EEM Tcl policy (we have done those with things like our web server).  But perhaps there is another way.  Have you looked at IP SLA as a way to do regular continuous pings of a host then have EEM integrate with that IP SLA collector and alert if the RTT becomes too high?

I have tried that, but sla didn't work well ( or at least I didnt get it right ), which is what made me write this script.

The script is much more complicated, i've integrated it on a DMVPN setup which continuously monitors its redundant links and reacts based on different behaviors, and its working well.

One of the checks it makes is issue a ping with repeat of 20, and compare, which is alright if it succeds but if it responds with timeout , the check slows the script big time ( with timeout option set to 1, its still too slow ), and I wish I could just intercept in between those 20 ping echos which brings to my mind endless loop script.

Is there any side effects with long-running EEM TCL script?

You lose a VTY line while the script runs (since you will be using CLI), but other than that, it's much safer than a long-running tclsh script.

Thanks Joseph , seems fair enough ..can you refer me to that webserver script you mentioned before? I would be glad to see an example on how you achieved it.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: