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 » IBM MQ Installation/Configuration Support » Checking the existence of a QMgr

Post new topic  Reply to topic
 Checking the existence of a QMgr « View previous topic :: View next topic » 
Author Message
brgmo
PostPosted: Tue Jun 19, 2007 2:39 am    Post subject: Checking the existence of a QMgr Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Hi All,

Is it possible to check if the queue manager exists or not on the box by using scripts. Like, i want to run a script for creating QMgr and queues. But,before i run this script,i want to check if the queue manager exists. If it exists, i want the script to exit.

Regards
brgmo.
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Jun 19, 2007 2:59 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Perl script? ksh script? parse the output of dspmq.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
fjb_saper
PostPosted: Tue Jun 19, 2007 2:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Yes it is possible and there are many ways to do it. It all depends on your scripting language...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
brgmo
PostPosted: Tue Jun 19, 2007 3:08 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

I am using Linux running under Bourne shell. So, i think probably i will have to use a bourne script to write this script.If someone has already written it, please be kind to share that.

Regards
brgmo.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 19, 2007 3:16 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

brgmo wrote:
I am using Linux running under Bourne shell. So, i think probably i will have to use a bourne script to write this script.If someone has already written it, please be kind to share that.

Regards
brgmo.

We won't do your work for you. You have been given directions... What did you try and what were the results ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Jun 19, 2007 3:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Quite a while ago, wschutz posted a script that used awk to parse the output of dspmq.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
brgmo
PostPosted: Tue Jun 19, 2007 5:37 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

I think, you are talking about the followinf script written by wschutz.
Quote:

echo "dis ql(*)" | runmqsc | egrep "QUEUE\(TEST.*\) *TYPE\(QLOCAL\)" | awk '{print $1}' | sed -e "s/QUEUE(\(.*\))/DELETE QLOCAL\(\1\)/" | runmqsc


But, it doesn't check for the existence of the queues.

Regards
brgmo.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 19, 2007 5:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You said you wanted to check the existance of the qmgr, not "the queues".

Most of what you need to know about checking the existance of "the queues" is in the MQSC Script Reference manual, which I'm going to assume you've read at this point.

Is there a specific command in that manual that you did not understand? Is there a concept described in that manual that you did not understand?

What have you tried? What happened when you tried it? Did you get an error?

Have you written any bourne shell scripts before? Did you look for documentation and examples on writing bourne shell scripts?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 19, 2007 6:52 am    Post subject: Reply with quote

Guest




Take a look at crtmqm control command in the MQ V6 System Admin Guide.

If you or your script attempts to create a new qmgr AND the qmgr already exists, your attempt will fail. If the qmgr doesn't exist, it will be created.

Take a look at runmqsc control command in the same manual.
Now that you have a qmgr - either a pre-existing one or a newly created one, you or your script can attempt to create object definitions.

If you next attempt to create objects on the qmgr AND you specify NOREPLACE, then no existing object definitions will be replaced.
Back to top
jefflowrey
PostPosted: Tue Jun 19, 2007 6:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

bruce2359 wrote:
If you next attempt to create objects on the qmgr AND you specify NOREPLACE, then no existing object definitions will be replaced.


NOREPLACE is the default.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jun 19, 2007 7:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

jefflowrey wrote:
Quite a while ago, wschutz posted a script that used awk to parse the output of dspmq.


I did too apparently... http://www.mqseries.net/phpBB2/viewtopic.php?t=12704
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue Jun 19, 2007 7:16 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Michael Dag wrote:
jefflowrey wrote:
Quite a while ago, wschutz posted a script that used awk to parse the output of dspmq.


I did too apparently... http://www.mqseries.net/phpBB2/viewtopic.php?t=12704


No... your script doesn't use AWK...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jun 19, 2007 7:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

jefflowrey wrote:
Michael Dag wrote:
jefflowrey wrote:
Quite a while ago, wschutz posted a script that used awk to parse the output of dspmq.


I did too apparently... http://www.mqseries.net/phpBB2/viewtopic.php?t=12704


No... your script doesn't use AWK...


sorry must be my last 6 word memory buffer playing tricks on me...
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
brgmo
PostPosted: Tue Jun 19, 2007 7:47 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Thanks a lot guys. I have got that working on linux.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Checking the existence of a QMgr
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.