|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
display queue filters flags: keyword-operator-filter value |
« View previous topic :: View next topic » |
Author |
Message
|
dakoroni |
Posted: Wed May 19, 2021 5:20 am Post subject: display queue filters flags: keyword-operator-filter value |
|
|
Acolyte
Joined: 10 Jan 2020 Posts: 50
|
Hello forum users,
Any advise on the following will be much appreciated:
I have a QMGR (v9.1.0.3) running on AIX v7.2 hosting hundreds of queues.
I need to run a command that displays only the queues (qlocal & qremote) where 'T24' is the 2nd or 3rd qualifier within queue object name.
For instance: BRO_T24_SAP (2nd qualifier), FILES_IDOCS_T24 (3rd qualifier).
According to IBM URL for Display Queue command posted at: https://www.ibm.com/docs/en/ibm-mq/9.1?topic=commands-display-queue#q086270___3, neither QUEUE, nor QLOCAL/QREMOTE are included in the parameters list, so i was wondering about
the filter flags to be included in the display queue where clause:
For instance, DISPLAY QUEUE(*) WHERE(???? LIKE *T24*)
OR
the parameters to be associated with the following command:
echo "display queue (*)" | runmqsc QMANAGER01
I assume the response will be applicable to define/delete/alter queue commands as well, facilitating scripting.
Thanks in advance,
Cheers, Nick. |
|
Back to top |
|
 |
PaulClarke |
Posted: Wed May 19, 2021 11:38 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Hi Nick,
Well, you can't do this using the standard MQ commands. MQ supports wildcards only at the end of the object name. Another restriction is that you can't use the object name in a WHERE clause. So, unless you want to write a huge amount of code yourself, you are probably down to using a vendor product. So, let me tell you about ours.
<VENDOR PLUG>
Take a look at our MQSCX product. This has a variety of additional ways in which the data can be filtered. So, briefly, you can issue commands such as the following:
- DIS QUEUE(*PUB*)
- DIS QUEUE(APP1.*PUB*)
- DIS Q(A?????B)
- DIS CONN(*) ALL =FIND(amqsput)
- DISPLAY Q(*) =WHERE(DESCR LK '*PUB*')
- DISPLAY Q(*) =WHERE(CURDEPTH GT 0 AND QUEUE LK '*CHANNEL*')
- DISPLAY CHANNEL(*) =WHERE(!MCAUSER & !SCYEXIT & !SSLCIPH)
- DISPLAY Q(*) =WHERE(CURDEPTH >= 0.80*MAXDEPTH)
- DISPLAY Q(*) =WHERE(QUEUE != UPPER(QUEUE))
- DISPLAY Q(*) =WHERE(GET = DISABLED)
- DISPLAY QSTATUS(*) =WHERE(QTIME.SHORT > 5000000)
None of these commands would be legal using the normal MQSC parser but all are allowable by MQSCX. I am trying to keep this brief but I imagine you can guess what each command does.
MQSCX has a lot of other advantages over standard MQSC but one of the major ones is that it easily allows you to process the responses. You mentioned scripting which is extremely hard to do using MQSC. However, with MQSCX you can do scripting very easily. Here's a simple example to give you an idea:
Code: |
=mqsc
@CountXQs = 0
* Get all the transmission queues
foreach(DISPLAY QUEUE(*) CURDEPTH WHERE(USAGE EQ XMITQ))
* Is the depth non-zero ?
if (curdepth > 0)
@CountXQs = @CountXQs + 1
@qname = QUEUE
@depth = CURDEPTH
* Read channel status for this queue
foreach(DISPLAY CHSTATUS(*) WHERE(XMITQ EQ <@qname>))
print @qname,"depth",@depth, CHANNEL,"is",STATUS
endfor
if (_matches = 0)
print @qname,"depth",@depth,"No channel status"
endif
endif
endfor
if (@CountXQs = 0)
print "No non-empty Xmit Qs found"
endif
|
Take a look at the MQSCX manual if you want to see the dozens of other things it can do - https://www.mqgem.com/mqscx.html and if you would like a 30-day no obligation trial of the product them just send an email to support@mqgem.com
</VENDOR PLUG>
Regards,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
dakoroni |
Posted: Thu May 20, 2021 12:25 am Post subject: display queue filters flags: keyword-operator-filter value |
|
|
Acolyte
Joined: 10 Jan 2020 Posts: 50
|
Hi Paul,
At first many thanks for your response.
To be honest, I am very fond of MQGEM products as well as, helpful blog postings made by Morag. I am also aware about the MQSCX features and capabilities.
The main issue -as usual- is to convince business management for the added value of the licensing cost.
P.S.
FYI, I have been thoroughly using your MO71 support pack, since the time you were part of MQ development team in IBM UK labs.
Cheers Nick. |
|
Back to top |
|
 |
PaulClarke |
Posted: Thu May 20, 2021 12:45 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Hi Nick,
You are right - it is never easy to get the money men to part with their cash. It is usually the familiar battle between visible and invisible costs. They won't pay $100 to buy a product in that'll do the job but they will pay for days of someone's time to develop an inferior solution that need to be maintained and fixed for years to come costing them ten times as much in the long run.
Anyway, thank-you for the kind words about our products and my previous SupportPacs. We are lucky to have so many valued users of all of our software - it makes it all so much more worthwhile,
Regards,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
tczielke |
Posted: Thu May 20, 2021 4:20 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
runmqsc output is easier to filter on if you adjust the output to be one line per object returned. This take some scripting to do that, but the blog post below contains a script that does this.
https://community.ibm.com/community/user/integration/blogs/tim-zielke1/2020/07/09/mqsc-qmgrs-script
Once you have your runmqsc data in a one line per object format, you can then use Unix tools like egrep to do regex or simple searches on the data.
It is not elegant, but it is what I have done to have a way to process subsets of all the object data across our MQ environment (e.g. all queues, all channels, all cluster information, etc.). _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|