How to Configure Embedded Event Manager (EEM) on Cisco IOS

Опубликовано: 11 Февраль 2025
на канале: Ferds Tech Channel
3,518
19

TIMESTAMPS:
0:00 Introduction
4:16 EEM Configuration
6:45 EEM Simulation
9:55 Conclusion

Configure Embedded Event Manager on Cisco IOS

Embedded Event Manager Policies
EEM offers the ability to monitor events and take informational or corrective action when the monitored events occur or a threshold is reached.
An EEM policy is an entity that defines an event and the actions to be taken when that event occurs.
There are two types of EEM policies: an applet or a script. An applet is a simple form of policy that is defined within the CLI configuration.
A script is a form of policy that is written in Tool Command Language (Tcl).

Configure
conf t
event manager applet NO_SHUT_INT
event syslog pattern "GigabitEthernet0/0, changed state to administratively down"
action 1.0 cli command "enable"
action 2.0 cli command "conf term"
action 3.0 cli command "int gi0/0"
action 4.0 cli command "no shut"
end
wr


Another Example:
event manager applet CONFIGURATION_CHANGE !Registers the applet with the EEM and enters applet configuration mode.
event syslog pattern "Configured from console by" !Specifies the event criteria for an Embedded Event Manager (EEM) applet that is run by matching syslog messages.
action 1.0 cli command "show log | inc SYS-5-CONFIG_I"
action 2.0 mail server "smtp.office365.com" to "[email protected]" from "[email protected]" subject "CONFIGURATION_CHANGE" body "$_cli_result"
end
wr


Verify
show event manager policy registered !Displays the EEM policies that are currently registered.
show event manager environment !Displays the name and value of EEM environment variables.
show event manager history events !Use this command to display detailed information about each EEM event.
debug event manager action cli
debug event manager action mail

References:
https://www.cisco.com/c/en/us/td/docs... - Embedded Event Manager Overview
https://www.cisco.com/c/en/us/td/docs... - Writing Embedded Event Manager Policies Using the Cisco IOS CLI
https://www.cisco.com/c/en/us/support... - Best Practices and Useful Scripts for EEM
https://community.cisco.com/t5/networ... - Cisco EEM Best Practices
https://community.cisco.com/t5/networ... - EEM Built-in "Action" Variables

#cisco #ccna #ccnp #ccie