Author |
Message
|
John89011 |
Posted: Wed Apr 15, 2009 7:48 am Post subject: shell script to check QMGR status |
|
|
Voyager
Joined: 15 Apr 2009 Posts: 94
|
Is there a way to create a shell script that will check the status of QMGRs without calling the MQSC commands?
I was thinking of writing a script that will check the QMGR status, alert if it's down and possibly attempt to restart without any fancy toos. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Apr 15, 2009 7:53 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
The dspmq command will show the status of the QMs on the server. |
|
Back to top |
|
 |
John89011 |
Posted: Wed Apr 15, 2009 7:54 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2009 Posts: 94
|
Yes, but is there a way to check the status without using that command?
Btw, thanks for the quick reply! |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 15, 2009 7:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What counts as "status" by your rules?
Why is it important in any useful way to NOT use "mq" commands to check "mq"?
Why are you dead set that you should write something yourself? What requirements are you under that prevent you from using either a supportPac or a professional tool? |
|
Back to top |
|
 |
John89011 |
Posted: Wed Apr 15, 2009 8:09 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2009 Posts: 94
|
Status as in runing, ended unexpectedly, ended normally etc...
I can write a script that will call the dspmq command but what happens when MQ hangs? In the past I would run dspmq (this in Unix) and it would just hang thus not providing status on any of the QMGRs so was wondering if there is a way around it? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Apr 15, 2009 9:01 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
The only way to be sure MQ is fully up is to use MQ.
Use the PING command in runmqsc. Use the amqscnxc sample program to connect to the QM. Use the amqsputc command to put some messages, then amqsgetc to get them. If that works, MQ is probably OK.
I wrote a script for my shop that does for every QM, and then sends messages to every QM from every QM that has connectivity, to prove the channels work. Was it a lot of work? Sure. But now with one script I can excercise every QM and every channel and now that they are wrong when they say "the MQ is not on". The script is very useful after MQ upgrades - gives me a good sense that things are OK.
This is above and beyond all the QPASA monitoring we have that watches MQ its own way. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Apr 15, 2009 6:06 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
John89011 wrote: |
Status as in runing, ended unexpectedly, ended normally etc...
I can write a script that will call the dspmq command but what happens when MQ hangs? In the past I would run dspmq (this in Unix) and it would just hang thus not providing status on any of the QMGRs so was wondering if there is a way around it? |
I have never experienced 'dspmq' hanging. If it does, you have big problems with MQ. I would have no hesitation in relying on that command in a MQ health check script. _________________ Glenn |
|
Back to top |
|
 |
John89011 |
Posted: Wed Apr 15, 2009 6:09 pm Post subject: |
|
|
Voyager
Joined: 15 Apr 2009 Posts: 94
|
yea well... one of our developers ran DBX in UAT and hosed up MQ |
|
Back to top |
|
 |
dgolding |
Posted: Fri Apr 17, 2009 1:40 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
dbx - as in the interactive debugger, perhaps on a live process? Yes, I could imagine it could do that, especially with root privilege.
Other good ways to hose up MQ - random killing of processes, delete IPC resources from under the queue manager, deleting files - I could go on.
But what has that got to do with "dspmq"? |
|
Back to top |
|
 |
|