[collectd] apache and collectd plugin
Amit Gupta
amit.gupta221 at gmail.com
Tue Apr 21 10:42:20 CEST 2009
On Tue, Apr 21, 2009 at 12:48 AM, Florian Forster <octo at verplant.org> wrote:
> 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? ;)
This is what I thought earlier but then I wasn't sure if the
scoreboard output (along with legends) will always be present. I will
probably re-look at the scoreboard output.
>
> 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..
I have kept the type_instance (apache-scoreboard-<type_instance>) as
per the legend definition in the mod_status output (which is why I
didn't unify it), for instance, the legend 'W' stands for "sending
reply" in apache and "write" in lighttpd. Do you want it to be
unified?
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)
>
> iD8DBQFJ7MqHHdggu3Q05IYRAuZQAJ9FpuQBye70bKshI2hvVhUfSQm7rACfctRB
> XO+RoZjo8vUGj601yr+oKK0=
> =DtIr
> -----END PGP SIGNATURE-----
>
>
More information about the collectd
mailing list