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 » IBM MQ API Support » Need Sample

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 Need Sample « View previous topic :: View next topic » 
Author Message
klamerus
PostPosted: Tue Mar 01, 2005 5:09 pm    Post subject: For Sure Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

I have to agree with that. If these other items are available, why not this last (which seems pretty useful).

We are looking at the contact admin product, which looks pretty promising, either as a fill the gaps tool or permanently, but this does look like a deficit. If I can just find the code I'm looking of somewhere. Despite lots of alleged samples, I've yet to kick over the rock with this bug.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
RogerLacroix
PostPosted: Tue Mar 01, 2005 5:39 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

The direct link is: qstatus.c

Are you looking at MQ application monitoring or just plain MQ monitoring because maybe Mercury thinks queue stats is MQ app monitoring (and sell a different tool).

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
klamerus
PostPosted: Tue Mar 01, 2005 6:06 pm    Post subject: Don't know Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Don't know.

Mercury SiteScope is pretty good, but doesnt' cover getting queue statistics (at least not the # of messages pulled off a queue).
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
RogerLacroix
PostPosted: Tue Mar 01, 2005 6:13 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Do they have a call-able API or a command-line program to feed their collector (server component)?

I did this for a client to get queue stats into HP-Openview (just the high water mark levels).

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
klamerus
PostPosted: Tue Mar 01, 2005 6:22 pm    Post subject: Opposite Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Actually, what it has is the opposite. It has the ability to call your code (you have to create the right code), which must return the information to it that correlates with the parameters you're asking for. So, in a nutshell it is SiteScope that's extensible out, but not the other way around. It's the monitor, and it will call your adapters to things. That way you can code it to monitor anything.

I'm still not seeing in this sample how to get the # of messages that have been pulled off the queue though. Which of the attributes return gives me anything to work with on determing the # of messages that the have been retrieve (via GET) from the queue (since previous requests). I can understand I would need to keep some data from each pass of my loop, but I don't see what data to keep.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
clindsey
PostPosted: Tue Mar 01, 2005 6:36 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

You have to backup now at look at Roger's comments when he suggested looking at the qstatus.c sample

Quote:

Go get the qstatus sample program at IBM Developer web site and change the request from queue attributes to queue reset stats. et voila.


It gives you a template to work from. Now you have to look at the Programmable Commands and Format and Administration Interface documentation to see which commands and attributess may be substituted in to suite your needs.

Charlie
Back to top
View user's profile Send private message
klamerus
PostPosted: Wed Mar 02, 2005 2:44 am    Post subject: PCF Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Yeah, that's what I've been looking through, to no avail. I will attempt to figure this out further. Just not easy to find things in (or how to use them).
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Wed Mar 02, 2005 5:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you follow the sample code, but adjust it so that you specify a Reset Queue Statistics PCF Message, then you will be given a Reset Queue Statistics Response PCF Message.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
malammik
PostPosted: Wed Mar 02, 2005 8:16 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

public List getQueueStats() {
PCFAgent agent = null;
PCFParameter[] parameters = { new MQCFST(CMQC.MQCA_Q_NAME, QFlexUtil.STAR), };
List queueStatRecords = new ArrayList();
try {
agent = MqPcfUtil.getPCFAgent(qmanager);
if(agent == null){
logger.info("PCFAgent failed to connect Queue Manager :" + qmanager.getQmanager_nm());
return queueStatRecords;
}
logger.info("PCFAgent Connected Queue Manager :" + qmanager.getQmanager_nm());

// Use the agent to send the request.
MQMessage[] responses = agent.send(CMQCFC.MQCMD_RESET_Q_STATS, parameters);
List responseParameters = MqPcfUtil.getMessagesParameterMap(responses);

for (int i = 0; i < responseParameters.size(); i++) {
Map pcfParams = (Map)responseParameters.get(i);

String queueName = (String) pcfParams.get(new Integer(CMQC.MQCA_Q_NAME));
if(StringUtils.isNotEmpty(queueName))queueName = queueName.trim();
Integer enqCount = (Integer) pcfParams.get(new Integer(CMQC.MQIA_MSG_ENQ_COUNT));
Integer deqCount = (Integer) pcfParams.get(new Integer(CMQC.MQIA_MSG_DEQ_COUNT));
Integer highDepth = (Integer) pcfParams.get(new Integer(CMQC.MQIA_HIGH_Q_DEPTH));
Integer timeSinceLastReset = (Integer) pcfParams.get(new Integer(CMQC.MQIA_TIME_SINCE_RESET));

// Create and populate queue stat object.
QueueStat queueStatRecord = (QueueStat) DormUtil.getExampler(DataConstants.QUEUE_STATS);
queueStatRecord.setQueue_nm(queueName); // 48 bytes length
queueStatRecord.setMsg_in(enqCount);
queueStatRecord.setMsg_out(deqCount);
queueStatRecord.setHigh_depth(highDepth);
queueStatRecord.setTime_since_reset(new Long(timeSinceLastReset.longValue()));

// Some records have to be filtered.
if (isNotFilteredObject(QUEUE_STATS_FILTERS, queueName)){
queueStatRecords.add(queueStatRecord);
}
//else {
//logger.info("PCF Util: QUEUE (" + queueName + ") was filtered out.");
//}
}
}
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
klamerus
PostPosted: Wed Mar 02, 2005 4:35 pm    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Wow. Thanks.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
klamerus
PostPosted: Wed Mar 02, 2005 6:11 pm    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Okay, so I get it. For some reason, from the previous comments it sounded as if I needed to keep track of the count of messages on the queue since the last stats request.

What this is showing me is that with each reset, I'm returned the number of enqueues and dequeues and the time since the last reset. So, all I need to do is divide the dequeues by the time and I'm looking at the rate at which my programs are pulling messages off the queue.

The only potential downside is that I've just reset these counters, but I can't see any downside to that. Does anyone else?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
klamerus
PostPosted: Wed Mar 02, 2005 6:13 pm    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Will this work with remote queues?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
malammik
PostPosted: Wed Mar 02, 2005 8:22 pm    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

no. remote queues dont have depth. If any of the mq built in events against that queue such as for example queue depth high take place between ur explicit resets, the event will cause stats to reset so what you will get the stats not from your reset but from the last time that event occured. To avoid that you can disable all events against the queues you are doing resets for.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
klamerus
PostPosted: Thu Mar 03, 2005 3:07 am    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Hmmm. I don't think we have any events set up. Is there a quick way to check? Some comand statement or such.

Also, if we turn these off, would this work against remote queues?

The idea here would be to create the program that we're going to use to check for "flow" through our queues (the dequeues) on one of the servers in our MQ cluster and want it to send us e-mail in the situation that a queue has depth, and yet nothing has been dequeued for 5 minutes. That would indicate that the program processing items from the queue has "died".
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
malammik
PostPosted: Thu Mar 03, 2005 6:20 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

Remote queues do not have depth and therefore you can never run reset queue stats against a remote queue.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » IBM MQ API Support » Need Sample
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.