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 » How to monitor QMgr by application?

Post new topic  Reply to topic Goto page 1, 2  Next
 How to monitor QMgr by application? « View previous topic :: View next topic » 
Author Message
mqquester
PostPosted: Tue Jan 06, 2004 9:17 am    Post subject: How to monitor QMgr by application? Reply with quote

Apprentice

Joined: 27 Nov 2003
Posts: 35

Hi buddy,

Do you know how to program a small application to monitor QMgr? How could I know currently the QMgr is running or not? any library provided?

Thanks in advance
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jan 06, 2004 9:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

what version of MQ, which platform? Just running or not, to report?

Michael
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mqquester
PostPosted: Tue Jan 06, 2004 9:32 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2003
Posts: 35

MQ5.2 on UNIX & windows.
I hope if QMgr is not running or any error, an e-mail can inform me.
Back to top
View user's profile Send private message
Prahasith
PostPosted: Tue Jan 06, 2004 9:46 am    Post subject: Reply with quote

Disciple

Joined: 16 May 2003
Posts: 184
Location: Kansas City

you can write a shell script or perl script that checks for
queue manager agents amqzlaa0 and sends an e-mail if it doesn't exist. put the shell script in the cron jobs so that it checks periodically
Back to top
View user's profile Send private message Send e-mail
mqquester
PostPosted: Tue Jan 06, 2004 9:59 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2003
Posts: 35

Thanks Prahasith, I found amqzlaa0.exe file. But where can I find description of this file? What does this file do?
For Windows, what can I do?
Back to top
View user's profile Send private message
Prahasith
PostPosted: Tue Jan 06, 2004 10:13 am    Post subject: Reply with quote

Disciple

Joined: 16 May 2003
Posts: 184
Location: Kansas City

AMQZLAA0 Queue manager agents perform the bulk of the work for applications that connect to the queue manager using MQCNO_STANDARD_BINDING
Back to top
View user's profile Send private message Send e-mail
mqquester
PostPosted: Tue Jan 06, 2004 10:23 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2003
Posts: 35

So it means if AMQZLAA0 does not exist which means there is some errors on QMgr. The application is just programmed for monitoring the existing of AMQZLAA0.exe file?
Back to top
View user's profile Send private message
Prahasith
PostPosted: Tue Jan 06, 2004 10:31 am    Post subject: Reply with quote

Disciple

Joined: 16 May 2003
Posts: 184
Location: Kansas City

hey sorry
you should check for amqzxma0 not AMQZLAA0
from this you can say whether queue manager is running or not

find_qmgrs_running {
my $my_tmp = " ";
#$email_txt = $email_txt . "find_qmgrs_running\n";
log_msg("find_qmgrs_running\n");
@list_amqzxma0 = `ps -ef|grep amqzxma0| grep -v grep `;
$ctr = 0;
foreach $s (@list_amqzxma0) {
if ($ctr == 0) {
log_msg(" Queue managers currently running:\n");
$email_txt = $email_txt . "\n Queue managers currently running:\n";
}

chomp($s);
@ps_list = split(/[\-][m]/, $s); # split on the -m string
$qmgr_name = @ps_list[1];
$qmgr_name =~ s/^\s+//;
$qmgr_name =~ s/\s+$//;
log_msg(" $qmgr_name\n");
$email_txt = $email_txt . " $qmgr_name\n";
$ctr++;
$qmgrs_running = "Y";
push(@running_qmgrs, $qmgr_name);
}

if ($ctr == 0) {
log_msg(" No queue managers running\n");
$email_txt = $email_txt . " No queue managers running\n";
$qmgrs_running = "N";
}
log_msg("\n");

return($qmgrs_running);
}
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Jan 06, 2004 10:46 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

You are above version 5.2 you can use dspmq instead.
Here is a thread that discusses on how you do that.
Monitoring MQ using dspmq
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Prahasith
PostPosted: Tue Jan 06, 2004 11:02 am    Post subject: Reply with quote

Disciple

Joined: 16 May 2003
Posts: 184
Location: Kansas City

with venny's solution you can probabaly right a batch script for windows too using dspmq
Back to top
View user's profile Send private message Send e-mail
mqquester
PostPosted: Tue Jan 06, 2004 11:40 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2003
Posts: 35

Great, thank you both.
Back to top
View user's profile Send private message
markt
PostPosted: Tue Jan 06, 2004 3:14 pm    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

Do NOT attempt to monitor MQ from looking at whether a named process is running. If the process does not exist, then the qmgr is not up; however you can determine nothing reliable from the existence of a process.
Back to top
View user's profile Send private message
kman
PostPosted: Tue Jan 06, 2004 7:30 pm    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2003
Posts: 309
Location: Kuala Lumpur, Malaysia

QM status is kept in the registry for Windows, and in the qmstatus.ini on Unix. You can write a program to look up for the registry values, or for qmstatus content.
For mq5.3 you can make use of dspmq command on both platform. I can't remember where does mq 5.2 on windows keep the status, I think it should be in the registry too.
I have to agree that looking up for the amq process is not enough to tell the status, except for whether it is running or not.
You can always write a simple program to connect to the QM, that way it'll return whether it is running, unavailable or not found. Or run a script against runmqsc command output.
Back to top
View user's profile Send private message Yahoo Messenger
bower5932
PostPosted: Wed Jan 07, 2004 8:11 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

On Windows, you can also:

amqmdain status QMGR
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
JasonE
PostPosted: Wed Jan 07, 2004 9:38 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

I wouldnt trust the qmstatus as a way of monitoring the health of a qmgr - If you kill -9'ed all the Unix processes making up MQ, who would update the qmstatus.ini to reflect that...!

Dspmq is a lot better, and I'm sure there are other ways of doing it too, as well as vendor products.

The real question you need to ask yourself is what you regard as a healthy qmgr! ie the qmgr may work fine but channel problems may make your application fail, or a deadlock in MQ stops anything from working but it appears up and running from dspmq etc. Sending a round trip dummy message, for example, may be one way of checking the way the application would work etc

I would identify your requirements for a working system and start there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » How to monitor QMgr by application?
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.