ASPLMQ User Guide v 1.00
© 2026 Bassem W. Jamaleddine


3-2

   Monitoring Changes in Clustered IBM MQ Queues and
      Sending Notifications


Visual comparisons for IBM MQ queue configuration drift are rendered by applying ASPL operators to the differential group variables representing the queues. Additionally, ASPL monitoring operators can trigger real-time email alerts to notify designated recipients. This section explains how to use ASPL to detect queue changes within a clustered IBM MQ qmgr. The first part introduces the clustered_delta_queues.aspl script, which detects changes in the queues across the group union of the clustered TESTA qmgr installed on hosts nynymq and vavamq. The second part details the usage of the ASPL playchanges command with differential group variables to visualize queue configuration changes over time. The third part introduces the monitor_clustered_delta_queues.aspl script, which performs the same change detection but also sends automated email reports to designated recipients.

The scripts and ASPL sessions discussed in this section depend on the element grouping class IBMMQ_QUEUES_GROUP created in section "Grouping Class for IBM MQ Queue Attributes".

ACME Co. configured the TESTA queue manager on hosts nynymq and vavamq. Initially, the queue objects on both hosts must be identical. Validate this configuration by displaying the similarity score and any configuration drift between the queue objects on both hosts:

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view simz

Adding the ALTTIME attribute to the ks-vector causes the similarity score to drop to 0.0, as all queues were configured at different times across the hosts.

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view simz -ks+ ALTTIME

As shown in Figure 3.2.1, comparing the TESTA queue objects across both hosts yields a similarity score of 1.0. However, including the ALTTIME attribute drops the similarity score to 0.0 because it causes every element in the ks-vector to mismatch. For this reason, the queuescompare.pl script excludes the ALTDATE, ALTTIME, and chksum attributes from ASPL operations by default.
full view

Image File

 Fig. 3.2.1   [The similarity between qmgr TESTA installed on two hosts]
ASPLMQ 2026 by Bassem Jamaleddine


The following command compares the queue configurations of the TESTA qmgr across both hosts:

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view funion

The command displays the group union of the queue names with matching attributes, which appear in green in Figure 3.2.2.
full view

Image File

 Fig. 3.2.2   [queuescompare_nynymq-TESTA-vavamq-TESTA-funion.png]
ASPLMQ 2026 by Bassem Jamaleddine
To demonstrate the effect of adding ALTTIME to the ks-vector, Figure 3.2.3 displays all queue names in red. This visual coloring reflects the 0.0 similarity score previously shown in Figure 3.2.1, where the mismatching timestamps render the elements completely dissimilar.

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view funion -ks+ ALTTIME

full view

Image File

 Fig. 3.2.3   [Impact of ALTTIME when included in the ks-vector]
ASPLMQ 2026 by Bassem Jamaleddine


Display 3.2.1 details the ASPL commands executed by the queuescompare.pl script when comparing the clustered TESTA qmgr prior to modifying any queues.

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view funion

viewme

 Display. 3.2.1   [Display showing the queuescompare.pl execution between clustered qmgr TESTA before any change]
Comparing Clustered qmgr TESTA Before any Change
The group union of the queues appears entirely in green, indicating a perfect configuration match between the queue managers. Run queuescompare.pl with the -view changed option to confirm that no configuration modifications have occurred within the queues of the clustered TESTA qmgr.

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view changed

full view

Image File

 Fig. 3.2.4   [queuescompare_nynymq-TESTA-vavamq-TESTA-view_changed-beforechanges.png]
ASPLMQ 2026 by Bassem Jamaleddine
An alignment comparison between the queues of the clustered TESTA queue manager is displayed using the following command:

#  queuescompare.pl -hostqmgr nynymq:TESTA -hostqmgr vavamq:TESTA -view useq

full view

Image File

 Fig. 3.2.5   [queuescompare_nynymq-TESTA-vavamq-TESTA-view_useq-beforechanges.png]
ASPLMQ 2026 by Bassem Jamaleddine

■ Detecting Queue Configuration Changes in a Clustered Qmgr


