Author |
Message
|
KIT_INC |
Posted: Thu Jul 16, 2015 7:00 am Post subject: MQSC using wild card but skip default object |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
We use wild card very often to find out what is defined under the Qmgr
such as
dis q(*) or dis chl(*)
The output will include all default objects also.
Just wondering if there is a way to avoid displaying of the default objects in the output of display using wild card. |
|
Back to top |
|
 |
Michael Dag |
Posted: Thu Jul 16, 2015 7:21 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
not with regular runmqsc, you may want to look at mqscx from MQGem / Paul Clarke for that. _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
jeevan |
Posted: Fri Jul 17, 2015 12:14 pm Post subject: Re: MQSC using wild card but skip default object |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
KIT_INC wrote: |
We use wild card very often to find out what is defined under the Qmgr
such as
dis q(*) or dis chl(*)
The output will include all default objects also.
Just wondering if there is a way to avoid displaying of the default objects in the output of display using wild card. |
You can avoid the generic dis q(*) in favor of
dis ql(*)
dis qa(*)
dis qc(*)
dis qr(*)
or if you want to display the queues based on the messages on the queue, you can use where clause e.g
dis ql(*) where (curdepth ne 0)
Note: however this only applies for ql
The other way is to issue command from command prompt. Assuming the qmgr is in *nix environment, you can do much better filtering. eg friom command prompt
for q in QL QA QR QC ; do echo "dis $q(*)"|runmqsc IB9QMGR; done
Use can use grep to filter out or capture queues.
Note: you can apply this technique with any objects. Also you now can refine further to make the output in desired format |
|
Back to top |
|
 |
PaulClarke |
Posted: Fri Jul 17, 2015 12:42 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
As Michael says this is trivial to do using MQSCX. You would issue a command like.....
Code: |
dis q(*) =where(queue nl "SYSTEM.DEFAULT.*") |
If anyone would like a free trial licence I would be glad to send them one,
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
jeevan |
Posted: Fri Jul 17, 2015 3:50 pm Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
PaulClarke wrote: |
As Michael says this is trivial to do using MQSCX. You would issue a command like.....
Code: |
dis q(*) =where(queue nl "SYSTEM.DEFAULT.*") |
If anyone would like a free trial licence I would be glad to send them one,
Cheers,
Paul. |
Hi Paul,
I do not mean your tool is not good or not necessary but I just wanted to show an alternative way, though manual, exits. In early days, I have used your tool a lot and there is not word to appreciate what you gave to MQ geeks/novices. |
|
Back to top |
|
 |
PaulClarke |
Posted: Fri Jul 17, 2015 8:47 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Jeevan,
No problem at all. Whenever someone asks a question I think it only right and proper that people explore as many alternatives as possible. As with anything in life, there is usually half a dozen ways to solve the same problem. Deciding amongst them is usually the tricky part but knowing what all the choices are is a good place to start.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
Michael Dag |
Posted: Sat Jul 18, 2015 3:45 am Post subject: Re: MQSC using wild card but skip default object |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
jeevan wrote: |
KIT_INC wrote: |
Just wondering if there is a way to avoid displaying of the default objects in the output of display using wild card. |
You can avoid the generic dis q(*) in favor of
dis ql(*)
dis qa(*)
dis qc(*)
dis qr(*)
or if you want to display the queues based on the messages on the queue, you can use where clause e.g
dis ql(*) where (curdepth ne 0)
Note: however this only applies for ql
The other way is to issue command from command prompt. Assuming the qmgr is in *nix environment, you can do much better filtering. eg friom command prompt
for q in QL QA QR QC ; do echo "dis $q(*)"|runmqsc IB9QMGR; done
Use can use grep to filter out or capture queues.
Note: you can apply this technique with any objects. Also you now can refine further to make the output in desired format |
Please also read the important part of the question: can I apply a filter to avoid seeing the de SYSTEM.DEFAULT.... objects, the answer with regular MQSC is no as the filter NE can not be applied to the object name...
you could wrap a shell/cmd script around but there is no oneline option in runmqsc either so you can not display attributes along... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
PaulClarke |
Posted: Sat Jul 18, 2015 4:55 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
That's a very good point Michael. I hadn't twigged that the provided 'alternative' didn't really solve the asked question
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Jul 18, 2015 5:51 am Post subject: Re: MQSC using wild card but skip default object |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Michael Dag wrote: |
you could wrap a shell/cmd script around but there is no oneline option in runmqsc either so you can not display attributes along... |
Time for an RFE then?
After all the code does exist for a one line output of MQ Objects in the dmpmqcfg utility. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
vsathyan |
Posted: Sat Jul 18, 2015 10:11 am Post subject: |
|
|
Centurion
Joined: 10 Mar 2014 Posts: 121
|
Is there any utility where I can run the below command?
I would like to use the * or other wildcards before the string and not after like SYSTEM.*
Thanks. _________________ Custom WebSphere MQ Tools Development C# & Java
WebSphere MQ Solution Architect Since 2011
WebSphere MQ Admin Since 2004 |
|
Back to top |
|
 |
