- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2013 05:21 AM
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.
Solved! Go to Solution.
- Labels:
-
EEM Scripting
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2013 12:12 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2013 06:34 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2013 11:24 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2013 12:12 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2013 11:12 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2013 06:46 AM
