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

TCL help

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.

Everyone's tags (2)
6 REPLIES
Cisco Employee

Re: TCL help

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.

New Member

Re: TCL help

Script attached.  Thanks.

Cisco Employee

Re: TCL help

This version should do what you want.

New Member

Re: TCL help

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!

Cisco Employee

Re: TCL help

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.

New Member

Re: TCL help

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.

420
Views
0
Helpful
6
Replies
CreatePlease to create content