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.
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"withsync no skip yescan block a dangerous command or ask for confirmation.event interface name ... parameter input_errorsreacts when error counters rise.event nonecreates an applet you run by hand withevent 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 registeredlists active applets, anddebug event manager action clishows 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?
Which event type runs an applet on a schedule?
event timer cron.Why is EEM useful even when you have central automation?
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.
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.