We use it with jdk7 openjdk6 or java6-oracle

If your java path is not in the path just export it with something like (do a "locate libjvm.so" to know the path)
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/java

In Ubuntu/Debian just paste this in /etc/default/collectd
On RHEL I put it in the init script, perhaps /etc/default/collectd or /etc/sysconfig/collectd can also accept it

Best regards



Le 08/11/2012 16:52, martin a écrit :
Hi Poil,

You were spot on I did this a few days ago and it showed that libjvm.so was not found i.e. broken.

The problem was that I was using the Oracle JDK instead of the OpenJDK installation.

What I've done is modify my existing tomcat installation to point to the Oracle JDK and install the Java 1.7 OpenJDK and let collectd use that.

Cheers

-Martin


---- On Wed, 07 Nov 2012 19:26:56 +0000 *Poil<[email protected] <mailto:[email protected]>>* wrote ----

    Hi,

    what's this command return ?

    ldd /var/lib64/collectd/java.so

    Best regards,
    Le 01/11/2012 18:35, martin a écrit :
    Hi all,

    I wonder if someone can help me I'm migrating from jmxtrans to
    collectd-java/genericjmx, I've configured it as follows but I'm
    getting a "Found a configuration for the `java' plugin, but the
    plugin isn't loaded or didn't register a configuration callback."
    error

    ---Start Here
    # cat collectd5.conf
    BaseDir     "/var/lib/collectd5"
    PIDFile     "/var/run/collectd5.pid"
    LoadPlugin syslog
    LoadPlugin cpu
    LoadPlugin interface
    LoadPlugin load
    LoadPlugin memory
    Include "/etc/collectd5.d/*.conf"

    # cat collectd5.d/graphite.conf
    LoadPlugin write_graphite

    <Plugin write_graphite>
      <Carbon>
        Host "myhost1"
        Port "2003"
        Prefix "collectd."
        StoreRates false
        AlwaysAppendDS false
        EscapeCharacter "_"
      </Carbon>
    </Plugin>

    # cat collectd5.d/genericjmx.conf
    LoadPlugin java

    <Plugin "java">
      JVMARG "-Djava.class.path=/usr/share/collectd/java"
      LoadPlugin "org.collectd.java.GenericJMX"
      <Plugin "GenericJMX">
        <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>
          ServiceURL
    "service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi"
          Host "vmapp1"
          Collect "memory_pool"
        </Connection>
      </Plugin>
    </Plugin>
    --end here

    I've got collectd-java and multiple versions of java installed i.e.

    # rpm -ql collectd-java
    /usr/lib64/collectd/java.so
    /usr/share/collectd/java
    /usr/share/collectd/java/collectd-api.jar
    /usr/share/collectd/java/generic-jmx.jar
    /usr/share/man/man5/collectd-java.5.gz
    # rpm -qa | grep -i -e java -e jre -e jdk
    collectd-java-5.1.0-1.el6.x86_64
    java-1.7.0-openjdk-1.7.0.3-2.1.el6.7.x86_64
    java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
    jre-1.7.0_07-fcs.x86_64
    java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64
    gcc-java-4.4.6-3.el6.x86_64
    jdk-1.7.0_07-fcs.x86_64

    but I get the following errors:
    Nov  1 17:33:14 ip-10-39-3-223 collectd[20610]: collectd:
    Stopping 5 read threads.
    Nov  1 17:33:14 ip-10-39-3-223 collectd[20809]: Found a
    configuration for the `java' plugin, but the plugin isn't loaded
    or didn't register a configuration callback.
    Nov  1 17:33:14 ip-10-39-3-223 collectd[20809]: Found a
    configuration for the `java' plugin, but the plugin isn't loaded
    or didn't register a configuration callback.
    Nov  1 17:33:14 ip-10-39-3-223 collectd[20809]: There is a
    `Plugin' block within the configuration for the java plugin. The
    plugin either only expects "simple" configuration statements or
    wasn't loaded using `LoadPlugin'. Please check your configuration.
    Nov  1 17:33:14 ip-10-39-3-223 collectd[20810]: Initialization
    complete, entering read-loop.

    # collectd5 -t
    Could not find plugin java.
    # collectd5 -T
    Could not find plugin java.

    Can anyone help me fix this?

    -Martin


_______________________________________________ collectd mailing [email protected] <mailto:[email protected]> http://mailman.verplant.org/listinfo/collectd



_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to