ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » MQSC using wild card but skip default object

Post new topic  Reply to topic Goto page 1, 2  Next
 MQSC using wild card but skip default object « View previous topic :: View next topic » 
Author Message
KIT_INC
PostPosted: Thu Jul 16, 2015 7:00 am    Post subject: MQSC using wild card but skip default object Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Thu Jul 16, 2015 7:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2602
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
View user's profile Send private message Visit poster's website MSN Messenger
jeevan
PostPosted: Fri Jul 17, 2015 12:14 pm    Post subject: Re: MQSC using wild card but skip default object Reply with quote

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
View user's profile Send private message
PaulClarke
PostPosted: Fri Jul 17, 2015 12:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jeevan
PostPosted: Fri Jul 17, 2015 3:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulClarke
PostPosted: Fri Jul 17, 2015 8:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Michael Dag
PostPosted: Sat Jul 18, 2015 3:45 am    Post subject: Re: MQSC using wild card but skip default object Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2602
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
View user's profile Send private message Visit poster's website MSN Messenger
PaulClarke
PostPosted: Sat Jul 18, 2015 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
smdavies99
PostPosted: Sat Jul 18, 2015 5:51 am    Post subject: Re: MQSC using wild card but skip default object Reply with quote

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
View user's profile Send private message
vsathyan
PostPosted: Sat Jul 18, 2015 10:11 am    Post subject: Reply with quote

Centurion

Joined: 10 Mar 2014
Posts: 121

Is there any utility where I can run the below command?

Code:
DIS QL(*.QUEUE)


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
View user's profile Send private message
jeevan
PostPosted: Sat Jul 18, 2015 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message
jeevan
PostPosted: Sat Jul 18, 2015 10:28 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

vsathyan wrote:
Is there any utility where I can run the below command?

Code:
DIS QL(*.QUEUE)


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
View user's profile Send private message
vsathyan
PostPosted: Sat Jul 18, 2015 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message
vsathyan
PostPosted: Sat Jul 18, 2015 12:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Sun Jul 19, 2015 12:05 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2602
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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » MQSC using wild card but skip default object
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.