Type Name Latest commit message Commit time
Failed to load latest commit information.
lib avoid panic when result has only 0 or 1 line Oct 2, 2018 update README Nov 24, 2017
main.go ls | grep mackerel-plugin | xargs -L 1 perl tool/ Nov 25, 2016


JVM(jstat) custom metrics plugin for agent.


mackerel-plugin-jvm -javaname=<javaname> [-pidfile=</path/to/pidfile>] [-jstatpath=</path/to/jstat] [-jpspath=/path/to/jps] [-jinfopath=/path/to/jinfo] [-remote=<host:port>]


  • JVM 1.6 or higher

Example of mackerel-agent.conf

command = "/path/to/mackerel-plugin-jvm -javaname=NettyServer -jstatpath=/usr/bin/jstat -jpspath=/usr/bin/jps -jinfopath=/usr/bin/jinfo"

Monitoring remote JVM

This plugin can retrieve metrics from remote jstatd with rmi protocol by setting -remote option. In this case, following limitations are applied:

  • jps and jstat commands must be executable localy from this plugin
  • 'CMS Initiating Occupancy Fraction' metric cannot be retrieved remotely

About javaname

You can check javaname by jps command.

# jps
14203 NettyServer
14822 Jps

Please choose an arbitrary name as javaname when you use pidfile option. It is just used as a prefix of graph label.

User to execute this plugin

This plugin (as well as the jps command explained above) must be executed by the user who executes the target Java application process, while mackerel-agent usually runs under root privilege. Since the executing user may not be root, you are required to specify the user in mackerel-agent-conf as shown above.