[collectd] apache and collectd plugin

Amit Gupta amit.gupta221 at gmail.com
Wed Apr 29 18:29:13 CEST 2009


On Wed, Apr 22, 2009 at 1:53 PM, Florian Forster <octo at verplant.org> wrote:
> I think we have two options left:
>
>  - Set a header callback using the CURLOPT_HEADERFUNCTION option and
>   look for the ‘Server’ header field. If it contains “lighttpd”, assume
>   lighttpd, Apache otherwise.
>
>  - Let the user configure which server software he's using.
>
> The two could be combined, of course: Use the user's setting if he has
> given one, (try to) determine the server software automatically if not.
>
> What do you think?
yeah this sounds good. While I thought about parsing the headers
initially but then the server headers can easily be changed, so I
wasn't sure about this approach earlier. Combing this with the user
specified server configuration value seems like the best solution.

Do find the patch attached. I am using st->server_type variable which
will be set to APACHE or LIGHTTPD based on the following logic:
- If the user has specified Server element in the conf file and it is
"apache" or "lighttpd", then set  st->server_type variable
appropriately, otherwise ignore the Server value
- Parse the headers (only if the Server element is NULL or invalid) to
determine the type and set the st->server_type variable accordingly
- if  st->server_type is not set as yet, then default it to apache

Regards
Amit
>
> Regards,
> -octo
> --
> Florian octo Forster
> Hacker in training
> GnuPG: 0x91523C3D
> http://verplant.org/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFJ7tQZHdggu3Q05IYRAmL8AJ9GNfgvV53+OvnlN7lwws66R3RNTQCfZ2oj
> gVwB204JKotXvQUFpbawyWs=
> =x0hg
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apache.lighttpd-scoreboard.patch
Type: text/x-patch
Size: 7435 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090429/76a86597/attachment.bin 


More information about the collectd mailing list