[collectd] apache and collectd plugin

Amit Gupta amit.gupta221 at gmail.com
Tue Apr 14 17:37:28 CEST 2009


Hi,
Based on Bruno/Florian input, I have changed the apache code to
support the following configuration structure:
<Plugin apache>
  <Instance "instance_name">
     URL ....
     Host ... # optional and defaults to hostname_g
  </Instance>
   URL ...
</Plugin>

I have defined Instance as a block and not Host because the idea here
is to monitor multiple apache instances on the same machine. For
apache instances on remote machines, one could specify Host within the
Instance block (which is optional and default is hostname_g). For
legacy configuration, I am converting the legacy block to <Instance
""> which defaults to apache.

Do find the patch attached. I am not very familiar with git
format-patch and send-email functionalities as yet, so I am attaching
a diff -ur output as mentioned in the submitting-patches.shtml page.

The things which haven't been done as yet:
- I haven't used plugin_register_complex_read as yet. The main reason
being I am working on 4.6.1 version and I can't seem to find the
function plugin_register_complex_read in the code base. I believe it
is being added only in 4.6.2
- lighttpd scoreboard is not yet handled. This would probably be my next task.

Question:
Given that this plugin can be used by both apache and lighttpd, how do
we find out if the server is lighttpd or apache?. It will be good to
have different rrd file names for apache and lighttpd which could only
be done if we set different vl.type for both the servers. One way I
can think of is to rely on the differences of the mod_status output of
the two servers or perhaps we could have a generic type as "httpd".
(which can be done only in the next major release if you folks are
planning to change the plugin name to httpd in the next major release)

Regards
Amit

2009/3/16 Amit Gupta <amit.gupta221 at gmail.com>:
> On Mon, Mar 16, 2009 at 4:12 PM, Florian Forster <octo at verplant.org> wrote:
>> Hi Amit, Bruno,
>>
>> On Mon, Mar 16, 2009 at 10:39:39AM +0100, Bruno Prémont wrote:
>>> <Apache>
>>>   <Host "apache.domain.org">
>>>     Url ...
>>>   </Host>
>>>   <Host "lightttpd.domain.org">
>>>     Url ...
>>>   </Host>
>>>   Url ...
>>> </Apache>
>>
>> this is exactly what I'd have suggested. Especially the ``no block
>> behaves just like <Host "">, i. e. use hostname_g'' part is important to
>> establish backwards compatibility.
>
> This loooks great. I will try to work on it.
>
> Ideally I would like to see rrd files for apache and lighttpd running
> on the same machine to sit under different directories e.g
> <basedir>/<hostname>/apache for apache and
> <basedir>/<hostname>/lighttpd for lighttpd. May be introducing a
> configuration variable like directory/instance can help? (the default
> value will be "apache"). Does that sound okay?
>
> I would also like the name of the rrd files to be server specific.
> Right now, the name of the rrd files have apache as prefix which may
> not make sense for lighttpd. We probably can introducing another
> variable like "prefix" or something similar (default will be apache?).
>
> Regards
> Amit
>>
>> Copying the plugin is not nice, imho, since it leads to a lot of
>> duplicated code.. Renaming the plugin to something like `httpd' will
>> have to wait for the next major version since it's a backwards
>> incompatible change. Feel free to add it to the list in our wiki:
>> <http://collectd.org/wiki/index.php/Plans_for_5.0>
>>
>> Regards,
>> -octo
>> --
>> Florian octo Forster
>> Hacker in training
>> GnuPG: 0x91523C3D
>> http://verplant.org/
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.6 (GNU/Linux)
>>
>> iD8DBQFJviz9Hdggu3Q05IYRAkDbAJ0eklT41+UhuTgzPL7HEz/lkJuOIACeNKJs
>> OhHI2u6RrWn0J+4dURmP9fE=
>> =tWyH
>> -----END PGP SIGNATURE-----
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd-4.6.1-mine.apache.patch
Type: text/x-patch
Size: 18069 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090414/7a7c7384/attachment.bin 


More information about the collectd mailing list