Vsh Script Policies; Environment Variables - Cisco Nexus 7000 Series Configuration Manual

Hide thumbs Also See for Nexus 7000 Series:
Table of Contents

Advertisement

Configuring the Embedded Event Manager
• Execute any CLI commands.
• Update a counter.
• Log an exception.
• Force the shutdown of any module.
• Reload the device.
• Shut down specified modules because the power is over budget.
• Generate a syslog message.
• Generate a Call Home event.
• Generate an SNMP notification.
• Use the default action for the system policy.
If you want to allow the triggered event to process any default actions, you must configure the EEM policy
Note
to allow the default action. For example, if you match a CLI command in a match statement, you must
add the event-default action statement to the EEM policy or EEM will not allow the CLI command to
execute.
Note
Verify that your action statements within your user policy or overriding policy do not negate each other
or adversely affect the associated system policy.

VSH Script Policies

You can also write policies in a VSH script, using a text editor. These policies have an event statement and
action statement(s) just as other policies, and these policies can either augment or override system policies.
After you write your VSH script policy, copy it to the device and activate it.

Environment Variables

You can define environment variables for EEM that are available for all policies. Environment variables are
useful for configuring common values that you can use in multiple policies. For example, you can create an
environment variable for the IP address of an external e-mail server.
You can use an environment variable in action statements by using the parameter substitution format.
This example shows a sample action statement to force a module 1 shutdown, with a reset reason of "EEM
action."
switch (config-eem-policy)# action 1.0 forceshut module 1 reset-reason "EEM action."
If you define an environment variable for the shutdown reason, called default-reason, you can replace that
reset reason with the environment variable, as shown in the following example.
switch (config-eem-policy)# action 1.0 foreshut module 1 reset-reason $default-reason
You can reuse this environment variable in any policy.
Cisco Nexus 7000 Series NX-OS System Management Configuration Guide
VSH Script Policies
243

Advertisement

Table of Contents
loading

Table of Contents