我想使用 WebSphere 7 中的 WSADMIN 命令来查询系统上队列的状态。
谁能帮我吗?
谢谢
对于任何感兴趣的人,这里是 jeff 答案的 jython 版本。
qpoint = 'WebSphere:*,type=SIBQueuePoint'
queues = AdminControl.queryNames(qpoint).split()
for q in queues:
identifier = AdminControl.getAttribute(q, 'identifier')
size = AdminControl.getAttribute(q, 'depth')
print identifier + ' size: ' + size + ' messages'
print AdminControl.getAttributes(q)
因此,为了找出队列深度,我编写了这个 JACK 脚本......
set qpoint "WebSphere:*,type=SIBQueuePoint"
set queues [$AdminControl queryNames $qpoint]
foreach q $queues {
set identifier [$AdminControl getAttribute $q identifier]
set size [$AdminControl getAttribute $q depth]
puts "$identifier size: $size messages"
puts [$AdminControl getAttributes $q]
把它塞进盒子上的一个文件中,jeff.jacl 并调用命令......
/opt/IBM/WebSphere/AppServer/bin # ./wsadmin.sh -profile jp.cmd.jacl
你得到了什么?好吧,你会得到一整袋很棒的东西!
WASX7209I: Connected to process "server1" on node WRSNode using SOAP connector; The type of process is: UnManagedProcess
CHANGE_REQUEST size: 15 messages
{depth 15} {state ACTIVE} {id CFAC834BE6AF5D9A30451D01_QUEUE_51} {identifier CHANGE_REQUEST} {highMessageThreshold 50000} {sendAllowed true}
ETL_DEAD size: 378 messages
接下来的工作是看看我是否可以直接使用 JACL 使用的所有 java 代码。
为了使用 WebSphere PMI 检索 SIB 队列的深度,您需要选择以下两个计数器:
AvailableMessageCount 和 UnavailableMessageCount
方法如下: 从 WebSphere Application Server 管理控制台,转到托管消息传递引擎的应用程序服务器的性能监控基础架构 (PMI) 面板:
应用程序服务器 > your_app_server_name > 性能监控基础架构 (PMI)
默认情况下,您将位于“配置”选项卡上。如果您希望在不重新启动应用程序服务器的情况下启动此监控,您可以选择切换到运行时选项卡。
进入 PMI 面板后,单击链接“自定义”,即最后一个单选按钮的标签。这将带您进入自定义监控级别面板。从左侧导航树中,选择: - SIB Service - SIB Messaging Engines - *- Destinations- Queues 选择两个计数器:AvailableMessageCount 和 UnavailableMessageCount,然后单击位于顶部的 Enable 按钮。此时应保存您的设置。