cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1373
Views
0
Helpful
3
Replies

Best practice of invoking EEM within EEM

pingduck
Level 1
Level 1

To simplify scripting, I want to invoke another EEM within EEM. Is there a best practice for how it is done?

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

You can do this in a number of ways depending on your use case.  But I tend to like application events:

 

Applet 1:

action X publish-event sub-system 798 type 1 arg1 FOO

 

Applet 2:

event appl sub-system 798 type 1

action X puts $_application_data1 <== Prints FOO

I apologize that I missed your reply earlier. It seems like a cool way to pass control from one applet to another. Can you tell me where I can find documentation to "sub-system 798 type 1". Many advanced EEM scripts have some magic numbers. Is there a document that list all the sub-system or SNMP events that can be used in EEM?

You're right that these are magic numbers.  Unfortunately, there isn't a list of all subsystems since the rest are internal to IOS.  Subsystem 798 is reserved for "user defined" and type 1 is just a convention.  You could have different types within 798 if you want different events.  That is, consider 798 your user-defined namespace, and use as many types there as you want.