<div dir="ltr">Hi !<br><br>&nbsp; I&#39;m working on a JNI-JMX plugin. It&#39;s work as snmp plugin ... you define instances (a jvm with jmx on) and for each instance the beans that collectd will pull it.<br><br>&nbsp; On start collectd, we up one jni connection, and foreach instance, we create a new java JMXConnector (with the instance parameters). On pull, foreach instance, we call the JMXConnector get method and pass it to collectd.<br>
<br>&nbsp;I hope to send to the list a alpha-alpha version in two weeks.<br><br>thanks in advance, and sorry for me english<br><br>justo <br><br><div class="gmail_quote">On Thu, Sep 11, 2008 at 7:59 AM, Brian Long <span dir="ltr">&lt;<a href="mailto:brian@dotspots.com">brian@dotspots.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hi Steve,<div><br></div><div>I&#39;ve integrated collectd with JMX in our systems. We use it to poll the JVM as well as any other relevant metrics we want from our applications.&nbsp;</div>
<div><br>
</div><div>What I ended up doing was creating a MonitoredResource and MonitoredAttribute annotation (similar to ManagedResource and ManagedAttribute) which can be applied to any bean and getter. Then I have a MonitoredAnnotationBeanPostProcessor which registers all beans and their attributes which wish to be monitored. A MonitoringAgent bean is constructed which emits a single JMX operation, getMonitoredBeans. This returns a collection of object names and attributes which have been decorated by the Monitored* annotations and registered via the post processor. (And since there are no beans to annotate for JVM metrics, I just hand-register all the interesting JVM objects/attributes in code...)</div>

<div><br></div><div>I have a bridge process with is invoked by the exec plugin which connects to an app and retrieves all monitored beans by invoking getMonitoredBeans (via JMX obviously). It proceeds to then retrieve all the monitored attributes by retrieving each attribute for each object name emitted in getMonitoredBeans. The bridge is responsible for turning object names and attributes into plugin/type/instance/data source labels that are posted by PUTVAL.</div>

<div><br></div><div><div>Everything about this works fine... the only thing we had to revisit was launching the bridge app at every iteration. We eventually turned it into a long-running process which never exits, just to avoid the overhead of bringing up a new JVM each time.</div>

<div><br></div></div><div>This is obviously very specific to a system which is based around Spring, but I found it very simple to emit new metrics this way - all you need to do is apply the annotations and everything works completely automatically.</div>

<div><br></div><font color="#888888"><div>-B</div></font><div><div></div><div class="Wj3C7c"><div><br><div class="gmail_quote">On Wed, Sep 10, 2008 at 5:59 AM, steve hillier <span dir="ltr">&lt;<a href="mailto:shillier@halogensoftware.com" target="_blank">shillier@halogensoftware.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;Hi,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I&#39;ve read through the docs and faq, and done a few test builds<br>
 &nbsp; &nbsp; &nbsp; &nbsp;from<br>
 &nbsp; &nbsp; &nbsp; &nbsp;source, but did not find any answers to my question(s).<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I&#39;m prototyping a statistics collection package that includes<br>
 &nbsp; &nbsp; &nbsp; &nbsp;system,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;network, and JVM statistics collection. I see that collectd can<br>
 &nbsp; &nbsp; &nbsp; &nbsp;do most<br>
 &nbsp; &nbsp; &nbsp; &nbsp;of what I want already (great!), but I don&#39;t see anything that<br>
 &nbsp; &nbsp; &nbsp; &nbsp;might<br>
 &nbsp; &nbsp; &nbsp; &nbsp;point towards someone else having used it to gather JVM<br>
 &nbsp; &nbsp; &nbsp; &nbsp;statistics.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I&#39;m not averse to writing my own plugin, but I don&#39;t want to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;reinvent<br>
 &nbsp; &nbsp; &nbsp; &nbsp;the wheel either, so my question is: Has anyone ever tried to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;implement<br>
 &nbsp; &nbsp; &nbsp; &nbsp;JVM statistics collection, specifically via JMX or some such<br>
 &nbsp; &nbsp; &nbsp; &nbsp;method?<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;If not, what barriers might I encounter trying to code up a<br>
 &nbsp; &nbsp; &nbsp; &nbsp;plugin to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;add this functionality?<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Thanks,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Steve.<br>
<br>
<br>
_______________________________________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org" target="_blank">collectd@verplant.org</a><br>
<a href="http://mailman.verplant.org/listinfo/collectd" target="_blank">http://mailman.verplant.org/listinfo/collectd</a><br>
</blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org">collectd@verplant.org</a><br>
<a href="http://mailman.verplant.org/listinfo/collectd" target="_blank">http://mailman.verplant.org/listinfo/collectd</a><br>
<br></blockquote></div><br></div>