apdiag command reference

The apdiag command collects diagnostic information from the system. You can also list all components available for restricting the log collection.

apdiag command syntax

Usage:
apdiag [-h] [-v] {doc,list,collect,statusdata}
-h|--help
Displays help for the command.
-v|--version
Displays command version.
Positional arguments:
doc | less
Displays more detailed information about command options.
list
Lists available components/symptoms/component sets.
collect
Collects diagnostic data.

Listing the components, symptoms, or component sets

Usage:
apdiag list [-h] [--components] [--symptoms] [--sets] [--system-type {Local|Appliance|ApplianceMini|IDAA|ICP}]
-h|--help
Displays help for the command.
--components
Lists all the components with their subcomponents.
--symptoms
Lists all the symptoms. For a full list of available symptoms, see Running diagnostics by using the apdiag command.
--sets
Lists all the component sets. A component set is a group of components that are frequently used together to accomplish a task.
Following is a list of the available component sets:
  • callhome_logs
  • dns_dhcp_logs
  • hw_logs
  • mfg_logs
  • network_logs
  • nodeos_logs
  • openshift_logs
  • security_logs
  • system_snapshot
  • upgrade_logs
--system-type {Local|Appliance|ApplianceMini|IDAA|ICP}
Specifies the system type. This parameter is required only if it is not possible to automatically detect the system type, which results in an error. The default is set to detect automatically.

Collecting diagnostic data

Usage:
apdiag collect [-h] [--components [COMPONENT [COMPONENT ...]]]
                      [--symptoms [SYMPTOM [SYMPTOM ...]]]
                      [--sets [SET [SET ...]]] [--comp-file COMPFILE]
                      [--minus-components [COMPONENT [COMPONENT ...]]]
                      [--skip-cores yes/no] [--ignore-space-check]
                      [--atime TIMESTAMP] [--btime TIMESTAMP]
                      [--nodes [NODE [NODE ...]]]
                      [--node-roles [{CONTROL|WORKER|UNSET|...}:{PHYSICAL_NODE|VM},... [{CONTROL|WORKER|UNSET|...}:{PHYSICAL_NODE|VM},... ...]]]
                      [--node-types [{PHYSICAL|VM}:NODENAME,... [{PHYSICAL|VM}:NODENAME,... ...]]]
                      [--dumpdir DUMPDIR] [--suffix SUFFIX]
                      [--timeout-multiply NUMBER] [--estimate-time]
                      [--comp-threads NUMBER]
                      [--system-type {Local,Appliance,ApplianceMini,IDAA,ICP}]
                      [--comp-param [COMP:ARG[,ARG...] [COMP:ARG[,ARG...]
                      ...]]] [--skip-secure-data] [--force]
                      [--fabsws [FABSW [FABSW ...]]]
                      [--mgtsws [MGTSW [MGTSW ...]]]
                      [--enclosure [ENCL [ENCL ...]]]
                      [--ips-containers [IPSCONTAINER [IPSCONTAINER ...]]]
                     
--components {all | component [component]}
Specifies whether to collect data for all components (if you specify all or '*') or for one or more specific components. You can specify the component name with or without a subcomponent name. For example, you can specify database to collect data about all subcomponents of the database component or specify database/uptime to collect information for just the uptime subcomponent. You cannot specify a subcomponent name alone (for example, uptime). Separate each component name with a space. For a list of all available components, run apdiag list --components.
The apdiag command has a plugin for Netezza Performance Server logs. That plugin calls nzlogcollector inside the NPS container. You can use the following command to 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"
In this example, the -symptom crash option is passed.
--symptoms [symptom [symptom]]
One or more space-separated symptoms for which to collect information. For a list of all available symptoms, run apdiag list --symptoms.
--sets [set [set]]
One or more component sets for which to collect information. For a list of all available sets, run apdiag list --sets.
--comp-file compfile
A plain text file that contains a list of components for which to collect data. Specify each component in a separate line in plain text.
--minus-components [component [component]]
Space-separated list of one or more components to omit when collecting data. For a list of all available components, run apdiag list --components.
--skip-cores yes|no
Skip the collection of core files present under logs directories. The default is yes.
--ignore-space-check
Ignores the minimum space requirement check. When omitted, the tool checks if the system has more than the minimum of required free disk space. Returns error if space requirements are not fulfilled.
--atime timestamp
--btime timestamp
Defines a time window from which to collect the data. --atime specifies the starting point of the window, --btime specifies the ending time. If --atime is not given, then the default starting time is 7 days ago. If --btime is not given, then the default ending time is now(). The following time formats must be used:
  • YYYY-mm-dd HH:MM:SS
  • nH/D/W where n is a number of hours, days, or weeks respectively, for example: --atime 8H --btime 1H would mean a time window of 7 hour length with starting time now()-8H, and end time now()-1H.
