diag gather-diagnostics

Gather diagnostic information about the services associated with an instance of Cloud Pak for Data and create a diagnostics log.

Extended description

When you run the gather-diagnostics command, you must specify the services that you want to gather information about. Run the diag list-services command to get a list of the services that you can gather diagnostic data for. Diagnostic information for the dependencies of these services is automatically included in the log.

If the privileged monitoring service is installed, the gather-diagnostics command collects more logs and resources in the diagnostics log file.
  • Pod container logs for the operator namespace are saved in the Cloud Pak for Data folder.
  • Health check information is saved as YAML files in the Healthcheck folder. These resources include:
    • Cluster resources, which include nodes, node metrics, cluster operators, machine config pools, and certificate signing requests.
    • Operator resources, which include cluster service versions, catalog sources, subscriptions, install plans, operator groups, operand requests, pods, and deployments.
    • Operand resources, which include Cloud Pak for Data service custom resources, operand configs, operand registries, and operand bind information.

For more information, see Installing privileged monitors.

Prerequisites

Before you can complete certain IBM® Software Hub setup and management tasks, you must create a profile so that you can run the appropriate cpd-cli commands. A profile enables the cpd-cli to verify that you are a IBM Software Hub user and that you have the appropriate administrator permissions to complete a task. For more information, see Creating a profile to use the cpd-cli management commands.

Syntax

cpd-cli diag gather-diagnostics <product-id> \
[--from=<year-month-dayTh:m:s-05:00>] \
[--output=json|yaml|text] \
--profile=<cpd-profile-name> \
[--to=<year-month-dayTh:m:s-05:00>] \
[--verbose]

Arguments

Table 1: Command options
Argument Description
<product-id> One or more product IDs (in a comma-separated list) to gather diagnostics for.

Options

Table 1: Command options
Option Description

--from

-f

The RFC3339 format timestamp from which to begin gathering diagnostics.
Status
Optional.
Syntax
--from=<year-month-dayTh:m:s-05:00>
Default value
The option defaults to the current time when a timestamp is not specified.
Valid values
A RFC3339 format timestamp.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.

--output

-o

Specify an output format.
Status
Optional.
Syntax
--output=json|yaml|text
Default value
text
Valid values
Valid formats include JSON, YAML, or text (the default format).
--profile The name of the profile that you created to store information about an instance of Cloud Pak for Data and your credentials for the instance.
Status
Required.
Syntax
--profile=<cpd-profile-name>
Default value
No default.
Valid values

The name of the profile that you created.

--to

-t

The RFC3339 format timestamp from which to stop gathering diagnostics.
Status
Optional.
Syntax
--to=<year-month-dayTh:m:s-05:00>
Default value
The option defaults to a half an hour from the current time when a timestamp is not specified.
Valid values
An RFC3339 format timestamp.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Examples

Note: The following examples use the recommended installation environment variables.

It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For more information, see Setting up installation environment variables.

Retrieve the diagnostics logs from a Cloud Pak for Data service.
cpd-cli diag gather-diagnostics <product-id> \
--profile=${CPD_PROFILE_NAME}