ipmi plugin: Rename IPMI sensors so names are unique.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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: Fix another format string.
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!
src/Makefile.am: Define HAS_BOOL when building the perl plugin.
This works around a bug in Perl, which despite C99 defining the "bool" type
defines its own version of that type unless HAS_BOOL is defined... :-/
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This works around a bug in Perl, which despite C99 defining the "bool" type
defines its own version of that type unless HAS_BOOL is defined... :-/
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Use -Wall -Werror (AM_CFLAGS) when building any module.
A few plugins have to set custom CFLAGS. When using "<plugin>_la_CFLAGS =",
$(AM_CFLAGS) will no longer be used when compiling <plugin> as that resets the
CFLAGS to the empty string. So, in that case, we have to explicitly add
$(AM_CFLAGS) to the custom CFLAGS of that plugin.
After doing so, a couple of problems have been identified which have been
fixed in this patch as well. That includes a possible SEGFAULT in the snmp
plugin which was missing an argument to WARNING().
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
A few plugins have to set custom CFLAGS. When using "<plugin>_la_CFLAGS =",
$(AM_CFLAGS) will no longer be used when compiling <plugin> as that resets the
CFLAGS to the empty string. So, in that case, we have to explicitly add
$(AM_CFLAGS) to the custom CFLAGS of that plugin.
After doing so, a couple of problems have been identified which have been
fixed in this patch as well. That includes a possible SEGFAULT in the snmp
plugin which was missing an argument to WARNING().
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configure: Include libesmtp in the summary output.
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>
contrib/examples/: Be more verbose about how to handle types.
As suggested by Wolfgang Kroener.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
As suggested by Wolfgang Kroener.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'master' of /var/lib/git/collectd
Conflicts:
src/email.c
Conflicts:
src/email.c
src/common.c: Add end-of-line characters to strsplit()
This fixes plugins that use it to break lines read using fgets()
and forget that "\n" is left at the buffer's end. At least
battery and wireless plugins is affected.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This fixes plugins that use it to break lines read using fgets()
and forget that "\n" is left at the buffer's end. At least
battery and wireless plugins is affected.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
email plugin: Fix a format string.
src/collectd.conf.in: Fix the NotificationExec example.
src/plugin.c: Add assertions to detect if two linked lists are the same.
This will catch errors as just fixed in the exec plugin in the future.
This will catch errors as just fixed in the exec plugin in the future.
exec plugin: Set notify->meta to NULL before copying the list.
Otherwise we will run into a nasty endless loop.
Otherwise we will run into a nasty endless loop.
exec plugin: Added support for notification meta information.
src/plugin.[ch]: Implement `plugin_notification_meta_copy'.
The exec plugin copies the notifications before creating threads, so we need to
be able to copy the meta data to a second notification.
The exec plugin copies the notifications before creating threads, so we need to
be able to copy the meta data to a second notification.
src/utils_threashold.c: Add meta data to the notifications.
The min/max warning/failure values, the current value and name of the
data source are now included in the meta data part of the notification.
The min/max warning/failure values, the current value and name of the
data source are now included in the meta data part of the notification.
src/plugin.[ch]: Use different functions instead of a void pointer.
src/plugin.[ch]: Add `notification meta data' to notification_t.
The plan is to have arbitrary values attached to notifications that user
defined actions can use to get machine parseable values for building
own notification strings or the like.
For example, the threshold checking stuff will (in the near future) add
the current (offending) value as well as the threshold values themselves
to the notification, so that notifying plugins don't need to parse the
(freely formatted) notification string to get that information.
The plan is to have arbitrary values attached to notifications that user
defined actions can use to get machine parseable values for building
own notification strings or the like.
For example, the threshold checking stuff will (in the near future) add
the current (offending) value as well as the threshold values themselves
to the notification, so that notifying plugins don't need to parse the
(freely formatted) notification string to get that information.