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. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

::cisco::eem::event_registers

Hello,

I have some fairly basic (not to me) question with regards to TCL/EEM event_registers.  As I understand it once you schedule a policy (via IOS CLI), it'll run when the event register happens.  Am I right?

I've been reading the following URL and have been able to find lots of different ways of initiating a script.

http://www.cisco.com/c/en/us/td/docs/ios/netmgmt/configuration/guide/12_2sx/nm_12_2sx_book/nm_eem_policy_tcl.html#wp1204375

The syntax of the commands quickly blows me away and although there is a million example of running a script because some syslog event happens I haven't found much else with regards to examples of other common triggers.

Firstly, in my case I'm trying to run a script on a regular interval, say every 60 seconds, indefinitely.  I get the impression that I want a watchdog timer to acheive this and that the event_register command would look something like this;

::cisco::eem::event_register_timer watchdog time 60 maxrun 240

1. Does that look correct?

Secondly, more complex event_registers seem to call variables.  For example, some mention something that isn't referenced anywhere in the script. 

2. How can an event register call a variable that hasn't been defined.  Doesn't this fall under normal rules of "no variable, can't use it then"?

::cisco::eem::event_register_timer watchdog time $EEM_L2VPN_SCRIPT_INTERVAL

This one for example seems to run when after a length of time defined (in my mind) by a variable ($EEM_L2VPN_SCRIPT_INTERVAL) that can't even exist until the script runs.  This feels like a chicken and egg scenario to me.

Here's another one,

::cisco::eem::event_register_timer watchdog name ioMemFree time $EEM_FREE_MEM_INTERVAL

3. Is "name ioMemFree" referencing a well know IOS/TCL attribute.  Again, this suggests the time to run this is based on the variable $EEM_FREE_MEM_INTERNAL.  I can only imagine this is the other way around and the value is placed into this variable on run.

4. If that is the case though, what value of ioMemFree actually triggers the script?

5.  Is there a very basic list of common uses and a rough explanation of each bit lying around on the web that anyone knows of?

All I've found is documentation that cooks the mind.

Apologies for all the daft questions.  I'm clearly finding the whole thing very confusing.

Many thanks in advance,

Alex

  • EEM Scripting
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

::cisco::eem::event_registers

1. Yes, that is a valid event registration line

2. This variable must be defined first.  In this case, it would need to be defined using "event manager environment EEM_L2VPN_SCRIPT_INTERVAL" in config t mode.

3. This is an arbitrary name.  The timer names can be anything you want.

4. This policy would trigger when the watchdog counter counts down from the number of seconds specified in the environment variable EEM_FREE_MEM_INTERVAL to zero.

5. There are plenty of examples in the Documents section of this forum to help you.  You can also sign up at http://ciscolive365.com to look at presentations given on EEM.  There are recordings there as well.

2 REPLIES
Cisco Employee

::cisco::eem::event_registers

1. Yes, that is a valid event registration line

2. This variable must be defined first.  In this case, it would need to be defined using "event manager environment EEM_L2VPN_SCRIPT_INTERVAL" in config t mode.

3. This is an arbitrary name.  The timer names can be anything you want.

4. This policy would trigger when the watchdog counter counts down from the number of seconds specified in the environment variable EEM_FREE_MEM_INTERVAL to zero.

5. There are plenty of examples in the Documents section of this forum to help you.  You can also sign up at http://ciscolive365.com to look at presentations given on EEM.  There are recordings there as well.

New Member

::cisco::eem::event_registers

Great information, thank you.

I think I'm starting to get a very basic understanding.  Catching certain bits of output/regexp is still cooking my mustard a little bit but making progress at least.

Thanks for taking the time to respond.

Kind regards

Alex

438
Views
0
Helpful
2
Replies
This widget could not be displayed.