twstrace command

Use the twstrace command to configure traces, and collect logs, traces, and configuration files (ita.ini and jobManager.ini) for agents. You collect all the information in a compressed file when it is running without stopping and restarting it.

See command usage and verify version

To see the command usage and options, use the following syntax.

Syntax

twstrace -u | -v

Parameters

-u
Shows the command usage.
-v
Shows the command version.

Enable or disable trace

To set the trace to the maximum or minimum level, use the following syntax.

Syntax

twstrace -enable | -disable

Parameters

-enable
Sets the trace to the maximum level. The maximum level is 1000.
-disable
Sets the trace to the minimum level. The minimum level is 3000.

Set trace information

To set the trace to a specific level, specify the number of trace files you want to create, and the maximum size the trace files can reach, use the following syntax.

Syntax

twstrace [ -level <level_number> ] [ -maxFiles <files_number> ] [ -maxFileBytes <bytes_number> ]

Parameters

-level <level_number>
Sets the trace level. Specify a value in the range from 1000 to 3000, which is also the default value. Note that if you set this parameter to 3000, you have the lowest verbosity level and the fewest trace messages. To have a better trace level, with the most verbose trace messages and the maximum trace level, set it to 1000.
-maxFiles <files_number>
Specify the number of trace files you want to create.
-maxFileBytes <bytes_number>
Set the maximum size in bytes that the trace files can reach. The default is 1024000 bytes.

Show trace information

To display the current trace level, the number of trace files, and the maximum size the trace files can reach, use the following syntax.

Syntax

twstrace -level | -maxFiles | -maxFileBytes

Parameters

-level
See the trace level you set.
-maxFiles
See the number of trace files you create.
-maxFileBytes
See the maximum size you set for each trace file

Sample

The example shows the information you receive when you run the following command:
twstrace -level -maxFiles -maxFileBytes
AWSITA176I The trace properties are: level="1000",
max files="3", file size="1024000".

Collect trace information

To collect the trace files, the message files, and the configuration files in a compressed file, use the following syntax.

Syntax

twstrace -getLogs [ -zipFile <compressed_file_name> ] [ -host <host_name> ] [ -protocol {http | https } [ -port <port_number> ][ -iniFile <ini_file_name> ]

Parameters

-zipFile <compressed_file_name>
Specify the name of the compressed file that contains all the information, that is logs, traces, and configuration files (ita.ini and jobManager.ini) for the agent. The default is logs.zip.
-host <host_name>
Specify the host name or the IP address of the agent for which you want to collect the trace. The default is localhost.
-protocol http|https
Specify the protocol of the agent for which you are collecting the trace. The default is the protocol specified in the .ini file of the agent.
-port <port_number>
Specify the port of the agent. The default is the port number of the agent where you are running the command line.
-iniFile <ini_file_name>
Specify the name of the .ini file that contains the SSL configuration of the agent for which you want to collect the traces. If you are collecting the traces for a remote agent for which you customized the security certificates, you must import the certificate on the local agent and specify the name of the .ini file that contains this configuration. To do this, perform the following actions:
  1. Extract the certificate from the keystore of the remote agent.
  2. Import the certificate in a local agent keystore. You can create an ad hoc keystore whose name must be TWSClientKeyStore.kdb.
  3. Create an .ini file in which you specify:
    • 0 in the tcp_port property as follows:
      tcp_port=0
      
    • The port of the remote agent in the ssl_port property as follows:
      ssl_port=<ssl_port>
      
    • The path to the keystore you created in Step 2 in the key_repository_path property as follows:
      key_repository_path=<local_agent_keystore_path>