EEM action CLI commands contain an EEM action label that is a unique identifier that can be any string
value. Actions are sorted and run in ascending alphanumeric (lexicographical) key sequence using the label
as the sort key. If you are using numbers as labels be aware that alphanumerical sorting will sort 10.0 after
1.0, but before 2.0, and in this situation we recommend that you use numbers such as 01.0, 02.0, and so on,
or use an initial letter followed by numbers.
Embedded Event Manager Environment Variables
EEM allows environment variables to be used in EEM policies. Tool Command Language (Tcl) allows global
variables to be defined that are known to all procedures within a Tcl script. EEM allows environment variables
to be defined using a CLI command, the
event manager environment
command, for use within an EEM
policy. All EEM environment variables are automatically assigned to Tcl global variables before a Tcl script
is run. There are three different types of environment variables associated with Embedded Event Manager:
•
User-defined--Defined by you if you create an environment variable in a policy that you have written.
•
Cisco-defined--Defined by Cisco for a specific sample policy.
•
Cisco built-in (available in EEM applets)--Defined by Cisco and can be read only or read/write. The
read only variables are set by the system before an applet starts to execute. The single read/write variable,
_exit_status, allows you to set the exit status at policy exit for policies triggered from synchronous
events.
Cisco-defined environment variables (see the table below) and Cisco system-defined environment variables
may apply to one specific event detector or to all event detectors. Environment variables that are user-defined
or defined by Cisco in a sample policy are set using the
event manager environment
command. Variables
that are used in the EEM policy must be defined before you register the policy. A Tcl policy contains a section
called
“
Environment Must Define
”
that can be defined to check that any required environment variables are
defined before the policy runs.
Cisco built-in environment variables are a subset of the Cisco-defined environment variables and the built-in
variables are available to EEM applets only. The built-in variables can be read-only or can be read and write,
and these variables may apply to one specific event detector or to all event detectors. For more details and a
table listing the Cisco system-defined variables, see the
““
Writing Embedded Event Manager Policies Using
the Cisco IOS CLI
”
module.
Cisco-defined environment variables begin with an underscore character (_). We strongly recommend
that customers avoid the same naming convention to prevent naming conflicts.
Note
The table below describes the Cisco-defined variables used in the sample EEM policies. Some of the
environment variables do not have to be specified for the corresponding sample policy to run and these are
marked as optional.
Table 157: Cisco-Defined Environmental Variables and Examples
Example
Description
Environment Variable
interface Ethernet1/0
The first configuration command
that is executed.
_config_cmd1
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1676
Information About Embedded Event Manager
Содержание Catalyst 2960 Series
Страница 78: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches lxxviii Contents ...
Страница 96: ......
Страница 184: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 102 Additional References ...
Страница 195: ...P A R T II IP Multicast Routing Configuring IGMP Snooping and Multicast VLAN Registration page 115 ...
Страница 196: ......
Страница 250: ......
Страница 292: ......
Страница 488: ......
Страница 589: ...P A R T VI Cisco Flexible NetFlow Configuring NetFlow Lite page 509 ...
Страница 590: ......
Страница 619: ...P A R T VII QoS Configuring QoS page 539 Configuring Auto QoS page 645 ...
Страница 620: ......
Страница 749: ...P A R T VIII Routing Configuring IP Unicast Routing page 669 Configuring IPv6 First Hop Security page 677 ...
Страница 750: ......
Страница 796: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 714 Additional References ...
Страница 856: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 774 Additional References ...
Страница 1400: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1318 Additional References ...
Страница 1546: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1464 Auto Identity ...
Страница 1596: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1514 Additional References ...
Страница 1604: ......
Страница 1740: ......
Страница 1764: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1682 Additional References ...
Страница 1942: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1860 cli_write ...
Страница 1950: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1868 context_save ...
Страница 2058: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1976 event_register_wdsysmon ...
Страница 2076: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 1994 smtp_subst ...
Страница 2090: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 2008 sys_reqinfo_syslog_history ...
Страница 2104: ...Consolidated Platform Configuration Guide Cisco IOS Release 15 2 4 E Catalyst 2960 X Switches 2022 unregister_counter ...
Страница 2105: ...P A R T XII Configuring Cisco IOS IP SLAs Configuring Cisco IP SLAs page 2025 ...
Страница 2106: ......
Страница 2118: ......
Страница 2164: ......