action add
To specify the action of adding values of two variables when an an Embedded Event Manager (EEM) applet is triggered, use the action add command in applet configuration mode. To undo the add action, use the no form of this command.
action label add {long-integer | variable-name} {long-integer | variable-name}
no action label add
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. |
add |
Adds the values of two variables. |
variable-name |
String value to be placed as the variable name. |
long-integer |
Long integer value to be added to a variable. |
Command Default
By default, there is no change in the value of variables configured within an EEM applet.
Command Modes
Applet configuration (config-applet)
Command History
Release |
Modification |
---|---|
12.4(22)T |
This command was introduced. |
12.2(33)SRE |
This command was integrated into Cisco IOS Release 12.2(33)SRE. |
Usage Guidelines
You can use this command to add the values of two variables. The result is stored in the variable named $_result. The value of the variable must be a long integer, else the action will fail.
Examples
The following example shows how to configure an EEM applet to add the values of two variables:
Router(config)#event manager applet one
Router(config-applet)#action 1.0 set $var1 10
Router(config-applet)#action 1.0 set $var2 20
Router(config-applet)#action 1.0 add $var1 $var2
Router(config-applet)#