The clustered_delta_queues.aspl script, shown in Listing 3.2.1, detects configuration changes within the queues of the clustered TESTA qmgr. You will edit the script  clustered_delta_queues.aspl  in ASPL's shared directory.

#  vi `asplcmd ~shared`/clustered_delta_queues.aspl

See Listing 3.2.1 for the clustered_delta_queues.aspl script.

 -LIS- Listing. 3.2.1   [Listing of clustered_delta_queues.aspl]
(raw text)
1.     #!/usr/bin/env  aspl 
2.     #ENVARG= -wsname CLUSTERED_TESTA_QUEUES -groupingclass IBMMQ_QUEUES_GROUP  
3.     
4.     ;;***********************************************************************
5.     ;;   clustered_delta_queues.aspl
6.     ;;   detect changes in IBM MQ queue attributes in a cluster of qmgrs.
7.     ;;   Assuming the qmgr TESTA is installed on hosts NYNYMQ and VAVAMQ
8.     ;;   
9.     ;;   Copyright © 2021-2026 Bassem W. Jamaleddine
10.    ;;   All rights reserved.
11.    ;;   
12.    ;;***********************************************************************
13.    
14.    ;; Before running the script, a first initialization of group variable
15.    ;; captures is required. The script interrogates the set variables
16.    ;; detecting changes in an incremental change of data configuration.
17.    ;; # aspl -wsname CLUSTERED_TESTA_QUEUES -groupingclass IBMMQ_QUEUES_GROUP 
18.    ;;     aspl > nytesta = ggqmgrqueues(hostname,nynymq,qmgrname,TESTA)
19.    ;;     aspl > vatesta = ggqmgrqueues(hostname,vavamq,qmgrname,TESTA)
20.    ;; NOTE: below fU, is used so to labinate group label, since grp1 is 
21.    ;;       uc(qmgrname) in ggqmgrqueues(), and qmgrnames are the same
22.    ;;       in a cluster of hosts.
23.    ;;     aspl > nyvatesta = fU, nytesta vatesta 
24.    
25.    endScriptIfShellArgsLessThan 1
26.    
27.    ks-  TRIGDATA PROCESS INITQ ALTDATE ALTTIME chksum
28.    
29.    printblock ANY CHANGES IN THE QMGRs ATTRIBUTES OF $1 ARE SHOWN BELOW
30.    
31.    ?? $1
32.    ;; view only these have changed 
33.    fU,`ks~  @$1
34.    
35.    ;; view all whether changed or not
36.    ;;fU,  @$1
37.    
38.    intermittentarc 1
39.    ;; playop on differential group variable showing only these have changed
40.    playop fU,`ks~ $1
41.    ;; playop showing them all whether changed or not
42.    ;;playop fU, $1
43.    
44.    ;; quietly have labinated union of group variable on top of answer stack
45.    displayoff
46.    fU,`ks~ @$1
47.    displayon
48.    
49.    setwriteformat MQ_Writer_QueuesColor
50.    writeformat
51.    ;;writeformatonchanges
52.    
53.    saveonchanges
54.    
55.    endscript
56.    
57.    __END__
58.    
59.    $00 detects changes in the queues attributes of IBM MQ qmgr at ACME Co.
60.    The qmgr TESTA is created on two hosts: nynymq and vavamq; it is
61.    assumed to be a clustered qmgr. Using ASPL group union, we can monitor
62.    changes in the clustered queues TESTA.
63.    The nyvatesta is the group variable that represents queues in both qmgrs
64.    installed on hosts NYNYMQ and VAVAMQ, that is: nyvatesta = fU, nytesta vatesta
65.    
66.       You must provide the grouping variable for the qmgr or gmgrs 
67.          nytesta   for queues of qmgr TESTA hosted on NYNYMQ
68.          vatesta   for queues of qmgr TESTA hosted on VAVAMQ 
69.          nyvatesta for queues of qmgr TESTA hosted on NYNYMQ and VAVAMQ
70.    

ASPLMQ 2026 Bassem Jamaleddine


Running the clustered_delta_queues.aspl script without arguments displays its usage instructions.
full view

Image File

 Fig. 3.2.6   [Usage of clustered_delta_queues.aspl]
ASPLMQ 2026 by Bassem Jamaleddine


Prior to script execution, capture the baseline queue configurations for the clustered TESTA qmgr across both hosts. This requires separate identifiers for the TESTA instances on nynymq and vavamq. Initialize the ASPL session by creating the namedspace CLUSTERED_TESTA_QUEUES under IBMMQ_QUEUES_GROUP element grouping class. Then, define the nytesta and vatesta set variables within the session to hold the initial configuration of the queues in TESTA qmgr for nynymq and vavamq respectively.

# aspl -wsname CLUSTERED_TESTA_QUEUES -groupingclass IBMMQ_QUEUES_GROUP

aspl> nytesta = ggqmgrchann(hostname,nynymq,qmgrname,TESTA)

aspl> vatesta = ggqmgrchann(hostname,vavamq,qmgrname,TESTA)

aspl> nyvatesta = fU, nytesta vatesta
    the group variable represents the queues in both qmgrs

aspl> bye
    bye will save the workspace before leaving the ASPL interpreter

The identifier nyvatesta is assigned the group union of the elements in nytesta and vatesta, which represents all queues within the TESTA queue manager hosted across nynymq and vavamq. Display 3.2.1 illustrates the commands for the initial configuration of the set variables within the namedspace CLUSTERED_TESTA_QUEUES.
viewme

 Display. 3.2.2   [First time initialization of group variables for script clustered_delta_queues.aspl]
initialization of group variables for script clustered_delta_queues.aspl
Figure 3.2.7 illustrates the output of the following ASPL statement:

aspl> nyvatesta = fU, nytesta vatesta

full view

Image File

 Fig. 3.2.7   [Initializing the set variables in namedspace CLUSTERED_TESTA_QUEUES]
ASPLMQ 2026 by Bassem Jamaleddine
Testing the script requires modifying the queue configurations. The following commands apply four changes to the queues of the TESTA queue manager hosted on vavamq:
  • Making a 1st change
  • (vavamq's qmgr:TESTA) 19:38 mqm@vavamq: ~ #  echo "DEFINE QLOCAL(MSAX5) GET(DISABLED) MAXMSGL(4194111) REPLACE" | runmqsc TESTA

    22:52 mqm@VAVAMQ: ~ #  echo "DEFINE  QLOCAL(MSAX5)  GET(DISABLED) MAXMSGL(4194111) REPLACE" | runmqsc TESTA
    5724-H72 (C) Copyright IBM Corp. 1994, 2009.  ALL RIGHTS RESERVED.
    Starting MQSC for queue manager TESTA.
    
         1 : DEFINE  QLOCAL(MSAX5)  GET(DISABLED) MAXMSGL(4194111) REPLACE
    AMQ8006: WebSphere MQ queue created.
    One MQSC command read.
    No commands have a syntax error.
    All valid MQSC commands were processed.
    
  • Making a 2nd change
  • (vavamq's qmgr:TESTA) 00:36 mqm@vavamq: ~ #  echo "DELETE QLOCAL(MSB3VAVA)" | runmqsc TESTA

    5724-H72 (C) Copyright IBM Corp. 1994, 2009.  ALL RIGHTS RESERVED.
    Starting MQSC for queue manager TESTA.
    
         1 : DELETE  QLOCAL(MSB3VAVA)
    AMQ8007: WebSphere MQ queue deleted.
    One MQSC command read.
    No commands have a syntax error.
    All valid MQSC commands were processed.
    
  • Making a 3rd change
  • (vavamq's qmgr:TESTA) 00:37 mqm@vavamq: ~ #  echo "DEFINE QLOCAL(MSAX5) GET(DISABLED) MAXMSGL(104857600) REPLACE" | runmqsc TESTA

    5724-H72 (C) Copyright IBM Corp. 1994, 2009.  ALL RIGHTS RESERVED.
    Starting MQSC for queue manager TESTA.
    
         1 : DEFINE  QLOCAL(MSAX5)  GET(DISABLED) MAXMSGL(104857600) REPLACE
    AMQ8006: WebSphere MQ queue created.
    One MQSC command read.
    No commands have a syntax error.
    All valid MQSC commands were processed
    
  • Making a 4th change
  • REVERT PREVIOUS DELETION BY RECREATING THE DELETED QUEUE MSB3VAVA.

    (vavamq's qmgr:TESTA) 00:37 mqm@vavamq: ~ #  echo "DEFINE QLOCAL(MSB3VAVA) PUT(DISABLED) MAXMSGL(104857222) REPLACE" | runmqsc TESTA

    00:52 mqm@VAVAMQ: ~ #  echo "DEFINE  QLOCAL(MSB3VAVA)  PUT(DISABLED) MAXMSGL(104857222) REPLACE" | runmqsc TESTA
    5724-H72 (C) Copyright IBM Corp. 1994, 2009.  ALL RIGHTS RESERVED.
    Starting MQSC for queue manager TESTA.
    
         1 : DEFINE  QLOCAL(MSB3VAVA)  PUT(DISABLED) MAXMSGL(104857222) REPLACE
    AMQ8006: WebSphere MQ queue created.
    One MQSC command read.
    No commands have a syntax error.
    All valid MQSC commands were processed.
    
    Display 3.2.3 illustrates the four configuration changes made to the queues of the TESTA queue manager hosted on vavamq. Following each modification, the clustered_delta_queues.aspl script was invoked against the nyvatesta set variable.

    #  clustered_delta_queues.aspl nyvatesta

    Each script execution interrogates the nyvatesta set variable, refreshing the variable from its sources to detect configuration drift. ASPL detects any group modifications and archives them in the variable's historical pool, transforming nyvatesta into a differential group variable.

    Display 3.2.3 illustrates the ASPL statements executed by the clustered_delta_queues.aspl script against the nyvatesta set variable. The script iterates through its internal commands four times — once for each recorded configuration change.
    viewme

     Display. 3.2.3   
    Figure 3.2.6 illustrates the modifications captured in the nyvatesta differential group variable. These variations result from executing the playop operator on the group union of elements with mismatching attributes.

    aspl>  playop fU`ks~ nyvatesta

    full view

    Image File

     Fig. 3.2.8   [ASPL differential group operation revealing changes in the nyvatesta group variable]
    ASPLMQ 2026 by Bassem Jamaleddine


    Figure 3.2.7 shows the prettyprint report of the queues in the differential group variable nyvatesta.
    full view

    Image File

     Fig. 3.2.9   [Report showing the queues historical changes in the CLUSTERED_TESTA_QUEUES]
    ASPLMQ 2026 by Bassem Jamaleddine
    To summarize the modifications, Display 3.2.4 illustrates an ASPL session initialized by loading the CLUSTERED_TESTA_QUEUES namespace. The ASPL statements issued here mirror those following the fourth configuration change in Display 3.2.3, except for the report printed by the writer. In Display 3.2.4, the statement preceding the writer is:

    aspl> fU,`ks~ @nyvatesta

    This statement displays only the queues that have been altered, deleted, or added at any time across either queue manager. Logically, the statement retrieves the group union of all modified queue elements. The ticked `ks~ is read: such that the ks-vector is different. Unlike Display 3.2.3, where the fU, @nyvatesta statement aggregates the group union of all historical states regardless of modifications, this statement filters the output to show only active changes. Refer to ASPL Operations Guide for more information on ASPL ticked operations.
    viewme

     Display. 3.2.4   
    Figure 3.2.10 shows the report for only these changed states (queues) due to fU,`ks~ @nyvatesta. Compare it to Figure 3.2.7 that shows the cumulative states (queues) due to fU, @nyvatesta.
    full view

    Image File

     Fig. 3.2.10   [CLUSTERED_TESTA_QUEUES-1-to-4-fUticked-writeformat.png]
    ASPLMQ 2026 by Bassem Jamaleddine


    Because nyvatesta depends on the nytesta and vatesta variables, the ASPL interpreter also treats these variables as differential group variables. Consequently, a configuration change in nyvatesta implies a state modification in one or both of these variables. Display 3.2.5 illustrates the output of the clustered_delta_queues.aspl script when executed against them. Viewing the state modifications of the vatesta set variable exposes the vertical variation within the queues of the TESTA queue manager hosted on vavamq, and the same behavior applies to the nytesta variable.
    viewme

     Display. 3.2.5   [Changes are implied in nytesta and vatesta]
    ASPLMQ 2026 by Bassem Jamaleddine
    Viewing state modifications within the vatesta differential group variable reveals the vertical configuration drift for the TESTA queue manager hosted on vavamq. The same behavior applies to the nytesta set variable. Figure 3.2.11 illustrates this vertical variation within vatesta in the report generated by the following command:

    #  clustered_delta_queues.aspl vatesta

    full view

    Image File

     Fig. 3.2.11   [Vertical variation in vatesta representing the queues of qmgr TESTA on vavamq]
    ASPLMQ 2026 by Bassem Jamaleddine

     

    ■ Playing the differential group variable to view changes in the queues of qmgr TESTA chronogically

    In ASPL, executing the playchanges operator against a differential group variable displays its historical state modifications over time. For example, run the following command to view the four recorded changes within the vatesta differential group variable, which tracks the queue configurations for the TESTA queue manager hosted on vavamq:

    #  asplcmd "load CLUSTERED_TESTA_QUEUES; intermittentarc 1; playchanges vatesta"

    Figure 3.2.8 shows the partial output revealing the intermittent changes in the state of the variable vatesta.
    full view

    Image File

     Fig. 3.2.12   [Playchanges to reveal the changes made in the queues of TESTA hosted on vavamq]
    ASPLMQ 2026 by Bassem Jamaleddine
    To clearly view configuration changes for the queues of TESTA queue manager hosted on vavamq, initialize an ASPL session by loading the namedspace CLUSTERED_TESTA_QUEUES. Then, execute the playchanges operator against the vatesta differential group variable, as illustrated in Display 3.2.6.
    viewme

     Display. 3.2.6   [Playing changes on the differential group variable vatesta]
    ASPLMQ 2026 by Bassem Jamaleddine

     

    ■ Sending Email Notification on Queue Configuration Change


    The ASPL varchangenotify command detects modifications within group data and transmits notifications to a designated list of email addresses. The monitor_clustered_delta_queues.aspl script, shown in Listing 3.2.2, accepts the nytesta, vatesta, or nyvatesta set variables as an argument. The script interrogates the specified variable and transmits an email notification if it detects any configuration changes.

     -LIS- Listing. 3.2.2   [Listing of monitor_clustered_delta_qmgrs.aspl]
    (raw text)
    1.     #!/usr/bin/env  aspl 
    2.     #ENVARG= -wsname CLUSTERED_TESTA_QMGRS -groupingclass IBMMQ_QMGR_GROUP 
    3.     
    4.     ;;***********************************************************************
    5.     ;;   monitor_clustered_delta_qmgrs.aspl
    6.     ;;   monitoring a cluster of qmgrs, if a change is detected then send email
    7.     ;;   notifying what has been changed.
    8.     ;;   Assuming the qmgr for TESTA Co. is installed on hosts NYNYMQ and VAVAMQ/
    9.     ;;   
    10.    ;;   Copyright © 2021-2026 Bassem W. Jamaleddine
    11.    ;;   All rights reserved.
    12.    ;;   
    13.    ;;***********************************************************************
    14.    
    15.    ;; Before running the script, a first initialization of group variable
    16.    ;; captures is required. The script issue varchangenotify on a set variable
    17.    ;; to detect any changes in the group (representing the qmgr configuration).
    18.    ;; # aspl -wsname CLUSTERED_TESTA_QMGRS -groupingclass IBMMQ_QMGR_GROUP 
    19.    ;;     aspl > nytesta = ggibmqmgrs(hostname,nynymq,qmgrname,TESTA)
    20.    ;;     aspl > vatesta = ggibmqmgrs(hostname,vavamq,qmgrname,TESTA)
    21.    ;;     aspl > nyvatesta = fU, nytesta vatesta 
    22.    ;; NOTE: make the variables monitorable, but can also be done inline
    23.    ;;     aspl > vsmonbits nytesta 11111111
    24.    ;;     aspl > vsmonbits vatesta 11111111
    25.    ;;     aspl > vsmonbits nyvatesta 11111111
    26.    ;;     aspl > bye
    27.    
    28.    endScriptIfShellArgsLessThan 1
    29.    
    30.    ks-  ALTDATE ALTTIME chksum 
    31.    
    32.    ;; if you didn't set the monitoring bits in the variable, then you can do
    33.    ;; it inline 
    34.    vsmonbits $1 11111111
    35.    
    36.    varchangenotify $1  emailsgroup1
    37.    
    38.    ;; uncomment the line below to save the last updated qmgrs otherwise
    39.    ;; last changes are not recorded, and script will keep sending emails
    40.    ;;save
    41.    
    42.    endscript
    43.    
    44.    __END__
    45.    
    46.    $00 detects changes in the qmgr attributes of IBM MQ qmgr at ACME Co.
    47.    The qmgr TESTA is created on two hosts: nynymq and vavamq; it is
    48.    assumed to be a clustered qmgr. Using ASPL command varchangenotify, we can
    49.    monitor if there is any change in the group representing the clustered
    50.    qmgr TESTA; if a change is detected then an email showing what has
    51.    changed is sent to the list of emails tagged with emailsgroup1.
    52.    
    53.       You must provide the grouping variable for the qmgr or gmgrs 
    54.          nytesta   for qmgr TESTA hosted on NYNYMQ
    55.          vatesta   for qmgr TESTA hosted on VAVAMQ 
    56.          nyvatesta for qmgr TESTA hosted on NYNYMQ and VAVAMQ
    57.    
    58.    The nyvatesta is the group variable that represents both qmgrs
    59.    installed on hosts NYNYMQ and VAVAMQ, that is: nyvatesta = fU, nytesta vatesta
    
    
    ASPLMQ 2026 Bassem Jamaleddine
    The monitoring bits are toggled within the nyvatesta group variable.

    aspl> vsmonbits nyvatesta 11111111

    The statement varchangenotify $1 emailsgroup1 interrogates the variable passed to the script (represented by $1). Upon detecting a configuration modification, it transmits a report to the email addresses defined under the emailsgroup1 tag. To edit ASPL's emailspool, simply issue the command:

    #  asplcmd ~emailsfile

    full view

    Image File

     Fig. 3.2.13   [Editing the emailsfile]
    ASPLMQ 2026 by Bassem Jamaleddine


    Because a configuration change was made to the MSB3VAVA queue on host vavamq, the system can detect the modification and send an email alert. Figure 3.2.10 illustrates these queue modifications for the queues in TESTA queue manager hosted on vavamq.
    full view

    Image File

     Fig. 3.2.14   [Changes made in the queues of TESTA hosted on vavamq]
    ASPLMQ 2026 by Bassem Jamaleddine
    Figure 3.2.11 illustrates the output when executing the script against the nyvatesta group variable, which represents the queue manager cluster.
    full view

    Image File

     Fig. 3.2.15   [monitor_clustered_delta_queues_aspl-nyvatesta.png]
    ASPLMQ 2026 by Bassem Jamaleddine
    ASPL sends an email notification to the designated recipients to report queue modifications. Figure 3.2.12 illustrates an example alert sent to bassem@localhost detailing the configuration changes.
    full view

    Image File

     Fig. 3.2.16   [monitor_clustered_delta_queues_aspl-nyvatesta-email-notification.png]
    ASPLMQ 2026 by Bassem Jamaleddine