
Embedded Event Manager (EEM)
common use cases and operations of the on-box EEM automation tool as well as the Tcl scripting engine.
- A very flexible and powerful IOS tool.
- Allows engineers to build software applets that can automate many tasks.
- Enables you to build custom scripts using Tcl.
- Scripts can automatically execute based on the output of an action or an event on a device.
- EEM is all contained within the local device. No need to rely on an external scripting engine or monitoring device in most cases.
EEM Event Detectors
Some EEM event detectors and how they interact with the IOS subsystem.
- EEM applets composed of multiple building blocks. This focuses on: events and actions block.
- EEM applets use a similar logic to the ifthen statements used in some of the common programming languages (if an event happens, then an action taken).
EEM Applets
An applet that is looking for a specific syslog message, stating that the Loopback0 went down. If this specific syslog pattern matched (an event) at least once, then the following actions will be taken:
- The Loopback0 shut down and brought back up.
- The router will generate a syslog message that says, “I’ve fallen, and I can’t get up!”
- An email that includes the output of show interface loopback0 sent to the network admin. Remember to include the enable and configure terminal commands at the beginning of actions within an applet.
Debugging Output
- Based on the output from the debug event manager action cli, you can see the actions taking place when the applet is running.
- The applet being engaged when a user issues the shutdown command on the Loopback0 interface.
CLI Patterns
- When certain commands entered using the CLI, they trigger an EEM event within an applet. The configured actions then take place as a result of the CLI pattern being matched.
- Example 29-3 uses another common EEM applet to match the CLI pattern “write mem.” When the applet triggered, the following invoked:
- The router generates a syslog message “Configuration File Changed! TFTP backup successful.”
- The startup-config file copied to a TFTP server.
EEM Environment Values
- There are multiple ways to call out specific EEM environment values.
- Although it is possible to create custom names and values that are arbitrary and can be set to anything,
- it is good practice to use common and descriptive variables.
Tcl Scripts
- An EEM script configured with the event none command. There is no automatic event that the applet is monitoring, this applet runs only when it is triggered manually. To manually run an EEM applet, the event manager run applet-name command must be used.
Script Contents
- Example 29-5 displays a snippet for the exact content of the ping.tcl script used in the manually triggered EEM applet in Example 29-4.
- To see the contents of a Tcl script that resides in flash memory, issue the more command followed by the file location and filename.
- The more command can be used to view all other textbased files stored in the local flash memory as well.
EEM Summary
The value in using automation and configuration management tools is the ability to move more quickly than is possible with manual configuration. Automation helps ensure that the level of risk due to human error is reduced by using proven automation methods. The following are some of the most common and repetitive configurations for which network operators leverage automation tools to increase speed and consistency:
- Device name/IP address
- Quality of service
- Access list entries
- Usernames/passwords
- SNMP settings
- Compliance