Code

collectd.git
16 years agoMerge branch 'collectd-4.3'
Florian Forster [Wed, 26 Mar 2008 08:52:25 +0000 (09:52 +0100)]
Merge branch 'collectd-4.3'

Conflicts:

src/unixsock.c

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Wed, 26 Mar 2008 08:48:27 +0000 (09:48 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

Conflicts:

src/unixsock.c

16 years agounixsock plugin: Open two different IO stream handles for reading and writing.
Sebastian Harl [Wed, 26 Mar 2008 08:44:04 +0000 (09:44 +0100)]
unixsock plugin: Open two different IO stream handles for reading and writing.

Full-duplex standard IO streams are not really supported on sockets.
Mixing input and output functions involves calls to lseek(2) which is
not supported on sockets and thus causes the IO operations to fail.
Opening two IO streams solves the problem.

This is a backport of 43df21461d523023951746ef669f1bb95f61366d.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agounixsock plugin: Open two different IO stream handles for reading and writing.
Sebastian Harl [Wed, 26 Mar 2008 08:42:56 +0000 (09:42 +0100)]
unixsock plugin: Open two different IO stream handles for reading and writing.

Full-duplex standard IO streams are not really supported on sockets.
Mixing input and output functions involves calls to lseek(2) which is
not supported on sockets and thus causes the IO operations to fail.
Opening two IO streams solves the problem.

This is a backport of 43df21461d523023951746ef669f1bb95f61366d.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agounixsock plugin: Open two different IO stream handles for reading and writing.
Sebastian Harl [Tue, 25 Mar 2008 18:58:20 +0000 (19:58 +0100)]
unixsock plugin: Open two different IO stream handles for reading and writing.

Full-duplex standard IO streams are not really supported on sockets.
Mixing input and output functions involves calls to lseek(2) which is
not supported on sockets and thus causes the IO operations to fail.
Opening two IO streams solves the problem.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocontrib/cussh.pl: Fixed input line parsing.
Sebastian Harl [Tue, 25 Mar 2008 18:31:37 +0000 (19:31 +0100)]
contrib/cussh.pl: Fixed input line parsing.

The regexes parsing the user input lines have been adopted to take into
account that the newline at the end of the line has been removed.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocontrib/cussh.pl: Added support for LISTVAL.
Sebastian Harl [Tue, 25 Mar 2008 14:59:40 +0000 (15:59 +0100)]
contrib/cussh.pl: Added support for LISTVAL.

Also fixed the following minor problems:
 * the arguments passed to Collectd::Unixsock::putval() have been updated
   to the current version of the Perl module
 * remove newlines from the end of the input line - the unixsock plugin
   currently seems to be buggy when receiving two newlines in a row

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoCollectd::Unixsock: Fixed some typos.
Sebastian Harl [Tue, 25 Mar 2008 14:58:47 +0000 (15:58 +0100)]
Collectd::Unixsock: Fixed some typos.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_{get,put}val.c: Fixed usage of parse_identifier().
Sebastian Harl [Wed, 26 Mar 2008 08:34:14 +0000 (09:34 +0100)]
utils_cmd_{get,put}val.c: Fixed usage of parse_identifier().

This function modifies its first argument which, in these cases, is used
again after the function call. Now, a copy of the string is passed to
parse_identifier().

This is a backport of 0a905cbd3151716c5749b5e7c5e439861466804d.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_{get,put}val.c: Fixed usage of parse_identifier().
Sebastian Harl [Tue, 25 Mar 2008 14:58:15 +0000 (15:58 +0100)]
utils_cmd_{get,put}val.c: Fixed usage of parse_identifier().

This function modifies its first argument which, in these cases, is used
again after the function call. Now, a copy of the string is passed to
parse_identifier().

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_*: Terminate all lines printed to the socket with newline.
Florian Forster [Wed, 26 Mar 2008 08:31:33 +0000 (09:31 +0100)]
utils_cmd_*: Terminate all lines printed to the socket with newline.

This is a backport of 1ca0b79a4274784e4cc15d45e46e2cfa0c2039cf.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_*: Terminate all lines printed to the socket with newline.
Sebastian Harl [Tue, 25 Mar 2008 14:56:59 +0000 (15:56 +0100)]
utils_cmd_*: Terminate all lines printed to the socket with newline.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoDisambiguated the protocol used by the unixsock (and other) plugins.
Sebastian Harl [Wed, 26 Mar 2008 08:28:40 +0000 (09:28 +0100)]
Disambiguated the protocol used by the unixsock (and other) plugins.

As discussed with Florian on IRC, the interpretation of the status line
returned by the unixsock plugin (et.al.) is now strictly specified. A status
greater than or equal to zero indicates success and the number of subsequent
lines of output. A negative status still indicates failure.

This way, frontends can manage the output without having to know any
command-specific interpretation rules.

The GETVAL command has been updated to implement this specification. It now
returns each value on a separate line. collectd-unixsock(5) has been updated
to reflect the changes.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_flush.c: Simplified / improved option parsing.
Sebastian Harl [Tue, 25 Mar 2008 14:53:45 +0000 (15:53 +0100)]
utils_cmd_flush.c: Simplified / improved option parsing.

Instead of parsing all options before doing any work, each option is now
handled right after it has been parsed. This has the following benefits:

 * No need to allocate and construct any data structures.
 * The timeout option may be used multiple times now, only affecting any
   plugins listed after this.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd-unixsock(5): Updated the paragraph about Collectd::Unixsock.
Sebastian Harl [Tue, 25 Mar 2008 14:52:47 +0000 (15:52 +0100)]
collectd-unixsock(5): Updated the paragraph about Collectd::Unixsock.

The module is no longer available in contrib/PerlLib/ but bindings/perl/.
Also it's now installed by default.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoliboconfig/parser.y: Enabled verbose error messages.
Sebastian Harl [Mon, 24 Mar 2008 11:07:20 +0000 (12:07 +0100)]
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>
16 years agoliboconfig: Include the filename in error messages.
Sebastian Harl [Mon, 24 Mar 2008 11:06:49 +0000 (12:06 +0100)]
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>
16 years agoperl plugin: Updated copyright information.
Sebastian Harl [Sat, 22 Mar 2008 16:22:49 +0000 (17:22 +0100)]
perl plugin: Updated copyright information.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd-unixsock(5): Fixed some typos.
Sebastian Harl [Sat, 22 Mar 2008 16:22:19 +0000 (17:22 +0100)]
collectd-unixsock(5): Fixed some typos.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoutils_cmd_flush.c: Terminate all lines printed to the socket with a newline.
Sebastian Harl [Sat, 22 Mar 2008 16:21:45 +0000 (17:21 +0100)]
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>
16 years agocollectd-unixsock(5): Be more specific which time `LISTVAL' returns.
Florian Forster [Mon, 24 Mar 2008 10:36:46 +0000 (11:36 +0100)]
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..

16 years agounixsock plugin: Use `src/utils_cmd_listval.[ch]' and remove the local cache.
Florian Forster [Mon, 24 Mar 2008 10:33:32 +0000 (11:33 +0100)]
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.

16 years agosrc/utils_cmd_listval.[ch]: Added a new module which implements the `LISTVAL' command.
Florian Forster [Mon, 24 Mar 2008 10:29:46 +0000 (11:29 +0100)]
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]'.

16 years agosrc/utils_cache.[ch]: Improved the `uc_get_names' to return the times, too.
Florian Forster [Mon, 24 Mar 2008 10:28:19 +0000 (11:28 +0100)]
src/utils_cache.[ch]: Improved the `uc_get_names' to return the times, too.

16 years agosrc/utils_cache.[ch]: Add `uc_get_names', a function to return all keys in the cache.
Florian Forster [Mon, 24 Mar 2008 09:42:03 +0000 (10:42 +0100)]
src/utils_cache.[ch]: Add `uc_get_names', a function to return all keys in the cache.

16 years agosensors plugin: Print information why a specific feature is ignored in debug mode.
Florian Forster [Sat, 22 Mar 2008 10:14:03 +0000 (11:14 +0100)]
sensors plugin: Print information why a specific feature is ignored in debug mode.

As requested by Ondřej Válek.

16 years agowireless plugin: Fix reading the noise value.
Florian Forster [Sat, 22 Mar 2008 09:45:11 +0000 (10:45 +0100)]
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.

16 years agobuild.sh: Use glibtoolize if it's available.
Sebastian Harl [Sun, 9 Mar 2008 18:59:15 +0000 (19:59 +0100)]
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>
16 years agoconfigure: Do not preset $with_libstatgrab and $with_libdevstat.
Sebastian Harl [Sun, 9 Mar 2008 18:58:24 +0000 (19:58 +0100)]
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>
16 years agocontrib/redhat/collectd.spec: Updated the description of the package.
Florian Forster [Sat, 22 Mar 2008 09:07:34 +0000 (10:07 +0100)]
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.

16 years agocontrib/redhat/: Added a spec file and affiliated config files.
Richard Shade [Sat, 22 Mar 2008 08:55:05 +0000 (09:55 +0100)]
contrib/redhat/: Added a spec file and affiliated config files.

16 years agosrc/utils_cache.c: Fix a bug that was introduced by the preceding merge.
Florian Forster [Sat, 22 Mar 2008 08:45:41 +0000 (09:45 +0100)]
src/utils_cache.c: Fix a bug that was introduced by the preceding merge.

16 years agoMerge branch 'collectd-4.3'
Florian Forster [Sat, 22 Mar 2008 08:41:42 +0000 (09:41 +0100)]
Merge branch 'collectd-4.3'

Conflicts:

src/utils_cache.c

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Sat, 22 Mar 2008 08:40:00 +0000 (09:40 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

16 years agocollectd(1): Document the supported signals.
Sebastian Harl [Tue, 18 Mar 2008 11:35:08 +0000 (12:35 +0100)]
collectd(1): Document the supported signals.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoperl plugin: Fixed the "EnableDebugger after LoadPlugin" warning.
Sebastian Harl [Tue, 18 Mar 2008 11:34:17 +0000 (12:34 +0100)]
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>
16 years agoconfigfile.c: Include more than one files in lexicographical order.
Sebastian Harl [Thu, 20 Mar 2008 12:22:15 +0000 (13:22 +0100)]
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>
16 years agoliboconfig/oconfig.c: Free all allocated memory in oconfig_free().
Sebastian Harl [Thu, 20 Mar 2008 10:03:32 +0000 (11:03 +0100)]
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>
16 years agoconfigfile.c: Abort if any config file could not be read.
Sebastian Harl [Thu, 20 Mar 2008 10:02:06 +0000 (11:02 +0100)]
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>
16 years agoconfigfile.c: Fixed a memory leak in cf_read_generic().
Sebastian Harl [Thu, 20 Mar 2008 10:01:18 +0000 (11:01 +0100)]
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>
16 years agoconfigfile.c: Fixed a segfault after a parse error.
Sebastian Harl [Thu, 20 Mar 2008 10:00:37 +0000 (11:00 +0100)]
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>
16 years agoAUTHORS: Speak about `plugins', not `modules'.
Florian Forster [Sat, 22 Mar 2008 08:27:44 +0000 (09:27 +0100)]
AUTHORS: Speak about `plugins', not `modules'.

Also sorted the plugins and put them all before any other patches.

16 years agoMerge branch 'pull/collectd-4.3' into collectd-4.3
Florian Forster [Tue, 18 Mar 2008 09:19:43 +0000 (10:19 +0100)]
Merge branch 'pull/collectd-4.3' into collectd-4.3

16 years agosrc/utils_{cache,threshold}.c: Fix the concept of failed and missing values.
Florian Forster [Tue, 18 Mar 2008 09:18:11 +0000 (10:18 +0100)]
src/utils_{cache,threshold}.c: Fix the concept of failed and missing values.

Apparently I was confused at the time - and still am ;)

