[collectd] java plugin load issue

Bill Schwanitz bilsch at gmail.com
Wed Nov 7 20:10:13 CET 2012


On Nov 1, 2012, at 1:35 PM, martin <martin at uncommonsense-uk.com> wrote:

> # cat collectd5.d/genericjmx.conf 
> LoadPlugin java
> 
> <Plugin "java">
>   JVMARG "-Djava.class.path=/usr/share/collectd/java"
>   LoadPlugin "org.collectd.java.GenericJMX"

Try this: 
  JVMARG "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"

The memory_pool config looks right to me, it may just be failing to initialize the java and generic plugin?

Here is the full config I have been using for 2+ years now ( not full, just relevent part )

-- begin java.conf --
LoadPlugin java
<Plugin "java">
  # required JVM argument is the classpath
  # JVMArg "-Djava.class.path=/installpath/collectd/share/collectd/java"
  # Since version 4.8.4 (commit c983405) the API and GenericJMX plugin are
  # provided as .jar files.
  JVMARG "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
  LoadPlugin "org.collectd.java.GenericJMX"
  
  <Plugin "GenericJMX">
    # Memory usage by memory pool.
    <MBean "memory_pool">
      ObjectName "java.lang:type=MemoryPool,*"
      InstancePrefix "memory_pool-"
      InstanceFrom "name"
      <Value>
        Type "memory"
        #InstancePrefix ""
        #InstanceFrom ""
        Table true
        Attribute "Usage"
      </Value>
    </MBean>
    <Connection>
      InstancePrefix "foo-"
      ServiceURL "service:jmx:rmi:///jndi/rmi://<*snip*>/jmxrmi"
      Collect "memory_pool"
    </Connection>
  </Plugin>
</Plugin>
-- end java.conf --


More information about the collectd mailing list