On Dec 11, 2007 8:11 AM, Florian Forster <<a href="mailto:octo@verplant.org">octo@verplant.org</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Justo :)</blockquote><div>Hi Florian,<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Thanks for your ``development peak'' at your new plugin :) I didn't have
<br>time to read all of your plugin, so the following is based on your email<br>and a quick look at the read function ;)<br><div class="Ih2E3d"></div></blockquote><div> <br> cute & paste & minor aspects, isn't a "development peak" XDXDXD ;-)
<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>On Mon, Dec 10, 2007 at 01:03:13PM +0100, Justo Alonso wrote:
<br>> <plugin tomcat><br>> instance "blog"<br>> url "<a href="http://localhost:8080/collectd/stats" target="_blank">http://localhost:8080/collectd/stats</a>"<br>> instance "web"
<br>> url "<a href="http://localhost:9090/collect/stats" target="_blank">http://localhost:9090/collect/stats</a>"<br>> user "stats"<br>> password "**************"<br>> </plugin>
<br><br></div>I'd prefer if the order of the lines didn't make a difference. To get<br>the following syntax you'd need to use the ``complex configuration''<br>scheme. Don't worry about it too much, though - since it's a bit tricky
<br>to parse I'll write a patch against your code, so you don't have to dig<br>into this ;)<br>-- 8< --<br><div class="Ih2E3d"> <Plugin tomcat><br> <Instance "blog"><br> Url "<a href="http://localhost:8080/collectd/stats" target="_blank">
http://localhost:8080/collectd/stats</a>"<br></div> </Instance><br><div class="Ih2E3d"> <Instance "web"><br> Url "<a href="http://localhost:9090/collect/stats" target="_blank">http://localhost:9090/collect/stats
</a>"<br></div> User "stats"<br> Password "**************"<br> </Instance><br> </Plugin><br>-- >8 --<br><div class="Ih2E3d"></div></blockquote><div><br>perfect !! <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>> On the tomcat side, you need install a collectd servlet.<br>> [...]
<br></div><div class="Ih2E3d">> This servlet is a modification of manager/status, so it's under Apache<br>> license.<br><br></div>What sets this new servlet apart from the already existing servlet? As<br>far as I've seen you can append `?XML=true' to the servlet bundled with
<br>Tomcat and get XML output from that, too..</blockquote><div> </div><div>The manager/status servlet don't have stats for the garbage collector, and have information about ips, methods, uris of the workers that is not useful (and increase the length of the result). I cute no-xml output, and a fullStatus option (I think not useful for us)
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>> TODO<br><div class="Ih2E3d">> - tomcat_buffer have fix size, maybe a realloc ??
<br><br></div>Do as you think it's practical. If the size of the status page could<br>differ a lot (depending on the setup, I don't think it'll differ between<br>calls much) then realloc would be better. Such a change could be back-
<br>ported to the apache plugin, too..</blockquote><div><br>Yes, depends of the configuration, and the workers (maxThreads ) of the connector. Maybe if we compact stage information, only one '<workers stage="..KFS..">' tag as apache status, the length of the result can be under 16k .... umm ...
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div class="Ih2E3d"><br>> - tomcat_instances have fix size, dinamyc list ??
<br><br></div>Yes, please.</blockquote><div><br>I'm working on it ...<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>Since we talked about this in another thread here's how I'd return an<br>error from the read function in this case:<br><br>> static int tomcat_read (void)<br>> {<br> int success = 0;<br>> for( x = 0; x <= tomcat_instances_num; x++ ) {
<br>> tomcat_instance_t *ti = tomcat_instances[x];<br>><br> /* If this happens there's a bug in the code and it's<br> * safer not to do anything. */<br>> if( ti == NULL ) {
<br>> ERROR ("tomcat: read, instance object is null.");<br>> return (-1);<br>> }<br>><br> /* ... */<br>><br>> tomcat_buffer_len = 0;
<br>> if (curl_easy_perform (ti->curl) != 0)<br>> {<br>> ERROR ("tomcat: curl_easy_perform failed for instance %s: %s",<br>> ti->name,
<br>> tomcat_curl_error);<br> continue;<br>> }<br>><br> /* ... */<br> success++;<br>> }<br>><br>
return ((success > 0) ? 0 : -1)<br>> } /* int tomcat_read */<br><br>This means: If ALL instances fail, -1 is returned. If at least one<br>instance succeeded, return 0. Thus the plugin returns -1 if something is
<br>seriously broken and it's likely it'll fail again next time it's<br>called..<br></blockquote><div><br>ok ... cut & paste it .. ;-)<br><br>I hope in this week will send you the modifications.<br><br>tia, and sorry for mi english
<br>j <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Regards,<br>-octo</blockquote><div><br><br>justo <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font color="#888888">--<br>Florian octo Forster<br>Hacker in training<br>GnuPG: 0x91523C3D<br><a href="http://verplant.org/" target="_blank">http://verplant.org/</a><br></font><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG
v1.4.6 (GNU/Linux)<br><br>iD8DBQFHXjgjOIGYkRnzlcMRAn5SAKCXD0eEC9hTON1PJSF2noB1XG0NNgCfQYQO<br>aO4oxn0sBEHUdWJMXlos5OU=<br>=NX4+<br>-----END PGP SIGNATURE-----<br><br></blockquote></div><br>