Merge branch 'collectd-4.5'
Merge branch 'collectd-4.4' into collectd-4.5
multimeter plugin: Check the return value of `write'.
This resolves warnings when compiling on GNU with:
CPPFLAGS="-D_FORTIFY_SOURCE"
This resolves warnings when compiling on GNU with:
CPPFLAGS="-D_FORTIFY_SOURCE"
collectd.conf(5): Fix a POD error.
value match: Add a match to check the actual value(s) of data-sources.
src/filter_chain.[ch]: Implement the built-in `return' target.
The `stop' target now aborts all processing of the value completely, `return'
only stops the current chain and continues processing the parent chain.
The collectd.conf(5) manual page has been updated and the `FC_ACTION_*' defines
have been renamed to `FC_TARGET_*'.
The `stop' target now aborts all processing of the value completely, `return'
only stops the current chain and continues processing the parent chain.
The collectd.conf(5) manual page has been updated and the `FC_ACTION_*' defines
have been renamed to `FC_TARGET_*'.
collectd.conf(5): Document the regex match and the set target.
regex match: Require *all* regular expressions to match.
Before, when there were multiple regular expressions for the same field,
for example the host, only of of those regular expressions needed to
match for a successful overall match.
The new behavior is not that *all* regular expressions need to match for
a successful overall match. This makes the behavior much easier to
understand.
Before, when there were multiple regular expressions for the same field,
for example the host, only of of those regular expressions needed to
match for a successful overall match.
The new behavior is not that *all* regular expressions need to match for
a successful overall match. This makes the behavior much easier to
understand.
set target: Don't allow setting of the `type' field.
set target: Implement a target to set fields in a value list.
It's currently possible to re-set the `type'. This is most likely not
good and will result in unpredictable behavior. I'll remove that,
probably.
It's currently possible to re-set the `type'. This is most likely not
good and will result in unpredictable behavior. I'll remove that,
probably.
regex match: Add myself to the list of copyright holders.
Sebastian insisted on it ;)
Sebastian insisted on it ;)
src/filter_chain.c: Beatify debug and warning messages.
src/filter_chain.c: Actually abort default targets when one signals `stop'.
It should not behave as documented.
It should not behave as documented.
src/filter_chain.c: Fix a rather unimportant typo.
collectd.conf.in: Add something for the filtering stuff.
Mostly a pointer to the manual page for now.
Mostly a pointer to the manual page for now.
collectd.conf(5): Add an example to the filter documentation.
src/filter_chain.c: Implement the default behavior.
If no <Chain> is defined, send all values to all write plugins.
If no <Chain> is defined, send all values to all write plugins.
src/meta_data.[ch]: Added a framework for meta data.
This framework is planned to be used in at least three places:
- Extend the global cache to allow attaching a meta-data object to each
entry. The meta-data can then be used by other plugins to attach
miscellaneous information to an entry. Possibly uses include
calculation of floating averages or storing the state for a hysteresis
threshold.
- Add a meta-data object to every `value_list_t' in
`plugin_dispatch_values'. The meta-data object can then be used by
matches and targets to pass information about a value-list to one
another.
- Replace the notification meta-data stuff in src/plugin.[ch] with such
an object.
This framework is planned to be used in at least three places:
- Extend the global cache to allow attaching a meta-data object to each
entry. The meta-data can then be used by other plugins to attach
miscellaneous information to an entry. Possibly uses include
calculation of floating averages or storing the state for a hysteresis
threshold.
- Add a meta-data object to every `value_list_t' in
`plugin_dispatch_values'. The meta-data object can then be used by
matches and targets to pass information about a value-list to one
another.
- Replace the notification meta-data stuff in src/plugin.[ch] with such
an object.
Merge branch 'ff/libcollectdclient'
Merge branch 'ff/filter'
src/filter_chain.c, src/match_regex.c: Add some debugging messages.
src/plubin.c: Call `fc_process' instead of calling the write plugins directly.
src/filter_chain.c: Allow the create-function of mathces to be NULL.
Not all targets actually need to be created, for example
the `stop' target.
Not all targets actually need to be created, for example
the `stop' target.
src/filter_chain.c: Add `Target' blocks to `Chain' blocks.
I simply forgot them :/
I simply forgot them :/
match_regex plugin: Fix a typo.
src/configfile.c: Dispatch the `Chain' blocks to fc_configure.
src/plugin.c: Use the write-list in plugin_write.
Not the flush-list, doh!
Not the flush-list, doh!
match_regex plugin: Renamed `filter_pcre' to `match_regex'.
In order to fit into the new match/target schema, the substitute part of the
plugin has been removed for now and will be put in a target plugin in the
future.
The match_regex now registeres a match with the new infrastructure and uses
regular expressions to match certain values based on their identifier.
In order to fit into the new match/target schema, the substitute part of the
plugin has been removed for now and will be put in a target plugin in the
future.
The match_regex now registeres a match with the new infrastructure and uses
regular expressions to match certain values based on their identifier.
src/filter_chain.[ch]: Implement an advanced filtering framework.
The concept separates `filter' plugins into `match' and `target' plugins. Those
two parts can be combined in wild variation, allowing *very* flexible
mechanisms.
The concept is explained in more detail in the `FILTER CONFIGURATION' section
of collectd.conf(5), also added with this commit.
The concept separates `filter' plugins into `match' and `target' plugins. Those
two parts can be combined in wild variation, allowing *very* flexible
mechanisms.
The concept is explained in more detail in the `FILTER CONFIGURATION' section
of collectd.conf(5), also added with this commit.
src/plugin.[ch]: Implement `plugin_write', a function to pass values to specific write plugins.
This function does none of the magic `plugin_dispatch_value' does. It simiply
takes a value and passes it to the requested plugin.
This function is intended to be used with the upcoming `filter chain' code,
which will allow to pass values to specific plugins only.
This function does none of the magic `plugin_dispatch_value' does. It simiply
takes a value and passes it to the requested plugin.
This function is intended to be used with the upcoming `filter chain' code,
which will allow to pass values to specific plugins only.
configure.in: Include <stdint.h> and <inttypes.h> when checking for double storage layout.
Some systems, for example Solaris 9, don't have <stdint.h> and define
`uint32_t' via <inttypes.h> instead. Be more permissive by including
both header files when checking how doubles are stored in memory.
Some systems, for example Solaris 9, don't have <stdint.h> and define
`uint32_t' via <inttypes.h> instead. Be more permissive by including
both header files when checking how doubles are stored in memory.
contrib/collection.cgi: Add meta-graph definitions for the vmem plugin.
contrib/collection.cgi: Add graph definitions for the vmem plugin.
dbi plugin: Replace `dbi_conn_error_flag' with `dbi_conn_error'
Version 0.8 of the libdbi deprecates `dbi_conn_error_flag', so use the other
function.
Version 0.8 of the libdbi deprecates `dbi_conn_error_flag', so use the other
function.
mysql plugin: Fix a typo: `$endptr' -> `&endptr'.
Yes, I've done a little Perl lately ;)
Also fix a non-void function without return value..
Yes, I've done a little Perl lately ;)
Also fix a non-void function without return value..
libcollectdclient: Use the `SSTRCATF' macro some more.
This really does make stuff shorter. Hopefully it
makes it easier to read, too.
This really does make stuff shorter. Hopefully it
makes it easier to read, too.
libcollectdclient: Document the used macros.
They're probably not obvious unless you've doe quite
some C coding.
They're probably not obvious unless you've doe quite
some C coding.
libcollectdclient: Implemented `lcc_flush'.
libcollectdclient: Implemented `lcc_putval'.
collectd-nagios: Use `libcollectdclient' and various improvements.
The improvements include:
- Copyright and license header.
- More consistent output.
- Frees some more memory that was allocated..
- Better standards compliance.
- Make all functions `static' (except `main', of course).
- Use `%g' instead of `%lf' to print floating point values.
The improvements include:
- Copyright and license header.
- More consistent output.
- Frees some more memory that was allocated..
- Better standards compliance.
- Make all functions `static' (except `main', of course).
- Use `%g' instead of `%lf' to print floating point values.
src/libcollectdclient: Add a library which abstracts talking to the `unixsock' plugin.
Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
mysql plugin: Be more careful when parsing the `Port' argument.
collectd.conf(5): Document the new options of the mysql plugin.
mysql plugin: Allow configuration of `Port' and `Socket'.
Hi,
I have a patch for mysql collectd library.
The patch allow to specify also Port and Socket
parameters for those who have a non-standard configuration
of mysql.
It's very straightforward. If accepted, there is only to
change documentation and config file to reflect the new
parameters.
Enjoy
Mirko
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Hi,
I have a patch for mysql collectd library.
The patch allow to specify also Port and Socket
parameters for those who have a non-standard configuration
of mysql.
It's very straightforward. If accepted, there is only to
change documentation and config file to reflect the new
parameters.
Enjoy
Mirko
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
filter_pcre: Handle out of memory situations more gracefully.
Merge branch 'sh/next'
Merge branch 'collectd-4.5'
Merge branch 'collectd-4.4' into collectd-4.5
src/utils_rrdcreate.c: srrd_create: Copy the `filename' argument.
Some versions of librrd, for example the one in Debian Etch, don't have the
`const' qualifier for the first (filename) argument for `rrd_create_r'. So
we'll copy the argument first. This sucks big time, but is the only reasonable
way to get around this.
Some versions of librrd, for example the one in Debian Etch, don't have the
`const' qualifier for the first (filename) argument for `rrd_create_r'. So
we'll copy the argument first. This sucks big time, but is the only reasonable
way to get around this.
Install types.db into PKGDATADIR instead of PKGLIBDIR.
The FHS specifies that /usr/share should be used to store architecture
independent data while /usr/lib includes object files, libraries and
architecture dependent data.
The FHS specifies that /usr/share should be used to store architecture
independent data while /usr/lib includes object files, libraries and
architecture dependent data.
contrib/oracle: Fixed some typos.
filter_pcre plugin: Added support to rewrite value lists.
For this purpose "Substitute*" options have been introduced for each regex
option. Upon a successful match, the matching substring will be replaced by
the specified replacement text.
Configuration example:
<Plugin filter_pcre>
<RegEx>
Plugin "^sensors$"
PluginInstance "^Some Weird Sensor Chip Name Prefix"
SubstitutePluginInstance "foo"
</RegEx>
</Plugin>
For this purpose "Substitute*" options have been introduced for each regex
option. Upon a successful match, the matching substring will be replaced by
the specified replacement text.
Configuration example:
<Plugin filter_pcre>
<RegEx>
Plugin "^sensors$"
PluginInstance "^Some Weird Sensor Chip Name Prefix"
SubstitutePluginInstance "foo"
</RegEx>
</Plugin>
utils_subst: Added a module providing functions for string substitution.
Currently, the functions subst() and asubst() are available which may be used
to replace parts of a string with a specified replacement text. The latter
automatically allocates the memory required for the return value while the
former writes to a user specified buffer.
Currently, the functions subst() and asubst() are available which may be used
to replace parts of a string with a specified replacement text. The latter
automatically allocates the memory required for the return value while the
former writes to a user specified buffer.
utils_*.h: Made header files self-hosting.
Added (hopefully) all missing includes.
Added (hopefully) all missing includes.
filecount plugin: Added the "Recursive" config option.
This option controls whether or not to recurse into subdirectories. It's
enabled by default, so backward-compatibility is retained.
This option controls whether or not to recurse into subdirectories. It's
enabled by default, so backward-compatibility is retained.
collectd.conf(5): Added a missing </RegEx> to the configuration example.
libiptc/Makefile.am: Added xtables.h, libxtc.h to libiptc_la_SOURCES.
Else, those files would not be included in the tarball.
Else, those files would not be included in the tarball.
src/Makefile: Build ipvs and uuid plugins using $AM_CFLAGS.
configure, mysql plugin: Check for mysql.h as well.
Up to now, only mysql/mysql.h has been checked for. However, mysql_config
--cflags usually adds the complete path to mysql.h to the include flags. In
most setups, mysql/mysql.h can be found in the search path as well (usually
the header is available in something like /usr/include/mysql/mysql.h) so this
issue has not been found so far. However, if that's not the case, the build
will fail.
Thanks to Dusty Doris <collectd@dusty.name> for reporting this.
Up to now, only mysql/mysql.h has been checked for. However, mysql_config
--cflags usually adds the complete path to mysql.h to the include flags. In
most setups, mysql/mysql.h can be found in the search path as well (usually
the header is available in something like /usr/include/mysql/mysql.h) so this
issue has not been found so far. However, if that's not the case, the build
will fail.
Thanks to Dusty Doris <collectd@dusty.name> for reporting this.
contrib/collection3: Add the `format' parameter to the graph.cgi.
With this parameter one can specify the file format the graph is returned in,
for example `format=SVG' for an SVG image.
With this parameter one can specify the file format the graph is returned in,
for example `format=SVG' for an SVG image.
src/utils_complain.c: Include "collectd.h" as first header file.
This is needed to get the _FILE_OFFSET_BITS define right.
This is needed to get the _FILE_OFFSET_BITS define right.
apcups plugin: Include "collectd.h" *before" <stdlib.h>.
If not defined, <stdlib.h> sets/defines _FILE_OFFSET_BITS. Since (in 32bit
mode) "collectd.h" defines that, too, you'll run into compilation problems.
If not defined, <stdlib.h> sets/defines _FILE_OFFSET_BITS. Since (in 32bit
mode) "collectd.h" defines that, too, you'll run into compilation problems.
Merge branch 'ff/oracle'
Conflicts:
configure.in
Conflicts:
configure.in
contrib/oracle: Add an example schema and SQL statements for the oracle plugin.
create_schema.ddl: Script to create a schema that can be queried by
collectd.
db_systat.sql: Sample SQL statements to be used in the collectd
configuration.
create_schema.ddl: Script to create a schema that can be queried by
collectd.
db_systat.sql: Sample SQL statements to be used in the collectd
configuration.
filecount plugin: Fixed an off-by-one error in the configuration code.
The memory allocated to store the information about configured directories did
not take into account the newly added directory. This would cause a segfault
at some point of time (when specifying more than four directories in my case).
Thanks to Martin Janota <janota.m@cce.cz> for finding and reporting this bug.
The memory allocated to store the information about configured directories did
not take into account the newly added directory. This would cause a segfault
at some point of time (when specifying more than four directories in my case).
Thanks to Martin Janota <janota.m@cce.cz> for finding and reporting this bug.
perl plugin: Fix an uninitialized variable warning.
Resolves: #33
Resolves: #33
src/utils_dns.c: Cast a `char' to `int' when using `tolower'.
This is needed at least on NetBSD, but probably on other non-GNU libcs as well.
Resolves: #32
This is needed at least on NetBSD, but probably on other non-GNU libcs as well.
Resolves: #32
filter_pcre: Added a plugin to filter value lists based on PCRE.
The user may specify a set of Perl-compatible regular expressions to match any
component of the (host, plugin, plugin instance, type, type instance) tuple.
Any of the filter flags may be used to handle a successful match.
Sample plugin configuration:
<Plugin filter_pcre>
<RegEx>
Host "^mail\d+$"
Plugin "^tcpconns$"
TypeInstance "^SYN_"
Action NoWrite
</Plugin>
The user may specify a set of Perl-compatible regular expressions to match any
component of the (host, plugin, plugin instance, type, type instance) tuple.
Any of the filter flags may be used to handle a successful match.
Sample plugin configuration:
<Plugin filter_pcre>
<RegEx>
Host "^mail\d+$"
Plugin "^tcpconns$"
TypeInstance "^SYN_"
Action NoWrite
</Plugin>
libiptc/libip6tc.c: Fix a glibc 2.8 compatibility problem.
Hi,
the attached patch fix the build with glibc 2.8. Please include it in
the next version.
Thanks,
Devid Antonio Filoni
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Hi,
the attached patch fix the build with glibc 2.8. Please include it in
the next version.
Thanks,
Devid Antonio Filoni
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/configfile.c: Fix a closing-brace comment.
filter_ignore plugin: Add a simple plugin to ignore specific identifiers.
Still needs documentation and testing.
Still needs documentation and testing.
ChangeLog: Fix a typo.
ChangeLog: Fix a typo.
Merge branch 'collectd-4.5'
Bumped version to 4.5.1; Updated ChangeLog.
Merge branch 'collectd-4.5'
Merge branch 'collectd-4.4' into collectd-4.5
Conflicts:
ChangeLog
version-gen.sh
Conflicts:
ChangeLog
version-gen.sh
ChangeLog: Added the changed poisoning behavior.
16 years agosrc/collectd.h: Poison various insecure string functions only when debugging is enabled.
src/collectd.h: Poison various insecure string functions only when debugging is enabled.
Because the `poison' pragma complains about macros (which are then never
used), this feature does more harm than good in everyday use. So we'll
only activate it when building in debug mode, so hopefully authors of
new plugins will use this.
Because the `poison' pragma complains about macros (which are then never
used), this feature does more harm than good in everyday use. So we'll
only activate it when building in debug mode, so hopefully authors of
new plugins will use this.
Bumped version to 4.4.4; Updated ChangeLog.
Updated the TODO file.
postgresql plugin: Added another missing call to PQclear().
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
postgresql plugin: Do not open new connections during reinitialization.
When reinitializing the plugin a new connection to all databases has been
opened. Now, we check if the connection already exists. In that case no new
connection will be opened but the existing connection will be pinged instead.
Thanks to Admin <collectd-info@internode.com.au> for finding and reporting
this.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
When reinitializing the plugin a new connection to all databases has been
opened. Now, we check if the connection already exists. In that case no new
connection will be opened but the existing connection will be pinged instead.
Thanks to Admin <collectd-info@internode.com.au> for finding and reporting
this.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
postgresql plugin: Add a couple of PQclear() calls.
The postgresql plugin is missing a couple of PQclear() calls
Thanks to Admin <collectd-info@internode.com.au> for pointing this out.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
The postgresql plugin is missing a couple of PQclear() calls
Thanks to Admin <collectd-info@internode.com.au> for pointing this out.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/plugin.[ch]: Added support for "filter" callbacks.
This type of callback is very similar to write callbacks:
int (*) (const data_set_t *, value_list_t *)
The return value of that callback indicates what further actions are to be
taken. It may be a bitwise OR of any of the following new flags:
FILTER_NOWRITE or FILTER_NOTHRESHOLD_CHECK. If both flags are used (which
equals the flag FILTER_IGNORE), the value list is ignored completely.
If more than one such callback is available, the respective return values are
bitwise OR'ed. If they "sum" up to FILTER_IGNORE, no further callbacks are
executed (lazy evaluation).
This type of callback may be used for the following purposes:
* rewrite information included in the value list (e.g. the instance
name)
* discard certain information on a fine-grained level based on the
information provided by the data set and value list
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This type of callback is very similar to write callbacks:
int (*) (const data_set_t *, value_list_t *)
The return value of that callback indicates what further actions are to be
taken. It may be a bitwise OR of any of the following new flags:
FILTER_NOWRITE or FILTER_NOTHRESHOLD_CHECK. If both flags are used (which
equals the flag FILTER_IGNORE), the value list is ignored completely.
If more than one such callback is available, the respective return values are
bitwise OR'ed. If they "sum" up to FILTER_IGNORE, no further callbacks are
executed (lazy evaluation).
This type of callback may be used for the following purposes:
* rewrite information included in the value list (e.g. the instance
name)
* discard certain information on a fine-grained level based on the
information provided by the data set and value list
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
contrib/exec-munin.px: Fix the folding markers..
src/Makefile.am: Use $mkinstalldirs instead of $(INSTALL) -D.
Some systems (e.g. Solaris 8) do not support the -D option.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Some systems (e.g. Solaris 8) do not support the -D option.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/utils_tail.c: Call `clearerr' before `fgets'.
Hopefully this will resolve problems under the dietlibc.
Hopefully this will resolve problems under the dietlibc.
src/Makefile.am: Fix a copy'n'paste typo.
collectd.conf: Added a sample <Plugin> section in the perl config.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
types.db: Reintroduced the "spam_check" type.
This is used by the "email" plugin. Apparently, it got lost when converting
the plugin to the v4 interface: Instead of "spam_check", "email_check" had
been added to types.db. I did not remove "email_check" though as this would
introduce a regression - though very unlikely, somebody out there might be
using that type.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This is used by the "email" plugin. Apparently, it got lost when converting
the plugin to the v4 interface: Instead of "spam_check", "email_check" had
been added to types.db. I did not remove "email_check" though as this would
introduce a regression - though very unlikely, somebody out there might be
using that type.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collection.cgi: Added support for the "connection" type.
This is used e.g. by the "ipvs" plugin.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This is used e.g. by the "ipvs" plugin.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.5'
Conflicts:
configure.in
Conflicts:
configure.in
Merge branch 'collectd-4.4' into collectd-4.5
src/utils_cache.c: Fix a serious memory leak.
Whenever a data set went missing, the its name (the `key'; up to (5*64)+4
bytes) was not free'd.
Thanks to Niraj Tolia for reporting this :)
Whenever a data set went missing, the its name (the `key'; up to (5*64)+4
bytes) was not free'd.
Thanks to Niraj Tolia for reporting this :)
oracle plugin: Correct the inline documentation.
collectd.conf(5): Added documentation for the "oracle" plugin.
src/configfile.c: Fix a minor memory leak.
Thanks to Niraj Tolia for reporting this :)
Thanks to Niraj Tolia for reporting this :)
network plugin: Fix a minor memory leak.
Thanks to Niraj Tolia for reporting this :)
Thanks to Niraj Tolia for reporting this :)