ctsnap Command

Purpose

Gathers configuration, log, and trace information about the Reliable Scalable Cluster Technology (RSCT) components.

Syntax

ctsnap [ -c cluster_name_pattern ] [ -C cluster_ID_pattern ] [ -d output_dir ] [ -D daemon_name_pattern ] [ -k stackdump_default ] [ -n node_name_pattern ] [ -N node_ID_pattern ] [ -p days | { -f from_date -t to_date } ] [ -s spool_dir ] [ -S size ] [ -x runrpttr ] [ -h ]

Description

The ctsnap command gathers configuration, log, and trace information about the RSCT components that are installed with AIX® or PowerHA®. This command collects data only for the local node on which it is running. Depending on the programs that are installed, information about the following components may be included:
  • Audit log resource manager (IBM.AuditRM)
  • Cluster security services (ctsec)
  • Common information model resource manager (IBM.CIMRM)
  • Configuration resource manager (IBM.ConfigRM)
  • Event management (ha_em)
  • Event response resource manager (IBM.ERRM)
  • File system resource manager (IBM.FSRM)
  • First failure data capture (ct_ffdc)
  • Group services (cthags)
  • Host resource manager (IBM.HostRM)
  • Least-privilege resource manager (IBM.LPRM)
  • Low-level application programming interface (lapi)
  • Management domain resource manager (IBM®.MgmtDomainRM)
  • Microsensor resource manager (IBM.MicroSensorRM)
  • Recovery resource manager (IBM.RecoveryRM)
  • Resource monitoring and control (ctrmc)
  • Sensor resource manager (IBM.SensorRM)
  • Storage resource manager (IBM.StorageRM)
  • Topology services (cthats)
  • Virtual shared disk (vsd) (on AIX 6.1)
  • Recoverable virtual shared disk (rvsd) (on AIX 6.1)

If a problem occurs with any of these components, you can run this command in order to provide information to your software service organization.

The output of the ctsnap command consists of a compressed tar file (ctsnap.node_name.nnnnnnnn.tar.Z) and a log file (ctsnap.node_name.nnnnnnnn.log), where node_name is the name of the node on which ctsnap was run, and nnnnnnnn is the time stamp of when the ctsnap command was run. Provide both of these files to your software service organization. By default, ctsnap puts these files in the /tmp/ctsupt directory. Use the -d flag to specify a different output directory.

When needed, you can use ctsnap to collect information about spooled trace files. Use the -c, -C, -D, -f, -n, -N, -p, -s, -S, and -t flags to capture a subset of trace information. You can use the ctsnap -k stackdump_default command to produce a stack dump for the following RSCT subsystems:
  • Audit log resource manager (IBM.AuditRM)
  • Common information model resource manager (IBM.CIMRM)
  • Configuration resource manager (IBM.ConfigRM)
  • Event response resource manager (IBM.ERRM)
  • File system resource manager (IBM.FSRM)
  • Generic resource manager (IBM.GblResRM)
  • Group services (cthags)
  • Least-privilege resource manager (IBM.LPRM)
  • Microsensor resource manager (IBM.MicroSensorRM)
  • Recovery resource manager (IBM.RecoveryRM)
  • Resource monitoring and control (ctrmc)
  • Sensor resource manager (IBM.SensorRM)
  • Storage resource manager (IBM.StorageRM)
  • Topology services (cthats)

To format the trace file contents of all of the RSCT resource managers, use the -x flag.

You can also use the ctsnap command to obtain the trace and logging root directory from the RSCT File configuration file (ctfile.cfg).

Flags

-c cluster_name_pattern
Specifies a selection pattern that will limit trace collection to certain cluster names. The pattern is interpreted as a Perl-language regular expression.
-C cluster_ID_pattern
Specifies a selection pattern that will limit trace collection to certain cluster IDs. The pattern is interpreted as a Perl-language regular expression.
-d output_dir
Specifies the output directory. The default directory is /tmp/ctsupt.
-D daemon_name_pattern
Specifies a selection pattern that will limit trace collection to certain daemons. The pattern is interpreted as a Perl-language regular expression.
-f from_date
Specifies the date from which you want to collect information. The format of the from_date parameter is:
yyyy-mm-dd[.hh[:mm[:ss]]] 
Note: Use -f in conjunction with the -t flag.
-k stackdump_default
Produces a stack dump for these RSCT subsystems: cthags, cthats, ctrmc, IBM.AuditRM, IBM.CIMRM, IBM.ConfigRM, IBM.ERRM, IBM.FSRM, IBM.GblResRM, IBM.LPRM, IBM.MicroSensorRM, IBM.RecoveryRM, IBM.SensorRM, and IBM.StorageRM.
-n node_name_pattern
Specifies a selection pattern that limits the trace collection to certain node names. The pattern is interpreted as a Perl-language regular expression.
-N node_ID_pattern
Specifies a selection pattern that limits the trace collection to certain node IDs. The pattern is interpreted as a Perl-language regular expression.
-p days
Specifies how many previous days' worth of spooled trace information to collect.
-s spool_dir
Captures trace files for the specified spooling directory.
-S size
Specifies the maximum cumulative size of all of the trace files to collect (in megabytes).
-t to_date
Specifies the date to which you want to collect information. The format of the to_date parameter is:
yyyy-mm-dd[.hh[:mm[:ss]]] 
Note: Use -t in conjunction with the -f flag.
-x runrpttr
Formats the trace file contents of all of the RSCT resource managers.

Using this flag increases the size of the ctsnap output files, so you might need to increase the size of the file system that contains the output directory.

-h
Writes the command's usage statement to standard output.

Security

Only root users can run this command.

Exit Status

0
The command ran successfully.
1
The command was not successful.

Standard Output

When the -h flag is specified, this command's usage statement is written to standard output.

Standard Error

Error messages are written to standard error (and to the ctsnap.host_name.nnnnnnnn.log file).

Implementation Specifics

This command is part of the rsct.core.utils fileset for AIX®.

Examples

  1. To gather RSCT support information, enter:
    ctsnap
  2. To gather RSCT support information and place it in the /tmp/mydir directory, enter:
    ctsnap -d /tmp/mydir
  3. To capture all trace files for the /opt/traces directory, enter:
    ctsnap -s /opt/traces
  4. To capture all trace files for the /opt/traces directories of the configuration resource manager daemons, enter:
    ctsnap -s /opt/traces -D '.*ConfigRM.*' 
  5. To capture all trace files for the /opt/traces directory for the date range 08-28-2008 to 08-29-2008, enter:
    ctsnap -s /opt/traces -f 08-28-2008 -t 08-29-2008
  6. To capture all trace files for the /opt/traces directory for the previous four days, enter:
    ctsnap -s /opt/traces -p 4
  7. To capture all trace files for the /opt/traces directory for the most recent 50 MB of trace information, enter:
    ctsnap -s /opt/traces -S 50

Location

/usr/sbin/rsct/bin/ctsnap
Contains the ctsnap command

Files

/tmp/ctsupt
Location of the default directory that contains the output files.
/tmp/ctsupt/ctsnap.host_name.nnnnnnnn.log
Location of the log file of the command execution, where nnnnnnnn is a timestamp and host_name is the name of the host on which the command was run.
tmp/ctsupt/ctsnap.host_name.nnnnnnnn.tar.Z
Location of the compressed tar file that contains the collected data, where nnnnnnnn is a timestamp and host_name is the name of the host on which the command was run.