Lesson Overview  

Modern enterprise networks require automation to improve operational efficiency, reduce human errors, and respond quickly to network events.

Network engineers often perform repetitive tasks such as monitoring interface status, collecting troubleshooting information, backing up configurations, checking routing neighbors, and responding to device failures.


Automation technologies help perform these activities consistently without requiring engineers to manually execute every command.


Two important concepts in network automation are Cisco Embedded Event Manager (EEM) and Agent-Based vs Agentless Automation.


Cisco EEM is an event-driven automation framework available on supported Cisco network devices. It allows devices to monitor predefined conditions and automatically execute actions when specific events occur.


Agent-based automation uses software installed on managed systems to perform monitoring, configuration, or management operations.


Agentless automation uses existing management interfaces, such as SSH, REST APIs, NETCONF, or RESTCONF, without requiring a dedicated automation agent to be installed on every managed device.


Understanding these approaches helps network engineers select appropriate automation solutions for enterprise networks.


Learning Objectives 

By the end of this lesson, you will be able to:

  1. Understand Cisco EEM architecture and its key components.

  2. Identify different EEM events and triggering conditions.

  3. Create and configure EEM applets for automated actions.

  4. Apply EEM for network monitoring, troubleshooting, and configuration tasks.

  5. Verify EEM policies and troubleshoot execution issues.

  6. Differentiate between agent-based and agentless automation.

  7. Explain push and pull automation models.

  8. Identify common protocols used in network automation.

  9. Implement agentless automation using Ansible on Cisco IOS XE.

  10. Understand on-device agents and network telemetry.

  11. Compare automation approaches based on security, scalability, and maintenance.


1.  Cisco Embedded Event Manager (EEM)

1.1 What Is Cisco EEM?

Cisco Embedded Event Manager (EEM) is an event-driven automation framework that runs directly on supported Cisco network devices.

EEM monitors device events and performs predefined actions when configured conditions are met.

These events may include:

  • Interface status changes.

  • Syslog messages.

  • Timer expiration.

  • CLI execution.

  • Routing-related events.

  • Resource utilization thresholds.

  • SNMP events.

  • Track object state changes.

EEM allows network devices to respond to certain operational conditions automatically.


Example

A router experiences an interface failure. Without automation, an engineer may need to:

  1. Receive a monitoring alert.

  2. Log in to the router.

  3. Identify the affected interface.

  4. Execute troubleshooting commands.

  5. Collect logs.

  6. Investigate the problem.

With EEM, the router can automatically collect predefined diagnostic information when the interface-down event occurs. This reduces the time required to collect evidence.


1.2 Why Is EEM Important?

EEM provides local automation capabilities without requiring a separate automation server for every event.


Benefits of Cisco EEM

Benefit

Description

Event-Driven Automation

Executes actions when predefined events occur

Faster Troubleshooting

Collects diagnostic information automatically

Local Execution

Runs on the network device

Reduced Manual Work

Automates repetitive CLI tasks

Flexible Triggers

Supports multiple event detectors

Operational Consistency

Executes predefined actions consistently

Integration

Can interact with syslog, CLI, timers, and other supported facilities


Common EEM Use Cases

  • Interface-down event logging.

  • Automatic collection of CPU information.

  • Periodic configuration backups.

  • Routing neighbor troubleshooting.

  • Track object monitoring.

  • Syslog-triggered diagnostics.

  • Scheduled command execution.

  • Network maintenance automation.

1.3 How Cisco EEM Works

EEM consists of event detection and policy execution components. An event detector monitors a particular condition. When the configured event occurs, EEM evaluates the policy and executes the associated actions.


EEM Architecture

Pasted content image

EEM Workflow

  1. An event occurs on the network device.

  2. An EEM event detector identifies the event.

  3. The event detector triggers the configured policy.

  4. The EEM policy engine executes the policy.

  5. The policy performs predefined actions.

  6. The device records or reports the result.

1.4 Main Components of EEM

Event Detectors

Event detectors monitor specific system conditions.


EEM Policies

Policies define what should happen when an event is detected. Policies can be implemented using EEM applets or supported scripting mechanisms.


Actions

Actions define the operations performed after an event occurs.

Examples include:

  • Execute a CLI command.

  • Generate a syslog message.

  • Read an environment variable.

  • Collect troubleshooting information.

  • Perform conditional processing.

EEM Scheduler

EEM uses scheduling mechanisms to manage policy execution. Scheduling and execution limits help control how policies consume device resources.


1.5 EEM Lab Topology

Pasted content image

Lab Addressing

Node / Interface

Address

Purpose

PC1

192.168.10.10/24

Management/testing workstation

SW1

192.168.10.1

Access switch management

R1 Gi0/0

192.168.10.1/24

Inside / management-facing interface

R1 Gi0/1

203.0.113.1/30

WAN-facing interface used for event tests

Syslog/NMS

192.168.20.100

Optional remote collector for EEM-generated syslog events

Lab objective: Configure EEM on R1 to detect events, create notifications, collect troubleshooting output, execute a controlled configuration change, and perform scheduled data collection.


1.6 EEM Events

An EEM policy begins with an event statement. The event statement defines what must happen before the applet is scheduled to run.

Event Type

Typical Use

Example Concept

Syslog

React to a specific IOS/IOS XE log message.

Interface state change, routing adjacency failure, configuration change.

Timer - watchdog

Run repeatedly after a fixed number of seconds.

Health check every 300 seconds.

Timer - cron

Run on a calendar schedule.

Collect statistics every hour or every night.

Track

React to an object-tracking state transition.

Reachability object or route tracking goes down.

SNMP / OID

React when a monitored MIB object meets criteria.

Memory, interface counters, IP SLA related OID changes.

None

Register a policy for manual execution.

Operator tests the applet with event manager run.

Platform / resource

React to supported platform health events.

CPU, memory, environmental or watchdog conditions; availability depends on platform/release.


1.6.1 Syslog Event Detector  

The Syslog event detector triggers an EEM policy when a matching syslog message is generated.


Example Scenario

An uplink interface goes down. The device generates a syslog message similar to:

%LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down

EEM can match this message and execute predefined actions.  

Example Configuration  

Explanation

  • event manager applet