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
Merge branch 'collectd-4.6'
snmp plugin: Use `complex reads', one for each host.
This way the reads are sheduled by the global read threads, thread
handling can be removed completely and intervals which are not a
multiple of the global interval are possible.
This way the reads are sheduled by the global read threads, thread
handling can be removed completely and intervals which are not a
multiple of the global interval are possible.
mysql plugin: Use "mysql-$db" when registering a read callback.
mysql plugin: use plugin_register_complex_read
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
configure: Prefixed cache-ids in AC_CACHE_CHECK with "c_cv_".
autoconf requires the string "_cv_" to be present in cache-ids.
This patch adds/changes `have_broken_perl_load_module' which was added
after 4.5.
autoconf requires the string "_cv_" to be present in cache-ids.
This patch adds/changes `have_broken_perl_load_module' which was added
after 4.5.
Bumped version to 4.6.2; Updated ChangeLog.
mysql plugin: un-static-ize mysql connections
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.5' into collectd-4.6
src/plugin.c: Fix an error message.
mysql plugin: Some changes to the configuration handling.
The member `instance' is used to determine whether or not to use ``legacy
mode'':
- If it is NULL, legacy mode is in action
- Otherwise, non-legacy mode should be used.
``legacy mode'' and ``non-legacy mode'' cannot be mixed: If at least one
database is defined in the ``new'' way, all options that'd be valid in
legacy mode will only trigger a warning.
The member `instance' is used to determine whether or not to use ``legacy
mode'':
- If it is NULL, legacy mode is in action
- Otherwise, non-legacy mode should be used.
``legacy mode'' and ``non-legacy mode'' cannot be mixed: If at least one
database is defined in the ``new'' way, all options that'd be valid in
legacy mode will only trigger a warning.
configure: Prefixed cache-ids in AC_CACHE_CHECK with "c_cv_".
autoconf requires the string "_cv_" to be present in cache-ids.
autoconf requires the string "_cv_" to be present in cache-ids.
configfile, types_list: Improved error messages when handling "TypesDB".
Merge branch 'collectd-4.6' of /var/lib/git/collectd into collectd-4.6
mysql plugin: add support for multiple databases
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/plugin.[ch]: Pass an interval to `plugin_register_complex_read'.
src/plugin.c: Remove an unused variable.
src/liboping/liboping.c: Fix a problem with strict aliasing.
Just remove the code since it's dead anyway.
Thanks to Alan Pevec <apevec at gmail.com> for pointing this out :)
Just remove the code since it's dead anyway.
Thanks to Alan Pevec <apevec at gmail.com> for pointing this out :)
src/filter_chain.c: Allow chains without a default target.
This is how it's documented.
This is how it's documented.
timediff match: Register the correct match name.
src/utils_cache.c: Fix an error message.
src/plugin.c: Use a heap to schedule reads.
With this change basically only timeout checks are triggered from the
global "read loop". This will allow each read function to be queried at
a different interval. This is currently not used, but will come in handy
in the future.
With this change basically only timeout checks are triggered from the
global "read loop". This will allow each read function to be queried at
a different interval. This is currently not used, but will come in handy
in the future.
src/collectd.conf.in: Add `match_timediff'.
Merge branch 'collectd-4.6'
Merge branch 'collectd-4.5' into collectd-4.6
15 years agoMerge branch 'collectd-4.5' of octo@verplant.org:/var/lib/git/collectd into collectd-4.5
Merge branch 'collectd-4.5' of octo@verplant.org:/var/lib/git/collectd into collectd-4.5
bind plugin: Actually handle RR cache numbers as `gauge'..
Hi Florian,
Well a working patch was even less trivial as the quick one from
yesterday evening.
Just using a gauge type is not sufficient (only 0 is written to RRD
files), it's also necessary to adjust the bind_xml_stats_handle_view()
as has been done for the memory statistics
Attached is a patch to bind.c (I skipped types.db) which fixes the
cache data collection.
In addition I attached a graph of the cache evolution and memory (for
memory it might be worth giving it an own type as it's not cumulative
at all)
Bruno
Hi Florian,
Well a working patch was even less trivial as the quick one from
yesterday evening.
Just using a gauge type is not sufficient (only 0 is written to RRD
files), it's also necessary to adjust the bind_xml_stats_handle_view()
as has been done for the memory statistics
Attached is a patch to bind.c (I skipped types.db) which fixes the
cache data collection.
In addition I attached a graph of the cache evolution and memory (for
memory it might be worth giving it an own type as it's not cumulative
at all)
Bruno
bind plugin: "Trivial patch" to make `rr cache' stats work.
bind plugin: "Trivial patch" to make `rr cache' stats work.
contrib/collection3: Use {interface} in `if_octets' graphs.
contrib/collection3: Add graph for `ps_cputime'.
contrib/collection3: Add the "height" parameter.
src/common.c, memory plugin: Fix a potential problem under Solaris.
When the kstat chain has been updated (and init is called again),
get_kstat should overwrite the existing kstat pointer thingy.
When the kstat chain has been updated (and init is called again),
get_kstat should overwrite the existing kstat pointer thingy.
contrib/collection3: Fix two minor issues.
contrib/collection3: Add "Wirkleistung" graph.
contrib/collection3: Minor HTML work-around for some browsers.
contrib/collection3: Update bin/json.cgi to use the JSON module.
contrib/collection3: Add graph for "Table space" graphs.
contrib/collecion3: Add graphs for `dns_opcode' and `io_octets'.
contrib/collection3: Add the `index' to the parameters.
src/liboping/test_liboping.c: Remove legacy file.
Merge branch 'ff/gmond'
Merge branch 'collectd-4.6'
rrdtool plugin: Beatify a debugging message.
gmond plugin: Add a configuration.
gmond plugin: Add a plugin to receive Ganglia multicast traffic.
Merge branch 'sh/collectd-4.5' into sh/collectd-4.6
Conflicts:
contrib/collection3/lib/Collectd/Graph/Common.pm
src/postgresql_default.conf
Conflicts:
contrib/collection3/lib/Collectd/Graph/Common.pm
src/postgresql_default.conf
postgresql_default.conf: Make sure the "disk_io" query does not return NULLs.
Starting with some version between 8.3.3 and 8.3.6, pg_statio_*_tables returns
NULL instead of 0 for statistics if no instance of the appropriate relation
exists. PQgetvalue() returns an empty string in that case which would then
result in error messages when udb_result_submit() tries to convert that to a
number.
Now, the "disk_io" query uses PostgreSQL's coalesce() function to make sure 0
is returned instead of NULL.
Starting with some version between 8.3.3 and 8.3.6, pg_statio_*_tables returns
NULL instead of 0 for statistics if no instance of the appropriate relation
exists. PQgetvalue() returns an empty string in that case which would then
result in error messages when udb_result_submit() tries to convert that to a
number.
Now, the "disk_io" query uses PostgreSQL's coalesce() function to make sure 0
is returned instead of NULL.
src/plugin.c: Remove an unused variable.
contrib/exec-nagios.px: Make it possible to run the same script multiple times.
rrdtool plugin: Fix a possible race condition at startup.
On a very busy system, if the network plugin was initialized before the
rrdtool plugin, `rrd_cache_insert' may be called before the RRDtool
plugin is initialized. It would then pass `cache == NULL' to
`c_avl_get', resulting in a segmentation fault.
On a very busy system, if the network plugin was initialized before the
rrdtool plugin, `rrd_cache_insert' may be called before the RRDtool
plugin is initialized. It would then pass `cache == NULL' to
`c_avl_get', resulting in a segmentation fault.
collectd.conf(5): Don't mix spaces and tabs in configuration examples.
contrib/collection3: Fix stacking with NAN values.
Stacked values above NAN values were not drawn previously..
Stacked values above NAN values were not drawn previously..
contrib/collection3: Minor cleanups.
contrib/collection3: Add the "IgnoreUnknown" config option.
Used by the "GenericStacked" graphs.
Used by the "GenericStacked" graphs.
contrib/collection3: Add "Total" to "GenericIO" graphs.
Using the RRDtool 1.2 VDEF syntax.
Using the RRDtool 1.2 VDEF syntax.
contrib/collection3: Add the "DataDir" config option.
contrib/collection3/bin/.htaccess: s/SetHandler/AddHandler/
SetHandler doesn't accept a file extension.
SetHandler doesn't accept a file extension.
contrib/collection3/bin/.htaccess: Add file.
This has been missing. Wonder why nobody complained..?
This has been missing. Wonder why nobody complained..?
postgresql_default.conf: Added a short usage and copyright header.
postgresql plugin: Made variable names more self-explanatory.
Also, while I was at it, improved some error messages.
Also, while I was at it, improved some error messages.
postgresql_default.conf: Don't use the deprecated {Min,Max}PgVersion options.
collectd.conf(5): Mention that `Oracle' doesn't like semicolons..
.. at the end of the SQL statement.
.. at the end of the SQL statement.
libcollectdclient: Check if the file handle is valid before writing to it.
And free allocated memory when connecting fails. Only assign anything to
the user-provided pointer if `lcc_connect' succeeds. This should make
error-handling much more straight-forward.
And free allocated memory when connecting fails. Only assign anything to
the user-provided pointer if `lcc_connect' succeeds. This should make
error-handling much more straight-forward.
snmp plugin: Added a note about a potential bug that needs fixing.
Negative absolute (gauge) values may be casted to an unsigned integer
variable on their way throught he daemon, producing VERY HIGH tempera-
tures in winter..
Negative absolute (gauge) values may be casted to an unsigned integer
variable on their way throught he daemon, producing VERY HIGH tempera-
tures in winter..
Merge branch 'bp/php-collection' into collectd-4.5
php-collection: Add support for named graph lists as favorites
php-collection: Add support for named graph lists as favorites
php-collection allowed saving and loading a list of graphs from a
cookie.
This patch changes loading/saving to provide support for naming
of favorite graph lists.
When saving a name has to be provided (up to 30 alphanumerical
characters includeing underscore and hyphen.
For loading a named list can be selected from a dropdown list (this list
is refreshed when it gets focus) of available favorites.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection: Add support for named graph lists as favorites
php-collection allowed saving and loading a list of graphs from a
cookie.
This patch changes loading/saving to provide support for naming
of favorite graph lists.
When saving a name has to be provided (up to 30 alphanumerical
characters includeing underscore and hyphen.
For loading a named list can be selected from a dropdown list (this list
is refreshed when it gets focus) of available favorites.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/functions.php: Escape/avoid problematic characters in RRD commandline
php-collection/functions.php: Escape/avoid problematic characters in RRD commandline
rrdtool does not like '!' in variable names so replace them with '_'.
(bind plugin has them in a few type-instances and type-instance is used
as variable name by MetaGraphs)
Also escape rrdtool field seperators that might appear in file names.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/functions.php: Escape/avoid problematic characters in RRD commandline
rrdtool does not like '!' in variable names so replace them with '_'.
(bind plugin has them in a few type-instances and type-instance is used
as variable name by MetaGraphs)
Also escape rrdtool field seperators that might appear in file names.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/definitions.php: Add MetaGraph definitions for bind plugin
php-collection/definitions.php: Add MetaGraph definitions for bind plugin
Add metagraph definition and matching function for the various
types used by bind plugin.
Adjust the memory MetaGraph function to support bind memory statistics.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/definitions.php: Add MetaGraph definitions for bind plugin
Add metagraph definition and matching function for the various
types used by bind plugin.
Adjust the memory MetaGraph function to support bind memory statistics.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/graph.php: Add missing error500() function
php-collection/graph.php: Add missing error500() function
When a call to rrdtool fails or some other internal error occurs
a HTTP error with code 500 and matching error image should be
returned, added the missing error500() function which does this
the same way as error404() and error400() functions.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/graph.php: Add missing error500() function
When a call to rrdtool fails or some other internal error occurs
a HTTP error with code 500 and matching error image should be
returned, added the missing error500() function which does this
the same way as error404() and error400() functions.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection: Fixes and multiple saved graph lists
php-collection/functions.php: Fix collectd_flush()
Some obsolete code in collectd_flush() caused PHP Notice errors
and prevented caused the function to return before attempting
to ask collectd to flush cache.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/functions.php: Fix collectd_flush()
Some obsolete code in collectd_flush() caused PHP Notice errors
and prevented caused the function to return before attempting
to ask collectd to flush cache.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/definitions.php: Add missing MetaGraph for tcp_connections
php-collection/definitions.php: Add missing MetaGraph for tcp_connections
Add missing MetaGraph reference for tcp_connections and fix DS name
for the MetaGraph
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
php-collection/definitions.php: Add missing MetaGraph for tcp_connections
Add missing MetaGraph reference for tcp_connections and fix DS name
for the MetaGraph
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
contrib/php-collection: A few more bug-fixes to the graphing scripts.
This removes some obsolete code which prevents flush from working and adds
missing wrapper error500().
This removes some obsolete code which prevents flush from working and adds
missing wrapper error500().
src/plugin.c, network, rrdtool: Improved thread shutdown.
Just some comments, info messages and not assigning zero to pthread_t.
Just some comments, info messages and not assigning zero to pthread_t.
ping plugin: Add support for drop rate and standard deviation.
README: Documented the `--with-fp-layout' configure option.
src/collectd.conf.in: Only include very few standard plugins by default.
Available but disabled by default plugins are listed with one hash
mark ("#") in front of them; unavailable plugins are listed with two hash
marks ("##") in front of them.
Plugins loaded by default are:
- syslog || logfile
- rrdtool || network || csv
- cpu
- interface
- load
- memory
Available but disabled by default plugins are listed with one hash
mark ("#") in front of them; unavailable plugins are listed with two hash
marks ("##") in front of them.
Plugins loaded by default are:
- syslog || logfile
- rrdtool || network || csv
- cpu
- interface
- load
- memory
protocols plugin: Add to configuration summary and collectd.conf.in.
protocols plugin: Add a plugin which collets protocol information.
Currently a Linux only plugin. This plugin collects information about
IP, TCP, UDP, etc.
Thanks to Ulf Zimmermann for his (indirect) suggestion ;)
Currently a Linux only plugin. This plugin collects information about
IP, TCP, UDP, etc.
Thanks to Ulf Zimmermann for his (indirect) suggestion ;)
Merge branch 'ff/java'
Merge branch 'collectd-4.6'
Merge branch 'collectd-4.5' into collectd-4.6
dns plugin: Don't pass a NULL pointer to `pcap_open_live'.
Although the documentation states clearly, that passing a NULL pointer
as device is okay and handled like "any", doing so will crash the daemon
on some systems, most notably *BSDs but Linux users have reported this
behavior, too.
This patch passes "any" when the pointer it NULL, which reportedly
resulted in a different behavior, but still crashing the daemon. We'll
keep trying ;)
Although the documentation states clearly, that passing a NULL pointer
as device is okay and handled like "any", doing so will crash the daemon
on some systems, most notably *BSDs but Linux users have reported this
behavior, too.
This patch passes "any" when the pointer it NULL, which reportedly
resulted in a different behavior, but still crashing the daemon. We'll
keep trying ;)
oracle plugin: Fix type size issue under 64bit systems.
Under 64bit systems, `ub4' is of a different size than `size_t', so that a
`(size_t *)' cannot be casted to a `(ub4 *)' automatically.
Under 64bit systems, `ub4' is of a different size than `size_t', so that a
`(size_t *)' cannot be casted to a `(ub4 *)' automatically.
contrib/oracle/create_schema.ddl: Add GPLv2 license information.
In accordance with Roman Klesel,
<C937BDA691901BFAD72AFEF3@ganga.office.noris.de>
In accordance with Roman Klesel,
<C937BDA691901BFAD72AFEF3@ganga.office.noris.de>
src/common.c: Fixed a race condition in check_create_dir().
Between checking for the existence of a directory using stat() and creating
the directory using mkdir(), another thread might have already created the
directory thus causing mkdir() to fail with errno == EEXIST. This case is now
handled sanely, no longer causing the function (and thus some write callback)
to fail in this case.
Most likely, this only happens during startup when creating the data
directories - later, no two threads should try to create the same directory.
Interestingly enough, I frequently encountered this issue on a single core
machine.
Between checking for the existence of a directory using stat() and creating
the directory using mkdir(), another thread might have already created the
directory thus causing mkdir() to fail with errno == EEXIST. This case is now
handled sanely, no longer causing the function (and thus some write callback)
to fail in this case.
Most likely, this only happens during startup when creating the data
directories - later, no two threads should try to create the same directory.
Interestingly enough, I frequently encountered this issue on a single core
machine.
collectd.conf(5), collectd-java(5): Updated the documentation for the Java plugin.
collectd-java(5): Documented the `match' and `target' callbacks.
bindings/java/: CollectdMatchFactoryInterface: Add more JavaDoc.
bindings/java/: Unify inline documentation terms.
s/function/method/
s/function/method/
java plugin: Add support for `target' callbacks.
With the ``do everything while in the configuration phase'' issues all
sorted out, this was actually kinda easy.
Matches and targets share a lot of code, so that the patch actually isn't
all that large..
Now, the Java plugin is feature-complete \o/
With the ``do everything while in the configuration phase'' issues all
sorted out, this was actually kinda easy.
Matches and targets share a lot of code, so that the patch actually isn't
all that large..
Now, the Java plugin is feature-complete \o/
Merge branch 'master' into ff/java
Merge branch 'collectd-4.6'
src/plugin.c: Assure that targets get dynamically allocated memory.
If targets want to replace the values, they will have to use dynamically
allocated memory. If they can't free the values, because the pointer
might point to statically allocated memory, memory will be lost.
Unfortunately stack allocation will not do, since we will then not be able
to detect multiple replacements.
To impose as little a performance issue as possible, the dynamic allo-
cation is only done when either chain is present. If the filter mecha-
nism is not used, the values will not be copied.
If targets want to replace the values, they will have to use dynamically
allocated memory. If they can't free the values, because the pointer
might point to statically allocated memory, memory will be lost.
Unfortunately stack allocation will not do, since we will then not be able
to detect multiple replacements.
To impose as little a performance issue as possible, the dynamic allo-
cation is only done when either chain is present. If the filter mecha-
nism is not used, the values will not be copied.
java plugin: Add support for `match' callbacks.
Holy crap, that one needed some serious magic.. The problem is, that the
filter chains are created before the initialization functions are run.
Since the Java plugin used to initialize the JVM and load the classes in
the init function, the match callbacks were not available in time.
The behavior is now: Create the JVM as soon as the the first `LoadPlugin'
option is found and load and configure all Java plugins while in the
configuration phase. (I. e. exactly like C plugins.)
Phew, I've earned that beer now.
Holy crap, that one needed some serious magic.. The problem is, that the
filter chains are created before the initialization functions are run.
Since the Java plugin used to initialize the JVM and load the classes in
the init function, the match callbacks were not available in time.
The behavior is now: Create the JVM as soon as the the first `LoadPlugin'
option is found and load and configure all Java plugins while in the
configuration phase. (I. e. exactly like C plugins.)
Phew, I've earned that beer now.
logfile plugin: Interpret `(notification_t *)->time == 0' as `now'.
java plugin: Expose `plugin_dispatch_notification' to Java plugins.
src/collectd.conf.in: Add `LoadPlugin java'.
src/plugin.c: Fix plugin_dispatch_notification again.