author | Marco Chiappero <marco@absence.it> | |
Thu, 19 Mar 2009 12:30:32 +0000 (13:30 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 19 Mar 2009 12:30:32 +0000 (13:30 +0100) | ||
commit | 0c3fcab4abed820084393e64dc30a88512941de1 | |
tree | b81a180f773bfffbf49c152683a1eb5350eb489c | tree | snapshot |
parent | e4b8a186516b61f16d94a76db0aa102a3270d46c | commit | diff |
uptime plugin: Add a plugin to measure the time a system has been running.
Florian Forster ha scritto:
>Hi Marco,
Hi Florian,
> Checking the KSTAT_TYPE_NAMED twice (three times if you count the
> assertion) is of course not necessary. I suspect a copy'n'paste error ;)
Me too. Please remove the second one at least, kstat_read do not change
ks_type.
>A quick `grep' revealed that `get_kstat' is only used in two places, the
>memory and the swap plugin - both trying to figure out the pagesize. If
>you need something else than `KSTAT_TYPE_NAMED', I'd suggest to move the
>checks to a new function `get_kstat_pagesize' and use that function in
>the two plugins.
I went for the kstat.h only solution.
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.
I'm using it right now on a linux machine, but I haven't tested yet on
Solaris and BSDs. Today I tried to compile it on OpenSolaris, but after
fighting with the packaging system and many other things I gave up and
decided I won't try anymore. So, since I'd like to say the plugin is
done after testing it, Solaris testers are wanted :P
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.
See you soon :)
Regars,
Marco
Florian Forster ha scritto:
>Hi Marco,
Hi Florian,
> Checking the KSTAT_TYPE_NAMED twice (three times if you count the
> assertion) is of course not necessary. I suspect a copy'n'paste error ;)
Me too. Please remove the second one at least, kstat_read do not change
ks_type.
>A quick `grep' revealed that `get_kstat' is only used in two places, the
>memory and the swap plugin - both trying to figure out the pagesize. If
>you need something else than `KSTAT_TYPE_NAMED', I'd suggest to move the
>checks to a new function `get_kstat_pagesize' and use that function in
>the two plugins.
I went for the kstat.h only solution.
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.
I'm using it right now on a linux machine, but I haven't tested yet on
Solaris and BSDs. Today I tried to compile it on OpenSolaris, but after
fighting with the packaging system and many other things I gave up and
decided I won't try anymore. So, since I'd like to say the plugin is
done after testing it, Solaris testers are wanted :P
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.
See you soon :)
Regars,
Marco
src/types.db | diff | blob | history | |
src/uptime.c | [new file with mode: 0644] | blob |