JBoss Twiddle

本文介绍了如何利用JBoss提供的Twiddle工具与远程JMX服务器进行交互,包括获取服务器信息、查询MBeans、获取属性、查询MBeanInfo等基本操作。通过示例代码展示了如何访问和查询服务器上的MBeans。
摘要由CSDN通过智能技术生成

JBoss provides a simple command line tool that allows for interaction with a remote JMX server instance. This tool is called twiddle (for twiddling bits via JMX) and is located in the bin directory of the distribution. Twiddle is a command execution tool, not a general command shell.

D:\jboss4.3.0.GA\bin 

To access basic information about a server, use the serverinfo command.
[bin]$ ./twiddle.sh -H serverinfo

To query the server for the name of MBeans matching a pattern, use the query command.
[bin]$ ./twiddle.sh -H query

To get the attributes of an MBean, use the get command
[bin]$ ./twiddle.sh -H get

To query the MBeanInfo for an MBean, use the info command:
[bin]$ ./twiddle.sh -H info


My Test :
D:\jboss4.3.0.GA\bin>twiddle -H serverinfo

D:\jboss4.3.0.GA\bin>twiddle --server=localhost -u admin -p admin serverinfo --count
1122
D:\jboss4.3.0.GA\bin>twiddle --server=localhost -u admin -p admin serverinfo --domain
jboss
D:\jboss4.3.0.GA\bin>twiddle --server=localhost -u admin -p admin serverinfo --list


D:\jboss4.3.0.GA\bin>twiddle -s localhost -u admin -p admin get "jboss.system:type=Server" Started
Started=true

D:\jboss4.3.0.GA\bin>twiddle -s localhost -u admin -p admin invoke jboss:service=JNDIView list true

 

D:\jboss4.3.0.GA\bin>twiddle -s localhost -u admin -p admin get "jboss.system:type=ServerInfo" MaxMemory
MaxMemory=799145984
D:\jboss4.3.0.GA\bin>twiddle -s localhost -u admin -p admin query "jboss.system:type=ServerInfo"
jboss.system:type=ServerInfo
D:\jboss4.3.0.GA\bin>twiddle -s localhost -u admin -p admin query "jboss.system:*"
jboss.system:service=MainDeployer
jboss.system:type=Log4jService,service=Logging
jboss.system:service=ServiceDeployer
jboss.system:service=ThreadPool
jboss.system:service=JARDeployer
jboss.system:type=Server
jboss.system:service=ServiceController
jboss.system:type=ServerConfig
jboss.system:type=ServerInfo

see:
D:\jboss4.3.0.GA\server\mycis\deploy\snmp-adaptor.sar\attributes.xml
<mbean name="jboss.system:type=ServerInfo" oid-prefix=".1.2.3.4.1">
      <attribute name="ActiveThreadCount" oid=".1"/>
      <attribute name="FreeMemory" oid=".2"/>
      <attribute name="MaxMemory" oid=".3"/>
   </mbean>


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值