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 Index » General IBM MQ Support » script before qmgr start

Post new topic  Reply to topic
 script before qmgr start « View previous topic :: View next topic » 
Author Message
paustin_ours
PostPosted: Wed Oct 30, 2019 11:10 am    Post subject: script before qmgr start Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

Is there a way to call a script before a queue manager starts?

would like to implement multi instance queue managers but need to have a script run on a server the qmgr switches over to and before the queue manager starts. Similarly if it fails on the running server, before switching i would like a dscript run on the current server before switching and also on the new server before qmgr starts up. Is this possible?
Back to top
View user's profile Send private message Yahoo Messenger
bruce2359
PostPosted: Wed Oct 30, 2019 11:26 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9442
Location: US: west coast, almost. Otherwise, enroute.

Yes, you can issue 'strmqm' command from a script.
_________________
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
View user's profile Send private message
PeterPotkay
PostPosted: Wed Oct 30, 2019 4:50 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Internal MQ processes are deciding when to switch a multi instance QM from one node to another when there is an unplanned reason to fail over. The unplanned failover occurs without anyone calling strmqm. I don't know how you would guarantee your script ran before this automated outside-of-your-control failover occurred.

What does your script do?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Thu Oct 31, 2019 1:18 am    Post subject: Re: script before qmgr start Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

paustin_ours wrote:
Is there a way to call a script before a queue manager starts?

would like to implement multi instance queue managers but need to have a script run on a server the qmgr switches over to and before the queue manager starts. Similarly if it fails on the running server, before switching i would like a dscript run on the current server before switching and also on the new server before qmgr starts up. Is this possible?


This normally is called HA (e. g. PowerHA for AIX).
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Thu Oct 31, 2019 8:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20729
Location: LI,NY

Have you looked at running it as a queue manager service, starting at queue manager start and setting a different script for qmgr shutdown / service shutdown...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
HubertKleinmanns
PostPosted: Thu Oct 31, 2019 11:45 pm    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

First question: Which platform ?

Second question: What shall your script do (Peter asked this already)?

MQ controls the take-over of a multi-instance QMgr by checking some file locks - no script is involved. As soon as the standby-instance recognizes an unlocking of this file, it starts the QMgr. No chance to put a script into the flow.

But may be you could create a MQ service object of type COMMAND, which runs your script, like this:
Code:
DEFINE SERVICE('<your_name>') SERVTYPE(COMMAND) +
   CONTROL(STARTONLY) STARTCMD('<your_script>') +
   STARTARG('<script_args>') STDOUT('...') STDERR('...')


This script wouldn't run before the QMgr starts, but immediately after the QMgr came up.

If you have to check some things, before the QMgr is started, you cannot use multi-instance QMgrs. In this case you have to use HA (or some own scripts around, which nearly do the same).
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » script before qmgr start
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.