16 years agoMerge branch 'pull/collectd-4.3' into collectd-4.3
Florian Forster [Mon, 17 Mar 2008 09:45:23 +0000 (10:45 +0100)]
Merge branch 'pull/collectd-4.3' into collectd-4.3

16 years agosrc/utils_cache.c: Fix the handling of `Persist'.
Florian Forster [Fri, 14 Mar 2008 13:30:02 +0000 (14:30 +0100)]
src/utils_cache.c: Fix the handling of `Persist'.

And reorganized/cleaned up the code a bit.

16 years agocontrib/rrd_filter.px: Added the ability to add (empty) data sources.
Florian Forster [Thu, 13 Mar 2008 17:19:48 +0000 (18:19 +0100)]
contrib/rrd_filter.px: Added the ability to add (empty) data sources.

16 years agosrc/{mbmon,plugin,unixsock}.c: Simple fixes for Solaris 5.8
Florian Forster [Thu, 13 Mar 2008 17:19:00 +0000 (18:19 +0100)]
src/{mbmon,plugin,unixsock}.c: Simple fixes for Solaris 5.8

16 years agocontrib/rrd_filter.px: Added a scale and shift filter.
Florian Forster [Thu, 13 Mar 2008 11:33:50 +0000 (12:33 +0100)]
contrib/rrd_filter.px: Added a scale and shift filter.

