[collectd] Plugin:GenericJMX -- Best Practices to monitor 2 JVMs on same host

Josh Behrends jbehrends at gmail.com
Wed Aug 7 23:26:52 CEST 2013


You can prefix the JMX instance in the connection block for each
application using the "InstancePrefix" attribute.  Here is an example from
one of my hosts where I'm monitoring activemq and cassandra on the same
host.  All cassandra metrics will have a CAS- in front of them, and all
activemq metrics will be prefixed with AMQ-

    #######################
    # Connection block(s) #
    #######################
    <Connection>
      Host "myhost"
      InstancePrefix "CAS-"
      ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi"
      Collect "memory_pool"
      Collect "memory-heap"
      Collect "memory_nonheap"
      Collect "java_threads"
      Collect "classes"
      Collect "garbage_collector"
      Collect "jvm_uptime"
    </Connection>
    <Connection>
      Host "myhost"
      InstancePrefix "AMQ-"
      ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
      Collect "memory_pool"
      Collect "memory-heap"
      Collect "memory_nonheap"
      Collect "java_threads"
      Collect "classes"
      Collect "garbage_collector"
      Collect "jvm_uptime"
    </Connection>

Hope this helps!



On Wed, Aug 7, 2013 at 10:41 AM, Poil <poil at quake.fr> wrote:

> Hi,
>
> I collect Karaf and cassandra on a same host
> I use somethink like this
>
>   <Plugin  "GenericJMX">
>     <MBean  "cassandra/classes">
>       ObjectName "java.lang:type=ClassLoading"
>       InstancePrefix "cassandra_java"
>       <Value>
>         Type "gauge"
>         InstancePrefix "loaded_classes"
>         #InstanceFrom ""
>         Table false
>         Attribute "LoadedClassCount"
>       </Value>
>     </MBean>
>
>     <MBean  "karaf/classes">
>       ObjectName "java.lang:type=ClassLoading"
>       InstancePrefix "karaf_java"
>       #InstanceFrom ""
>        <Value>
>         Type "gauge"
>         InstancePrefix "loaded_classes"
>         #InstanceFrom ""
>         Table false
>         Attribute "LoadedClassCount"
>       </Value>
>     </MBean>
>
> <Connection>
> Collect "karaf/classes"
>  Collect "cassbandra/classes"
> </Connection>
>
> More info https://github.com/Poil/**CGraphz/wiki/GenericJMX<https://github.com/Poil/CGraphz/wiki/GenericJMX>
>
> regards
>
> Le 07/08/2013 12:54, Alexzander thunder Shevchenko a écrit :
>
>  Hi.
>>
>> I wonder how I can get same values for more than one JVMs?
>> I have MBeans for heap/nonheap memory values and I want to collect this
>> data from 2JVMs. But prefix for rrd's I can setonly in MBeans block, but
>> not in Connection block. I can setup two or more Connection block, but I
>> will get an error "update failed"-blah-blah-blah since it tries to write
>> the same rrd's. I see the only way to set MBean blocks with different
>> InstancePrefixes... I dont want to override Hostname property in Connection
>> block. Is there is another way to do this?
>>
>> Thanks,
>>
>>
>
> ______________________________**_________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/**listinfo/collectd<http://mailman.verplant.org/listinfo/collectd>
>



-- 
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130807/868dd3f4/attachment.html>


More information about the collectd mailing list