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. And see here for current known issues.

New Member

Running a loop TCL script

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.

Everyone's tags (5)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Running a loop 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.

5 REPLIES
Cisco Employee

Running a loop TCL script

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?

New Member

Running a loop TCL script

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?

Cisco Employee

Running a loop 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.

New Member

Running a loop TCL 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.

Cisco Employee

Running a loop TCL script

1334
Views
0
Helpful
5
Replies