Author |
Message
|
sudaltsov |
Posted: Fri Mar 09, 2018 3:23 am Post subject: runmqsc error handling |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
Does anybody have any idea how to check runmqsc success/failure in the client mode? I am talking about checking $? after exit. It seems it works correctly when in local mode and always 0 in client mode:
Code: |
> runmqsc MYQM < zz
5724-H72 (C) Copyright IBM Corp. 1994, 2015.
Starting MQSC for queue manager MYQM.
1 : DEFINE QL ('EXISTINGREMOTEQ') REPLACE
AMQ8151: WebSphere MQ object has different type.
One MQSC command read.
No commands have a syntax error.
One valid MQSC command could not be processed.
> echo $?
10
> runmqsc -c MYQM < zz
5724-H72 (C) Copyright IBM Corp. 1994, 2015.
Starting MQSC for queue manager MYQM.
1 : DEFINE QL ('EXISTINGREMOTEQ') REPLACE
AMQ8151: WebSphere MQ object has different type.
1 command responses received.
> echo $?
0
|
It looks like a clear bug to me.  |
|
Back to top |
|
 |
sudaltsov |
Posted: Fri Mar 09, 2018 3:26 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
Just in case:
Code: |
> dspmqver
Name: WebSphere MQ
Version: 8.0.0.5
Level: p800-005-160516.2
BuildType: IKAP - (Production)
Platform: WebSphere MQ for AIX
Mode: 64-bit
O/S: AIX 7.1
InstName: Installation4
InstDesc:
Primary: Yes
InstPath: /opt/IBM/WMQ/8.0.0.5/usr/mqm
DataPath: /var/mqm
MaxCmdLevel: 802
LicenseType: Production
|
Can anyone please check that on the newer versions? |
|
Back to top |
|
 |
PaulClarke |
Posted: Fri Mar 09, 2018 3:51 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Trying to parse the responses to RUNMQSC is always going to be a bit tricky. Have a look at MQSCX. This makes it easy to check the success/failure of each command as well as much more.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
sudaltsov |
Posted: Fri Mar 09, 2018 7:35 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
Unfortunately that tool is commercial, and pricy one. I do not think that would be approved by the company. |
|
Back to top |
|
 |
PaulClarke |
Posted: Fri Mar 09, 2018 10:23 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Hi,
Sorry, I should have made it more obvious that I was talking about our own product there with <Vendor> tags or something.
That is probably the first time I have heard MQSCX being referred to as 'pricey' though. An individual yearly MQSCX licence is NZ$ 100 (or about USD 73). That is about 20 cents a day! If you have many users then the licence cost per user can be significantly less.
So the question one should ask is "how much time would MQSCX need to save me in my daily work day to pay for itself'. At 20 cents a day I suspect it is not very much time at all - unless you are really, really under paid The average US Salary is $44,564 a year or $21.42 an hour. So, to pay for itself MQSCX would need to save you only 34 seconds a day. And that is average salary - I suspect most MQ Administrators are paid considerably more than average salary.
I agree that getting management to sign off on any tools purchase can be a challenge. They never seem to quite grasp the concept of visible versus invisible cost. However, I don't agree with you that MQSCX is expensive and I think it is fairly easy to make a case that it would actually save your company money. This is true, of course, of many products, not just MQSCX.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
sudaltsov |
Posted: Mon Mar 12, 2018 1:56 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
I see your point and I agree that your tool is a good value for money (providing it actually delivers what is said on the website). But you correctly mentioned that tools like these are difficult to get through the management. And yes I totally agree that runmqsc is a usability disaster which is crying for replacement with something usable. Anyway, I will make an effort to get your tool into our company, but I am not holding my breath...
Anyway, my question still remains unanswered within runmqsc-bound sphere of solutions... |
|
Back to top |
|
 |
crashdog |
Posted: Mon Mar 12, 2018 2:50 am Post subject: |
|
|
 Voyager
Joined: 02 Apr 2017 Posts: 77
|
|
Back to top |
|
 |
sudaltsov |
Posted: Mon Mar 12, 2018 5:34 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
Yes, I would expect code 10 when there are errors. And with local QM runmqsc gives exactly that. But not in the client mode... |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Mar 12, 2018 7:41 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Are you running runmqsc in the same shell? On a platform with both qmgr (server) and MQ Client?
Post the env settings for MQSERVER, MQCHLLIB and MQCHLTAB when you runmqsc with -c switch. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
sudaltsov |
Posted: Mon Mar 12, 2018 7:54 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
Yes I am running on the same server, same shell, same QM.
MQCHLLIB and MQCHLTAB are not defined.
MQSERVER points to the some valid channel on that QM (sorry won't give the hostname here, do not want troubles).
I am sure MQSERVER is correct because valid mqsc commands are executed without problems.
The scenario is perfectly reproducible. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Mar 12, 2018 8:43 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Is there another qmgr with the same name in your network? One in PROD, another in TEST?
I just noticed the ‘different type’ error. Does the MQSERVER IP and PORT point to a different qmgr? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Last edited by bruce2359 on Mon Mar 12, 2018 9:10 am; edited 1 time in total |
|
Back to top |
|
 |
sudaltsov |
Posted: Mon Mar 12, 2018 8:47 am Post subject: |
|
|
Voyager
Joined: 02 May 2012 Posts: 82
|
I intentionally created 'bad' mqsc. Totally expected 'different type' error means I am trying to create local queue with the same name as the existing remote queue. I want that script to fail - so I am demonstrating that local runmqsc gives proper error code 10 while client-mode runmqsc returns (incorrectly) 0.
PS No, there is only one QM with that name. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 12, 2018 9:06 am Post subject: Re: runmqsc error handling |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sudaltsov wrote: |
It looks like a clear bug to me.  |
Then you need a PMR - no one in this forum will be able to fix it.
I do agree that it looks a lot like the client version is reporting that it's successfully passed the command to the target queue manager rather than the result of the command; this is in line with the InfoCenter entry on runmqsc if not the spirit of it. So a PMR is needed to either fix runmqsc or (as I perhaps cynically expect) the InfoCenter to be reworded......
I would also agree with @PaulClark that if you're trying to automate a lot of administration then you need a commercial product (possibly his - it does do what it says on the website and suggesting otherwise is a bit off). Obviously having such a product adopted requires some effort but if your management compares the Total Cost of Ownership of such a product with having you (or your successors) maintain a series of scripts then the numbers are usually clear.
(I have no connection to @PaulClark except he's a nice man who buys me drinks at MQTC, I receive no commission from his sales, other commercial products are available which may fit your requirements better and no liability, express or implied, is accepted for any consequences of any decision you may make)
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Mar 12, 2018 9:14 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
... and your mileage may vary. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 12, 2018 9:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
... and your mileage may vary. |
Quite so!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|