cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
837
Views
0
Helpful
6
Replies

TCL help

oemoralesjr
Level 1
Level 1

I have written a TCL script that sends an email when a T1 in an MLP bundle goes inactive. The cron timer runs the script every 2 minutes.  The problem I have is that I don't want an email every two minutes until the circuit goes back to an active state.  I want to write some code that will check a time stamp of the last sent email so it will only send a new email every hour.  Very new to TCL and am still learning so any help is appreciated.

6 Replies 6

Joe Clarke
Cisco Employee
Cisco Employee

Please post the code you currently have.

In the future, it is best to post these kind of questions under Network Infratructure > Network Management.  I will be more likely to see them.

Script attached.  Thanks.

This version should do what you want.

Incredible.  That works perfectly.  I know you are probably busy, but if you have time to break down what you did that would help me tremendously.  I am still learning so would love to understand the logic behind what you wrote.  For instance, if I want to change the time to wait to send another email, it looks like I would change the exp.  I believe the syntax is minutes * seconds.

Thanks again!

I used a context to save the last time the email was sent.  Then, if the time is greater than an hour, send another email.  Yes, if you modify the expr you can adjust how often emails are sent.  If you want to make this more flexible, then you should consider changing the "60" in the expr to an EEM environment variable.

Thanks for your help. I did make the "60" a EEM variable since we may play with the time to after a while. I just took out the expression and made the variable 3600. At any rate, I really appreciate your help.

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: