19.2 Cisco Embedded Event Manager (EEM) & Intent-Based Networking
Key Takeaways
- Cisco Embedded Event Manager (EEM) is a device-native automation subsystem built into Cisco IOS/IOS-XE comprising Event Detectors (EDs), the EEM Server Engine, and Event Policies (Applets or Tcl scripts) that autonomously detect operational events and trigger remediation actions on-box.
- EEM Event Detectors monitor diverse system subsystems including Syslog patterns (regex), CLI command interception, Interface counter thresholds, Timers (cron schedules, countdowns, watchdogs), IP SLA performance metrics, and Object Tracking state transitions.
- EEM executes action statements in strict alphanumeric ASCII sorting order of their labels (e.g., `action 1.0`, `action 2.0`, `action 10.0`), meaning improper labeling like `action 10` will execute before `action 2`.
- Synchronous CLI event detection (`sync yes`) intercepts commands prior to execution, enabling policies to block destructive commands (`reload`, `write erase`) or enforce approvals by setting `$_exit_status 0` (block) or `$_exit_status 1` (permit).
- Intent-Based Networking (IBN) implements a closed-loop lifecycle spanning Translation (business intent into network policy), Activation (automated provisioning across underlay/overlay fabrics), and Assurance (continuous verification via streaming telemetry, AI-driven dynamic baselines, and automated self-healing remediation).
19.2 Cisco Embedded Event Manager (EEM) & Intent-Based Networking
Core Blueprint Focus: Cisco 350-401 ENCOR v1.2 topic 6.6 (construct an EEM applet to automate configuration, troubleshooting, or data collection), in the domain v1.2 renamed "Automation and Artificial Intelligence", tests candidates on on-box event-driven automation with Cisco Embedded Event Manager (EEM) and the architecture of Intent-Based Networking (IBN) and AI-Driven Operations (AIOps). Candidates must master EEM Event Detectors (Syslog, CLI, Timer, Interface Counter, IP SLA, Object Tracking), construct EEM Applets with proper action sequencing and variable substitution (
$_cli_result,$_syslog_msg), configure synchronous vs. asynchronous execution modes, and explain the IBN closed-loop lifecycle (Translation, Activation, Assurance) alongside Cisco AI Network Analytics.
Modern network operations require both decentralized, real-time on-box responsiveness and centralized, intelligent artificial intelligence orchestration. When a physical uplink experiences intermittent CRC errors or a critical routing neighbor fails, waiting for an external network management system (NMS) or centralized controller to poll the device over SNMP or streaming telemetry introduces unacceptable failover latency. Cisco Embedded Event Manager (EEM) solves this by embedding an intelligent, autonomous policy engine directly inside the Cisco IOS-XE kernel. Concurrently, centralized Intent-Based Networking (IBN) and AIOps frameworks ingest global telemetry to dynamically adapt baselines and enforce self-healing network states.
+---------------------------------------------------------------------------------------------------+
| EEM & INTENT-BASED NETWORKING COEXISTENCE |
+---------------------------------------------------------------------------------------------------+
| |
| [ CENTRALIZED AI CONTROLLER ] (Cisco Catalyst Center / AI Network Analytics) |
| - Closed-Loop Lifecycle: Translation -> Activation -> Assurance -> Machine Reasoning Engine (MRE)|
| - Dynamic Baselines (Machine Learning) & Anomaly Detection across global telemetry streams |
| | (Policy & Telemetry) |
| v |
| ================================== CISCO IOS-XE DEVICE ========================================= |
| | | |
| | +----------------------------------------------------------------------------------------+ | |
| | | CISCO EMBEDDED EVENT MANAGER (EEM) SUBSYSTEM | | |
| | | | | |
| | | [ EVENT DETECTORS ] [ EEM SERVER ENGINE ] [ EEM ACTION ENGINE ] | | |
| | | - Syslog Regex Match - Policy Scheduling - CLI Command Execution | | |
| | | - CLI Intercept (Sync/Async) - Event Queue & Locks - Syslog Notification | | |
| | | - Timer (Cron/Watchdog) - Variable Evaluation - SMTP Email Alerts | | |
| | | - Track / IP SLA Object - Multi-Event Correlation - SNMP Traps | | |
| | | - Interface Error Counters - $_exit_status Handling - $_cli_result Storage | | |
| | +----------------------------------------------------------------------------------------+ | |
| ================================================================================================ |
+---------------------------------------------------------------------------------------------------+
1. Cisco Embedded Event Manager (EEM) Architecture
Cisco Embedded Event Manager (EEM) is a distributed, device-native event management system built into Cisco IOS and IOS-XE. EEM allows network devices to proactively monitor internal system states, detect operational events in real time, and automatically execute remediation, diagnostic, or notification actions on-box without external controller latency.
The Three Pillars of EEM Architecture
- Event Detectors (EDs): Software subsystems embedded in IOS-XE that monitor specific internal hardware, software, interface, or protocol states. When a monitored condition occurs, the Event Detector publishes an event notification to the EEM Server.
- EEM Server Engine: The core dispatcher and scheduling engine. It receives event notifications from Event Detectors, evaluates registered policies to match triggers, manages policy execution priorities and concurrency locks, and passes execution parameters to the action engine.
- EEM Policies (Applets & Tcl Scripts): The user-defined automation logic executed in response to an event:
- EEM Applets: Simple, declarative policies defined directly in Cisco IOS-XE global configuration mode using CLI syntax. Ideal for standard operational automation (interface bouncing, CLI security blocking, automated backups).
- EEM Tcl Scripts: Advanced, programmatic scripts written in Tool Command Language (Tcl) and stored as
.tclfiles in flash memory (bootflash:). Ideal for complex conditional logic, socket communication, loops, and advanced data processing.
+---------------------------------------------------------------------------------------------------+
| COMPREHENSIVE EEM EVENT DETECTORS |
+---------------------------------------------------------------------------------------------------+
| Event Detector | Trigger Condition & Description | Example Cisco IOS-XE Syntax |
| :-------------- | :------------------------------ | :------------------------------------------- |
| **`syslog`** | Matches regular expression patterns against internal system logging messages. | `event syslog pattern "LINK-3-UPDOWN.*GigabitEthernet1/0/1.*down"` |
| **`cli`** | Intercepts CLI commands entered in EXEC or config mode. Supports synchronous blocking.| `event cli pattern "reload" sync yes` |
| **`timer`** | Chronological triggers: Cron schedules, repeating watchdogs, or one-shot countdowns.| `event timer cron cron-entry "0 2 * * *"` (Runs daily at 2:00 AM) |
| **`track`** | Triggers when a Cisco Object Tracking state transitions (`up` $\leftrightarrow$ `down`). | `event track 10 state down` |
| **`interface`** | Triggers when interface performance/error counters cross defined thresholds. | `event interface name Gi1/0/1 parameter rx_crc_errors entry-val 50 entry-op gt` |
| **`ip-sla`** | Triggers based on Cisco IP SLA probe threshold violations or SLA state changes.| `event ipsla sub-type reaction num 1` |
| **`snmp`** | Triggers when a local SNMP MIB Object Identifier (OID) exceeds a threshold. | `event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.3 get-type exact entry-val 85 entry-op gt` |
| **`none`** | Manual trigger executed on-demand via the CLI command `event manager run <name>`. | `event none` |
+---------------------------------------------------------------------------------------------------+
Multi-Event Correlation in EEM
EEM allows combining multiple event detectors using logical boolean operators (and, or, and-not) within a single applet policy using event tags:
! EEM Applet using Multi-Event Boolean Correlation
event manager applet CORRELATED_LINK_FAIL
event tag 1.0 syslog pattern "LINK-3-UPDOWN: Interface GigabitEthernet1/0/1, changed state to down"
event tag 2.0 track 100 state down
trigger
correlation 1.0 and 2.0
action 1.0 syslog msg "[CRITICAL] Both Physical Link Gi1/0/1 and IP SLA Track 100 Failed!"
action 2.0 cli command "enable"
action 3.0 cli command "configure terminal"
action 4.0 cli command "interface GigabitEthernet1/0/2"
action 5.0 cli command "no shutdown"
2. EEM Policy Definition, Sequencing Rules & Variable Substitution
EEM Applets are declared in global configuration mode using event manager applet <name>. Inside the applet configuration context, the engineer specifies the trigger event and an ordered series of action statements.
The Critical Action Sequencing Rule
[!CAUTION] CRITICAL BLUEPRINT EXAM RULE: Cisco EEM executes action statements in alphanumeric ASCII sorting order of their action labels, NOT in the sequential physical order they were typed into the CLI!
+---------------------------------------------------------------------------------------------------+
| EEM ACTION LABEL SEQUENCING PITFALL |
+---------------------------------------------------------------------------------------------------+
| |
| INCORRECT INTEGER LABELING: |
| action 1 cli command "enable" |
| action 2 cli command "configure terminal" |
| action 10 cli command "interface Gi1/0/1" |
| |
| * ASCII SORTING ORDER: '1' -> '10' -> '2' |
| * EXECUTION SEQUENCE: action 1 ==> action 10 ==> action 2 |
| * RESULT: Switch attempts 'interface Gi1/0/1' in EXEC mode before 'config t' -> FAILS! |
| |
| RECOMMENDED BEST PRACTICE (DECIMAL OR ZERO-PADDED LABELS): |
| action 1.0 cli command "enable" |
| action 2.0 cli command "configure terminal" |
| action 10.0 cli command "interface Gi1/0/1" |
| * ASCII SORTING ORDER: '1.0' -> '2.0' -> '10.0' |
| * EXECUTION SEQUENCE: action 1.0 ==> action 2.0 ==> action 10.0 -> SUCCESS! |
+---------------------------------------------------------------------------------------------------+
Primary EEM Action Statements
action <id> cli command "<string>": Executes an interactive CLI command. Multi-command workflows must explicitly includeenableandconfigure terminal.action <id> syslog msg "<string>" priority <level>: Injects a custom message into the local syslog buffer and remote syslog collectors.action <id> mail server "<ip>" to "<email>" from "<email>" subject "<title>" body "<body>": Dispatches an automated SMTP email alert.action <id> snmp-trap strdata "<string>": Sends an enterprise SNMP trap containing diagnostic strings.action <id> set $_exit_status 0 | 1: Used in synchronous CLI interception (sync yes). Setting$_exit_status 0drops/blocks the command;$_exit_status 1allows the command to execute.
EEM Built-In System Variables & User Environment Variables
+---------------------------------------------------------------------------------------------------+
| EEM SYSTEM & USER VARIABLES |
+---------------------------------------------------------------------------------------------------+
| Variable Name | Type | Description & Contents |
| :----------------- | :-------- | :--------------------------------------------------------------- |
| **`$_cli_msg`** | Built-in | The exact raw CLI command string intercepted by a `cli` detector.|
| **`$_cli_result`** | Built-in | The textual terminal output returned from the preceding CLI |
| | | command execution (`action <id> cli command ...`). |
| **`$_syslog_msg`** | Built-in | The complete raw syslog message text captured by a `syslog` ED. |
| **`$_event_pub_time`**| Built-in| Timestamp (epoch/ISO) indicating when the event was published. |
| **`$_exit_status`**| Built-in | Exit control status for synchronous CLI interception (0=Drop,1=Pass)|
| **User-Defined** | Custom | Global variables configured via `event manager environment <K> <V>|
+---------------------------------------------------------------------------------------------------+
Synchronous (sync yes) vs. Asynchronous (sync no) Execution
-
Synchronous Execution (
sync yes):- The EEM Server pauses the triggering process (e.g., CLI parser or syslog dispatcher) while the EEM policy executes.
- The policy can evaluate conditions, run diagnostics, and determine whether to permit or reject the original action using
set $_exit_status. - Bound by a maximum execution run-time (
maxrun <seconds>, default 20s) to prevent locking the CLI parser permanently.
-
Asynchronous Execution (
sync no):- The triggering event runs immediately in the background without waiting for the EEM policy to finish.
- Best for non-blocking notifications, scheduled configuration backups, and automated interface recovery.
3. Production Cisco IOS-XE EEM Applet Configurations
Scenario 1: Synchronous CLI Interception (Preventing Destructive Commands)
This production policy intercepts any administrative attempt to issue a reload or write erase command in privileged EXEC mode, logs a high-severity security alert with the user's intercepted command string, and immediately blocks the execution:
! Block destructive reload command and log security violation
event manager applet GUARD_PROD_RELOAD authorization bypass
event cli pattern "reload" sync yes
action 1.0 syslog priority critical msg "[SECURITY ALERT] Unauthorized 'reload' attempted! Intercepted command: '$_cli_msg'"
action 2.0 set _exit_status 0
Scenario 2: Interface Error Detection with Dynamic Output Capture ($_cli_result)
This applet monitors interface input error thresholds, executes a show interface diagnostic command upon crossing the threshold, captures the command output into $_cli_result, sends an alert containing the diagnostic data, and bounces the interface to clear ASIC hardware stalls:
! Detect interface CRC errors, capture diagnostics, and bounce port
event manager applet RECOVER_FLAPPING_PORT
event interface name GigabitEthernet1/0/1 parameter rx_crc_errors entry-val 20 entry-op gt
action 1.0 syslog msg "[EEM DETECTED] Gi1/0/1 exceeded 20 CRC errors. Running diagnostics..."
action 2.0 cli command "enable"
action 3.0 cli command "show interfaces GigabitEthernet1/0/1 counters errors"
action 4.0 syslog msg "[DIAGNOSTIC OUTPUT] $_cli_result"
action 5.0 cli command "configure terminal"
action 6.0 cli command "interface GigabitEthernet1/0/1"
action 7.0 cli command "shutdown"
action 8.0 cli command "no shutdown"
action 9.0 cli command "end"
action 9.1 syslog msg "[EEM RECOVERY] GigabitEthernet1/0/1 bounced successfully."
Scenario 3: Scheduled Nightly Configuration Backup to Remote SCP Server
! Set global environment variables for backup destination
event manager environment BACKUP_SRV 10.100.50.25
event manager environment BACKUP_USER netbackup
!
event manager applet SCHEDULED_NIGHTLY_BACKUP
event timer cron cron-entry "0 23 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "copy running-config scp://$BACKUP_USER:VaultPass123!@$BACKUP_SRV/backups/sw-core-01.cfg"
action 3.0 syslog msg "[EEM BACKUP] Automated nightly running-config backup dispatched to SCP repository."
EEM CLI Verification & Inspection Commands
! 1. Display all registered EEM applets and trigger criteria
Core-Switch# show event manager policy registered
No. Class Type Event Type Trap Time Registered Name
1 applet user cli Off Sun Aug 30 14:10:22 2026 GUARD_PROD_RELOAD
2 applet user interface Off Sun Aug 30 14:12:05 2026 RECOVER_FLAPPING_PORT
3 applet user timer cron Off Sun Aug 30 14:15:30 2026 SCHEDULED_NIGHTLY_BACKUP
! 2. Display recent EEM event triggering history and execution status
Core-Switch# show event manager history events
No. Time of Event Event Type Name
1 Sun Aug 30 15:45:10 2026 cli GUARD_PROD_RELOAD
2 Sun Aug 30 18:02:14 2026 interface RECOVER_FLAPPING_PORT
! 3. Display configured global EEM environment variables
Core-Switch# show event manager environment
Name Value
BACKUP_SRV 10.100.50.25
BACKUP_USER netbackup
4. Intent-Based Networking (IBN) Lifecycle
Traditional enterprise networks operate on a manual, box-by-box configuration model where business policies (such as compliance requirements, QoS prioritization, and security segmentation) must be manually translated into thousands of discrete CLI commands across switches, routers, and firewalls. This model is slow, error-prone, and lacks continuous validation.
Intent-Based Networking (IBN) transforms this paradigm by capturing high-level business goals (Intent) and utilizing intelligent software controllers to automatically translate, activate, and continuously assure that the network satisfies those goals.
+---------------------------------------------------------------------------------------------------+
| THE THREE PILLARS OF THE IBN LIFECYCLE |
+---------------------------------------------------------------------------------------------------+
| |
| 1. TRANSLATION (Business Intent -> Network Policy) |
| - Ingests human intent (e.g., "Medical IoT devices must only communicate with PACS servers"). |
| - Translates intent into concrete, vendor-agnostic policies, ACLs, and QoS parameters. |
| - Evaluates policy consistency and models security impact before deployment. |
| |
| 2. ACTIVATION (Automated Deployment & Orchestration) |
| - Provisions physical and virtual underlays and overlays (SD-Access, SD-WAN, ACI). |
| - Deploys configurations programmatically via NETCONF/YANG, RESTCONF, and Ansible/Terraform. |
| - Validates device capabilities and verifies syntax integrity during deployment. |
| |
| 3. ASSURANCE (Continuous Verification & Predictive Insights) |
| - Continuously ingests streaming telemetry, Model-Driven Telemetry (MDT), NetFlow, and Syslog. |
| - Verifies in real time that live network behavior matches the original business intent. |
| - Detects configuration drift, SLA violations, throughput degradation, and connectivity loss. |
| |
| ==> CLOSED-LOOP REMEDIATION (Self-Healing Network Operations) |
| - Automatically triggers corrective actions (Activation) when Assurance detects drift or |
| anomalies, restoring the network to compliance without human operator intervention. |
+---------------------------------------------------------------------------------------------------+
5. Cisco AI Network Analytics & Closed-Loop Operations
Traditional network monitoring relies on static threshold alerting (e.g., alert NOC if interface utilization > 80% or client Wi-Fi connection time > 5 seconds). In enterprise environments, static thresholds create two severe operational failures:
- Alert Fatigue: Normal traffic surges (such as 9:00 AM employee arrival) trigger thousands of false-positive alarms that overwhelm NOC operators.
- Undetected Degradation (False Negatives): A critical failure occurring during low-traffic periods (e.g., Sunday at 3:00 AM where latency spikes from 20ms to 4.5s) goes completely unalerted because it never crosses the arbitrary 5.0s static threshold.
+---------------------------------------------------------------------------------------------------+
| STATIC THRESHOLDS VS. AI NETWORK ANALYTICS |
+---------------------------------------------------------------------------------------------------+
| |
| STATIC THRESHOLD MONITORING (Legacy): |
| - Fixed Rule: Alert when AP client onboarding time > 5.0 seconds. |
| - Monday 9:00 AM (Peak Rush): 1,000 users join; latency is 4.8s -> High load, 50 alerts fired! |
| - Sunday 3:00 AM (Idle Night): 1 user takes 4.9s (normally 0.2s) -> Zero alerts (Failure missed!)|
| |
| AI NETWORK ANALYTICS (Machine Learning Dynamic Baselines): |
| - Analyzes 4+ weeks of historical telemetry to learn diurnal (day/night) cycles and peer groups. |
| - Monday 9:00 AM baseline computes expected 4.5s -> 4.8s is NORMAL (Zero false alerts). |
| - Sunday 3:00 AM baseline computes expected 0.2s -> 4.9s is a CRITICAL STATISTICAL OUTLIER (+24x)||
| Alert fires instantly with automated root cause analysis! |
+---------------------------------------------------------------------------------------------------+
Machine Learning Pillars of Cisco AI Network Analytics
- Dynamic Multi-Dimensional Baselines: Uses continuous machine learning to model expected performance metrics across time-of-day, day-of-week, seasonal variations, and peer device groupings. Baselines adjust automatically as network usage evolves.
- Unsupervised Anomaly Detection: Applies clustering algorithms (e.g., K-Means, DBSCAN) and time-series forecasting across high-frequency streaming telemetry to isolate statistical outliers in client onboarding (DHCP, DNS, 802.1X/RADIUS), roaming failures, RF interference, and packet loss.
- Event Deduplication & Noise Reduction: Aggregates and correlates thousands of related syslog messages, SNMP traps, and telemetry events into a single consolidated, high-fidelity Issue.
- Machine Reasoning Engine (MRE): An expert AI inference engine that automates root-cause analysis (RCA). When an anomaly is detected, MRE executes an automated decision tree (codified from decades of Cisco TAC diagnostic intelligence), pinpoints the exact root cause (such as a misconfigured DHCP pool, bad optical patch cable, or RF channel overlap), and provides guided, automated self-healing remediation commands.
A network security administrator configures a Cisco EEM applet to prevent unauthorized engineers from executing the 'write erase' command in privileged EXEC mode. The applet must intercept the command before execution, block it, and dispatch a critical syslog notification. Which event detector and action parameter combination correctly fulfills this requirement?
An automation engineer writes a Cisco EEM applet to bounce an access port during an outage. The engineer defines three action lines: 'action 1 cli command "enable"', 'action 2 cli command "configure terminal"', and 'action 10 cli command "interface GigabitEthernet1/0/5"'. What execution order will Cisco EEM follow, and why does this cause a configuration failure?
An enterprise network is managed using an Intent-Based Networking (IBN) architecture with Cisco Catalyst Center. High-frequency Model-Driven Telemetry indicates that voice traffic between two regional campus sites is experiencing excessive jitter, violating business QoS policies. In the closed-loop IBN lifecycle, which phase detects this policy violation, and what automated corrective workflow is initiated?
How does Cisco AI Network Analytics within Cisco Catalyst Center resolve the 'alert fatigue' problem caused by traditional static threshold monitoring in enterprise campus networks?
You've completed this section
Continue exploring other exams