Code

collectd.git
16 years agoperl plugin: Pass on identifiers to Perl flush callbacks.
Sebastian Harl [Thu, 21 Aug 2008 08:47:18 +0000 (10:47 +0200)]
perl plugin: Pass on identifiers to Perl flush callbacks.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd-perl(5): Added a note about the stability of the API.
Sebastian Harl [Thu, 21 Aug 2008 08:46:36 +0000 (10:46 +0200)]
collectd-perl(5): Added a note about the stability of the API.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoperl plugin, Collectd.pm: Added support for flushing of specific identifiers.
Sebastian Harl [Thu, 21 Aug 2008 08:45:43 +0000 (10:45 +0200)]
perl plugin, Collectd.pm: Added support for flushing of specific identifiers.

plugin_flush() now accepts three parameters, 'timeout', 'plugins' and
'identifiers'. The meaning of the former two did not change. 'identifiers' may
be a string or an array of strings specifying identifiers that are to be
passed along to the plugins' flush callbacks. This brings the Perl API in sync
with the C API.

plugin_flush_one() and plugin_flush_all() have been re-implemented in plain
Perl and marked as deprecated. A new XSUB, Collectd::_plugin_flush, has been
added which provides a small wrapper around the C implementation of
plugin_flush().

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agosrc/utils_parse_option.c: Check for the terminating null-byte, too.
Florian Forster [Thu, 21 Aug 2008 07:38:18 +0000 (09:38 +0200)]
src/utils_parse_option.c: Check for the terminating null-byte, too.

I was so focused on values with spaces, that I forgot to test trivial
cases :/

16 years agounixsock plugin et alii: Allow passing of arbitrary identifiers to the FLUSH command.
Florian Forster [Thu, 21 Aug 2008 07:26:21 +0000 (09:26 +0200)]
unixsock plugin et alii: Allow passing of arbitrary identifiers to the FLUSH command.

Due to a bug in the parsing of the FLUSH command, identifiers which
contained spaces would not be accepted. This patch introduces
src/utils_parse_option.[ch], which strips off an option in the form of
name="value" from the beginning of a buffer (removing leading and
trailing spaces) and returns the values found.

The Collectd::Unixsock module is updated to automatically quote
identifiers when necessary.

Many other commands may be effected by this bug, too. They'll be fixed
soon.

16 years agosrc/plugin.c: Reduced `plugin_flush_one' to a tiny legacy function.
Florian Forster [Wed, 20 Aug 2008 10:16:39 +0000 (12:16 +0200)]
src/plugin.c: Reduced `plugin_flush_one' to a tiny legacy function.

16 years agosrc/plugin.c: Pass a second argument to the `flush' callbacks.
Florian Forster [Wed, 20 Aug 2008 10:06:25 +0000 (12:06 +0200)]
src/plugin.c: Pass a second argument to the `flush' callbacks.

The flush callbacks not take two parameters, this was forgotten here.

16 years agosrc/plugin.c: Fix an endless loop in `plugin_flush'.
Florian Forster [Wed, 20 Aug 2008 10:01:50 +0000 (12:01 +0200)]
src/plugin.c: Fix an endless loop in `plugin_flush'.

