Merge branch 'collectd-4.3'
Merge branch 'collectd-4.2' into collectd-4.3
liboconfig/parser.y: Enabled verbose error messages.
This uses bison's "%error-verbose" option which might not be available in
other yacc implementations.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This uses bison's "%error-verbose" option which might not be available in
other yacc implementations.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
liboconfig: Include the filename in error messages.
As collectd now supports more than one config file, this is more
convenient.
A module-global variable is used for that purpose. If no filename is
available (e.g. if the user uses oconfig_parse_fh() directly), a string
like "<fd#X>" is used instead, where X is replaced by the file descriptor.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
As collectd now supports more than one config file, this is more
convenient.
A module-global variable is used for that purpose. If no filename is
available (e.g. if the user uses oconfig_parse_fh() directly), a string
like "<fd#X>" is used instead, where X is replaced by the file descriptor.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl plugin: Updated copyright information.
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>
collectd-unixsock(5): Fixed some typos.
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>
utils_cmd_flush.c: Terminate all lines printed to the socket with a newline.
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>
collectd-unixsock(5): Be more specific which time `LISTVAL' returns.
The timestamp of the last value and the time at which the last value was
received may differ..
The timestamp of the last value and the time at which the last value was
received may differ..
unixsock plugin: Use `src/utils_cmd_listval.[ch]' and remove the local cache.
Since no command uses the cache in the unixsock plugin anymore, it can be
removed. The implementation in `src/utils_cache.[ch]' is now used for all
commands, and all commands are in separate modules. This should be a
performance gain, since the implementation of unixsock used a linked list,
which is much slower than the AVL tree used in the global cache.
Also this resolves a nasty bug: The unixsock plugin used to use the _local_
interval setting when removing values from the cache. The global cache uses the
interval setting of the values themselves, to that mixing different intervals
in a big setup is now compatible with the `listval' and other commands.
Since no command uses the cache in the unixsock plugin anymore, it can be
removed. The implementation in `src/utils_cache.[ch]' is now used for all
commands, and all commands are in separate modules. This should be a
performance gain, since the implementation of unixsock used a linked list,
which is much slower than the AVL tree used in the global cache.
Also this resolves a nasty bug: The unixsock plugin used to use the _local_
interval setting when removing values from the cache. The global cache uses the
interval setting of the values themselves, to that mixing different intervals
in a big setup is now compatible with the `listval' and other commands.
src/utils_cmd_listval.[ch]: Added a new module which implements the `LISTVAL' command.
It's done using the global cache implemented in `src/utils_cache.[ch]'.
It's done using the global cache implemented in `src/utils_cache.[ch]'.
src/utils_cache.[ch]: Improved the `uc_get_names' to return the times, too.
src/utils_cache.[ch]: Add `uc_get_names', a function to return all keys in the cache.
sensors plugin: Print information why a specific feature is ignored in debug mode.
As requested by Ondřej Válek.
As requested by Ondřej Válek.
wireless plugin: Fix reading the noise value.
Accidentally the wrong value was used as `noise'. This patch fixes it.
Thanks to Ondřej Válek for pointing this out.
Accidentally the wrong value was used as `noise'. This patch fixes it.
Thanks to Ondřej Válek for pointing this out.
build.sh: Use glibtoolize if it's available.
This way, the script should work on e.g. MacOSX as well.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This way, the script should work on e.g. MacOSX as well.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configure: Do not preset $with_libstatgrab and $with_libdevstat.
Those variables are set when parsing the command line options and evaluated
inside the AC_ARG_WITH() macro. Presetting them overwrites any command line
options.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Those variables are set when parsing the command line options and evaluated
inside the AC_ARG_WITH() macro. Presetting them overwrites any command line
options.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
contrib/redhat/collectd.spec: Updated the description of the package.
Also updated the packager and vendor fields and added the redhat/ subdirectory
to contrib/README.
Also updated the packager and vendor fields and added the redhat/ subdirectory
to contrib/README.
contrib/redhat/: Added a spec file and affiliated config files.
src/utils_cache.c: Fix a bug that was introduced by the preceding merge.
Merge branch 'collectd-4.3'
Conflicts:
src/utils_cache.c
Conflicts:
src/utils_cache.c
Merge branch 'collectd-4.2' into collectd-4.3
collectd(1): Document the supported signals.
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>
perl plugin: Fixed the "EnableDebugger after LoadPlugin" warning.
For some strange reason my original patch (perl plugin: Warn if
"EnableDebugger" has been used after "LoadPlugin".) has been applied at the
wrong position (it has been applied to perl_config_includedir() instead of
perl_config_enabledebugger() - I have absolutely no clue why though).
Also, the check for the precondition of this warning has been fixed. In some
cases aTHX does not seem to be set, even though the Perl interpreter has
already been initialized. Now, perl_threads is used to check for that
condition.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
For some strange reason my original patch (perl plugin: Warn if
"EnableDebugger" has been used after "LoadPlugin".) has been applied at the
wrong position (it has been applied to perl_config_includedir() instead of
perl_config_enabledebugger() - I have absolutely no clue why though).
Also, the check for the precondition of this warning has been fixed. In some
cases aTHX does not seem to be set, even though the Perl interpreter has
already been initialized. Now, perl_threads is used to check for that
condition.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configfile.c: Include more than one files in lexicographical order.
Using qsort() and strcmp() the list of files (after reading the contents
of a directory or expanding globs) is sorted before inclusion. As the
order of options in the config file matters this is more convenient.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Using qsort() and strcmp() the list of files (after reading the contents
of a directory or expanding globs) is sorted before inclusion. As the
order of options in the config file matters this is more convenient.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
liboconfig/oconfig.c: Free all allocated memory in oconfig_free().
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>
configfile.c: Abort if any config file could not be read.
So far, when including all files from some directory, errors while reading
any of those config files have been reported but otherwise ignored. So,
collectd would run with some potentially incomplete configuration which is
not what I would expect.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
So far, when including all files from some directory, errors while reading
any of those config files have been reported but otherwise ignored. So,
collectd would run with some potentially incomplete configuration which is
not what I would expect.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configfile.c: Fixed a memory leak in cf_read_generic().
In case stat(2) failed, the memory allocated for the return value has not
been freed.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
In case stat(2) failed, the memory allocated for the return value has not
been freed.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configfile.c: Fixed a segfault after a parse error.
In cf_read_generic(), the parse result had not been checked to not be
NULL, which caused a segfault when trying to access any of its members.
Now, an error will be returned in that case.
Also, cf_ci_append_children() has been made more robust in that respect.
It now detects an empty source and does nothing in that case.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
In cf_read_generic(), the parse result had not been checked to not be
NULL, which caused a segfault when trying to access any of its members.
Now, an error will be returned in that case.
Also, cf_ci_append_children() has been made more robust in that respect.
It now detects an empty source and does nothing in that case.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
AUTHORS: Speak about `plugins', not `modules'.
Also sorted the plugins and put them all before any other patches.
Also sorted the plugins and put them all before any other patches.
Merge branch 'pull/collectd-4.3' into collectd-4.3
src/utils_{cache,threshold}.c: Fix the concept of failed and missing values.
Apparently I was confused at the time - and still am ;)
Apparently I was confused at the time - and still am ;)
Merge branch 'pull/collectd-4.3' into collectd-4.3
src/utils_cache.c: Fix the handling of `Persist'.
And reorganized/cleaned up the code a bit.
And reorganized/cleaned up the code a bit.
contrib/rrd_filter.px: Added the ability to add (empty) data sources.
src/{mbmon,plugin,unixsock}.c: Simple fixes for Solaris 5.8
contrib/rrd_filter.px: Added a scale and shift filter.
src/utils_threshold.c: Fix the configuration of {Failure,Warning}Max and inverted checking.
The first issue is a simple copy'n'paste error, the second a nasty oversight.
The first issue is a simple copy'n'paste error, the second a nasty oversight.
contrib/rrd_filter.px: Remove the (unused) Data::Dumper.
Bumped version to 4.3.1; Updated ChangeLog.
contrib/rrd_filter.px: Renamed the old `extractDS.px'.
It can do more than extracting DSes now.
It can do more than extracting DSes now.
network plugin: Use `sstrncpy' instead of `strncpy'.
This removes a few "buf[buflen - 1] = '\0';".
This removes a few "buf[buflen - 1] = '\0';".
src/common.[ch]: Changed the signature of `sstrncpy' to match that of `strncpy'.
Merge branch 'collectd-4.2' into collectd-4.3
Conflicts:
ChangeLog
src/network.c
version-gen.sh
Conflicts:
ChangeLog
src/network.c
version-gen.sh
Bumped version to 4.2.5; Updated ChangeLog.
configure.in: Fix a typo.
network plugin: Tested and fixed the receiving part on Sparc.
network plugin: Use `memcpy' when parsing packages, too.
This should prevent crashes due to unaligned memory access when running as
server.
This should prevent crashes due to unaligned memory access when running as
server.
ChangeLog: Wrote an entry for 4.2.5.
Merge branch 'collectd-4.3'
Merge branch 'collectd-4.2' into collectd-4.3
Collectd::Unixsock, cussh.pl: Added support for the "flush" command.
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>
src/common.c: Use uint8_t's instead of (signed) char's.
src/common.[ch]: Implemented `htond' and `ntohd' and applied it to the network plugin.
The functions convert doubles to the x86 representation or from the x86
representation to the representation used on the host. On x86 systems, this is
a NOP.
The functions convert doubles to the x86 representation or from the x86
representation to the representation used on the host. On x86 systems, this is
a NOP.
configure.in: Added checks to find out how doubles are stored.
src/utils_cmd_flush.c: Allow two options: `plugin' and `timeout'
Both options are optional. The meaning of `timeout' is the same, but must now
be prepended with `timeout='. The new `plugin=' option allows the user to
select only specific plugins to flush.
Both options are optional. The meaning of `timeout' is the same, but must now
be prepended with `timeout='. The new `plugin=' option allows the user to
select only specific plugins to flush.
Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
collectd.c: Check for errors in sigaction().
Terminate collectd if sigaction() fails which should not happen anyway.
While I was at it, I renamed the signal handler functions and the sigaction
structs to follow the coding style used everywhere else in collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Terminate collectd if sigaction() fails which should not happen anyway.
While I was at it, I renamed the signal handler functions and the sigaction
structs to follow the coding style used everywhere else in collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
unixsock plugin, utils_cmd_flush: Implemented the "flush" command.
This command flushes all cached data using plugin_flush_all(). An optional
timeout may be specified as an argument.
A new module "utils_cmd_flush" has been added for this purpose.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This command flushes all cached data using plugin_flush_all(). An optional
timeout may be specified as an argument.
A new module "utils_cmd_flush" has been added for this purpose.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
rrdtool plugin: Get the cache lock before checking for a nonexistent cache.
This should not make any difference, but, in theory, this is a semantical
error, so, let's just fix it :-)
Thanks to Stefan Völkel for pointing this out.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This should not make any difference, but, in theory, this is a semantical
error, so, let's just fix it :-)
Thanks to Stefan Völkel for pointing this out.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.3'
Merge branch 'collectd-4.2' into collectd-4.3
src/utils_cache.c: Fix SPARC alignment problems.
Merge branch 'pull/master'
network plugin: Align write access to the send buffer.
SPARC and possibly other architectures cannot access arbitrary memory
locations. This caused a `bus error' on SPARC when the network plugin was
loaded. This change hopefully fixes this problem.
SPARC and possibly other architectures cannot access arbitrary memory
locations. This caused a `bus error' on SPARC when the network plugin was
loaded. This change hopefully fixes this problem.
src/Makefile.am: Added dependencies on `utils_cmd_putnotif.[ch]' to the exec plugin.
src/utils_cmd_{putnotif,putval}.h: Don't include `plugin.h' without a reason.
src/utils_cmd_getval.[ch]: Moved the `getval' command out of the unixsock plugin.
16 years agounixsock plugin: us_handle_getval: Changed the function to use the global cache rathe...
unixsock plugin: us_handle_getval: Changed the function to use the global cache rather than the local one.
src/utils_cache.[ch]: Implemented `uc_get_rate_by_name'.
This functions allows to get values from the cache without creating a
`value_list_t' and `data_set_t' first. The existing function `uc_get_rate' has
been changed to use this function, too.
This functions allows to get values from the cache without creating a
`value_list_t' and `data_set_t' first. The existing function `uc_get_rate' has
been changed to use this function, too.
network plugin: Add a `flush' callback.
src/plugin.[ch]: Implemented `plugin_flush_one' which flushes only one specific plugin.
rrdtool plugin: Added a flush callback.
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>
collectd, plugin: Added support for "flush" callbacks.
A flush callback may be provided to make it possible to flush internal caches
(e.g. the rrdtool plugin's data cache) from outside the plugin. On SIGUSR1,
flush callback is invoked for all plugins. As flushing large amounts of data
might take some time a new thread is started to handle the request
asynchronously.
Thanks to Stefan Völkel for proposing this.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
A flush callback may be provided to make it possible to flush internal caches
(e.g. the rrdtool plugin's data cache) from outside the plugin. On SIGUSR1,
flush callback is invoked for all plugins. As flushing large amounts of data
might take some time a new thread is started to handle the request
asynchronously.
Thanks to Stefan Völkel for proposing this.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.3'
Merge branch 'collectd-4.2' into collectd-4.3
tcpconns plugin: Fix for compilation under FreeBSD.
src/collectd.c: Add the `-t' and `-h' switches to the usage information.
rrdtool plugin: Simplified heartbeat calculation
Looks simpler, should do the same.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Looks simpler, should do the same.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
hddtemp plugin: Use SCSI_DISK8_MAJOR thru SCSI_DISK15_MAJOR only if available.
Some Linux versions don't seem to provide the major numbers 8 thru 15.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Some Linux versions don't seem to provide the major numbers 8 thru 15.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/utils_match.[ch]: Pass a list of up to 31 submatches to the callback.
Merge branch 'collectd-4.3'
Merge branch 'collectd-4.2' into collectd-4.3
ping plugin: Fixed a typo when setting the TTL.
PING_DEF_TIMEOUT used to be used instead of PING_OPT_TTL as option
argument of ping_setopt(). This caused really strange effects when pinging
hosts, like a failed assertion in ping_timeval_sub() in liboping
indicating a latency <= 0.
Thanks to Romain Francoise for pointing this out and a lot of helpful
debugging information.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
PING_DEF_TIMEOUT used to be used instead of PING_OPT_TTL as option
argument of ping_setopt(). This caused really strange effects when pinging
hosts, like a failed assertion in ping_timeval_sub() in liboping
indicating a latency <= 0.
Thanks to Romain Francoise for pointing this out and a lot of helpful
debugging information.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
exec plugin: Don't pass an invalid egid to setgroups() if no group was given.
In case that no group has been specified in the config file, egid = -1 used to
be passed to setgroups() which, obviously, is not what we want.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
In case that no group has been specified in the config file, egid = -1 used to
be passed to setgroups() which, obviously, is not what we want.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl plugin: Warn if "EnableDebugger" has been used after "LoadPlugin".
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>
configure.in: Add the `tail' plugin to list of plugins.
Merge branch 'ff/tail'
src/types_list.c: Removed annoying debug messages.
src/utils_match.c: Added a debug message to print the received regex.
Escapes in the configfile made it interesting what string actually arrives at
the plugin.
Escapes in the configfile made it interesting what string actually arrives at
the plugin.
src/utils_tail_match.c: Submit NAN if type if gauge and no values were matched.
tail plugin: Fix a typo in the name of the config keys.
tail plugin: Add a plugin to tail and parse logfiles.
Renamed: src/utils_logtail.[ch] -> src/utils_tail_match.[ch]
src/utils_match.[ch]: Improved the handling of gauge values.
They can not use the consolidation functions `AVERAGE', `MIN', `MAX' and `LAST'
just as you know them from RRDTool.
They can not use the consolidation functions `AVERAGE', `MIN', `MAX' and `LAST'
just as you know them from RRDTool.
Merge branch 'ff/tail'
src/utils_match.c: Actually set `ds_type' in the object.
Also use the sub-match, not the overall match.
Also use the sub-match, not the overall match.
src/utils_logtail.c: Added another error message.
src/utils_tail.c: Added more error messages.
src/utils_logtail.h: Completed the documentation.
16 years agosrc/utils_logtail.[ch]: Implement a module that parses logfiles using the `utils_tail...
src/utils_logtail.[ch]: Implement a module that parses logfiles using the `utils_tail' and `utils_match' modules.