cttracecfg Command

Purpose

Changes the trace configuration and the spool area configuration dynamically.

Syntax

To change the trace configuration:

cttracecfg -T [ -l | -a | -u | -r ] [ -n section_name ] [ -p pattern ] [ -d dir ] [ -s size ]
[ -o on | off ] [ -h ]

To configure the spool area management:

cttracecfg -S [ -l | -a | -u | -r ] [ -n section_name ] [ -d dir ] [ -i interval ]
[ -t retention_days ] [ -c max_size ] [ -o on | off ] [ -h ]

Description

The cttracecfg command is used to turn on or off the trace spooling dynamically or to configure the cleanup activity on the spooling directory.

The ctracecfg command can be run with the -T flag to work on trace configuration (to enable or disable trace spooling) or with the -S flag to work on spool configuration (to clean up the spool directory).

Trace configuration

You can change the trace configuration by using the cttracecfg command. The trace configuration changes are dynamically picked by the Reliable Scalable Cluster Technology (RSCT) daemons and the required changes are applied to the daemon's trace configuration.

A reserved section called default represents the default values for the following attributes if these attributes are not defined in the trace configuration sections:

Attribute Description
spooling Specifies whether trace spooling is enabled or disabled.
tracesize Specifies the total trace size.
dest Specifies the spool destination directory.

You can overwrite the default behavior of the trace spooling by using a specialized section for a trace file. In the specialized section, you can change the spooling, tracesize, and dest attributes to change the daemon's trace behavior.

You can perform the following operations on trace configuration sections:

  • Query or list all the trace sections.
  • Add a section.
  • Change a section.
  • Delete a section.

Spool area management

You can change the spool area management policies by using the cttracecfg command and by using one of the following methods:

  • Enable or disable the cleanup activity on the spool area.
  • Change the cleanup interval of the spool area.
  • Change the number of retention days of the spooled files.
  • Change the maximum allowed size of the spool directory.

You can perform the following operations on spool area management sections:

  • Query or list all the spool area management sections.
  • Add a spool area management section.
  • Change a spool area management section.
  • Delete a spool area management section.
Note: The name of the spool area management section must start with the spoolarea_ string.

Flags

Trace configuration flags

Flag Description
-T Designates the cttracecfg command to work on dynamic tracing sections.
-l Lists the trace configuration sections.
-a Adds a trace configuration section.
-u Updates a trace configuration section.
-r Deletes a trace configuration section.
-n section_name Specifies a particular section in the configuration file.
-p pattern Specifies the pattern of the trace file directory.
-o [ on | off ] Turns on or off the trace spooling mechanism. The valid values of this flag are as follows:
on
Enables the trace spooling mechanism and copies the files to the spool directory.
off
Disables the trace spooling mechanism.
-d dir Specifies the destination directory path.
-s size Specifies the size of the trace in bytes.
-h Displays the usage information for this command.

Spool area management flags

Flag Description
-S Designates the cttracecfg command to work on trace spool area management sections.
-l Lists the spool area management sections.
-a Adds a spool area management section.
-u Updates a spool area management section.
-r Deletes a spool area management section.
-n section_name Specifies a particular section in the configuration file.
-o [ on | off ] Removes the old trace files from the spool directory. The valid values of this flag are as follows:
on
Removes the old trace files.
off
Does not remove the old trace files.
-d dir Specifies the destination directory path.
-i interval Specifies the cleanup interval in hours.
-t retention_days Specifies the number of retention days for a spooled file.
-c max_size Specifies the maximum allowed capacity of the trace spool area in MB.
-h Displays the usage information for this command.

Exit Status

0
The command completed successfully.
1
An error occurred.

Examples

  1. To query all the dynamic trace sections, type the following command:
    cttracecfg -T -l
  2. To query the default trace section, type the following command:
    cttracecfg -T -l -n default
  3. To query the dynamic trace section section_test, type the following command:
    cttracecfg -T -l -n section_test
  4. To configure the trace spooling mechanism for the resource monitoring and control (RMC) daemon that has a trace size of 2 MB and a destination directory path /data/trc, type the following command:
    cttracecfg -T -a -n RMCD -p "/var/ct/.*/log/mc/.*" -d "/data/trc" -s 2097152 -o on
  5. To add a spool area management section in the /data/trc directory such that the directory is checked every 12 hours and the spooled files are retained for 14 days before removing the spooled files, type the following command:
    cttracecfg -S -a -n spoolarea_data -d /data/trc -i 12 -t 14 -o on
  6. To delete the trace files from the trace spool area /data/trc if the spool area exceeds 50 MB size, type the following command. Also, the spool directory must be checked every 12 hours.
    cttracecfg -S -a -n spoolarea_data -d "/data/trc" -i 12 -c 50 -o on

Location

/opt/rsct/bin/cttracecfg
Contains the cttracecfg command.

Files

/var/ct/cfg/trace.conf
Contains the trace configuration and spool area configuration.