policy
Use the policy command to tie actions and conditions together into an active visibility policy. Active visibility is a framework designed to react to events and take actions in response. When conditions change, actions are triggered as specified by policies. Refer to the “Configuring Active Visibility” section in the GigaVUE Fabric Management Guide for details.
When a policy is triggered, an SNMP event can optionally be generated.
The policy command has the following syntax:
policy
alias <alias>
action
add <action name> [param <param name> <param value>] .. [param <param name> <param value>]
delete <action ID>
comment <comment>
condition
add <condition name> [param <param name> <param value>] .. [param <param name>
<param value>]
delete <condition ID>
enable
reset
all <enable | reset>
The following table describes the arguments for the policy command:
Argument |
Description |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
alias <alias> |
Specifies the name of the policy. Up to 100 polices per cluster can be created. For example: (config) # policy alias p1 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
action |
Adds an action to the policy. The actions are predefined. Up to five (5) actions can be specified in a policy. The parameter names and values that need to be specified, depend on the action. The following are the keywords that are used as parameters in some of the actions, as well as the definition of the value:
For details, refer to Specifying Keyword, portId.
For details, refer to Specifying Keyword, inlineNetTrafficPath.
For details, refer to Specifying Keyword, oobDir.
For details, refer to Specifying Keyword, oobTag. A policy is triggered if all the conditions are met, then all the actions are executed. Examples: (config) # policy alias p1 action add PortEnable param portId 1/1/x1 (config) # policy alias p1 action add MapDisable param mapId m1 (config) # policy alias AnyPortUp action add PortFilterAdd param portId &PortUp.portId& param ruleStr "pass vlan 100" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
delete <action ID> |
Deletes an action from the policy. The policy must exist. To find out the action ID, type ? as follows: (config) # (config) # policy alias p1 action delete ? The existing actions will be listed. For example: (config) # (config) # policy alias p1 action delete 2 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
comment <comment> |
Specifies a unique text string that describes the policy. Comments can be up to 256 characters. Comments must be enclosed in double quotation marks. Comments can be added only after a policy has been created. For example: (config) # policy alias p1 comment "Thursday policy" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
condition add |
Adds a condition to the policy. The conditions are predefined. Up to five (5) conditions can be specified in a policy. The parameter names and values that need to be specified, depend on the condition. The template specifies the parameters and values that must be included in the definition of a condition. The following are the keywords that are used as parameters in some of the conditions, as well as the definition of the value:
For details, refer to Specifying Keyword, portId on page 155.
The policy is executed only when all conditions are met. There is only one unique condition per policy. Examples: (config) # policy alias OverloadedToolPort condition add PortTxUtilHigh param portId 1/1/x1 param threshPct 80 (config) # policy alias AnyPortUp condition add PortUp param portId any(3/1/q4..q6) param period 5 (config) # policy alias SaveMemory condition add TimeOfDay param timeStr "( 45 10 * * * * )" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
delete <condition ID> |
Deletes a condition from the policy. The policy must exist. To find out the condition ID, type ? as follows: (config) # (config) # policy alias p1 condition delete ? The existing conditions will be listed. For example: (config) # (config) # policy alias p1 condition delete 10 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enable |
Enables the active visibility policy. To be executed, a policy must be enabled. For example: (config) # policy alias p1 enable |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reset |
Resets the status of the active visibility policy. For example: (config) # policy alias p1 reset |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
all <enable | reset> |
Enables all policies or resets all policies. Examples: (config) # policy all enable (config) # policy all reset |
Related Commands
The following table summarizes other commands related to the policy command:
Task |
Command |
|||||||||
Displays all actions in brief format. |
# show action |
|||||||||
Displays a specified action in detail. |
# show action alias MapRuleAdd |
|||||||||
Displays all actions in detail. |
# show action detail |
|||||||||
Displays all conditions in brief format. |
# show condition |
|||||||||
Displays a specified condition in detail. |
# show condition alias PortRxUtilHigh |
|||||||||
Displays all conditions in detail. In the output of the show condition command:
For example, the keyword <$portId$> is mandatory, while [$period$] is optional. The strings enclosed in dollar signs ($) are parameters that will be specified as part of configuring a policy. Some conditions do not have any parameters, such as TimeWeekday. When the node is up, the PortUp and PortDown conditions are evaluated immediately upon a link status change while the port TX and RX conditions are evaluated every five seconds through polling. When the node reboots or switches over, refer to Polling Following a Node Reboot, Switchover, or Cluster Change.
|
# show condition detail |
|||||||||
Displays all specified active visibility policies. The output of the show policy command displays the following:
|
# show policy |
|||||||||
Displays a specified policy |
# show policy alias policy1 |
|||||||||
Displays all policies in detailed format. Note: In the output of the show policy detail command, the following is displayed if the Active Visibility Daemon has initialized, but is not yet polling: Active Visibility Daemon is not polling!! Please try again in 222 seconds. The message indicates when the Active Visibility Daemon will start polling following a node or cluster reboot or a cluster leader change. If polling is not ready, the output of the show policy detail command displays the following message: Active Visibility Daemon is not polling!! Please try again in 133 seconds. Following a node reboot, switchover, or a change in the cluster, such as a role change, there is a period of time before the polling mechanism starts. The period of time depends on certain variables such as the number of ports on the node and the size of the cluster in which the node is a part of. If there is a large number of ports or if the node is part of a large cluster, the polling mechanism may take a longer period of time to start. In general, the period of time is between 10 and 15 minutes. |
# show policy detail |
|||||||||
Deletes a specified policy. |
(config) # no policy alias policy1 |
|||||||||
Deletes a comment for a specified policy. |
(config) # no policy alias policy1 comment |
|||||||||
Deletes a comment for a specified policy. |
(config) # policy alias policy1 no comment |
|||||||||
Disables the specified policy. |
(config) # no policy alias policy1 enable |
|||||||||
Disables the specified policy. |
(config) # policy alias policy1 no enable |
|||||||||
Deletes all policies. |
(config) # no policy all |
|||||||||
Disables all policies. |
(config) # no policy all enable |