Add automatic commands to policy rules
For every
rule, you can
configure an automatic command to be run when the rule is matched.
For example, you could configure a log file Entry policy to
automatically delete the contents of
C:\Temp
when the
System event log reports "
The C: disk is at or near
capacity.
"
For every automatic command, you can set the following
properties:
- In the Command text box, you specify the command and
parameters to run when the command is started for this message.
The command runs on the node you specify in the Node box. If
the command contains spaces, enclose it in quotation marks.
Commands that are internal to the Windows command shell (for
example
echo
or move
), must be preceded
by cmd /c
. See the Windows help for more information
about cmd
.
- In the Node text box, you specify the name of the node
on which the command will be started. You can also use the
variables
<$OPC_MGMTSV>
or
<$MSG_NODE_NAME>
, to configure reusable policies
for replicated sites. See policy variables for
more information.
- When Append output of command as annotation to the
message is selected, an annotation is added to the message when
the command completes. The annotation contains the start time,
output, exit value, and finish time of the command. If a command
fails, an annotation is provided even if this item is not
selected.
- When Acknowledge the message when command is successful
is selected, the message is automatically acknowledged (that is,
moved to the acknowledged message
browser) if the command is successful.
HP Operations allows you to define how the management
server is informed about the progress of local automatic
commands.
- Send the message immediately: Send a message to the
management server as soon as a local automatic command starts on
the managed
node. This is the default setting.
- You can also choose to wait until the local command
completes, and then send the message to the management server
based on whether the command was successful or failed.
Other options can help to reduce the amount of unnecessary
network traffic to the management server. For example, if a local
automatic command solves the problem that generated the message,
you may choose not to inform the management server.
To set up an automatic command
- Right-click the policy and select All Tasks
Edit...
- Select Rules.
- Select the rule to which you want to add a command.
- Select Modify.
- Select Actions.
- Select Automatic Command.
NOTE:
If you want to prevent automatic commands from being run on a node
other than the node where the message originates, add the following
registry key to the registry:
HKLM\SOFTWARE\Hewlett-Packard\OVEnterprise\Management
server\MsgActSrv:
Name: DISABLE_ALL_REMOTE_ACTIONS
Type: REG_SZ
Value: TRUE
If you set this registry key, note that you may need to
reconfigure existing policies (for example, policies supplied by
Smart Plug-ins) to function properly with this
restriction.
Related Topics: