Open an Active SmartTrace

Use the
NetMaster API Service
to open and view an active SmartTrace trace.
The Open an Active SmartTrace API uses the WebSocket protocol to capture a trace at a specific point in time. You can use the WebSocket API response in conjunction with a NetMaster REST API to query static data associated with the active SmartTrace. For example, say that you are troubleshooting an active connection. You use the Open an Active SmartTrace API to capture an in-progress SmartTrace. The WebSocket response provides you with the Active Trace ID, which you can then use to research static data from the trace, including details about the trace itself and details about all of the packets in the trace. To initiate the API request, you subscribe to the Open an Active SmartTrace API using any medium that supports Streaming Text-Oriented Messaging Protocol (STOMP).

Subscribe to the Open an Active Trace API

  1. Once you have been authenticated by the NetMaster API Server, enter the URI for the WebSocket API operation, using the following formula:
    protocol
    ://
    host
    :
    port
    /ws/v
    nn
    protocol
    Specifies whether the WS or WSS (secure) protocol is enabled for your client program.
    Values:
    ws, wss
    host
    Specifies the host or server name, or the domain name where the service is deployed and running.
    port
    Specifies the port number that is defined on the web server.
    ws/v
    nn
    Fixed portion of the URI for the API version, where
    nn
    is the version number.
    If you use the Zowe API Mediation Layer to access a NetMaster WebSocket API, you must use the following URI format:
    wss://
    host
    :
    port
    /ws/v
    nn
    /
    service-id
    /v
    nn
    This version of the URI includes the following additional elements:
    service-id
    The unique service ID that identifies your individual NetMaster API Service instances in the API Mediation Layer.
    Replace the
    systemid
    variable in the service ID with the system name of the host where the NetMaster API is running.
    v
    nn
    The API version number.
  2. Connect to the server using a connect type of STOMP, with the following header parameters:
    { "region": "NetMaster Regions ID", "traceid": "Active Trace ID" }
  3. Subscribe, using a STOMP subscribe destination of
    user/queue/smart-trace
    .

Response Format

Subscribing to
user/queue/smart-trace
is equivalent to making a request through a REST API URI. Once you subscribe, the WebSocket API returns data in the following format:
package com.broadcom.netmaster.controllers.ws.v1.smarttrace.modelsimport com.fasterxml.jackson.annotation.JsonProperty data class TraceInstanceResponse( @JsonProperty("activeTraceId") val activeTraceId: String, @JsonProperty("snapshotTraceId") val snapshotTraceId: String, )
Example:
In the following example, the subscription returns information for the activeTraceId value, which is a NetMaster generated string of six key values - in this case CWTCPCOPY-341-5-TCPIP11-0-1.
package com.broadcom.netmaster.controllers.ws.v1.smarttrace.modelsimport com.fasterxml.jackson.annotation.JsonProperty data class TraceInstanceResponse( @JsonProperty("activeTraceId") val activeTraceId: CWTCPCOPY-341-5-TCPIP11-0-1, @JsonProperty("snapshotTraceId") val snapshotTraceId: CWTCPCOPY-341-5-TCPIP11-0-1, )
The activeTraceID value is the same as the snapshotTraceId value, and can be queried with a REST API, as shown here, with a request to show all of the packets in the trace:
GET /api/v1/tcpip/U22NDE55/smart/trace/CWTCPCOPY-341-5-TCPIP11-0-1/packets
Refer to the GET: All Packet Summary topic for details on the returned packet data.