如何枚举 IBM WebSphere MQ 的队列管理器的本地队列?
我正在尝试编写一个简单的工具来监视队列管理器的状态。我想监视的事情之一是每个队列的当前队列深度。不过,我还没有找到一种方法来以编程方式枚举特定队列管理器上的所有队列。是否有任何 MQ API 提供此功能?我更喜欢用 C 来做到这一点,但如果只能用另一种语言的绑定来实现,我至少想知道这一点。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Capitalware 上的几个 C 示例。寻找使用 MQAI 接口的。除了 MQAI 程序之外,没有任何内容可以枚举队列,但它们都使用可编程命令格式 (PCF) 消息。枚举队列列表相当于 DIS Q(*) 的 PCF。
您还需要查看 信息中心
尝试将此添加为注释,但链接未按预期标记:
如果您远程执行此操作,您最终会以某种方式到达 PCF 命令。如果安装 WMQ 客户端 并使用 SupportPac MO72 将它们转换为 PCF(如果您愿意),但在 QMgr 中它最终是 PCF。我使用迭代 QMgrs 列表并执行 MO72 的脚本对 WMQ 进行大量集中查询和报告。我曾经使用CGI并通过MO72编写了一个Web前端。
顺便说一下, SupportPac MO71 将执行您所描述的监控类型。它是用 C 语言编译的,因此需要安装 WMQ 客户端,但可以将其设置为监视队列深度,甚至还有一个迷你 Web 服务器,以便许多人可以使用相同的 MO71 实例。
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(*).
You will also want to review the PCF manual in the Infocenter
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.
您应该考虑使用 GH Tester,它是 Green Hat 开发的中间件测试自动化工具:
http://www.greenhat.com
You should look at using GH Tester, its a middleware test automation tool developped by Green Hat:
http://www.greenhat.com