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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
build system: Automatically enable the processes and tcpconns plugins.
Merge branch 'collectd-4.4'
Conflicts:
configure.in
Conflicts:
configure.in
Merge branch 'collectd-4.3' into collectd-4.4
build system: Automatically enable the swap plugin if the kvm library is found.
This fixes a bug introduced with the previous commit.
This fixes a bug introduced with the previous commit.
build system: Check for `kvm_nlist'.
Build the tcpconns plugin if it exists.
Build the tcpconns plugin if it exists.
Merge branch 'ms/tcpconns'
build system: Check for `kvm_getprocs'.
Link the processes plugin with the `kvm' library if it provides this symbol.
Link the processes plugin with the `kvm' library if it provides this symbol.
Merge branch 'collectd-4.4'
Conflicts:
src/tcpconns.c
Conflicts:
src/tcpconns.c
Merge branch 'collectd-4.3' into collectd-4.4
Merge branch 'collectd-4.3' of /var/lib/git/collectd into collectd-4.3
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.
The used `kvm_getswapinfo' is apparently an extension not all versions of the
kvm library support.
tcpconns plugin: Removed legacy variables.
`off' was forgotten and the global `nl' was already commented out.
`off' was forgotten and the global `nl' was already commented out.
tcpconns plugin: Fix another format string.
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.
- 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.
AUTHORS: Added Michael Stapelberg.
build system: Added OpenBSD specific behavior for the tcpconns plugin.
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
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
tcpconns plugin: Fix formatstrings.
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.
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.
contrib/collection3: Added a couple more graph definitions.
contrib/collection3: Added the forgotten Collectd::Graph::Config module.
Merge branch 'collectd-4.4'
Merge branch 'collectd-4.3' into collectd-4.4
snmp plugin: Issue an error if an instance name is empty.
src/utils_threshold.c: Free allocated memory before returning..
..in an error condition.
..in an error condition.
memory plugin: The variable is named cache, not cached, at least on libstatgrab >= 0.16
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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>
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>
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>
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>
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.
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.
contrib/collection3: Update `json.cgi' to use the new config parsing function.
controb/collection3: Implement zooming using the mouse wheel.
Also you can now re-center the graph with a double click.
Also you can now re-center the graph with a double click.
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.
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.
contrib/collection3: Move configuration logic into Collectd::Graph::Config.
contrib/collection3: Updated the `collection3' stuff in contrib/.
examples/myplugin.c: Use sstrncpy instead of strcpy.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/Makefile.am: Add `postgresql_default.conf' to `EXTRA_DIST'.
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>
Also, collectd.conf.in has been updated.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
src/collectd.conf.in: Add the onewire plugin.
README: Added the `onewire' plugin.
Merge branch 'master' of git://git.verplant.org/collectd
Merge branch 'ff/owfs'
collectd.conf(5): inversed -> inverted
collectd.conf(5): Documented the `onewire' plugin.
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.
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.
Merge branch 'collectd-4.4'
Conflicts:
src/snmp.c
Conflicts:
src/snmp.c
ChangeLog: Updated after the merge.
Merge branch 'collectd-4.3' into collectd-4.4
Bumped version to 4.4.2; Updated ChangeLog.
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>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configfile.c: Fixed a typo.
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.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>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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>
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>
ipmi plugin: Fix a typo: sstrerror_r -> sstrerror.
snmp plugin: More format string fixes.
ntpd plugin: Use the standard types `uint8_t' etc. instead of `u_char' etc.
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..
`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..
src/{collectd.h,perl.c}: Poison sprintf after perl.h has been included.
snmp plugin: Fix two format strings.
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.
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.
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..?
We don't use it, we don't check for it. Why on earth is it still in there..?
Merge branch 'collectd-4.4'
Conflicts:
configure.in
Conflicts:
configure.in
Merge branch 'collectd-4.3' into collectd-4.4
Conflicts:
src/ntpd.c
Conflicts:
src/ntpd.c
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.
The libupsclient-config script is gone in newer versions, so we use pkg-config
instead.
ntpd plugin: Fix two format strings.
contrib/collection3: Add an basic, extensible, modular graphing front-end.
qmail plugin: Use `readdir_r' instead of `readdir'.
Merge branch 'collectd-4.4'
Conflicts:
src/apache.c
src/apcups.c
src/apple_sensors.c
src/battery.c
src/cpu.c
src/cpufreq.c
src/df.c
src/disk.c
src/dns.c
src/email.c
src/entropy.c
src/hddtemp.c
src/interface.c
src/ipvs.c
src/irq.c
src/load.c
src/mbmon.c
src/memcached.c
src/memory.c
src/multimeter.c
src/mysql.c
src/netlink.c
src/network.c
src/nfs.c
src/nginx.c
src/ntpd.c
src/nut.c
src/ping.c
src/processes.c
src/rrdtool.c
src/serial.c
src/snmp.c
src/swap.c
src/tape.c
src/tcpconns.c
src/users.c
src/utils_cmd_putval.c
src/vserver.c
src/wireless.c
src/xmms.c
Conflicts:
src/apache.c
src/apcups.c
src/apple_sensors.c
src/battery.c
src/cpu.c
src/cpufreq.c
src/df.c
src/disk.c
src/dns.c
src/email.c
src/entropy.c
src/hddtemp.c
src/interface.c
src/ipvs.c
src/irq.c
src/load.c
src/mbmon.c
src/memcached.c
src/memory.c
src/multimeter.c
src/mysql.c
src/netlink.c
src/network.c
src/nfs.c
src/nginx.c
src/ntpd.c
src/nut.c
src/ping.c
src/processes.c
src/rrdtool.c
src/serial.c
src/snmp.c
src/swap.c
src/tape.c
src/tcpconns.c
src/users.c
src/utils_cmd_putval.c
src/vserver.c
src/wireless.c
src/xmms.c
email plugin: Don't print `pthread_t'.
It may be a struct, so printing it is not portable.
It may be a struct, so printing it is not portable.
Merge branch 'collectd-4.3' into collectd-4.4
contrib/collection.cgi: Added basic support for "postgresql" statistics.
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: Added a plugin to collect PostgreSQL database statistics.
This plugin collects active server connections, transaction numbers, block IO
and table row manipulations of PostgreSQL databases. For this purpose it keeps
persistent connections to all configured databases. The statistics are
collected from PostgreSQL's "statistics collector" subsystem.
Currently, statistics are collected from the pg_stat_database,
pg_stat_user_tables and pg_statio_user_tables views. The following new types
have been introduced: pg_blks, pg_n_tup_c, pg_n_tup_g, pg_numbackends, pg_scan
and pg_xact. The type names are basically the same as the column names in the
queried views to keep things consistent. For the number of tuples, counter and
gauge values exist, so the type names have been prefixed with "_c" and "_g"
respectively.
Sample plugin configuration:
<Plugin postgresql>
<Database foo>
Host "hostname"
Port "5432"
User "username"
Password "secret"
SSLMode "prefer"
KRBSrvName "kerberos_service_name"
</Database>
<Database bar>
Service "service_name"
</Database>
</Plugin>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This plugin collects active server connections, transaction numbers, block IO
and table row manipulations of PostgreSQL databases. For this purpose it keeps
persistent connections to all configured databases. The statistics are
collected from PostgreSQL's "statistics collector" subsystem.
Currently, statistics are collected from the pg_stat_database,
pg_stat_user_tables and pg_statio_user_tables views. The following new types
have been introduced: pg_blks, pg_n_tup_c, pg_n_tup_g, pg_numbackends, pg_scan
and pg_xact. The type names are basically the same as the column names in the
queried views to keep things consistent. For the number of tuples, counter and
gauge values exist, so the type names have been prefixed with "_c" and "_g"
respectively.
Sample plugin configuration:
<Plugin postgresql>
<Database foo>
Host "hostname"
Port "5432"
User "username"
Password "secret"
SSLMode "prefer"
KRBSrvName "kerberos_service_name"
</Database>
<Database bar>
Service "service_name"
</Database>
</Plugin>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/utils_complain: Changed c_release() into a macro.
While the c_complain*() functions are usually used in error conditions only,
c_release() is usually used whenever things went right (which should be the
more common case ;-)). In order to minimize the overhead in the latter case,
c_release() has been changed into a macro which checks if the complaint
actually has to be released and calls c_do_release() in that case. This
function then takes care of reporting the release-message (this is the
original implementation of c_release()). So, we remove the overhead of a
function call in the usual case, i.e. when we don't have to report any
messages.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
While the c_complain*() functions are usually used in error conditions only,
c_release() is usually used whenever things went right (which should be the
more common case ;-)). In order to minimize the overhead in the latter case,
c_release() has been changed into a macro which checks if the complaint
actually has to be released and calls c_do_release() in that case. This
function then takes care of reporting the release-message (this is the
original implementation of c_release()). So, we remove the overhead of a
function call in the usual case, i.e. when we don't have to report any
messages.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/plugin.c: Initialize plugins before checking if read callbacks are available.
plugin_init_all() checks if any read callbacks are available before starting
the read threads. A few plugins register their read callback from their
init callback though. By initializing the plugins before that the read
threads are still started correctly if all plugins register the read
callback in the init callback.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
plugin_init_all() checks if any read callbacks are available before starting
the read threads. A few plugins register their read callback from their
init callback though. By initializing the plugins before that the read
threads are still started correctly if all plugins register the read
callback in the init callback.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
qmail plugin: Don't recurse into ".", ".." and other directories beginning with a dot.
Also use PATH_MAX instead of 4096.
Also use PATH_MAX instead of 4096.
rrdtool plugin: Use a hack to case the `argv' pointers in a portable way.
Build system: Added the qmail plugin.
qmail plugin: Various cleanups and bugfixes.
qmail plugin: Added a plugin to count messages in qmail queues.
Hello.
Here is my first collectd plugin.
It shows the two values of qmail queues, messages and todo.
The latter should be zero in normal cases. I included it because it
may help diagnose problems.
Maybe a config parameter could be added for it.
It supports a parameter for the Qmail base directory:
<Plugin qmail_queue>
QmailDir "/var/qmail"
</Plugin>
Feel free to modify it if you need.
Alessandro
Hello.
Here is my first collectd plugin.
It shows the two values of qmail queues, messages and todo.
The latter should be zero in normal cases. I included it because it
may help diagnose problems.
Maybe a config parameter could be added for it.
It supports a parameter for the Qmail base directory:
<Plugin qmail_queue>
QmailDir "/var/qmail"
</Plugin>
Feel free to modify it if you need.
Alessandro
src/{exec,types_list,utils_cache}.c: Fix format strings.
ipmi plugin: s/sstrerror_r/sstrerror/.
ChangeLog: Recoded to UTF-8.
processes plugin: Use read_file_contents().
src/processes.c: use read_file_contents()
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/processes.c: use read_file_contents()
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/common.c: Move read_file_contents() to here.
src/common.c: move read_file_contents() from thermal plugin
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/common.c: move read_file_contents() from thermal plugin
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
battery plugin: Use walk_directory().
src/battery.c: use walk_directory()
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/battery.c: use walk_directory()
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/common.c: Move walk_directory() to here.
src/common.c: Move walk_directory() from thermal plugin
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/common.c: Move walk_directory() from thermal plugin
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
email plugin: Don't unlink the socket file on startup.
Usually, collectd runs as user root, thus making it an unsafe operation to
unconditionally remove the file even though one should be able to assume
that it "belongs" to collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Usually, collectd runs as user root, thus making it an unsafe operation to
unconditionally remove the file even though one should be able to assume
that it "belongs" to collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd.conf(5), collectd.conf: Added the thermal plugin.
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: Not enough memory is an error, not a debug message!