jeevan |
Posted: Sat Jul 18, 2015 10:25 am Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
PaulClarke wrote: |
That's a very good point Michael. I hadn't twigged that the provided 'alternative' didn't really solve the asked question
Cheers,
Paul. |
Paul,
Again with great respect, I am again showing a simple solution. But this is not for everyone, probably for nerd or who have attained near nerd status.
for q in QL QA QR QC ; do echo "dis $q(*)"|runmqsc IB9QMGR; done
I changed my above script as follows
for q in QL QA QR QC ; do echo "dis $q(*)"|runmqsc IB9QMGR|egrep -iv "system|AMQ|MQSC"|grep -i queue; done
When I ran this, did not give any output as there were no non system queues
bash-4.1# displayQ
But when I defined one QL, on QA and one QR as below
define ql(TEST.1)
2 : define ql(TEST.1)
AMQ8006: WebSphere MQ queue created.
def qa(test.QA.1)
3 : def qa(test.QA.1)
AMQ8006: WebSphere MQ queue created.
define qr(TEST.QR.1)
4 : define qr(TEST.QR.1)
AMQ8006: WebSphere MQ queue created.
end
5 : end
4 MQSC commands read.
One command has a syntax error.
All valid MQSC commands were processed.
When I issued the simple command at prompt, even not going to runmqsc shell, it will display as below
bash-4.1# displayQ
QUEUE(TEST.1) TYPE(QLOCAL)
QUEUE(TEST.QA.1) TYPE(QALIAS)
QUEUE(TEST.QR.1) TYPE(QREMOTE)
To me, script can run the world, could this be the reason, companies are now ready to pay 200k for a devops, the new incarnation of a person who could write script for automate stuff, without any hesitation while they were not even ready to pay just above half for a TOGAF certified architect.
Has the almighty known the scripting, he would have the world created differently. Probably CMMI level 3 at least.
Last edited by jeevan on Sat Jul 18, 2015 1:38 pm; edited 2 times in total |
|
Back to top |
|
 |
jeevan |
Posted: Sat Jul 18, 2015 10:28 am Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
vsathyan wrote: |
Is there any utility where I can run the below command?
I would like to use the * or other wildcards before the string and not after like SYSTEM.*
Thanks. |
I can write one such utility for you if you are ready to pay the price. |
|
Back to top |
|
 |
vsathyan |
Posted: Sat Jul 18, 2015 11:43 am Post subject: |
|
|
Centurion
Joined: 10 Mar 2014 Posts: 121
|
Thanks Jeevan,
I can write that tool myself. I was just checking if there is already any free utility available and I don't want to reinvent the wheel.
 _________________ Custom WebSphere MQ Tools Development C# & Java
WebSphere MQ Solution Architect Since 2011
WebSphere MQ Admin Since 2004 |
|
Back to top |
|
 |
vsathyan |
Posted: Sat Jul 18, 2015 12:32 pm Post subject: |
|
|
Centurion
Joined: 10 Mar 2014 Posts: 121
|
By the way, i'm writing up a tool - WebSphere MQ Control Panel which has a bunch of features, like queue manager compare, detect damaged objects, search any object (*.QUEUE), universal deployer, message editors, queue pollers, report generation, much more features and going to share it with the MQ user community in a few months. It will be completely free.
Sample development screen shots can be found here.
https://drive.google.com/folderview?id=0B6pmC9rxCJTaLUVSNmNZSFozTGc&usp=sharing
Thanks,
vsathyan _________________ Custom WebSphere MQ Tools Development C# & Java
WebSphere MQ Solution Architect Since 2011
WebSphere MQ Admin Since 2004 |
|
Back to top |
|
 |
Michael Dag |
Posted: Sun Jul 19, 2015 12:05 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
@jeevan now add curdept or any other attribute you may like to see...
what is the point of displaying just queue names? it's about their status, setup etc... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
|