Author |
Message
|
donbirno |
Posted: Sat Feb 09, 2019 6:07 am Post subject: Common MQ script for UNIX & Windows |
|
|
Novice
Joined: 01 Nov 2013 Posts: 13
|
I have developed some shell scripts to monitor and administrate MQ in UNIX.We are adding up some windows servers now.
I guess javascript works on both UNIX and Windows, how flexible is it to write the same logic in javascript or writing a batch or powersheel with the same logic is the best thing to do?
My idea is to have a common script for both the env which makes it easier for future enhancements.
Eg of my script are discover and reset sequence of all channels in a qmgr. List and clear local queue with messages etc.. |
|
Back to top |
|
 |
exerk |
Posted: Sat Feb 09, 2019 7:59 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Re-inventing the wheel?  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Feb 09, 2019 8:13 am Post subject: Re: Common MQ script for UNIX & Windows |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
donbirno wrote: |
Eg of my script are discover and reset sequence of all channels in a qmgr. List and clear local queue with messages etc.. |
This is, or should be, a very rare occurrence in normal operation. _________________ 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 |
|
 |
PaulClarke |
Posted: Sat Feb 09, 2019 1:33 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
If you are wanting to monitor your entire MQ real estate then I tend to agree with the previous comment "why re-invent the wheel". There are many good monitoring products out there which have already solved many of the problems you will encounter. The cost of ownership of these products need not necessarily be prohibitive, especially when you consider the alternative.
If you are just trying to build a few scripts that will make your day to day life easier then writing them yourself makes perfect sense. I suspect most (if not all) MQ Administrators have a few scripts that they use on a regular basis to help them achieve common tasks.
As for the language to do it in I suspect that you will end up with a few. It depends on whether you are wanting to issue control commands or just issue MQ commands. If you are wanting to issue MQ commands though then it might be worth taking a look at MQSCX
<vendor plug>
MQSCX is a simple scripting language which allows you to issue and process the responses from MQSCX commands. It also makes using interactive MQSC a lot faster. The script language it very simple and easy to understand and limited only by your imagination. Here's a quick example that shows how you can add up how many messages you have across all your queues in your queue manager.
Code: |
@total = 0
foreach(DISPLAY QLOCAL(*) WHERE(CURDEPTH GT 0))
@total = @total + CURDEPTH
endfor
print 'Total CURDEPTH =',@total
|
Anyway if you are interested in MQSCX send an email to support@mqgem.com and we'll send you a free no obligation trial licence. The price of the product is very reasonable, especially considering the amount of time it can save you. All our prices, for all our products, are clearly displayed on our web site.
</vendor plug>
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
mvic |
Posted: Fri Feb 15, 2019 12:39 pm Post subject: Re: Common MQ script for UNIX & Windows |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
donbirno wrote: |
I have developed some shell scripts to monitor and administrate MQ in UNIX.We are adding up some windows servers now. |
There are many opinions on what language etc. to use.
But I would choose Java for a project like this.
A JRE fileset/package is included with MQ, in fact, so you don't even need to struggle to obtain it. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Feb 17, 2019 3:03 pm Post subject: Re: Common MQ script for UNIX & Windows |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
mvic wrote: |
donbirno wrote: |
I have developed some shell scripts to monitor and administrate MQ in UNIX.We are adding up some windows servers now. |
There are many opinions on what language etc. to use.
But I would choose Java for a project like this.
A JRE fileset/package is included with MQ, in fact, so you don't even need to struggle to obtain it. |
We use Korn Shell on UNIX and PowerShell on Windows. We avoid Java because it creates a dependency, and a need to patch / upgrade Java when required (sometimes it is forced due to security vulnerability remediation), so one ends up with a multitude of different Java versions and implementations (eg. Oracle, IBM), and various issues with compatibility, deprecation etc. Korn Shell and PowerShell are essentially part of the OS and seems to be a more reliable footprint over the longer term (5 - 10 years). [Sorry, I'm not a fan of Java] _________________ Glenn |
|
Back to top |
|
 |
mvic |
Posted: Sun Feb 17, 2019 3:17 pm Post subject: Re: Common MQ script for UNIX & Windows |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
I initially thought the OP wanted to call MQ APIs, but re-reading, I was probably wrong about that.
If wanting to call MQ APIs, then shell is not good for that.
So anyway I will shift ground and say, shell is ok, but better to use Perl. |
|
Back to top |
|
 |
mvic |
Posted: Sun Feb 17, 2019 3:18 pm Post subject: Re: Common MQ script for UNIX & Windows |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Re. the point about needing to keep JREs updated.
Just use the one that comes with MQ, and regularly update your MQ. |
|
Back to top |
|
 |
|