Since this function is most often called from the unixsock plugin,
which creates a separate thread for handling connections, this did
not effect the rest of the daemon and was kind of tricky to track
down. :/ What a stupid mistake :(

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Wed, 20 Aug 2008 07:21:37 +0000 (09:21 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

src/collectd.conf.pod

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Wed, 20 Aug 2008 07:20:56 +0000 (09:20 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

16 years agomemcached plugin: Fix a possible file descriptor leak.
Florian Forster [Tue, 19 Aug 2008 19:48:45 +0000 (21:48 +0200)]
memcached plugin: Fix a possible file descriptor leak.

Not sure if this fixes the reported bug, but it might.. Feedback would be
welcome.

References: #26

16 years agocontrib/collection3: Added graph description for `ps_rss'.
Florian Forster [Tue, 19 Aug 2008 15:18:57 +0000 (17:18 +0200)]
contrib/collection3: Added graph description for `ps_rss'.

16 years agocontrib/collection3: Added the ability to `flush' data sets.
Florian Forster [Tue, 19 Aug 2008 14:58:43 +0000 (16:58 +0200)]
contrib/collection3: Added the ability to `flush' data sets.

Both, bin/index.cgi and bin/graph.cgi can now send a FLUSH command to
the daemon via the Collectd::Unixsock module. For this to work you will
have to add the path to the UNIX socket of the `unixsock' plugin to the
configuration file `collection.conf'.

The configuration looks like this:
  UnixSockAddr "/var/run/collectd-unixsock"

16 years agocontrib/collection3: Remove an annoying debug message.
Florian Forster [Tue, 19 Aug 2008 14:54:10 +0000 (16:54 +0200)]
contrib/collection3: Remove an annoying debug message.

16 years agoMerge branch 'ph/ipmi'
Florian Forster [Tue, 19 Aug 2008 09:19:08 +0000 (11:19 +0200)]
Merge branch 'ph/ipmi'

16 years agoAUTHORS, ipmi plugin: Added Peter Holik as copyright holder.
Florian Forster [Tue, 19 Aug 2008 09:16:24 +0000 (11:16 +0200)]
AUTHORS, ipmi plugin: Added Peter Holik as copyright holder.

16 years agocollectd.conf(5): Added documentation for the ipmi plugin.
Peter Holik [Tue, 19 Aug 2008 09:11:02 +0000 (11:11 +0200)]
collectd.conf(5): Added documentation for the ipmi plugin.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd.conf(5): Added documentation for the ipmi plugin.
Peter Holik [Tue, 19 Aug 2008 09:08:53 +0000 (11:08 +0200)]
collectd.conf(5): Added documentation for the ipmi plugin.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoipmi plugin: Send notifications upon `not present' sensors.
Peter Holik [Tue, 19 Aug 2008 09:02:23 +0000 (11:02 +0200)]
ipmi plugin: Send notifications upon `not present' sensors.

This may be an unplugged power supply, for example. With the
`NotifySensorNotPresent' the plugin can be configured to create a notification
in this case.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoipmi plugin: Send notifications upon added/removed sensors.
Peter Holik [Tue, 19 Aug 2008 08:50:48 +0000 (10:50 +0200)]
ipmi plugin: Send notifications upon added/removed sensors.

It's enabled using the two new configuration options:
 * NotifySensorAdd
   A notification is produced when a sensor is removed. During the first
   minute, i. e. while the plugin is scanning for sensors, this is disabled.
 * NotifySensorRemove
   If a sensor got removed a notification is produced.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoipmi plugin: Rename IPMI sensors so names are unique.
Peter Holik [Tue, 19 Aug 2008 08:46:44 +0000 (10:46 +0200)]
ipmi plugin: Rename IPMI sensors so names are unique.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Added support for protocol versions less than 3.
Sebastian Harl [Sun, 17 Aug 2008 12:11:13 +0000 (14:11 +0200)]
postgresql plugin: Added support for protocol versions less than 3.

Support for passing parameters to a query was added in protocol version 3
which was introduced in version 7.4 of PostgreSQL (later version still support
earlier protocol versions though). If that is not available, we now fall back
to PQexec() if no parameters have been specified. Else, we skip the query and
report an error.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Fixed determination of 'max_params_num'.
Sebastian Harl [Sun, 17 Aug 2008 12:10:29 +0000 (14:10 +0200)]
postgresql plugin: Fixed determination of 'max_params_num'.

When adding the default queries to a database definition, 'max_params_num' has
not been updated at all, resulting in a failed assertion during query
execution. This is now fixed by splitting the common code for adding a query
definition to a database definition into a new function and using that
function where appropriate.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Added "disk_usage" query.
Sebastian Harl [Sat, 16 Aug 2008 17:40:09 +0000 (19:40 +0200)]
postgresql plugin: Added "disk_usage" query.

This is a new default query which collects the on-disk size of a database in
bytes. A new type "pg_db_size" has been added to types.db for this purpose.

The documentation in collectd.conf(5) and collection.cgi have been updated to
reflect this change.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql_default.conf, postgresql plugin: Split default queries by category.
Sebastian Harl [Sat, 16 Aug 2008 17:39:10 +0000 (19:39 +0200)]
postgresql_default.conf, postgresql plugin: Split default queries by category.

The default queries have been split as follows:

 | old            | new                                |
 +----------------+------------------------------------+
 | database       | backends, transactions             |
 | user_tables    | queries, query_plans, table_states |
 | io_user_tables | disk_io                            |

This allows for a more fine-grained control over which statistics are to be
collected.

The documentation and default queries definition have been updated to reflect
this change.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agosrc/common.h: Make sfree() usable like a function.
Sebastian Harl [Mon, 18 Aug 2008 07:30:03 +0000 (09:30 +0200)]
src/common.h: Make sfree() usable like a function.

By putting the code into a "do { } while (0)" loop it is treated like a single
statement and does not break "if () sfree()" like constructs.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agosrc/Makefile.am: Check for POD errors in the generated manpages.
Sebastian Harl [Sat, 16 Aug 2008 17:37:16 +0000 (19:37 +0200)]
src/Makefile.am: Check for POD errors in the generated manpages.

If any of the generated manpages includes the string '\<POD ERRORS\>' the
build aborts with an error message. If pod2man finds any errors it adds a
section with that name to the output.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd(1), collectd{-exec,.conf}(5): Fixed some minor POD errors.
Sebastian Harl [Sat, 16 Aug 2008 17:35:58 +0000 (19:35 +0200)]
collectd(1), collectd{-exec,.conf}(5): Fixed some minor POD errors.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agobuild system: Automatically enable the processes and tcpconns plugins.
Florian Forster [Tue, 19 Aug 2008 07:47:46 +0000 (09:47 +0200)]
build system: Automatically enable the processes and tcpconns plugins.

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 19 Aug 2008 07:46:34 +0000 (09:46 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

configure.in

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 19 Aug 2008 07:45:35 +0000 (09:45 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

16 years agobuild system: Automatically enable the swap plugin if the kvm library is found.
Florian Forster [Tue, 19 Aug 2008 07:44:56 +0000 (09:44 +0200)]
build system: Automatically enable the swap plugin if the kvm library is found.

This fixes a bug introduced with the previous commit.

16 years agobuild system: Check for `kvm_nlist'.
Florian Forster [Tue, 19 Aug 2008 07:42:15 +0000 (09:42 +0200)]
build system: Check for `kvm_nlist'.

Build the tcpconns plugin if it exists.

16 years agoMerge branch 'ms/tcpconns'
Florian Forster [Tue, 19 Aug 2008 07:35:07 +0000 (09:35 +0200)]
Merge branch 'ms/tcpconns'

16 years agobuild system: Check for `kvm_getprocs'.
Florian Forster [Tue, 19 Aug 2008 07:34:08 +0000 (09:34 +0200)]
build system: Check for `kvm_getprocs'.

Link the processes plugin with the `kvm' library if it provides this symbol.

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 19 Aug 2008 07:27:14 +0000 (09:27 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

src/tcpconns.c

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 19 Aug 2008 07:26:13 +0000 (09:26 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

16 years agoMerge branch 'collectd-4.3' of /var/lib/git/collectd into collectd-4.3
Florian Forster [Tue, 19 Aug 2008 07:25:46 +0000 (09:25 +0200)]
Merge branch 'collectd-4.3' of /var/lib/git/collectd into collectd-4.3

16 years agobuild system: Define which version of libkvm has been checked for.
Florian Forster [Tue, 19 Aug 2008 07:24:33 +0000 (09:24 +0200)]
build system: Define which version of libkvm has been checked for.

The used `kvm_getswapinfo' is apparently an extension not all versions of the
kvm library support.

16 years agotcpconns plugin: Removed legacy variables.
Florian Forster [Tue, 19 Aug 2008 05:42:07 +0000 (07:42 +0200)]
tcpconns plugin: Removed legacy variables.

`off' was forgotten and the global `nl' was already commented out.

16 years agotcpconns plugin: Fix another format string.
Florian Forster [Mon, 18 Aug 2008 16:19:26 +0000 (18:19 +0200)]
tcpconns plugin: Fix another format string.

16 years agotcpconns plugin: Various fixes for OpenBSD.
Florian Forster [Mon, 18 Aug 2008 15:44:16 +0000 (17:44 +0200)]
tcpconns plugin: Various fixes for OpenBSD.

- Renamed the TCP states to be the same as used with other operating systems.
- Improved and added error messages.
- Stripped down the `struct nlist'.
- Cleaned up `conn_read'.
- Support for IPv6 sockets has been improved: Not connected IPv6 sockets are
  now ignored, too. No idea what the remote-port previously would have been.

16 years agoAUTHORS: Added Michael Stapelberg.
Florian Forster [Mon, 18 Aug 2008 14:24:22 +0000 (16:24 +0200)]
AUTHORS: Added Michael Stapelberg.

16 years agobuild system: Added OpenBSD specific behavior for the tcpconns plugin.
Florian Forster [Mon, 18 Aug 2008 14:16:28 +0000 (16:16 +0200)]
build system: Added OpenBSD specific behavior for the tcpconns plugin.

16 years agotcpconns plugin: Add compatibility for OpenBSD.
Michael Stapelberg [Sat, 9 Aug 2008 12:42:07 +0000 (14:42 +0200)]
tcpconns plugin: Add compatibility for OpenBSD.

Hi there,

I've just integrated OpenBSD-support into the tcpconns module. Please test this
thouroughly, it's not running for so long on my box (but works fine).

Also, please add -lkvm to the right place in the autoconf-stuff so that when
using tcpconns on OpenBSD, libkvm is linked.

Also, I'm not sure about how much of the license we need to embed. I'll
therefore post the full license information so you can put it in if you feel
like:

/*      $collectd: parts of tcpconns.c, 2008/08/08 03:48:30 Michael Stapelberg $ */
/*      $OpenBSD: inet.c,v 1.100 2007/06/19 05:28:30 ray Exp $  */
/*      $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $        */

/*
 * Copyright (c) 1983, 1988, 1993
 *      The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

Best regards,
Michael

16 years agotcpconns plugin: Fix formatstrings.
Florian Forster [Mon, 18 Aug 2008 14:18:41 +0000 (16:18 +0200)]
tcpconns plugin: Fix formatstrings.

16 years agosnmp plugin: Fix a possible memory leak.
Florian Forster [Mon, 18 Aug 2008 08:48:21 +0000 (10:48 +0200)]
snmp plugin: Fix a possible memory leak.

The result was not freed when `csnmp_instance_list_add' failed. This
rarely happens in 4.3, but later versions will be more strict in the
function, so this became a problem.

16 years agocontrib/collection3: Added a couple more graph definitions.
Florian Forster [Wed, 13 Aug 2008 09:45:45 +0000 (11:45 +0200)]
contrib/collection3: Added a couple more graph definitions.

16 years agocontrib/collection3: Added the forgotten Collectd::Graph::Config module.
Florian Forster [Wed, 13 Aug 2008 07:48:50 +0000 (09:48 +0200)]
contrib/collection3: Added the forgotten Collectd::Graph::Config module.

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 12 Aug 2008 09:31:40 +0000 (11:31 +0200)]
Merge branch 'collectd-4.4'

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 12 Aug 2008 09:31:26 +0000 (11:31 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

16 years agosnmp plugin: Issue an error if an instance name is empty.
Florian Forster [Tue, 12 Aug 2008 09:30:07 +0000 (11:30 +0200)]
snmp plugin: Issue an error if an instance name is empty.

16 years agosrc/utils_threshold.c: Free allocated memory before returning..
Peter Holik [Tue, 12 Aug 2008 09:04:27 +0000 (11:04 +0200)]
src/utils_threshold.c: Free allocated memory before returning..

..in an error condition.

16 years agomemory plugin: The variable is named cache, not cached, at least on libstatgrab ...
Michael Stapelberg [Sat, 9 Aug 2008 12:42:24 +0000 (14:42 +0200)]
memory plugin: The variable is named cache, not cached, at least on libstatgrab >= 0.16

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoconfigure.in: Look for ip_vs.h in the kernel sources.
Boian Berberov [Mon, 11 Aug 2008 14:57:57 +0000 (16:57 +0200)]
configure.in: Look for ip_vs.h in the kernel sources.

Developers,

I am writing an updated ebuild for gentoo and I made this patch that allows
ip_vs.h to be located and the ipvs module to build. Normally I would include
this with the ebuild, but I thought it may be beneficial to send it to you.
Please review it and let me know what you think. I am still inexperienced with
autotools so the patch may not be well put together. If you would consider
applying it or a similar patch, please let me know so I can adjust the ebuild
accordingly.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agobindings/perl/Collectd.pm: Improved the way access to @plugins is synchronized.
Sebastian Harl [Fri, 1 Aug 2008 22:50:18 +0000 (00:50 +0200)]
bindings/perl/Collectd.pm: Improved the way access to @plugins is synchronized.

So far, a lock has been placed on @plugins, so that no two threads could
access the list of plugins simultaneously. This could cause problems which in
certain situations could even lead to deadlocks. E.g. when using the perl
plugin in combination with the rrdtool plugin with debugging enabled one would
get hit by the following situation: the perl plugin holds the lock on @plugins
and then dispatches values to the rrdtool plugin from some Perl plugin's read
function. The rrdtool plugin then tries to acquire its cache lock. At the same
time some other plugin dispatches values to the rrdtool plugin as well and
this thread now holds the lock on the rrdtool cache. While holding that lock,
the rrdtool plugin might dispatch a debug logging message and thus calls the
perl plugin's log-callback which tries to get the lock on @plugins thus
causing a deadlock.

This has been resolved by the following two changes:

 * Restrict the lock to the list of plugins of one type. This allows to access
   e.g. read and log plugins in parallel.

 * Unlock the variable before calling the Perl callback function. This
   further prevents nested locks.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocontrib/collection3: Add JavaScript code to unify the timespan of all graphs.
Florian Forster [Mon, 28 Jul 2008 09:06:51 +0000 (11:06 +0200)]
contrib/collection3: Add JavaScript code to unify the timespan of all graphs.

Using the new ``Set all images to this timespan'' button one can now easily
show the same timespan in all graphs. This allows to compare different graphs
much more easily.

16 years agocontrib/collection3: Update `json.cgi' to use the new config parsing function.
Florian Forster [Mon, 28 Jul 2008 09:05:39 +0000 (11:05 +0200)]
contrib/collection3: Update `json.cgi' to use the new config parsing function.

16 years agocontrob/collection3: Implement zooming using the mouse wheel.
Florian Forster [Sun, 27 Jul 2008 15:23:03 +0000 (17:23 +0200)]
controb/collection3: Implement zooming using the mouse wheel.

Also you can now re-center the graph with a double click.

16 years agocontrib/collection3: Add a generic `instance' placeholder.
Florian Forster [Sun, 27 Jul 2008 15:22:26 +0000 (17:22 +0200)]
contrib/collection3: Add a generic `instance' placeholder.

It will be replaced by either the type or plugin instance, depending on
which is defined.. This is handy for temperatures and stuff like that,
where sometimes the type instance doesn't exist.

16 years agocontrib/collection3: Move configuration logic into Collectd::Graph::Config.
Florian Forster [Sun, 27 Jul 2008 15:21:04 +0000 (17:21 +0200)]
contrib/collection3: Move configuration logic into Collectd::Graph::Config.

16 years agocontrib/collection3: Updated the `collection3' stuff in contrib/.
Florian Forster [Sun, 27 Jul 2008 11:08:28 +0000 (13:08 +0200)]
contrib/collection3: Updated the `collection3' stuff in contrib/.

16 years agoexamples/myplugin.c: Use sstrncpy instead of strcpy.
Sebastian Harl [Fri, 25 Jul 2008 14:17:18 +0000 (16:17 +0200)]
examples/myplugin.c: Use sstrncpy instead of strcpy.

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agosrc/Makefile.am: Add `postgresql_default.conf' to `EXTRA_DIST'.
Florian Forster [Thu, 24 Jul 2008 14:33:25 +0000 (16:33 +0200)]
src/Makefile.am: Add `postgresql_default.conf' to `EXTRA_DIST'.

16 years agocollectd.conf(5): Documented the support for custom queries.
Sebastian Harl [Wed, 23 Jul 2008 12:31:08 +0000 (14:31 +0200)]
collectd.conf(5): Documented the support for custom queries.

Also, collectd.conf.in has been updated.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Moved pg_stat_database query to postgresql_default.conf.
Sebastian Harl [Fri, 18 Jul 2008 19:39:29 +0000 (21:39 +0200)]
postgresql plugin: Moved pg_stat_database query to postgresql_default.conf.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Fixed the expansion of the "hostname" parameter.
Sebastian Harl [Wed, 23 Jul 2008 12:29:56 +0000 (14:29 +0200)]
postgresql plugin: Fixed the expansion of the "hostname" parameter.

If the configured hostname specifies a UNIX domain socket, the parameter now
expands to "localhost" as described earlier.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Added support for passing parameters to a query.
Sebastian Harl [Fri, 18 Jul 2008 19:38:48 +0000 (21:38 +0200)]
postgresql plugin: Added support for passing parameters to a query.

The parameters are referred to in the query string as $1, $2, ... The value of
a parameter is specified using the new "Param <name>" config option of a
"<Query>" block. <name> may be any of "hostname", "database" or "username"
which will be replaced by the value of the appropriate connection parameters.
The hostname will not evaluate to the the UNIX domain socket path -
"localhost" will be used instead.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Define default queries in a configuration file.
Sebastian Harl [Fri, 18 Jul 2008 19:38:03 +0000 (21:38 +0200)]
postgresql plugin: Define default queries in a configuration file.

Instead of writing custom code for each default query, those are now defined
in a configuration file which is parsed using the same mechanism as used for
user-defined queries. This configuration file (postgresql_default.conf) is
installed into $pkgdatadir.

Querying the pg_stat_database view is not currently supported this way. This
would require support for parameters in user-defined queries which is not
(yet) available.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Added support for custom queries.
Sebastian Harl [Fri, 18 Jul 2008 19:37:23 +0000 (21:37 +0200)]
postgresql plugin: Added support for custom queries.

The user may now define and use custom queries to collect data. A query is
defined by specifying the SQL query to execute and a definition of the data
type of each result column:

  <Query magic>
    Query "SELECT magic FROM wizard;"
    Column gauge magic
  </Query>

The "Column" configuration option specifies the type name and optional type
instance: Column <type> [<type_instance>]. The number and order of the
"Column" option has to match the columns of the query result.

A query is activated by adding the configuration option "Query <name>" to the
appropriate "<Database>" configuration blocks. A query may be used multiple
times.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agopostgresql plugin: Split off memory management into dedicated functions.
Sebastian Harl [Fri, 18 Jul 2008 19:36:41 +0000 (21:36 +0200)]
postgresql plugin: Split off memory management into dedicated functions.

Allocation and freeing of c_psql_database_t objects is now handled by the new
functions. This increases readability of the code.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agosrc/collectd.conf.in: Add the onewire plugin.
Florian Forster [Thu, 24 Jul 2008 08:07:22 +0000 (10:07 +0200)]
src/collectd.conf.in: Add the onewire plugin.

16 years agoREADME: Added the `onewire' plugin.
Florian Forster [Wed, 23 Jul 2008 15:20:55 +0000 (17:20 +0200)]
README: Added the `onewire' plugin.

16 years agoMerge branch 'master' of git://git.verplant.org/collectd
Florian Forster [Wed, 23 Jul 2008 15:18:13 +0000 (17:18 +0200)]
Merge branch 'master' of git://git.verplant.org/collectd

16 years agoMerge branch 'ff/owfs'
Florian Forster [Wed, 23 Jul 2008 15:17:49 +0000 (17:17 +0200)]
Merge branch 'ff/owfs'

16 years agocollectd.conf(5): inversed -> inverted
Florian Forster [Wed, 23 Jul 2008 15:16:50 +0000 (17:16 +0200)]
collectd.conf(5): inversed -> inverted

16 years agocollectd.conf(5): Documented the `onewire' plugin.
Florian Forster [Wed, 23 Jul 2008 15:15:51 +0000 (17:15 +0200)]
collectd.conf(5): Documented the `onewire' plugin.

16 years agoonewire plugin: Add a plugin to read onewire sensors.
Florian Forster [Wed, 23 Jul 2008 14:44:40 +0000 (16:44 +0200)]
onewire plugin: Add a plugin to read onewire sensors.

This plugin allows to read _temperature_ sensors connected over a
onewire bus using the `owcapi' library from the `owfs' project. Other
sensors can be added easily, but without hardware to test this it's
kind of hard to be sure it all works.

ToDo's: Document the plugin, make the `Alias' configuration option work.

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 15 Jul 2008 15:12:21 +0000 (17:12 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

src/snmp.c

16 years agoChangeLog: Updated after the merge. collectd-4.4.2
Florian Forster [Tue, 15 Jul 2008 14:39:29 +0000 (16:39 +0200)]
ChangeLog: Updated after the merge.

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 15 Jul 2008 14:32:37 +0000 (16:32 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

16 years agoBumped version to 4.4.2; Updated ChangeLog.
Florian Forster [Tue, 15 Jul 2008 14:29:39 +0000 (16:29 +0200)]
Bumped version to 4.4.2; Updated ChangeLog.

16 years agosrc/Makefile: Pass AM_CPPFLAGS to all plugins setting custom CPPFLAGS.
Sebastian Harl [Sun, 13 Jul 2008 19:33:19 +0000 (21:33 +0200)]
src/Makefile: Pass AM_CPPFLAGS to all plugins setting custom CPPFLAGS.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoconfigfile.c: Fixed a typo.
Sebastian Harl [Sat, 12 Jul 2008 09:36:04 +0000 (11:36 +0200)]
configfile.c: Fixed a typo.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocollectd.conf(5): Documented the support for wrapping lines.
Sebastian Harl [Sat, 12 Jul 2008 09:35:21 +0000 (11:35 +0200)]
collectd.conf(5): Documented the support for wrapping lines.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoliboconfig/scanner.l: Added support for \r\n line endings.
Sebastian Harl [Sat, 12 Jul 2008 09:34:30 +0000 (11:34 +0200)]
liboconfig/scanner.l: Added support for \r\n line endings.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoliboconfig/scanner.l: Added support for wrapping lines.
Sebastian Harl [Sat, 12 Jul 2008 09:33:27 +0000 (11:33 +0200)]
liboconfig/scanner.l: Added support for wrapping lines.

Lines may now be wrapped by using "\" as the last character before the
newline. This allows long lines to be split into multiple lines. This also
applies to quoted strings, which are, however, treated special in that
whitespace at the beginning of the following lines will be ignored. This
allows for nicely indenting the wrapped lines.

The following example:

  Foo a very very very long list of options \
      that does not fit on one line
  Bar "a very very very long string \
      which does not fit on one line"

... is equivalent to:

  Foo a very very very long list of options that does not fit on one line
  Bar "a very very very long string which does not fit on one line"

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agoipmi plugin: Fix a typo: sstrerror_r -> sstrerror.
Peter Holik [Tue, 15 Jul 2008 06:21:21 +0000 (08:21 +0200)]
ipmi plugin: Fix a typo: sstrerror_r -> sstrerror.

16 years agosnmp plugin: More format string fixes.
Florian Forster [Mon, 14 Jul 2008 17:38:11 +0000 (19:38 +0200)]
snmp plugin: More format string fixes.

16 years agontpd plugin: Use the standard types `uint8_t' etc. instead of `u_char' etc.
Florian Forster [Mon, 14 Jul 2008 15:35:42 +0000 (17:35 +0200)]
ntpd plugin: Use the standard types `uint8_t' etc. instead of `u_char' etc.

16 years agovserver plugin: Use `readdir_r' instead of `readdir'.
Florian Forster [Mon, 14 Jul 2008 15:27:36 +0000 (17:27 +0200)]
vserver plugin: Use `readdir_r' instead of `readdir'.

`readdir' is not thread safe, so use the (more thread safe) `readdir_r'.
Also, don't use the non-standard `d_type' member of the `dirent'
structure - it's not portable.

I'm aware that this plugin is very Linux specific and Linux most likely
will never use another C library than the GNU libc, but using this
member prevents me from compiling with the most restrictive `strict'
settings..

16 years agosrc/{collectd.h,perl.c}: Poison sprintf after perl.h has been included.
Florian Forster [Mon, 14 Jul 2008 13:47:02 +0000 (15:47 +0200)]
src/{collectd.h,perl.c}: Poison sprintf after perl.h has been included.

16 years agosnmp plugin: Fix two format strings.
Florian Forster [Mon, 14 Jul 2008 09:57:41 +0000 (11:57 +0200)]
snmp plugin: Fix two format strings.

16 years agosnmp plugin: Parse strings according to the data source type.
Florian Forster [Mon, 14 Jul 2008 09:49:06 +0000 (11:49 +0200)]
snmp plugin: Parse strings according to the data source type.

Some broken SNMP implementations returns numbers as a string, e. g. a
temperature could would be returned as "19.2 C". This change uses the
data source type, i. e. `counter' or `gauge' to convert that string into
an integer or a floating point number using strtoll or strtod. In case
of an error (string-pointer is NULL or no conversion could take place)
either zero or NAN is returned.

16 years agosrc/collectd.h: Don't include <pth.h>.
Florian Forster [Mon, 14 Jul 2008 08:04:37 +0000 (10:04 +0200)]
src/collectd.h: Don't include <pth.h>.

We don't use it, we don't check for it. Why on earth is it still in there..?

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Mon, 14 Jul 2008 07:46:27 +0000 (09:46 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

configure.in

16 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Mon, 14 Jul 2008 07:44:29 +0000 (09:44 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

Conflicts:

src/ntpd.c

16 years agoconfigure.in: Use pkg-config to detect the upsclient library.
Florian Forster [Mon, 14 Jul 2008 07:41:55 +0000 (09:41 +0200)]
configure.in: Use pkg-config to detect the upsclient library.

The libupsclient-config script is gone in newer versions, so we use pkg-config
instead.

16 years agontpd plugin: Fix two format strings.
Florian Forster [Mon, 14 Jul 2008 07:39:47 +0000 (09:39 +0200)]
ntpd plugin: Fix two format strings.

16 years agocontrib/collection3: Add an basic, extensible, modular graphing front-end.
Florian Forster [Tue, 8 Jul 2008 11:08:13 +0000 (13:08 +0200)]
contrib/collection3: Add an basic, extensible, modular graphing front-end.