This is part of a series of small blog posts which will cover some of the smaller, perhaps less likely to be noticed, features of IBM MQ. Read other posts in this series.
I expect almost 100% of MQ users on distributed platforms use the dspmq command fairly regularly. I certainly do. However, a conversation the other day led me to realise that not everyone knows (or remembers) that the dspmq command has parameters!
You are likely familiar with using the dspmq command to discover whether your queue managers on the machine are running or not. The simple output would be something like this:-
QMNAME(MQG1) STATUS(Running)
QMNAME(MQG2) STATUS(Ended normally)
If you have a lot of queue managers, you can target only specific ones by using the -m parameter, either to provide a full queue manager name, or a wildcarded queue manager name, for example:-
dspmq -m MQG1
dspmq -m MQG*
You can get a lot more out of dspmq than just the STATUS of the queue managers though. You can discover :-
- The installation details (name, path and version) of the queue manager
- Whether any queue managers are the default queue manager
- If you have multi-instance queue managers, you can discover whether standby instances are permitted and details about the instances
- If you are using RDQM (HA or DR) you can discover details about that
While there are various commands that show you details about your MQ installations, for example, dspmqver for your current installation, and dspmqinst for all the installations on the machine, the following command will show you the installations in use by queue managers.
dspmq -o installation
Note the output below has had the spaces trimmed to make this blog post more readable!
QMNAME(MQG2) INSTNAME(800FP6) INSTPATH(C:\mqm8006) INSTVER(8.0.0.6)
QMNAME(MQG1) INSTNAME(911GA) INSTPATH(C:\mqm9110) INSTVER(9.1.1.0)
Status about Highly Available queue managers
When you are running a multi-instance queue manager, you can check the status on either machine. For example, here's what you might see on the machine where the queue manager is active.
dspmq -m MQG3 -x -o standby -o status
QMNAME(MQG3) STANDBY(Permitted) STATUS(Running)
INSTANCE(GEMLNX1) MODE(Active)
INSTANCE(GEMLNX2) MODE(Standby)
And the same command on the machine where the queue manager is not active:-
QMNAME(MQG3) STANDBY(Permitted) STATUS(Running as standby)
INSTANCE(GEMLNX1) MODE(Active)
INSTANCE(GEMLNX2) MODE(Standby)
If you've forgotten to permit the standby instance ( strmqm -x MQG3) when you started the multi-instance queue manager, you will see status like the following:-
QMNAME(MQG3) STANDBY(Not permitted) STATUS(Running)
INSTANCE(GEMLNX1) MODE(Active)
When you are running an RDQM queue manager, the dspmq command has some status to show you, but remember you also have the rdqmstatus command.
If you have an RDQM HA Queue manager, you can use the following command:-
dspmq -m MQG4 -o ha -o status
On the primary node you will see output like the following:-
QMNAME(MQG4) Status(Running) HA(Replicated)
On one of the secondary nodes, you will see output like the following:-
QMNAME(MQG4) Status(Running elsewhere) HA(Replicated)
If you have an RDQM DR Queue manager, you can use the following command:-
dspmq -m MQG4 -o dr -o status
On the primary node you will see output like the following:-
QMNAME(MQG4) Status(Running) DRROLE(Primary)
On the recovery node, you will see output like the following:-
QMNAME(MQG4) Status(Ended immediately) DRROLE(Secondary)
N.B. "Status(Ended immediately)" is normal for the recovery node of an RDQM DR queue manager, rather than "Status(Running elsewhere)" which you will see with other multiple instance queue manager setups.
Connected processes
Finally, there is one further option on the dspmq command, which has been around for many years, but only officially admitted to and documented in more recent years, and that is the option to list the connected processes. This only works from the dspmq command running in the same installation as the queue manager, and is especially useful when your queue manager has been told to stop, but doesn't end. You can find out what process is holding it open and get rid of that process to allow the queue manager to stop.
dspmq -m MQG1 -c
You will see output like the following.
QMNAME(MQG1) STATUS(Running)
SUBPOOL(MQG1) PID(3128)
SUBPOOL(MQG1) PID(7152)
SUBPOOL(MQG1) PID(7144)
SUBPOOL(MQG1) PID(9184)
Rather than repeat advice given elsewhere, please see a blog post from Hursley, Why isn’t my queue manager shutting down? for more information about this parameter on the dspmq command.
Note: In recent releases (from V9.0.1 onwards), IBM MQ for z/OS now has an equivalent command to the distributed platform dspmq command in CSQUDSPM although the parameters differ significantly as you might imagine.
#Little-Gem#IBMMQ#ChampionsCorner