Coder Social home page Coder Social logo

graylog-plugin-input-jmx's Introduction

Graylog JMX Input Plugin

Graylog input plugin to monitor JMX end points with built-in support for JVM and Tomcat endpoints

Features

  • No agent required in the machines to be monitored
  • Support for Authentication
  • Support for SSL
  • Built-in support for monitoring JVM and Tomcat servers (more to come)
  • Monitor multiple servers from single input plugin instance
  • Support for monitoring custom JMX endpoints
  • Tested with Graylog 2.0.0

Setup

Download the plugin jar and copy to graylog plugin directory (restart the graylog server for the changes to take effect). From Graylog UI, launch System->Input and select "JMX" input type

Following parameters can be configured

  • Servers to monitor - Comma separated value of list of server IP Address or names to be monitored e.g. (10.220.5.123,webserver )
  • Port - Port on which the JMX endpoint is listening ( firewall should be configured for bidirectional access to this port)
  • JMX Object type - List of built-in JMX Object Types available. Select 'Custom' for monitoring custom endpoints. In this case the json config file path has to be specified in 'Config File Path' parameter
  • Username - Username configured in JMX access file (applicable when JMX authentication is enabled)
  • Password - Password configured in JMX password file (applicable when JMX authentication is enabled)
  • Polling Interval - Interval to poll JMX endpoints (recommend to set the interval > 30 secs)
  • Polling Interval time unit - Polling interval time unit

To enable JMX monitoring in your Java application you need to pass certain command options to the application. e.g. To enable bare minimum JMX monitoring without security:

java \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=12345 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-jar /usr/share/doc/openjdk-6-jre-headless/demo/jfc/Notepad/Notepad.jar

For more info on authentication and options refer http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html

Custom Configuration

To monitor custom JMX object types ( and to extend existing JMX type), a custom config file can be writtern and specified while launching the plugin. Example config file

{
  "type": "jvm", /* Type of the endpoint */
  "queries": [
    {
      "object": "java.lang:type=Memory", /* JMX ObjectName */
      "attributes": [
        {
          "name": "HeapMemoryUsage", /* JMX MBean Attribute Name */
          "key": "used", /* JMX Attribute Key if applicable */
          "label": "jvm.mem.heap.used" /* Maps to a field in the graylog message. Allowed characters are A-Z,a-z,0-9,.,_ */ 
        }
      ]
    },
    {
      "object": "java.lang:type=GarbageCollector,name=*",
      "attributes": [
        {
          "name": "CollectionCount",
          "label": "jvm.gc.{name}.count" /* Support for dynamic field names based on object name property values */
        }
      ]
    }
  ]
}

This plugin uses the JMX Query code from JMXTrans project

Enabling SSL

java -Dcom.sun.management.jmxremote.port=1234
    -Djavax.net.ssl.keyStore=/home/user/Documents/keystore.jks
    -Djavax.net.ssl.keyStorePassword=keystorepass
    -Djavax.net.ssl.trustStore=/home/user/Documents/truststore.ts
    -Djavax.net.ssl.trustStorePassword=truststorepass
    -Dcom.sun.management.jmxremote.registry.ssl=true
    -Dcom.sun.management.jmxremote.authenticate=false
    MainClass

Screenshots

Configuration Window

Configuration Window

JVM Dashboard

JVM Dashboard

graylog-plugin-input-jmx's People

Contributors

sivasamyk 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.