Hello, everyone. I have some questions.
1
R1(config)#do show run | begin event manager
event manager applet NO_INT
event cli pattern "show running-config" sync yes
action 0.9 cli command "enable"
action 1.0 cli command "show ip interface brief"
action 1.1 puts "$_cli_result"
action 2.0 set _exit_status "1"
What exactly is the cli_result variable? I somehow get it but at the same time, not really. What does the puts "$_cli_result" achieve? The keyword puts makes me think that something is put/added inside this variable. I know that without this variable, the output of show ip interface brief wonât be displayed. So what is a good definition of this variable and what it achieves?
2
The sync yes and sync no options confuse me a lot. Cisco documentation defines them as following:
Synchronous publishing of CLI eventsâThe CLI command is not executed until the EEM policy exits, and the EEM policy can control whether the command is executed. The read/write variable, _exit_status, allows you to set the exit status at policy exit for policies triggered from synchronous events. If _exit_status is 0, the command is skipped, if _exit_status is 1, the command is run.
Asynchronous publishing of CLI eventsâThe CLI event is published, and then the CLI command is executed.
Asynchronous publishing of CLI events with command skippingâThe CLI event is published, but the CLI command is not executed
What sync essentialy means is that the EEM policy is ran first, then the command while async executes both the command and the policy at the same time?
This part is probably the most confusing regarding EEM. Why are there these two options? Sync could be useful if we want to EEM to run instead of a command that was typed but the same can just be achieved by using async and telling EEM to skip the command. I canât think of many things at the moment where sync would achieve something that async cannot.
3
And the final thing that I donât understand is this:
R1(config-applet)#do show event manager policy reg
No. Class Type Event Type Trap Time Registered Name
1 applet user cli Off Sun Jun 22 12:26:55 2025 1
pattern {1} sync yes
maxrun 20.000
action 1.0 puts "First one!"
This simply types out âFirst one!â into the console.

Let me configure another applet
R1(config)#do show event manager policy reg
No. Class Type Event Type Trap Time Registered Name
2 applet user cli Off Sun Jun 22 12:31:13 2025 2
pattern {show running-config} sync no skip yes
maxrun 20.000
action 2.0 puts "Second one"
This one will print out âSecond oneâ when I type in the running config.

However, why does it use Syslog for this? For sync events, puts uses the console while for async events, it just uses SyslogâŚ
Thank you.
David