Running diagnostics by using the apdiag command

The apdiag utility collects various logs, commands output, and configuration files from the system for diagnosing issues. For command help details, see apdiag command reference.

As apuser or any other user with the same permissions, you can enter the list or collect version of the command on any node.

The apdiag list command gives you the information on all available options (components or symptoms) that you can use for restricting log collection.

With the apdiag collect command you can choose to collect the information for all components, a group of components listed in a file, component sets, or a group of components based on a pre-defined symptom. You can also restrict log collection to a specific time frame or specific hardware. Some options are provided as a fail-safe mechanism, that allow apdiag to run in case of system issues.

Following are the available symptoms with situations when they should be run:

docker_issue
When issues related to the docker component occur.
thinpool_issue
When issues related to thinpool corruption occur.

After identifying the symptoms in your environment, you can run apdiag collect --symptoms [SYMPTOM [SYMPTOM ...]].

Collecting group of components

There are several ways in which you can collect components and group them for convenience or reuse purposes. You can tag the components as symptoms, sets or in a plain text file using--symptoms, --sets or --comp-file respectively.

You can run:
  • apdiag list --symptoms to get a list of all available symptoms.
  • apdiag list --sets to get a list of all available sets.
  • apdiag --comp-file to specify a plain text file from which to get the component list.
    The text file should have components listed one per line. A set of components can be skipped from a group by using --minus-components. Multiple --symptoms, --sets and --components can be provided on a single command line:
    
      apdiag collect --symptoms <symptom name>
      apdiag collect --sets openshift_logs
      apdiag collect --comp-file /tmp/my_component_list.txt
      apdiag collect --sets openshift_logs --minus-components docker
      apdiag collect --symptoms <symptom name> --sets openshift_logs --components host/mount

Examples

  • Collect logs related to OpenShift:
    apdiag collect --sets openshift_logs
  • Collect logs related to OpenShift excluding docker components:
    apdiag collect --sets  openshift_logs --minus-components docker
  • Collect node ffdc logs for the e1n1 node only:
    apdiag collect --components hw/node/log_ffdc --nodes e1n1
  • Collect Platform Manager logs modified after certain time:
    apdiag collect --components platform_manager/log --atime '2019-06-13 12:18:00'
  • Collect the Platform Manager logs modified in the last two weeks:
    apdiag collect --components platform_manager/log --atime 2W
  • Collect logs and append a suffix to the collected directory:
    apdiag collect --sets openshift_logs --suffix pmr123
  • Collect NPS-related logs:
    apdiag collect --components ips/logs
    If you want to pass options to nzlogcollector, run the following command:
    apdiag collect --components ips/logs --comp-param ips/logs: "-symptom crash"
  • Collect all diagnostic information for network SFP issues:
    apdiag collect --set sfp_issue --spus all