+

Search Tips | Advanced Search

Monitor system resource usage by using the amqsrua command

We can use the amqsrua command to query performance data that is related to the system resource usage of a queue manager.


About this task

The amqsrua sample program showcases a way to consume IBM MQ monitoring publications and display performance data that is published by queue managers. This data can include information about the CPU, memory, and disk usage. We can also see data equivalent to the STATMQI PCF statistics data. The data is published every 10 seconds and is reported while the command runs.

We can run the command with just the queue manager name and interactively step through to choose the CLASS, then TYPE and then object parameters that are available for the queue manager at each step. If you know the CLASS, TYPE and object names for which you want to see information, we can specify them when you run the amqsrua command.

By default, the amqsrua program looks for statistics that are published by the queue manager under the topic tree $SYS/MQ/INFO/QMGR. Other components or applications can use a similar mechanism to publish under a different topic starting point. For example, the IBM MQ Bridge to Salesforce that is available on x86-64 Linux platforms, publishes statistics under $SYS/Application/runmqsfb. From IBM MQ Version 9.0.2, we can use the -p parameter to specify where amqsrua looks for the statistics for these other components on both Linux and Windows.


Procedure

  1. From the samples directory, issue the following command to display the available data for the queue manager: On Linux, MQ_INSTALLATION_PATH/samp/bin:
    ./amqsrua -m QMgrName
    On Windows, MQ_INSTALLATION_PATH\tools\c\Samples\Bin64:
    amqsrua -m QMgrName
    Where

      QMgrName
      Specifies the name of the queue manager to query. The queue manager must be running.
      If we do not specify a queue manager name, the default queue manager is used.

    The following options are available:

    CPU : Platform central processing units
    DISK : Platform persistent data stores
    STATMQI : API usage statistics
    STATQ : API per-queue usage statistics
    Enter Class selection
    ==> 
    
  2. From the list of CLASS options, enter STATMQI.
    ==> STATMQI
    CONNDISC : MQCONN and MQDISC
    OPENCLOSE : MQOPEN and MQCLOSE
    INQSET : MQINQ and MQSET
    PUT : MQPUT
    GET : MQGET
    SYNCPOINT : Commit and rollback
    SUBSCRIBE : Subscribe
    PUBLISH : Publish
    Enter Type selection
    ==>
  3. From the list of TYPE options, enter PUT.
    ==>PUT
    Publication received PutDate:20170329 PutTime:17045485 Interval:4 minutes,13.978 seconds
    Interval total MQPUT/MQPUT1 count 22 
    Interval total MQPUT/MQPUT1 byte count 25284 100/sec
    Non-persistent message MQPUT count 22 
    Persistent message MQPUT count 0 
    Failed MQPUT count 0 
    Non-persistent message MQPUT1 count 0 
    Persistent message MQPUT1 count 0 
    Failed MQPUT1 count 0 
    Put non-persistent messages - byte count 25284 100/sec
    Put persistent messages - byte count 0 
    MQSTAT count 0 
    
    Publication received PutDate:20170329 PutTime:17050485 Interval:10.001 seconds
    Interval total MQPUT/MQPUT1 count 1 
    Interval total MQPUT/MQPUT1 byte count 524 52/sec
    Non-persistent message MQPUT count 1 
    Persistent message MQPUT count 0 
    Failed MQPUT count 0 
    Non-persistent message MQPUT1 count 0 
    Persistent message MQPUT1 count 0 
    Failed MQPUT1 count 0 
    Put non-persistent messages - byte count 524 52/sec
    Put persistent messages - byte count 0 
    MQSTAT count 0 


Results

We used the amqsrua sample program interactively to look at statistics that queue managers publish on the system topics under the metadata prefix $SYS/MQ/INFO/QMGR.Note: This task is created for an IBM MQ queue manager that is running at Version 9.0.2 on Linux. Classes and types of resource publications that are available for queue managers might be different depending on their configuration, version, and platform. Use the amqsrua interactively to find the classes, types, and elements that are available for your specific queue manager.


What to do next

To develop your own monitoring application, see Developing your own resource monitoring program.