Note: The --atime and --btime options can be applied only to components that recognize a time window restriction. When you use --btime, you must consider that a log file might include entries that are time stamped before the specified --btime value of interest, but the log file might be modified after the specified --btime value. In such a case, the log file is not collected because the modification time is outside of the time window.

You can run the apdiag doc | less command for details.

--nodes node [node]
Specifies the names of one or more nodes to collect logs for. This parameter is required in two cases:
  • If you want to run the command against a subset of nodes. By default, the command runs against all nodes.
  • If you want to run the command against all nodes but the nodes and their roles cannot be automatically detected, which results in an error.

For the node values, use the host names and not the IP addresses. Separate each node name with a space.

The default value is all nodes
--node-roles [CONTROL|WORKER|UNSET|...:PHYSICAL_NODE|VM ... [CONTROL|WORKER|UNSET|...:PHYSICAL_NODE|VM ... ...]]
Specifies role names, physical node names or VM names having that role. Multiple role names can be specified. Separate each role name with a space. The default is set to detect automatically.
--node-types [PHYSICAL|VM:NODENAME ... [PHYSICAL|VM:NODENAME ... ...]]
Specifies node type and node names of that type. Multiple node types can be specified. Separate each node type with a space. The default is set to detect automatically.
--dumpdir dump_directory
Specifies the dump directory as an absolute path on a localhost. By default, the directory name is based on time stamp..

It is the user responsibility to clean up the custom dump directory after use. The default dump directory is cleaned up automatically.

--suffix suffix
Specifies a suffix to append to the name of the dump directory for ease of identification.
--timeout-multiply number
Multiplies all in-built timeouts by a factor. The factor is specified by an argument. The argument must be between 1 and 1000 (inclusive). The default value is individual and command dependent.
--estimate-time
Shows estimated time only, without collecting diagnostic data.
--comp-threads number
Specifies the maximum number of threads that an eligible component can use for running commands in parallel. Use 0 to disable threads within a component. The default value is component dependent with a cap of 10.

This option is useful if the system is overwhelmed by multiple commands. Each plug-in runs in parallel on different nodes. The --comp-threads option does not affect or control that parallelism.

--system-type {Local|Appliance|IDAA}
Specifies system type. This parameter is required only if it is not possible to automatically detect the system type, which results in an error.
--comp-param [COMP:ARG[,ARG...] [COMP:ARG[,ARG...] ...]]
Some components can use extra arguments that are meant for only those components. Such arguments can be passed by using the --comp-param option. If , or : are part of the argument, then you must escape them with the \ character.
Following are some examples:
apdiag collect --components database/dart_inspection --force --comp-param database/dart_inspection:'/T /TN mytbl /TSI 123'
  apdiag collect --components database/exfmt --comp-param database/exfmt:'-1 -d bludb'
  apdiag collect --components database/explain --comp-param database/explain:'-stmtfile /tmp/test.sql -database bludb'
  apdiag collect --components database/pd_monitor --comp-param database/pd_monitor:'-locks -wlocks -db bludb'
  apdiag collect --components database/support --comp-param database/support:'-d bludb'
  apdiag collect --components spark/logs_app --comp-param spark/logs_app:'user1,user2'
--skip-secure-data
Specifies that the components that contain secure data are not included in data collection. The log file indicates which components were not included in data collection.
--force
You can use this option if you need to run a command that must be run with caution in a controlled environment. For example, the command might impact performance or the functions of the storage array. Without the --force option, an error message is displayed when you run such potentially harmful commands.
--fabsws [FABSW [FABSW ...]]
A space-separated list of fabric switches for which information needs to be collected. The default is set for all fabric switches.
--mgtsws [MGTSW [MGTSW ...]]
A space-separated list of management switches for which information needs to be collected. The default is set for all management switches.
--enclosure [ENCL [ENCL ...]]
A space-separated list of enclosures for which hardware logs need to be collected. The default is set for all enclosures.
--ips-containers [IPS CONTAINER [IPS CONTAINER ...]]
A space-separated list of one or more IPS container names that can be used in eligible components. The default is set for all IPS containers.
--spus {all | [SPU [SPU...]]}
A space-separated list of Netezza® Performance Server SPU names to collect the logs for. Use --spus all to collect logs for all SPUs in the system.
For example usage of the apdiag command, see Running diagnostics by using the apdiag command.