03-11-2012 12:59 AM
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"?
03-15-2012 05:09 AM
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!
03-17-2012 04:10 PM
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.
03-18-2012 01:06 PM
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.
03-18-2012 01:12 PM
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.
03-19-2012 05:23 AM
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!
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: