set (EEM)
Note |
Effective with Cisco IOS Release 12.4(22)T, the set (EEM) command is replaced by the action set (EEM) command. See the action set (EEM) command for more information. |
To set the value of a local Embedded Event Manager (EEM) applet variable, use the set command in applet configuration mode. To remove the value of an EEM applet variable, use the no form of this command.
set label variable-name variable-value
no set label variable-name variable-value
Syntax Description
label |
Unique identifier that can be any string value. Actions are sorted and run in ascending alphanumeric key sequence using the label as the sort key. If the string contains embedded blanks, enclose it in double quotation marks. |
variable-name |
The EEM applet variable name. Currently only the _exit_status variable is supported. |
variable-value |
Integer value that represents the variable. For the _exit_status variable, this is the value that represents the exit status for the applet. Zero represents a successful exit status, and a nonzero value represents a failed exit status. |
Command Default
No EEM applet variable values are set.
Command Modes
Applet configuration (config-applet)
Command History
Release |
Modification |
---|---|
12.3(14)T |
This command was introduced. |
12.2(28)SB |
This command was integrated into Cisco IOS Release 12.2(28)SB. |
12.2(18)SXF4 |
This command was integrated into Cisco IOS Release 12.2(18)SXF4 to support Software Modularity images only. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.2(18)SXF5 |
This command was integrated into Cisco IOS Release 12.2(18)SXF5. |
12.2SX |
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware. |
12.4(22)T |
This command was replaced by the action set command. |
Usage Guidelines
In EEM applet configuration mode, three types of configuration statements are supported. The event commands are used to specify the event criteria to trigger the applet to run, the action commands are used to specify an action to perform when the EEM applet is triggered, and the set command is used to set the value of an EEM applet variable. Currently only the _exit_status variable is supported for the set command.
Examples
The following example shows how to set the _exit_status variable to represent a successful status after an event has occurred three times and an action has been performed:
Router(config)# event manager applet cli-match
Router(config-applet)# event cli pattern {.*interface loopback*} sync yes occurs 3
Router(config-applet)# action 1.0 cli command "no shutdown"
Router(config-applet)# set 1.0 _exit_status 0