16 years agosrc/utils_threshold.c: Fix the configuration of {Failure,Warning}Max and inverted...
Florian Forster [Wed, 5 Mar 2008 13:15:02 +0000 (14:15 +0100)]
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.

16 years agocontrib/rrd_filter.px: Remove the (unused) Data::Dumper.
Florian Forster [Wed, 5 Mar 2008 09:03:18 +0000 (10:03 +0100)]
contrib/rrd_filter.px: Remove the (unused) Data::Dumper.

16 years agoBumped version to 4.3.1; Updated ChangeLog. collectd-4.3.1
Florian Forster [Wed, 5 Mar 2008 08:44:24 +0000 (09:44 +0100)]
Bumped version to 4.3.1; Updated ChangeLog.

16 years agocontrib/rrd_filter.px: Renamed the old `extractDS.px'.
Florian Forster [Wed, 5 Mar 2008 08:43:21 +0000 (09:43 +0100)]
contrib/rrd_filter.px: Renamed the old `extractDS.px'.

It can do more than extracting DSes now.

16 years agonetwork plugin: Use `sstrncpy' instead of `strncpy'.
Florian Forster [Wed, 5 Mar 2008 08:28:11 +0000 (09:28 +0100)]
network plugin: Use `sstrncpy' instead of `strncpy'.

