views:

924

answers:

1

I'm trying to write a simple tool for monitoring the state of a Queue Manager. One of the things I'd like to monitor is the current queue depth of each queue. I haven't been able to find a way to programmatically enumerate all of the queues on a particular Queue Manager, though. Do any of the MQ APIs provide this functionality? I'd prefer to do this with C, but if it's only possible with another language's bindings, I'd at least like to know that.

+3  A: 

Several C samples at Capitalware. Look for the ones that use the MQAI interface. Nothing there that enumerates queues but the MQAI programs all use Programmable Command Format (PCF) messages. Enumerating the list of queues is a PCF equivalent of DIS Q(*).

http://www.capitalware.biz/mq_code_c.html

You will also want to review the PCF manual in the Infocenter.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzac.doc/pc10120_.htm

Tried to add this as a comment but the links didn't markup as expected:

One way or another you end up at PCF commands if you are doing this remotely. You can run MQSC script commands remotely if you install the WMQ client and use SupportPac MO72 to convert them to PCF if you want but at the QMgr it's ultimately PCF. I do a lot of central inquiry and reporting on WMQ with scripts that iterate over a list of QMgrs and execute MO72. I once used CGI and wrote a web front-end over MO72.

By the way, SupportPac MO71 will do the type of monitoring that you are describing. It's compiled C so it needs the WMQ client installed but it can be set up to monitor depth of queues and even has a mini web server so many people can use the same MO71 instance.

T.Rob
I eventually came to the conclusion that PCF was probably the way to go, but didn't follow up on this (as there was some hesitancy to allow PCF commands to be used, and later because I left the job where I was working on this). So while I didn't get a chance to verify this solution, it seems like it's probably the right one. Thanks.
Jean-Paul Calderone
I am pretty sure PCF is the only solution so far.
Dr. Xray