|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Detecting Queue Manager state |
« View previous topic :: View next topic » |
Author |
Message
|
Getson |
Posted: Mon Dec 09, 2002 8:51 am Post subject: Detecting Queue Manager state |
|
|
Newbie
Joined: 17 Jul 2001 Posts: 9 Location: Toronto, Canada
|
I am building specifications for a new production installation of MQSeries and I am trying to determine an effective method for monitoring the health of the queue manager. This will likely be running within an active HACMP environment and so the results of this status report will be used to trigger HACMP roll-over. Do you have any thoughts as too what the "best" method would be to checking the status of a Queue Manager? I can think of three ways to do this but I am not sure of the relative merits of the three. All options are run from an AIX shell:
1)
echo "ping qmgr" | runmqsc myqmgr
ping succeeds or fails. However it seems to fail if QM is starting, and will hang for about 20 seconds if awaiting a response when a QM ends (endmqm -i)
2)
ps -fu mqm|grep "amqzxma0 -m myqmgr"|grep -v grep|awk '{print $2}' -`
returns a PID if queue manager is running, nothing if not. however this doesn't impart any knowledge of the health of the particular process...(i.e. perhaps it is hung and still running, starting/stopping and thus not processing messages)
3)
dspmq myqmgr
displays status of the qmgr. Reports starting, running, ending, ended (the later two including the type of stop). This is my preferred method as the command seems to be intended for just this purpose. Any gotcha's on this that I am missing?
I am avoiding an obvious fourth option (MQ event messages) as receiving those depends on the queue manager being available, and involves more complicated programming then I am willing to get into at this time. |
|
Back to top |
|
 |
jsware |
Posted: Mon Dec 09, 2002 10:53 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
I use a combination of all those you have suggested.
First use dspmq to determine if the queue manager is starting/stopping.
If it's started, then check to see that all the processes are running (there are several of them - see the Admin guide for a list).
You can also check for listener, command server etc.
Finally do a "ping qmgr" to determine that the queue manager is responsive.
You might like to check out the HACMP supportpac (MC63) on IBM's website. You'll find it at the following location: http://www-3.ibm.com/software/ts/mqseries/txppacs/mc63.html |
|
Back to top |
|
 |
Getson |
Posted: Mon Dec 09, 2002 1:07 pm Post subject: |
|
|
Newbie
Joined: 17 Jul 2001 Posts: 9 Location: Toronto, Canada
|
Thanks,
Can you explain your reasoning for doing all of the above? (What do you gain from a given check not achieved with another one?) If possible I would prefer to use fewer checks, but it is important that I;
catch all true failures
have few or no false failure detections
do all checks efficiently.
Thanks for your help. |
|
Back to top |
|
 |
nimconsult |
Posted: Mon Dec 09, 2002 11:38 pm Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
Some comments:
Be carefull that none of these methods is able to make the difference between a programmed stop of the queue manager and a real failure.
About your third method: if the queue manager is stopped abruptly, for example by killing the processes, the queue manager status will still appear as running.
If I had to build something myself, I would use method 3 first, then if the queue manager is declared as running use method 1.
I would also recommend reading the support pac MC63. That's what I have used in HACMP solutions.
Nicolas _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
jsware |
Posted: Tue Dec 10, 2002 12:14 pm Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
My reason for checking using dspmq first allows me to determine that a queue manager has been intentionally ended (stopping, stopped [whatever]) Also doing dspmq without arguments and parsing it with perl/awk/somesuch allows me to get a list of queue managers on the box so I check each one in turn.
If I think it should be running then I check all the expected processes are present. I have seen situation before where not all processes are running, yet the queue manager appears to be running/responds to runmqsc commands but you can't use the MQ API.
If the processes have all been terminated and dspmq shows it running then this is an error state in my view. My stop scripts first try an immediate shutdown (endmqm -i) and then a pre-emptive shutdown (endmqm -p) and then kill off the remaining processes. If you follow this route (which is what HACMP supportpac does) then I have never seen a dspmq showing the queue manager running and no processes.
I finally do a "ping qmgr" because that is what the HACMP scripts do and it seems to "round things off for me". It's probably not essential if you've done all the other checks but it gives me that warm feeling... |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|