This
Creating a Custom Action Policy
You can use the "Get VMware Diagnostic Logs" action type included with the VMware Automations PowerPack to create custom automation actions that you can then use to build custom automation policies.
To create a custom action policy using the "Get VMware Diagnostic Logs" action type:
- Navigate to the Action Policy Manager page (Registry > Run Book > Actions).
- In the Action Policy Manager page, click the button.
- The Action Policy Editor modal appears.
- In the Action Policy Editor page, supply a value in each field.
- Action Name. Specify the name for the action policy.
- Action State. Specifies whether the policy can be executed by an automation policy (enabled) or cannot be executed (disabled).
- Description. Allows you to enter a detailed description of the action.
-
Organization. Organization to associate with the action policy.
- Action Type. Type of action that will be executed. Select the "Get VMware Diagnostic Logs" action type.
- Execution Environment. Select from the list of available Execution Environments. The default execution environment is System.
- Action Run Context. Select Database or Collector as the context in which the action policy will run.
- Input Parameters. A JSON structure that specifies each input parameter. Each parameter definition includes its name, data type, and whether the input is optional or required for this Custom Action Type. In the example shown above, the automation action policy request the last 50 lines of the authentication log from vCenter.
Input parameters must be defined as a JSON structure, even if only one parameter is defined.
-
Click [Save]. If you are modifying an existing action policy, click . Supply a new value in the Action Name field, and save the current action policy, including any edits, as a new policy.
Customizing Automation Actions
The VMware Automations PowerPack includes two automation actions that use the "Get VMware Diagnostic Logs" action type to request logs through the VMware vSphere Web Services API. You can specify the host and the options in a JSON structure that you enter in the Input Parameters field in the Action Policy Editor modal.
The following automation actions that use the "Get VMware Diagnostic Logs" action type are included in the VMware Automations PowerPack. Compare the commands run with the example in the image above.
Action Name | Description | Commands Run |
---|---|---|
Get VMware VMKernel Log and Syslog |
Collects the last 50 lines from the vmkernel.log file and the syslog.log file. |
|
Get VMware Diagnostic Logs |
Collects all lines in all logs from the vCenter appliance. |
|
Creating a VMware Automation Action
You can create a new automation action that collects certain logs using the “Get VMware Diagnostic Logs” custom action type. To do this, select “Get VMware Diagnostic Logs” in the Action Type drop-down list when you create a new automation action. You can also use the existing automation actions in the PowerPack as a template by using the [Save As] option.
The automation actions accept the following parameters in JSON:
Paramter | Input type | Description |
---|---|---|
num_lines | integer | Specifies the number of log lines to return. |
credential_id | integer |
Default value: 0 Specifies the credential_id to use for the connection.
|
log_files | string |
Default value: none Specifies the log files you want to collect. |