[Windows][Linux]

Monitoring system resource usage by using the amqsrua command

You 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 application 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. You 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.

You 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, you can specify them when you run the amqsrua command.

[V9.1.0 Jul 2018]By default, the amqsrua application 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 9.1.0, you can use the -p parameter to specify where amqsrua looks for the statistics for these other components on both Linux and Windows.

-m
Queue manager name. The queue manager must be running. If you do not specify a queue manager name, statistics for the default queue manager are displayed.
-c
CLASS name. IBM MQ resource usage publications are associated with a class. The classes represent the top level in the tree of metadata that describes the available resource usage information.
CPU
Returns information about CPU usage.
DISK
Returns information about disk usage.
STATMQI
Returns information about MQI usage.
STATQ
Returns information about per-queue MQI usage.
[V9.1.5 Apr 2020]STATAPP
Returns information about usage statistics for the application specified.
See Developing your own resource monitoring application for information on how you specify the topic tree for metadata, and Using the application name in supported programming languages for the characters you can use in the names of applications.
Note: You use the -o option to specify the application name being monitored for STATAPP, and the queue name for STATQ.

[V9.1.0 Jul 2018]For classes available only with the IBM MQ Bridge to Salesforce, see Monitoring the IBM MQ Bridge to Salesforce.

-t
TYPE name. IBM MQ resource usage publications are associated with a type within a class. Each publication includes the class and type that allows the class/type/element definitions to be found and the resulting publications to be handled. The class/type/element descriptions are published as metadata at queue manager startup.
-o
Object name. Resource usage publications are PCF messages that consist of a sequence of PCF elements. The PCF elements that are published for each class/type pair are advertised in the metadata. A leaf is stored in the tree that describes each element, thus allowing the elements to be processed.
[V9.1.0 Jul 2018]-p
Metadata prefix. Specify a topic tree starting point where amqsrua can look for statistics that are published by queue managers. The default topic tree is $SYS/MQ/INFO/QMGR but other components or applications might publish statistics under a different topic tree starting point, for example, the IBM MQ Bridge to Salesforce publishes statistics under $SYS/Application/runmqsfb.
-n
Publication count. You can specify how many reports are returned before the command ends. The data is published approximately every ten seconds, so if you enter a value of 50, the command returns 50 reports over 500 seconds. If you do not specify this parameter, the command runs until either an error occurs, or the queue manager shuts down.
[V9.1.0.10 Dec 2021]-s
Model queue. Optionally specify a model queue to use. (By default amqsrua uses the SYSTEM.DEFAULT.MODEL.QUEUE queue.)
-h
Usage

Procedure

  1. From the samples directory, issue the following command to display the available data for the queue manager:
    • [Linux]On Linux, MQ_INSTALLATION_PATH/samp/bin:
      ./amqsrua -m QMgrName
    • [Windows]On Windows, MQ_INSTALLATION_PATH\tools\c\Samples\Bin64:
      amqsrua -m QMgrName
    where QMgrName specifies the name of the queue manager that you want to query. The queue manager must be running. If you 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

You used the amqsrua sample application interactively to look at statistics that queue managers publish on the system topics under the metadata prefix $SYS/MQ/INFO/QMGR.
Note: Classes and types of resource publications that are available for queue managers might be different depending on their configuration, version, and platform. Use 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 application.