[collectd] (maybe silly) Question about get_kstat

Florian Forster octo at verplant.org
Thu Mar 19 14:23:24 CET 2009


Hi Marco,

On Thu, Mar 19, 2009 at 11:52:12AM +0100, Marco Chiappero wrote:
> Ok, I'm attaching the code, please check the preprocessor directives
> for the includes section, I don't much about defines created by the
> build system and its names.

looks very good, thank you :) I've added the required build-system
changes and made some changes, mostly shuffled the preprocessor stuff
around a bit and changed some comments.

I think I've fixed a Solaris bug, too:

-if ((knp = (kstat_named_t *) kstat_data_lookup (ksp, "boot_time")) != NULL)
+knp = (kstat_named_t *) kstat_data_lookup (ksp, "boot_time");
+if (knp == NULL)

Note `!=' vs `==': Since `knp' is dereferenced further down, NULL is
probably not the value we expect there.

By the way, the boot-time can be read under Linux from `/proc/stat'.
Maybe that'd simplify the plugin further..?

I've added the plugin to the master branch, it'd be great if you could
base further changes on that. :)

> As soon as I can I will edit the wiki page, but first I want to have a
> closer look to the iptable plugin and see how many modifications are
> needed for IPv6 and then have an opinion about the single vs. double
> plugin approach.

Oh, right, I wanted to do that last weekend but then got stuck with the
web stuff :/

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/20090319/a4529140/attachment.pgp 


More information about the collectd mailing list