This removes a few "buf[buflen - 1] = '\0';".

16 years agosrc/common.[ch]: Changed the signature of `sstrncpy' to match that of `strncpy'.
Florian Forster [Wed, 5 Mar 2008 08:27:28 +0000 (09:27 +0100)]
src/common.[ch]: Changed the signature of `sstrncpy' to match that of `strncpy'.

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Wed, 5 Mar 2008 08:16:16 +0000 (09:16 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

Conflicts:

ChangeLog
src/network.c
version-gen.sh

16 years agoBumped version to 4.2.5; Updated ChangeLog. collectd-4.2.5
Florian Forster [Tue, 4 Mar 2008 13:43:40 +0000 (14:43 +0100)]
Bumped version to 4.2.5; Updated ChangeLog.

16 years agoconfigure.in: Fix a typo.
Florian Forster [Tue, 4 Mar 2008 13:36:14 +0000 (14:36 +0100)]
configure.in: Fix a typo.

16 years agonetwork plugin: Tested and fixed the receiving part on Sparc.
Florian Forster [Tue, 4 Mar 2008 13:35:07 +0000 (14:35 +0100)]
network plugin: Tested and fixed the receiving part on Sparc.

16 years agonetwork plugin: Use `memcpy' when parsing packages, too.
Florian Forster [Tue, 4 Mar 2008 10:09:07 +0000 (11:09 +0100)]
network plugin: Use `memcpy' when parsing packages, too.

This should prevent crashes due to unaligned memory access when running as
server.

16 years agoChangeLog: Wrote an entry for 4.2.5.
Florian Forster [Tue, 4 Mar 2008 08:36:42 +0000 (09:36 +0100)]
ChangeLog: Wrote an entry for 4.2.5.

16 years agoMerge branch 'collectd-4.3'
Florian Forster [Thu, 28 Feb 2008 22:06:26 +0000 (23:06 +0100)]
Merge branch 'collectd-4.3'

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Thu, 28 Feb 2008 22:06:16 +0000 (23:06 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

16 years agoCollectd::Unixsock, cussh.pl: Added support for the "flush" command.
Sebastian Harl [Thu, 28 Feb 2008 17:33:06 +0000 (18:33 +0100)]
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>
16 years agosrc/common.c: Use uint8_t's instead of (signed) char's.
Florian Forster [Thu, 28 Feb 2008 18:54:55 +0000 (19:54 +0100)]
src/common.c: Use uint8_t's instead of (signed) char's.

16 years agosrc/common.[ch]: Implemented `htond' and `ntohd' and applied it to the network plugin.
Florian Forster [Thu, 28 Feb 2008 14:15:53 +0000 (15:15 +0100)]
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.

16 years agoconfigure.in: Added checks to find out how doubles are stored.
Florian Forster [Thu, 28 Feb 2008 13:23:27 +0000 (14:23 +0100)]
configure.in: Added checks to find out how doubles are stored.

16 years agosrc/utils_cmd_flush.c: Allow two options: `plugin' and `timeout'
Florian Forster [Wed, 27 Feb 2008 22:22:36 +0000 (23:22 +0100)]
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.

16 years agoMerge branch 'master' of octo@verplant.org:/var/lib/git/collectd
Florian Forster [Wed, 27 Feb 2008 21:50:22 +0000 (22:50 +0100)]
Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd

16 years agocollectd.c: Check for errors in sigaction().
Sebastian Harl [Wed, 27 Feb 2008 20:58:45 +0000 (21:58 +0100)]
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>
16 years agounixsock plugin, utils_cmd_flush: Implemented the "flush" command.
Sebastian Harl [Wed, 27 Feb 2008 20:57:37 +0000 (21:57 +0100)]
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>
16 years agorrdtool plugin: Get the cache lock before checking for a nonexistent cache.
Sebastian Harl [Wed, 27 Feb 2008 20:56:32 +0000 (21:56 +0100)]
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>
16 years agoMerge branch 'collectd-4.3'
Florian Forster [Wed, 27 Feb 2008 14:33:57 +0000 (15:33 +0100)]
Merge branch 'collectd-4.3'

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Wed, 27 Feb 2008 14:33:45 +0000 (15:33 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

16 years agosrc/utils_cache.c: Fix SPARC alignment problems.
Florian Forster [Wed, 27 Feb 2008 11:20:42 +0000 (12:20 +0100)]
src/utils_cache.c: Fix SPARC alignment problems.

16 years agoMerge branch 'pull/master'
Florian octo Forster [Wed, 27 Feb 2008 09:24:03 +0000 (10:24 +0100)]
Merge branch 'pull/master'

16 years agonetwork plugin: Align write access to the send buffer.
Florian octo Forster [Wed, 27 Feb 2008 09:22:19 +0000 (10:22 +0100)]
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.

16 years agosrc/Makefile.am: Added dependencies on `utils_cmd_putnotif.[ch]' to the exec plugin.
Florian Forster [Wed, 27 Feb 2008 09:21:00 +0000 (10:21 +0100)]
src/Makefile.am: Added dependencies on `utils_cmd_putnotif.[ch]' to the exec plugin.

16 years agosrc/utils_cmd_{putnotif,putval}.h: Don't include `plugin.h' without a reason.
Florian Forster [Wed, 27 Feb 2008 09:17:01 +0000 (10:17 +0100)]
src/utils_cmd_{putnotif,putval}.h: Don't include `plugin.h' without a reason.

16 years agosrc/utils_cmd_getval.[ch]: Moved the `getval' command out of the unixsock plugin.
Florian Forster [Wed, 27 Feb 2008 09:16:31 +0000 (10:16 +0100)]
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...
Florian Forster [Wed, 27 Feb 2008 09:08:54 +0000 (10:08 +0100)]
unixsock plugin: us_handle_getval: Changed the function to use the global cache rather than the local one.

16 years agosrc/utils_cache.[ch]: Implemented `uc_get_rate_by_name'.
Florian Forster [Wed, 27 Feb 2008 09:07:57 +0000 (10:07 +0100)]
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.

16 years agonetwork plugin: Add a `flush' callback.
Florian Forster [Wed, 27 Feb 2008 08:29:17 +0000 (09:29 +0100)]
network plugin: Add a `flush' callback.

16 years agosrc/plugin.[ch]: Implemented `plugin_flush_one' which flushes only one specific plugin.
Florian Forster [Wed, 27 Feb 2008 07:33:48 +0000 (08:33 +0100)]
src/plugin.[ch]: Implemented `plugin_flush_one' which flushes only one specific plugin.

16 years agorrdtool plugin: Added a flush callback.
Sebastian Harl [Tue, 26 Feb 2008 17:15:28 +0000 (18:15 +0100)]
rrdtool plugin: Added a flush callback.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd, plugin: Added support for "flush" callbacks.
Sebastian Harl [Tue, 26 Feb 2008 17:12:07 +0000 (18:12 +0100)]
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>
16 years agoMerge branch 'collectd-4.3'
Florian Forster [Wed, 27 Feb 2008 07:10:08 +0000 (08:10 +0100)]
Merge branch 'collectd-4.3'

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Wed, 27 Feb 2008 07:09:18 +0000 (08:09 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

16 years agotcpconns plugin: Fix for compilation under FreeBSD.
Rob Lensen [Wed, 27 Feb 2008 07:04:57 +0000 (08:04 +0100)]
tcpconns plugin: Fix for compilation under FreeBSD.

16 years agosrc/collectd.c: Add the `-t' and `-h' switches to the usage information.
Florian octo Forster [Tue, 26 Feb 2008 11:22:15 +0000 (12:22 +0100)]
src/collectd.c: Add the `-t' and `-h' switches to the usage information.

16 years agorrdtool plugin: Simplified heartbeat calculation
Stefan Völkel [Mon, 25 Feb 2008 19:14:19 +0000 (20:14 +0100)]
rrdtool plugin: Simplified heartbeat calculation

Looks simpler, should do the same.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agohddtemp plugin: Use SCSI_DISK8_MAJOR thru SCSI_DISK15_MAJOR only if available.
Sebastian Harl [Tue, 19 Feb 2008 11:24:53 +0000 (12:24 +0100)]
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>
16 years agosrc/utils_match.[ch]: Pass a list of up to 31 submatches to the callback.
Florian Forster [Mon, 25 Feb 2008 09:34:01 +0000 (10:34 +0100)]
src/utils_match.[ch]: Pass a list of up to 31 submatches to the callback.

16 years agoMerge branch 'collectd-4.3'
Florian Forster [Mon, 25 Feb 2008 07:30:28 +0000 (08:30 +0100)]
Merge branch 'collectd-4.3'

16 years agoMerge branch 'collectd-4.2' into collectd-4.3
Florian Forster [Mon, 25 Feb 2008 07:30:10 +0000 (08:30 +0100)]
Merge branch 'collectd-4.2' into collectd-4.3

16 years agoping plugin: Fixed a typo when setting the TTL.
Sebastian Harl [Sun, 24 Feb 2008 17:25:14 +0000 (18:25 +0100)]
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>
16 years agoexec plugin: Don't pass an invalid egid to setgroups() if no group was given.
Sebastian Harl [Sun, 24 Feb 2008 11:17:24 +0000 (12:17 +0100)]
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>
16 years agoperl plugin: Warn if "EnableDebugger" has been used after "LoadPlugin".
Sebastian Harl [Mon, 25 Feb 2008 07:28:39 +0000 (08:28 +0100)]
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>
16 years agoconfigure.in: Add the `tail' plugin to list of plugins.
Florian Forster [Sun, 24 Feb 2008 16:45:04 +0000 (17:45 +0100)]
configure.in: Add the `tail' plugin to list of plugins.

16 years agoMerge branch 'ff/tail'
Florian Forster [Sun, 24 Feb 2008 14:43:14 +0000 (15:43 +0100)]
Merge branch 'ff/tail'