Author |
Message
|
Anant.v |
Posted: Mon Feb 09, 2015 6:35 am Post subject: Sourcing the "mqprofile" script ( MQ v8) |
|
|
 Apprentice
Joined: 26 Nov 2014 Posts: 40 Location: Malaysia
|
Hello All,
Hope you all are doing fine.
I am trying to use the "mqprofile" script supplied by IBM to automatically target my commands to the specific installation. The only difficulty is, i am not able to do it !
here is what i have done so far :
1. download the "mqprofile" script and place it under /etc/opt/mqm/ .
2. As prescribed, add it to .bash_profile under mqm user.
. /etc/opt/mqm/mqprofile
3. logout and log in again.
But its not getting sourced. I am unable to even debug it by editing the script to take debugging into account. When i tried to run it simply by issuing the command manually, then also iam unable to target my commands automatically to the specific installations.
I am using MQv8. Please let me know if anybody else has faced similar issue.
As always, Thanks for your never ending support !! |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 09, 2015 6:47 am Post subject: Re: Sourcing the "mqprofile" script ( MQ v8) |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Anant.v wrote: |
download the "mqprofile" script |
From where?
Why can't you use setmqenv ? |
|
Back to top |
|
 |
Anant.v |
Posted: Mon Feb 09, 2015 7:33 am Post subject: |
|
|
 Apprentice
Joined: 26 Nov 2014 Posts: 40 Location: Malaysia
|
Hi mqjeff,
setmqenv has to be set each and every time if you are working with multiple installations. this "mqprofile" script is provided by "IBM" to simplify admin task by smartly targeting your commands to its associated installation.
Iam new to MQ, correct me if i am wrong anywhere |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 09, 2015 8:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I haven't worked with mqprofile before, in fact, I hadn't heard of it.
So when I asked 'where', I meant http://www-01.ibm.com/support/docview.wss?uid=swg21587504
Are you sure that the script is not getting sourced in your .bash_profile?
Are you sure that the mqm user has the necessary permissions to access the mqprofile script?
Have you asked your unix administrator for assistance? |
|
Back to top |
|
 |
tczielke |
Posted: Mon Feb 09, 2015 8:12 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
Just a few notes on sourcing a script which might be helpful here.
When you source a script (i.e. put a period before the script at your shell prompt):
. /etc/opt/mqm/profile
you are telling your active shell to read in the script but execute the commands in your active shell process. This is helpful if the script is setting environment variables, so your active shell can pick up the environment variable changes, itself.
When you do not source a script:
/etc/opt/mqm/profile
you are telling your active shell to read in the script but then run the commands in the script as child processes (i.e. fork/exec). So any commands to set environment variables would then not be done in your current shell, but in the child processes that you fork/exec.
It sounded like you correctly sourced the script, but then logged out/in again. That would kill your shell that did have the script sourced inside it, and then start a new shell that does not have your script sourced inside it. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 09, 2015 8:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
tczielke wrote: |
It sounded like you correctly sourced the script, but then logged out/in again. That would kill your shell that did have the script sourced inside it, and then start a new shell that does not have your script sourced inside it. |
I would agree except for
Anant.v wrote: |
2. As prescribed, add it to .bash_profile under mqm user.
. /etc/opt/mqm/mqprofile |
|
|
Back to top |
|
 |
tczielke |
Posted: Mon Feb 09, 2015 8:30 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
Good point. I did not read that original post, correctly.
I assume then the mqm id is set up to run with the bash script when it logs in? It sounds like .bash_profile is not getting executed when the mqm id logs in. I would check what shell is being used when the mqm id logs in:
i.e. grep mqm /etc/passwd
or check ps output |
|
Back to top |
|
 |
Anant.v |
Posted: Mon Feb 09, 2015 11:03 pm Post subject: |
|
|
 Apprentice
Joined: 26 Nov 2014 Posts: 40 Location: Malaysia
|
Actually , The thing is, its not even running when i tried to run it manually.
Also, the script has an inbuilt debugging capability and generates an output called "mqprofile.out". But Iam unable to see any fault in that too.
If anyone has been successful in using this script, please let me know..
If not, nevermind.. we can always source them each time we want using setmqenv.
Thanks for the support. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 10, 2015 6:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
The mqprofile script is intended for POSIX compliant shells, the Bourne shell, and the Z shell. |
So are you using one of those shells?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Feb 10, 2015 7:34 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
Quote: |
The mqprofile script is intended for POSIX compliant shells, the Bourne shell, and the Z shell. |
So are you using one of those shells?  |
.bash_profile only exists and is used in the Bourne Again SHell. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Fri Apr 27, 2018 3:31 pm Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
I encountered the exact same problem. mqprofile does not function as advertised in the IBM MQ support page. [url] ttps://www-01.ibm.com/support/docview.wss?uid=swg21587504#Old[/url] I setup mqm .bash_profile as specified (by IBM) and followed by running setmqenv as follows:
Code: |
. /etc/opt/mqm/mqprofile
setmqenv -n Installation1 -x 64 -z
|
I have 8.0.0.5 and 9.0.4 queue managers on the server. when I try strmqm for the Installation1 qmgr, everything is good. but when I try strmqm for the Installation2 qmgr (8.0.0.5) I get the
Code: |
AMQ5691: Queue manager 'V8TEST1' is associated with a different installation
('Installation2'). |
message. That message is not supposed to appear when mqprofile is functioning.
I am running /bin /bash shell which is Posix compliant (according to my research via google) |
|
Back to top |
|
 |
|