• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

使用jmx4perl和j4psh接管Jolokia

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

在ActiveMQ的API中,内置了Jolokia 。

可以使用jmx4perl来安装:

$ perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)

cpan[1]> install JMX::Jmx4Perl
...
...
jmx4perl
========

jmx4perl is a command line utility for accessing Jolokia agents
(www.jolokia.org). It can be used for script based exploration 
and easy inspection of the JMX space.

Install 'jmx4perl' ? (y/n) [y ]
....

其余的库可以自行安装

root@kali:~# j4psh http://192.168.197.25:8161/api/jolokia -user admin -password admin
[192.168.197.25:8161] : help
                  cd -- Enter a domain
             connect -- Connect to a server by its URL or symbolic name
               error -- Show last error (if any)
                help -- Print online help
             history -- Command History
                  ls -- List MBean Domains
                quit -- Quit
             servers -- Show all configured servers
[192.168.197.25:8161] : ls
JMImplementation:
    type=MBeanServerDelegate

jolokia:
    type=Config
    type=Discovery
    type=ServerHandler

io.fabric8.insight:
    type=LogQuery

java.nio:
    name=direct,type=BufferPool
    name=mapped,type=BufferPool

jmx4perl:
    type=Config

com.sun.management:
    type=DiagnosticCommand
    type=HotSpotDiagnostic

org.apache.activemq:
    brokerName=localhost,connector=clientConnectors,connectorName=amqp,type=Broker
    brokerName=localhost,connector=clientConnectors,connectorName=mqtt,type=Broker
    brokerName=localhost,connector=clientConnectors,connectorName=openwire,type=Broker
    brokerName=localhost,connector=clientConnectors,connectorName=stomp,type=Broker
    brokerName=localhost,connector=clientConnectors,connectorName=ws,type=Broker
    brokerName=localhost,destinationName=121.42.182.208_1234,destinationType=Topic,type=Broker
    brokerName=localhost,destinationName=ActiveMQ.Advisory.MasterBroker,destinationType=Topic,type=Broker
    brokerName=localhost,destinationName=ActiveMQ.Advisory.Queue,destinationType=Topic,type=Broker
    brokerName=localhost,destinationName=ActiveMQ.Advisory.Topic,destinationType=Topic,type=Broker
    brokerName=localhost,destinationName=abc.def,destinationType=Queue,type=Broker
    brokerName=localhost,instanceName=KahaDBPersistenceAdapter[/data/apache-activemq-5.15.2/data/kahadb_Index_/data/apache-activemq-5.15.2/data/kahadb],service=PersistenceAdapter,type=Broker
    brokerName=localhost,service=Health,type=Broker
    brokerName=localhost,service=Log4JConfiguration,type=Broker
    brokerName=localhost,type=Broker

java.lang:
    name=Code Cache,type=MemoryPool
    name=CodeCacheManager,type=MemoryManager
    name=Copy,type=GarbageCollector
    name=Eden Space,type=MemoryPool
    name=MarkSweepCompact,type=GarbageCollector
    name=Metaspace Manager,type=MemoryManager
    name=Metaspace,type=MemoryPool
    name=Survivor Space,type=MemoryPool
    name=Tenured Gen,type=MemoryPool
    type=ClassLoading
    type=Compilation
    type=Memory
    type=OperatingSystem
    type=Runtime
    type=Threading

java.util.logging:
    type=Logging

[192.168.197.25:8161] : cd java.lang
[192.168.197.25:8161 java.lang] : ls
java.lang:
    name=Code Cache,type=MemoryPool
    name=CodeCacheManager,type=MemoryManager
    name=Copy,type=GarbageCollector
    name=Eden Space,type=MemoryPool
    name=MarkSweepCompact,type=GarbageCollector
    name=Metaspace Manager,type=MemoryManager
    name=Metaspace,type=MemoryPool
    name=Survivor Space,type=MemoryPool
    name=Tenured Gen,type=MemoryPool
    type=ClassLoading
    type=Compilation
    type=Memory
    type=OperatingSystem
    type=Runtime
    type=Threading

[192.168.197.25:8161 java.lang] : cd type=ClassLoading
[192.168.197.25:8161 java.lang:type=ClassLoading] : ls
java.lang:type=ClassLoading

Attributes:
  TotalLoadedClassCount           long               TotalLoadedClassCount
  LoadedClassCount                int                LoadedClassCount
  ObjectName                      ObjectName         ObjectName
  UnloadedClassCount              long               UnloadedClassCount
  Verbose                         boolean            Verbose

[192.168.197.25:8161 java.lang:type=ClassLoading] : cat ObjectName
    {
      objectName => 'java.lang:type=ClassLoading'
    }
[192.168.197.25:8161 java.lang:type=ClassLoading] : 

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
perl的map函数发布时间:2022-07-22
下一篇:
CentOS7下sendEmail发邮件失败,提示invalidSSL_versionspecifiedat/usr/share/perl5/ ...发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap