+

Search Tips | Advanced Search

amqsact sample program

amqsact formats Application Activity Trace messages for you and is provided with IBM MQ .

The compiled program is located in the samples directory:


Display mode

By default, amqsact in display mode processes messages on SYSTEM.ADMIN.TRACE.ACTIVITY.QUEUE. We can override this behavior by specifying a queue name or topic string.

We can also control the trace period displayed and specify whether the activity trace messages are removed or retained after display.

amqsact   -m QMgrName   -q QName
  •   -t TopicString
  •   -b Browse
  •   -v Verbose
  •   -d Depth   -w Timeout   -s StartTime   -e EndTime

  • Required parameters

      -m QMgrName
      Name of the queue manager.
      -d Depth
      Number of records to display.
      -w Timeout
      Time to wait, in seconds. If no trace messages appear in the specified period, amqsact exits.
      -s StartTime
      Start time of record to process.
      -e EndTime
      End time of record to process.


    Optional parameters

      -q QName
      Specify a specific queue to override the default queue name
      -t TopicString
      Subscribe to an event topic
      -b
      Browse records only
      -v
      Verbose output


    Example output

    Use amqsact on queue manager TESTQM, with verbose output, on an MQCONN API call:
    amqsact -m TESTQM -v
    
    The preceding command gives the following example output:
    MonitorType: MQI Activity Trace
    Correl_id:
    00000000: 414D 5143 5445 5354 514D 2020 2020 2020 'AMQCTESTQM   '
    00000010: B5F6 4251 2000 E601           '        '
    QueueManager: 'TESTQM'
    Host Name: 'ADMINIB-1VTJ6N1'
    IntervalStartDate: '2014-03-15'
    IntervalStartTime: '12:08:10'
    IntervalEndDate: '2014-03-15'
    IntervalEndTime: '12:08:10'
    CommandLevel: 750
    SeqNumber: 0
    ApplicationName: 'IBM MQ_1\bin\amqsput.exe'
    Application Type: MQAT_WINDOWS_7
    ApplicationPid: 14076
    UserId: 'Emma_Bushby'
    API Caller Type: MQXACT_EXTERNAL
    API Environment: MQXE_OTHER
    Application Function: ''
    Appl Function Type: MQFUN_TYPE_UNKNOWN
    Trace Detail Level: 2
    Trace Data Length: 0
    Pointer size: 4
    Platform: MQPL_WINDOWS_7
    MQI Operation: 0
    Operation Id: MQXF_CONN
    ApplicationTid: 1
    OperationDate: '2014-03-15'
    OperationTime: '12:08:10'
    ConnectionId:
    00000000: 414D 5143 5445 5354 514D 2020 2020 2020 'AMQCTESTQM   '
    00000010: FFFFFFB5FFFFFFF6 4251 2000 FFFFFFE601  '        '
    QueueManager: 'TESTQM'
    Completion Code: MQCC_OK
    Reason Code: 0
    


    Dynamic mode

    We can enable dynamic mode by specifying an application name, a channel name, or a connection identifier as an argument to amqsact. Note that we can use wildcard characters in the name.

    In dynamic mode, activity trace data is enabled at the start of the sample by use of a nondurable subscription to a system topic. Collecting activity trace data stops when amqsact stops. You must specify a timeout for amqsact in dynamic mode. We can run multiple copies of amqsact concurrently, with each instance receiving a copy of any activity trace data.

    amqsact   -m QMgrName   -w Timeout   -a Application name
  •   -c Channel name
  •   -i Connection ID
  •   -v Verbose

  • Required parameters

      -m QMgrName
      Name of the queue manager.
      -w Timeout
      Time to wait, in seconds. If no trace messages appear in the specified period, amqsact exits.


    Optional parameters

      -a Application name
      Specify an application name to collect messages for
      -c Channel name
      Specify a channel to collect messages for
      -i Connection ID
      Specify a connection to collect messages for.
      -v
      Verbose output


    Example output

    The following command generates and displays activity trace messages for any connections made by applications that start with the text amqs. After 30 seconds of inactivity, the amqsact program ends, and no new activity trace data is generated.
    amqsactc -m QMGR1 -w 30 -a amqs*
    
    The following command generates and displays activity trace messages for any activity on the QMGR1.TO.QMGR2 channel. After 10 seconds of inactivity, the amqsact program ends, and no new activity trace data is generated.
    amqsactc -m QMGR1 -w 10 -c QMGR1.TO.QMGR2
    
    The following command generates and displays verbose activity trace messages for any activity on the existing IBM MQ connection that has a CONN of "6B576B5420000701", and an EXTCONN of "414D5143514D47523120202020202020". After a minute of inactivity, the amqsact program ends, and no new activity trace data is generated.
    amqsactc -m QMGR1 -w 60 -i 414D5143514D475231202020202020206B576B5420000701 -v