SUMMARY STEPS
1. enable
2. configure terminal
3. event manager applet applet-name
4. action label foreach [string-iterator] [string-input] [string-delimiter]
5. Specify any action command
6. action label
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Device> enable
Step 2
configure terminal
Example:
Device# configure terminal
Step 3
event manager applet applet-name
Example:
Device(config)# event manager applet iteration
Step 4
action label foreach [string-iterator] [string-input]
[string-delimiter]
Example:
Device(config-applet)# action 2.0 foreach
iterator "red blue green orange"
Step 5
Specify any action command
Example:
Device(config-applet)# action 3.0 puts
"Iterator is $iterator"
end
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
How to Write EEM Policies Using the Cisco IOS CLI
Purpose
Enables privileged EXEC mode.
• Enter your password if prompted.
Enters global configuration mode.
Registers the applet with the Embedded Event Manager (EEM)
and enters applet configuration mode.
Iterates over an input string using the delimter as a tokenizing
pattern.
• In this example, the iteration is run through the elements
of the input string - red, blue, green and orange.
Performs the action as indicated by the action command.
• In this example, the following message is displayed on
the screen:
Iterator is red
Iterator is blue
Iterator is green
Iterator is orange
1737