LoginSignup
11
9

More than 5 years have passed since last update.

jolokiaを使うときはj4pshが便利問題

Last updated at Posted at 2015-02-25

なにがいいの

jolokiaでJMXのメトリクス取りたい
でも、何をどうやって取るんだ?さっくと知りたい
そんな時に使える、と思う

一旦使える所まで

$ 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
    }

はー便利

色ついてるしなんかオシャレ
スクリーンショット 2015-02-25 11.13.35.png

参考:http://www.jolokia.org/tutorial.html

おしまい

11
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
9