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 Discussion » shell script to check QMGR status

Post new topic  Reply to topic
 shell script to check QMGR status « View previous topic :: View next topic » 
Author Message
John89011
PostPosted: Wed Apr 15, 2009 7:48 am    Post subject: shell script to check QMGR status Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Wed Apr 15, 2009 7:53 am    Post subject: Reply with quote

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
View user's profile Send private message
John89011
PostPosted: Wed Apr 15, 2009 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Apr 15, 2009 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
John89011
PostPosted: Wed Apr 15, 2009 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Wed Apr 15, 2009 9:01 am    Post subject: Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Wed Apr 15, 2009 6:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
John89011
PostPosted: Wed Apr 15, 2009 6:09 pm    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2009
Posts: 94

yea well... one of our developers ran DBX in UAT and hosed up MQ
Back to top
View user's profile Send private message
dgolding
PostPosted: Fri Apr 17, 2009 1:40 am    Post subject: Reply with quote

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
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 Discussion » shell script to check QMGR status
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.