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. And see here for current known issues.

New Member

Multiple EEM consecutive policy of processing a single event

Hi!

Please help me understand.

I do not quite understand the algorithm of MULTIPLE CONSECUTIVE policies are processed the SAME event.

As happens so that a policy ends and the other is called?

As ONE policy is activated understandable.  It ends with some "exit status" which affects the execution of "default action".

But as a start for the first second policy and what is the relationship between "exit status" and "entry status"?

This is the same and "exit status" stored in _entry_status system variable, after execution first policy,

and then verified by a second policy the of "entry status"?

Everyone's tags (2)
5 REPLIES
New Member

Multiple EEM consecutive policy of processing a single event

I also understand how to perform the two policies on one event.

What the experts say?

Registration the two policies on one event leads to the generation of two different events for each policy!

Cisco Employee

Multiple EEM consecutive policy of processing a single event

It sounds like you have it.  Yes, the exit status of one policy can be read and reacted upon by the entry status of another.  In this way you can decide if the next policy in a chain needs to run.  If the policies are synchronous (i.e., CLI ED policies), then you can control the execution of the second policy by setting the exit status in the first policy, then processing it as $_entry_status in the subsequent policy.

New Member

Re: Multiple EEM consecutive policy of processing a single event

Hi Joseph!

I probably did not quite understand the assignment of a "sync" in CLI ED.

You can clarify this issue?

I believe that the "sync" is used to determine when to execute the actual command itself "cmd": simultaneously with the policy (mode sync=yes) or after the policy (sync=no).

Asinc mode to be able to bypass the cmd parser, to use the syntax of your commands.

Or am I wrong?

It is not clear how the next policy will start? You can give a simple example.

PS.

Thank you for your speed responses.

Cisco Employee

Multiple EEM consecutive policy of processing a single event

Yes, sync refers to the CLI command blocking until the policy completes.  Async refers to both the policy and the CLI command running at the same time.  Only syncrhonous policies can be chained.  If you have two Tcl policies registered with:

::cisco::eem::event_register_cli pattern "show version" sync yes

When someone runs "show version" the first policy registered will execute.  It will run and set an exit status.  Once it completes, the second policy will run.  It can analyze the exit status of the first and decide whether or not to take any action.

New Member

Re: Multiple EEM consecutive policy of processing a single event

Exactly Joseph!

I agree with you and checked.

But here is what is written in the documentation:

"sync (Mandatory)

A “yes” means that the policy (the event publish) will

run synchronously with the CLI command; a “no” means that the

event publish will be performed asynchronously with the CLI

command. The event detector will be notified when the policy

completes running. The exit status of the policy indicates whether

or not the CLI command should be executed: if the exit status is

zero, which means that the policy is executed successfully, the CLI

command will not be executed; otherwise, the CLI command will be

executed."

"Exit status" no effect in async mode, policies and cli command are executed independently.

It would be correct to replace the words synchronously and asynchronously,

replaced by an regardless and independly of the EEM policy.

Thanks!

530
Views
9
Helpful
5
Replies