Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityIntermediate

Embedded Event Manager (EEM): automating reactions on Cisco IOS devices

In short: Embedded Event Manager runs small automation scripts on the router or switch itself. An applet waits for an event, such as a syslog message, a tracked object changing or a timer, and then runs actions such as CLI commands, syslog messages or emails. It is ideal for local reactions that must happen even when the central network management system cannot reach the device.

Automation that lives on the device

Most automation today runs from a central server with Python or Ansible. That is great for configuration, but it cannot react when the device is cut off from the server, and it reacts more slowly. EEM runs inside IOS and IOS XE. It sees events the moment they happen and acts locally. Applets are written in configuration mode; for more complex logic you can use Tcl scripts or, on IOS XE, Guest Shell with Python.

An EEM appletEventsyslog, track,timer, CLIConditionsoptional checksActionsCLI, syslog, mailResultfixed or alerted
Figure 1. EEM watches for an event on the device itself and runs your actions immediately.

Example 1: save diagnostics when a link goes down

event manager applet WAN-DOWN
 event syslog pattern "Interface GigabitEthernet0/0/0, changed state to down"
 action 1.0 cli command "enable"
 action 2.0 cli command "show interfaces gi0/0/0 | append flash:wan-down.txt"
 action 3.0 cli command "show logging | append flash:wan-down.txt"
 action 4.0 syslog priority critical msg "WAN link down - diagnostics saved"

When the interface goes down, the router collects the information you would want before anyone has time to log in.

Example 2: react to a track object

event manager applet ISP-A-FAILED
 event track 10 state down
 action 1.0 cli command "enable"
 action 2.0 cli command "clear ip nat translation *"
 action 3.0 syslog msg "ISP-A failed, NAT translations cleared"

This pairs with IP SLA tracking on a dual-ISP router: clearing old translations lets sessions re-establish through the backup provider straight away.

Example 3: a scheduled task

event manager applet NIGHTLY-SAVE
 event timer cron cron-entry "0 2 * * *"
 action 1.0 cli command "enable"
 action 2.0 cli command "write memory"

The cron entry uses the same format as Linux cron. Make sure NTP is configured, or "2 a.m." will be wrong.

Other useful events

  • event cli pattern "reload" with sync no skip yes can block a dangerous command or ask for confirmation.
  • event interface name ... parameter input_errors reacts when error counters rise.
  • event none creates an applet you run by hand with event manager run NAME, handy for testing.

Testing and safety

  • Start with actions that only log or collect information before you let applets change configuration.
  • Applets run with full privileges. If you use AAA command authorisation, give EEM a username with event manager session cli username.
  • show event manager policy registered lists active applets, and debug event manager action cli shows what each action did.

Real-world example: the flapping link nobody saw

A branch link dropped for a few seconds at random times each week. By the time anyone looked, it was fine and the interface counters had been cleared by a monitoring script. An EEM applet triggered on the "changed state to down" message saved interface details, optical levels and the log to flash each time. Two events later, the saved data showed the receive light level falling, and the provider replaced a dirty patch panel connector.

Practice

What are the two main parts of an EEM applet?
An event that triggers it and one or more actions it runs.
Which event type runs an applet on a schedule?
event timer cron.
Why is EEM useful even when you have central automation?
It runs on the device itself, so it reacts instantly and still works when the device cannot reach the central server.

Key takeaways

  • EEM runs automation applets directly on IOS and IOS XE devices.
  • Applets react to events such as syslog messages, track objects and timers.
  • Actions can run CLI commands, write syslog messages or collect diagnostics.
  • Test with logging-only actions first and use NTP for scheduled tasks.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: