[collectd] apache and collectd plugin

Florian Forster octo at verplant.org
Mon Apr 20 21:18:32 CEST 2009


Hi Amit,

On Mon, Apr 20, 2009 at 10:10:49PM +0530, Amit Gupta wrote:
> Do find the patch for lighttpd scoreboard attached. Let me know if
> this patch looks okay.

I've changes the plugin to use multiple threads in the mean time and did
some other cleanups. Luckily, merging the changes did result in no
conflicts worth speaking of :)

Because this multiple threads feature required stuff not available in
4.6, I'm afraid we can't work on top of 4.6.2 anymore. Could you please
download a snapshot from Sebastian's page? The attached patch should
apply cleanly against ``collectd-4.6.2.184.gcfb15b5'', available from:
  <http://snapshots.tokkee.org/collectd/2009-04-19/>

I have to admit, I feel a little uncomfortable using `ReqPerSec' to
detect Apaches and assume Lighttpd by default. I'd much prefer to use
the scoreboard only to determine that. Since both servers use characters
not used by the other, this should be possible to do:

  ...
  else if (buf[i] == 'W') sending++; /* used by both */
  ...
  else if (buf[i] == 'L') { logging++; looks_like_apache++; }
  ...
  else if (buf[i] == 'r') { lighttpd_read++; looks_like_lighttpd++; }
  ...
  
  if ((looks_like_apache != 0) && (looks_like_lighttpd != 0))
    ERROR: could be both.
  else if ((looks_like_apache == 0) && (looks_like_lighttpd == 0))
    ERROR: looks like neither.
  else if (looks_like_apache != 0)
    submit Apache values.
  else
    submit Lighttpd values.

The huge advantage I see is that we'd use the actual data we are
concerned about to determine whether it's an Apache or Lighttpd. Using
`ReqPerSec' works exactly so long as the Lighttpd don't decide to
implement this ``missing'' feature, too.

Does this sound reasonable or am I completely off here? ;)

Oh, one more minor issue: The variable `sending' is submitted with the
instance “sending” on Apache and “write” on Lighttpd. Maybe it'd be a
good idea to unify this..

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090420/93042844/attachment.pgp 


More information about the collectd mailing list