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 IndexGeneral IBM MQ SupportCommon MQ script for UNIX & Windows

Post new topicReply to topic
Common MQ script for UNIX & Windows View previous topic :: View next topic
Author Message
donbirno
PostPosted: Sat Feb 09, 2019 6:07 am Post subject: Common MQ script for UNIX & Windows Reply with quote

Novice

Joined: 01 Nov 2013
Posts: 12

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
View user's profile Send private message
exerk
PostPosted: Sat Feb 09, 2019 7:59 am Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 5993

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
View user's profile Send private message
bruce2359
PostPosted: Sat Feb 09, 2019 8:13 am Post subject: Re: Common MQ script for UNIX & Windows Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8328
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.
_________________
There are two types of people in this world:
1) Those that can extrapolate from incomplete data
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Sat Feb 09, 2019 1:33 pm Post subject: Reply with quote

Guardian

Joined: 17 Nov 2005
Posts: 914
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
View user's profile Send private message Visit poster's website
mvic
PostPosted: Fri Feb 15, 2019 12:39 pm Post subject: Re: Common MQ script for UNIX & Windows Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2076

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
View user's profile Send private message
gbaddeley
PostPosted: Sun Feb 17, 2019 3:03 pm Post subject: Re: Common MQ script for UNIX & Windows Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1925
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
View user's profile Send private message
mvic
PostPosted: Sun Feb 17, 2019 3:17 pm Post subject: Re: Common MQ script for UNIX & Windows Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2076

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
View user's profile Send private message
mvic
PostPosted: Sun Feb 17, 2019 3:18 pm Post subject: Re: Common MQ script for UNIX & Windows Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2076

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportCommon MQ script for UNIX & Windows
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.