Giter Site home page Giter Site logo

jmx-tools's Introduction

Tomcat JMX attributes logging tool

A small utility which dumps Tomcat JMX attributes in CSV format.

Prerequisite

It is required to enable JMX proxy servlet of the target Tomcat instance. This can be done by the following steps:

(A) Add the following Java System variables to enable JMX features

  -Dcom.sun.management.jmxremote
  -Dcom.sun.management.jmxremote.local.only=false
  -Dcom.sun.management.jmxremote.authenticate=false
  -Dcom.sun.management.jmxremote.port=$JMX_PORT
  -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT
  -Djava.rmi.server.hostname=127.0.0.1
  -Dcom.sun.management.jmxremote.ssl=false

(B) Add JMX roles in the tomcat-users.xml

<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="admin-gui"/>
  <role rolename="admin-script"/>
  <user
    username="tomcat"
    password="tomcat"
    roles="
      manager-gui,
      manager-script,
      manager-jmx,
      manager-status,
      admin-gui,
      admin-script"
  />
</tomcat-users>

Build

Built binary will be installed under GOPATH

$ ./script/build.sh

$ which jmx-logger
/Users/iwauo/go/1.13.6/bin/jmx-logger

Usage

Sample configuration

endpoint: http://localhost:8080/manager/jmxproxy

credential:
  user: tomcat
  pass: tomcat

output:
  interval: 5
  rows: 5
  useCRLF: true

columns:
- name: maxThreads
  type: Catalina:type=ThreadPool,name="http-apr-8080"
  attribute: maxThreads

- name: activeSessions
  type: Catalina:type=Manager,context=/,host=localhost
  attribute: activeSessions

Run

JMX attributes are emitted to the standard output by default.

$ jmx-logger -f jmxclient/config.yml

maxThreads,activeSessions
200,0
200,0
200,1
200,1
200,1

jmx-tools's People

Contributors

iwauo avatar acn-tajima-iwauo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.