Defining A Policy Using A Vsh Script; Registering And Activating A Vsh Script Policy - Cisco Nexus 7000 Series Configuration Manual

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

Advertisement

Defining a Policy Using a VSH Script

Command
action label string trimright string1 [string2]
switch(config-applet)# action 5.7 string
trimright "this is a testtest" "test"
action label set variable-name variable-value
switch(config-applet)# action 6.0 set $string
"Container"
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. You can use the terminal event-manager bypass command to allow all EEM policies with CLI
matches to execute the CLI command.
Defining a Policy Using a VSH Script
You can define a policy using a VSH script.
Before You Begin
Ensure that you are logged in with administrator privileges.
Ensure that your script name is the same name as the script filename.
Procedure
Step 1
In a text editor, list the commands that define the policy.
Step 2
Name the text file and save it.
Step 3
Copy the file to the following system directory: bootflash://eem/user_script_policies.

Registering and Activating a VSH Script Policy

You can register and activate a policy defined in a VSH script.
Cisco Nexus 7000 Series NX-OS System Management Configuration Guide
260
Configuring the Embedded Event Manager
Purpose
Trims the characters in string2 from the right end of
string1. By default, string2 corresponds to whitespace.
The action label is in the format number1.number2.
number1 can be any number up to 16 digits. The range
for number2 is from 0 to 9.
Sets the value of a variable.
The action label is in the format number1.number2.
number1 can be any number up to 16 digits. The range
for number2 is from 0 to 9.

Advertisement

Table of Contents
loading

Table of Contents