Hi !<br>&nbsp;&nbsp;&nbsp; I attach a source for a tomcat stats plugin. This plugin get an url and parse the results with libxml2 (need libcurl and libxml2). Collects stats for memory (max, free, total), garbage collectors (times and time), threads by connector (max, count, idle), request by connector (requests, errors, bytes) and workers state by connector. 
In the configuration, you have &quot;instance&quot;, &quot;url&quot;, &quot;user&quot;, &quot;password&quot;, &quot;cacert&quot;. You must define first instance, and the other options is related to it. You can define one or more instances (if you have 2 tomcats on the same machine). 
P.E<br><br>&lt;plugin tomcat&gt;<br>&nbsp;&nbsp;&nbsp; instance &quot;blog&quot;<br>&nbsp;&nbsp;&nbsp; url &quot;<a href="http://localhost:8080/collectd/stats">http://localhost:8080/collectd/stats</a>&quot;<br>&nbsp;&nbsp;&nbsp; instance &quot;web&quot;<br>&nbsp;&nbsp;&nbsp; url &quot;
<a href="http://localhost:9090/collect/stats">http://localhost:9090/collect/stats</a>&quot;<br>&nbsp;&nbsp;&nbsp; user &quot;stats&quot;<br>&nbsp;&nbsp;&nbsp; password &quot;**************&quot;<br>&lt;/plugin&gt;<br><br>this define 2 instances on the plugin, &quot;blog&quot; and &quot;web&quot;, blog don&#39;t have user/password and &quot;web&quot; have it.
<br><br>On the tomcat side, you need install a collectd servlet. This servlet get stats from mbeans (as manager/status) and the result is a xml with the info (please consider security needs of your platform. To me RemoteAddrValve for localhost is ok). This servlet is a modification of manager/status, so it&#39;s under Apache license.
<br><br>
TODO<br>&nbsp;&nbsp; - tomcat_read return values<br>&nbsp;&nbsp; - tomcat_buffer have fix size, maybe a realloc ??<br>&nbsp;&nbsp; - tomcat_instances have fix size, dinamyc list ??<br><br>comments ??<br>thanks,<br>justo<br><br><br>