joolokia를 사용할 때 j4psh가 편리한 문제입니다.

5405 단어 cpanJavaJolokia

뭐가 좋을까


JMX의 도량을 Joolokia로 잡고 싶어요.
그런데 어떻게 무엇을 얻었을까?머지않아 알게 될 것이다
그럴 때 쓸 수 있을 것 같아요.

잠시 사용할 수 있는 곳으로 가다

$ sudo yum -y groupinstall 'Development tools' 
$ sudo yum -y install cpan libyaml-devel expat-devel libxml2-devel
$ sudo yum -y install gcc gcc-c++ glibc-devel.x86_64 
$ perl -MCPAN -e shell
cpan[1]> o conf prerequisites_policy follow
cpan[2]> o conf commit
cpan[3]> upgrade
cpan[4]> YAML
cpan[4]> 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 ]y
j4psh
=====

j4psh is an interactive JMX shell with context sensitive command line
completion. It uses JMX::Jmx4Perl for connecting to the JMX backend
and has quite some Perl module dependencies.

Install 'j4psh' ? (y/n) [y ]

# それ以外はいらんし全部noにした

사용

$ j4psh http://localhost:8778/jolokia/
[localhost:8778] : 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
[localhost:8778] : cd java.lang
[localhost:8778 java.lang] : ls
java.lang:
    name=Code Cache,type=MemoryPool
    name=CodeCacheManager,type=MemoryManager
    name=Compressed Class Space,type=MemoryPool
    name=Metaspace Manager,type=MemoryManager
    name=Metaspace,type=MemoryPool
    name=PS Eden Space,type=MemoryPool
    name=PS MarkSweep,type=GarbageCollector
    name=PS Old Gen,type=MemoryPool
    name=PS Scavenge,type=GarbageCollector
    name=PS Survivor Space,type=MemoryPool
    type=ClassLoading
    type=Compilation
    type=Memory
    type=OperatingSystem
    type=Runtime
    type=Threading

[localhost:8778 java.lang] : cd type=Memory
[localhost:8778 java.lang:type=Memory] : ls
[localhost:8778 java.lang:type=Memory] : cat NonHeapMemoryUsage
    {
      committed => 56852480,
      init => 2555904,
      max => -1,
      used => 55591880
    }

매우 편리하다
색깔이 예뻐요.

참조: http://www.jolokia.org/tutorial.html
끝맺다

좋은 웹페이지 즐겨찾기