Scenario: Use watch support with a communications trace

You can use watch support with a communications trace.

You notice that Telnet sessions are dropping intermittently on the system, but nothing else seems to be wrong. When the sessions drop, message TCP2617 is sent to the QSYS/QSYSOPR message queue.

To solve the problem, you need to perform a communications trace using watch support so that the trace is automatically stopped when the TCP2617 message is sent to QSYSOPR. This allows you to capture only the data that you need to analyze the problem and prevents the trace from running longer than necessary.

To perform the communications trace using watch support, follow these steps:

  1. Start the communications trace:
    1. At the command line, type STRCMNTRC and press F4.
    2. For the Configuration object prompt, specify the name of the line, such as TRNLINE.
    3. For the Type prompt, specify the type of resource, such as *LIN.
    4. For the Watch for message, Message identifier prompt, type TCP2617.
    5. For the Watched message queue, Message queue prompt, type *SYSOPR. This ensures that the communications trace stops running when the TCP2617 message is sent to the QSYSOPR message queue.
    6. For the Length of time to watch prompt, type 2880. The value 2880 indicates that the communications trace runs for a maximum of two days (2880 minutes) if the message does not occur. When two days elapse, the trace ends. If you do not want the trace to end if the message does not occur during the specified time, specify *NOMAX for this parameter.
  2. Verify that the watch support started:
    1. At the command line, type DSPLOG and press F4.
    2. For the Log prompt, type QHST. You should see the following message:

      Job jobnumber/user/QSCCMNxxxx started on mm/dd/yy at hh:mm:ss in subsystem QUSRWRK in QSYS. Job entered system on mm/dd/yy at hh:mm:ss

      where user is the name of the user that runs the STRCMNTRC command and where xxxx indicates a unique identifier for the watch job. Note that CMN in the middle of the job name indicates that the watch job was started by the STRCMNTRC command.
  3. Verify that the watch support is running:
    • At the command line, type WRKACTJOB SBS(QUSRWRK).
    • You should see the watch job running in the QUSRWRK subsystem. The job is typically in DEQW status if the watched message has not been sent.
  4. After the TCP2617 message is sent to the QSYS/QSYSOPR message queue, you should verify that the trace has ended:
    • At the command line, type DSPMSG MSGQ(*SYSOPR).
    • You should see the CPI3999 message which indicates that the STRCMNTRC command was ended because of reason code 02. Reason code 02 indicates that Watch for event criteria met because of message id TCP2617 found in QSYS/QSYSOPR.
  5. Format the trace output using the Print Communications Trace (PRTCMNTRC) command to analyze the collected trace data. You might see that information is sent to the remote system but a response is not sent back. This indicates that the problem lies outside the local server.