Registering an EEM
policy is performed with the
event manager
policy command in
global
configuration mode. An EEM
script is available to be scheduled by the EEM until the
no form of this
command is entered. Prior to registering a policy, display EEM policies that
are available to be registered with the
show event manager policy
available command.
The EEM schedules
and runs policies on the basis of an event specification that is contained
within the policy itself. When the
event manager
policy command is invoked, the EEM examines the policy and
registers it to be run when the specified event occurs.
Username
To register an EEM
policy, you must specify the username that is used to run the script. This name
can be different from the user who is currently logged in, but the registering
user must have permissions that are a superset of the username that will run
the script. Otherwise, the script is not registered and the command is
rejected. In addition, the username that will run the script must have access
privileges to the commands run by the EEM policy being registered.
 Note |
AAA authorization
(such as the
aaa authorization
eventmanager command) must be configured before EEM policies can
be registered. See the
Configuring AAA
Services
module of
Configuring AAA
Services on
Cisco IOS XR Software
for more information about AAA authorization configuration.
|
Persist-time
An optional
persist-time
keyword for the username can also be defined. The
persist-time
keyword defines the number of seconds the username authentication is valid.
When a script is first registered, the configured username for the script is
authenticated. After the script is registered, the username is authenticated
again each time a script is run. If the AAA server is down, the username
authentication can be read from memory. The
persist-time
keyword determines the number of seconds this username authentication is held
in memory.
-
If the AAA
server is down and the
persist-time
keyword has not expired, then the username is authenticated from memory and the
script runs.
-
If the AAA
server is down, and the
persist-time
keyword has expired, then user authentication will fail and the script will not
run.
The following values
can be used for the
persist-time
keyword.
-
The default
persist-time is
3600 seconds (1 hour). Enter the
event manager
policy command without the
persist-time
keyword to set the
persist-time to
1 hour.
-
Enter 0 to stop
the username authentication from being cached. If the AAA server is down, the
username will not authenticate and the script will not run.
-
Enter
infinite to
stop the username from being marked as invalid. The username authentication
held in the cache will not expire. If the AAA server is down, the username will
be authenticated from the cache.
System or
user
keywords
If you enter the
event manager
policy command without specifying either the
system or
user keyword,
the EEM first tries to locate the specified policy file in the system policy
directory. If the EEM finds the file in the system policy directory, it
registers the policy as a system policy. If the EEM does not find the specified
policy file in the system policy directory, it looks in the user policy
directory. If the EEM locates the specified file in the user policy directory,
it registers the policy file as a user policy. If the EEM finds policy files
with the same name in both the system policy directory and the user policy
directory, the policy file in the system policy directory takes precedence and
is registered as a system policy.
Once policies have
been registered, their registration can be verified through the
show event manager policy
registered command. The output displays registered policy
information in two parts. The first line in each policy description lists the
index number assigned to the policy, the policy type (system or user), the type
of event registered, the time when the policy was registered, and the name of
the policy file. The remaining lines of each policy description display
information about the registered event and how the event is to be handled, and
come directly from the Tcl command arguments that make up the policy file.