Hi !<br> 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 "instance", "url", "user", "password", "cacert". 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><plugin tomcat><br> instance "blog"<br> url "<a href="http://localhost:8080/collectd/stats">http://localhost:8080/collectd/stats</a>"<br> instance "web"<br> url "
<a href="http://localhost:9090/collect/stats">http://localhost:9090/collect/stats</a>"<br> user "stats"<br> password "**************"<br></plugin><br><br>this define 2 instances on the plugin, "blog" and "web", blog don't have user/password and "web" 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's under Apache license.
<br><br>
TODO<br> - tomcat_read return values<br> - tomcat_buffer have fix size, maybe a realloc ??<br> - tomcat_instances have fix size, dinamyc list ??<br><br>comments ??<br>thanks,<br>justo<br><br><br>