Author |
Message
|
jsware |
Posted: Tue Jun 24, 2014 3:30 am Post subject: Check which installation a broker is associated with |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
How can I check which installation a broker is associated with from within a script?
So if I have v8 and v9 of MQSI installed and create a broker using each version.
So in order to start them within a script, I need to execute mqsiprofile from the relevant version. I need to be able to determine which mqsiprofile to source in before executing mqsistart on the broker. Where can I find this information? _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
Tibor |
Posted: Tue Jun 24, 2014 6:24 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
You can list all the mqsiprofile related environment variables with this command: set | grep MQSI and then you can choose the most appropriate one: MQSI_VERSION |
|
Back to top |
|
 |
jsware |
Posted: Tue Jun 24, 2014 12:39 pm Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
Tibor wrote: |
You can list all the mqsiprofile related environment variables with this command: set | grep MQSI and then you can choose the most appropriate one: MQSI_VERSION |
But I have not sourced in mqsiprofile yet so no MQSI environment variables are set. I want to work out which mqsiprofile to source in to start each broker on a machine _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
paustin_ours |
Posted: Tue Jun 24, 2014 1:11 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
I am a little confused. When you create a broker, you are not creating it at a version i dont think.
in my case i can source 8.0.0.4 profile and start the broker and it runs as 8.0.0.4.
i can source 8.0.01 profile and start the broker to run it as 8.0.01 broker.
but when it comes to v8 and v9 not sure if i can do that. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jun 24, 2014 1:26 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
mqsilist -a _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
jsware |
Posted: Thu Jul 03, 2014 11:48 pm Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
paustin_ours wrote: |
I am a little confused. When you create a broker, you are not creating it at a version i dont think.
in my case i can source 8.0.0.4 profile and start the broker and it runs as 8.0.0.4.
i can source 8.0.01 profile and start the broker to run it as 8.0.01 broker.
but when it comes to v8 and v9 not sure if i can do that. |
But if I have version 8.0.0.4 and 9.0.0.1 installed (because say, I am upgrading), I want to start it with the last started version similar to what Windows broker services do. only after you start a broker from the command line with a new version does the service get updated to the new program.
This tells me all the brokers installed (with some parsing), but not which version of the program was last used to start it. And I have to have chosen a version of mqsi to run this command with. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 04, 2014 12:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Code: |
C:\Program Files\IBM\MQSI\9001>mqsilist -a -d 2
BIP1280I: The number of IBM Integration Bus runtime installations on this machine is '4'.
8.0.0.1 : C:\Program Files\IBM\MQSI\8.0.0.1
8.0.0.0 : C:\Program Files\IBM\MQSI\8.0.0.0
7.0.0.3 : C:\Program Files\IBM\MQSI\7.0
9.0.0.1 : C:\Program Files\IBM\MQSI\9001
BIP8221I: Broker: TEST (Version v7.0) - TEST
BIP8221I: Broker: TEST8 (Version v8.0) - TEST8
BIP8221I: Broker: TEST8001 (Version v8.0) - TEST8001
===================================
BIP1285I: Broker 'IIB9001' on queue manager 'IIB9001' is stopped.
Start the broker for more information.
BIP8071I: Successful command completion. |
mqsilist -a -d 2 gives you plenty of information.
Now as to which version of mqsi to run looking at version 8, the only way to know is to check the level of the associated qmgr... TEST8 qmgr and TEST8001 qmgr.
For this use the latest version of the mq install and run
pathtolatestbin\setmqenv -m brokerqmgr
dspmqver
Thus you are able to distinguish which level of broker 8 to run against which broker at level 8. (8001 required a higher version of MQ than 8000).
By the way I inserted a little script in the place reserved for user scripts to run under mqsiprofile, that will check the level of the mqsiprofile being run and set the installation of MQ accordingly...
as directed under C:\ProgramData\IBM\MQSI\common\profiles
file mymqenv.cmd:
Code: |
@echo off
rem setting mq environment
if "%mqsi_version%" geq "8.0.0.1" (c:\mq75\bin\setmqenv -n mq75) |
Have fun.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jsware |
Posted: Fri Jul 04, 2014 3:07 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
Thanks fjb_saber - useful information.
The problem with mqsilist is that it only works if you've sourced in an mqsiprofile, which means you cannot source in another without hacking the environment variables significantly
I did find a little hack - there seems to be a file called AdminAgentPIDPath in the broker registry that contains the version of the broker that has been run. Not overly happy with looking for an internal file which IBM may change, but it gets me so far at the moment.
I'm using that file as a basis, I then start the broker in a subshell using:
bash -c "source $path/bin/mqsiprofile && mqsistart $broker"
I like your idea of resetting the MQ environment using a broker-wide script in the profiles directory.
Thanks
John. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
|