write_kafka plugin: Use 32bit random number when formatting a random key.
Previously, negative numbers would be truncated to "ffffffff" by the
buffer length on architectures where longs are 64 bit.
Fixes: #2074
Previously, negative numbers would be truncated to "ffffffff" by the
buffer length on architectures where longs are 64 bit.
Fixes: #2074
src/daemon/utils_random.[ch]: Implement cdrand_u().
Bump version to 5.6.1; Update ChangeLog.
Collected podtypo
collectd.spec: also disable write_redis on EL6
This plugin also depends on the hiredis library, which was retired from
EPEL6.
This plugin also depends on the hiredis library, which was retired from
EPEL6.
Merge branch 'collectd-5.5' into collectd-5.6
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec
collectd.spec: disable redis plugin on EL6
hiredis has been retired from EPEL6
hiredis has been retired from EPEL6
collectd.spec: disable redis plugin on EL6
More reformatting.
No idea why the previous round missed these files.
No idea why the previous round missed these files.
Tree wide: Reformat with clang-format.
Merge branch 'collectd-5.5' into collectd-5.6
Bump version to 5.5.3; Update ChangeLog.
Fix Lua header detection
checking lua.h usability... yes
checking lua.h presence... no
configure: WARNING: lua.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lua.h: proceeding with the compiler's result
checking for lua.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... no
configure: WARNING: lauxlib.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lauxlib.h: proceeding with the compiler's result
checking for lauxlib.h... yes
checking lualib.h usability... yes
checking lualib.h presence... no
configure: WARNING: lualib.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lualib.h: proceeding with the compiler's result
checking for lualib.h... yes
AC_CHECK_HEADERS uses the preprocessor directly, which doesn't use
CFLAGS. Fixes detection of the lua-5.1 compat libs on Fedora Rawhide.
checking lua.h usability... yes
checking lua.h presence... no
configure: WARNING: lua.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lua.h: proceeding with the compiler's result
checking for lua.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... no
configure: WARNING: lauxlib.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lauxlib.h: proceeding with the compiler's result
checking for lauxlib.h... yes
checking lualib.h usability... yes
checking lualib.h presence... no
configure: WARNING: lualib.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: lualib.h: proceeding with the compiler's result
checking for lualib.h... yes
AC_CHECK_HEADERS uses the preprocessor directly, which doesn't use
CFLAGS. Fixes detection of the lua-5.1 compat libs on Fedora Rawhide.
contrib/README: sort items
collectd-tg: Fix sleep interval.
nanosleep() was called with the current time, meaning that it would
block for years. This correctly subtracts "now" from the metric's time
and only sleeps for the duration between the two.
nanosleep() was called with the current time, meaning that it would
block for years. This correctly subtracts "now" from the metric's time
and only sleeps for the duration between the two.
Merge branch 'collectd-5.5' into collectd-5.6
Merge remote-tracking branch 'github/pr/2026' into collectd-5.5
apcups plugin: Skip metrics not reported by the UPS.
Fixes: #2025
Fixes: #2025
write_kafka plugin: Fix support for librdkafka 0.9.0.
Use rd_kafka_set_logger() only when rd_kafka_conf_set_log_cb() is not
available:
write_kafka.c: In function 'kafka_handle':
write_kafka.c:119:6: error: 'rd_kafka_set_logger' is deprecated (declared at /usr/local/include/librdkafka/rdkafka.h:2400) [-Werror=deprecated-declarations]
rd_kafka_set_logger(ctx->kafka, kafka_log);
^
Fixes: #2029
Use rd_kafka_set_logger() only when rd_kafka_conf_set_log_cb() is not
available:
write_kafka.c: In function 'kafka_handle':
write_kafka.c:119:6: error: 'rd_kafka_set_logger' is deprecated (declared at /usr/local/include/librdkafka/rdkafka.h:2400) [-Werror=deprecated-declarations]
rd_kafka_set_logger(ctx->kafka, kafka_log);
^
Fixes: #2029
Merge remote-tracking branch 'github/pr/2027' into collectd-5.5
modbus plugin: Avoid sizeof(struct sockaddr).
The previous version failed on FreeBSD with:
modbus.c: In function 'mb_read_data':
modbus.c:476:21: error: storage size of 'sockaddr' isn't known
struct sockaddr sockaddr;
^
The previous version failed on FreeBSD with:
modbus.c: In function 'mb_read_data':
modbus.c:476:21: error: storage size of 'sockaddr' isn't known
struct sockaddr sockaddr;
^
src/write_riemann_threshold.h: Various fixes.
* Add license header. Simply copied src/write_riemann_threadhold.c's license.
* Make header self-contained. "plugin.h" is needed for data_source_t and
value_list_t.
* Add names to the parameters and write documentation for the only exported
function.
* Add license header. Simply copied src/write_riemann_threadhold.c's license.
* Make header self-contained. "plugin.h" is needed for data_source_t and
value_list_t.
* Add names to the parameters and write documentation for the only exported
function.
write_riemann plugin: Fix order of includes.
The previous version failed on Solaris with:
In file included from ./daemon/collectd.h:31:0,
from write_riemann.c:36:
./config.h:1619:0: error: "_FILE_OFFSET_BITS" redefined [-Werror]
#define _FILE_OFFSET_BITS 64
^
The previous version failed on Solaris with:
In file included from ./daemon/collectd.h:31:0,
from write_riemann.c:36:
./config.h:1619:0: error: "_FILE_OFFSET_BITS" redefined [-Werror]
#define _FILE_OFFSET_BITS 64
^
Merge branch 'collectd-5.5' into collectd-5.6
configure.ac: make finding java deterministic
The sort order of the `find` command proves to be dependent on external
factors, which makes `./configure` pick different java versions on
different systems, making the whole build non-reproducible (see
https://reproducible-builds.org/ for more details).
Adding a call to `sort`, with the locale forced, fixes this issue.
Fixes: #1523
The sort order of the `find` command proves to be dependent on external
factors, which makes `./configure` pick different java versions on
different systems, making the whole build non-reproducible (see
https://reproducible-builds.org/ for more details).
Adding a call to `sort`, with the locale forced, fixes this issue.
Fixes: #1523
battery plugin: Fix type in a warning.
zfs_arc: remove double metric
I accidentally added prefetch_metadata_misses in 61635f3 but we
already had that metric.
Fixes #1963
I accidentally added prefetch_metadata_misses in 61635f3 but we
already had that metric.
Fixes #1963
Merge remote-tracking branch 'github/pr/2012' into collectd-5.6
openvpn: Fixed openvpn_read() on empty configuration.
When plugin loaded without configuration, it starts to spam logs with message
'read-function of plugin `openvpn' failed'.
Issue: #1932
When plugin loaded without configuration, it starts to spam logs with message
'read-function of plugin `openvpn' failed'.
Issue: #1932
src/daemon/common.c: Rewrite check_capability() using cap_get_bound().
capget(2) is Linux specific and the use of the raw syscalls is
discouraged. Also, there have been interesting crashes on some systems.
Issue: #2009
capget(2) is Linux specific and the use of the raw syscalls is
discouraged. Also, there have been interesting crashes on some systems.
Issue: #2009
write_kafka plugin: Reintroduce the "Key Random" setting.
Fixes: #1977
Fixes: #1977
Merge pull request #2005 from rpv-tomsk/issue-1996
write_http: Fixed DS type check
write_http: Fixed DS type check
write_http: Fixed DS type check
Closes: #1996
Closes: #1996
powerdns plugin: fix parsing of last key
I found this in my logs:
collectd[4678]: powerdns plugin: submit: Not found in lookup table: questions#012 = 98797645;
The octal #012 is '\n'. Add a space before the newline so the default
command is split into keys correctly.
Signed-off-by: Florian Forster <octo@collectd.org>
I found this in my logs:
collectd[4678]: powerdns plugin: submit: Not found in lookup table: questions#012 = 98797645;
The octal #012 is '\n'. Add a space before the newline so the default
command is split into keys correctly.
Signed-off-by: Florian Forster <octo@collectd.org>
utils_format_graphite: terminate buffer with \0
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
common.c: Use _LINUX_CAPABILITY_VERSION_3 in cap_header
While check_capability() function already requires
_LINUX_CAPABILITY_VERSION_3 via "#ifdef" since commit 448627953c we still
set the cap_header's version to deprecated _LINUX_CAPABILITY_VERSION. This
results in a warning like
> capability: warning: `collectd' uses 32-bit capabilities (legacy support in use)
from the kernel when a plugin (like iptables) calls our check_capability()
function.
With this commit we will set cap_header to kernel's current capability
version (_LINUX_CAPABILITY_VERSION_3), which is default since
kernel 2.6.26.
Signed-off-by: Florian Forster <octo@collectd.org>
While check_capability() function already requires
_LINUX_CAPABILITY_VERSION_3 via "#ifdef" since commit 448627953c we still
set the cap_header's version to deprecated _LINUX_CAPABILITY_VERSION. This
results in a warning like
> capability: warning: `collectd' uses 32-bit capabilities (legacy support in use)
from the kernel when a plugin (like iptables) calls our check_capability()
function.
With this commit we will set cap_header to kernel's current capability
version (_LINUX_CAPABILITY_VERSION_3), which is default since
kernel 2.6.26.
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.5' into collectd-5.6
fix one typo spotted by Debian's lintian tool
fix a couple of typos spotted by Debian's lintian tool
collectd.spec: increment changelog to mention 5.6.1
Bump version number in redhat spec
Merge remote-tracking branch 'github/pr/1958' into collectd-5.5
Bump version to 5.6.1; Update ChangeLog.
Merge branch 'collectd-5.5' into collectd-5.6
Merge remote-tracking branch 'github/pr/1961' into collectd-5.5
write_graphite: remove linking against libyajl (#1976)
write_graphite doesn't have anything to do with json. This seems to have
been accidentally added in 30c1111.
Fixes https://bugs.debian.org/839771
write_graphite doesn't have anything to do with json. This seems to have
been accidentally added in 30c1111.
Fixes https://bugs.debian.org/839771
src/daemon/plugin.[ch]: Make the user_data_t* const.
That is, user_data_t* passed to register_* functions. The actual callbacks
are still getting a user_data_t* since they, in theory, would be able to
modify the pointer stored in .data.
Issue: #1954
That is, user_data_t* passed to register_* functions. The actual callbacks
are still getting a user_data_t* since they, in theory, would be able to
modify the pointer stored in .data.
Issue: #1954
src/daemons/plugin.c: Don't modify user_data_t* in plugin_register_flush().
Fixes: #1954
Fixes: #1954
Revert "write_graphite: remove #ifndefs"
This reverts commit de80d27fe7023c2e377674b4cc341e539388b98e.
Fixes: #1953
This reverts commit de80d27fe7023c2e377674b4cc341e539388b98e.
Fixes: #1953
write_http plugin: Don't register a flush callback unconditionally.
Fixes: #1955
Fixes: #1955
Use readdir() instead of the deprecated readdir_r().
Cf. https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html
Cf. https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html
RRDCacheD plugin: Improve various RRD-related error messages.
RRDCacheD plugin: Try to reconnect upon failed operations.
The RRD client library does not provide means to check the status of a
connection and there's no way to detect that the connection is broken after,
for example, the daemon restarted. To work around that, try to reconnect if
any client operation fails.
Reported via https://bugs.debian.org/657877
The RRD client library does not provide means to check the status of a
connection and there's no way to detect that the connection is broken after,
for example, the daemon restarted. To work around that, try to reconnect if
any client operation fails.
Reported via https://bugs.debian.org/657877
commom: Fixed AIX doesn't have MSG_DONTWAIT
Merge branch 'collectd-5.4' into collectd-5.5
contrib/examples/myplugin.c: Fix copy and paste error.
Merge branch 'collectd-5.5' into collectd-5.6
curl_json plugin: Skip unexpected non-map values.
Assume, for example, the config `Key "*/foo"`. This config expects JSON
in the form:
{
"bar": {
"foo": 1337
}
}
If the available JSON is instead:
{
"error_code": 0,
"bar": {
"foo": 1337
}
}
the code will take a look at the zero associated with "error_code" and
determine that a map (with key "foo") is expected instead. Previously
the code would continue, eventually calling `cj_get_type()` which
expects that `key->type` is a valid pointer, resulting in a segmentation
fault.
This patch does three things to ensure that this segmentation fault does
not happen again:
1. `cj_get_type()` checks its argument to make sure it is valid before
dereferencing any pointers.
2. In case a non-map is found when a map is expected, the code will
return instead of limping on.
3. After calling `cj_cb_inc_array_index()`, which may update the key,
make sure that it actually did and that key is valid now.
Fixes: #1896
Assume, for example, the config `Key "*/foo"`. This config expects JSON
in the form:
{
"bar": {
"foo": 1337
}
}
If the available JSON is instead:
{
"error_code": 0,
"bar": {
"foo": 1337
}
}
the code will take a look at the zero associated with "error_code" and
determine that a map (with key "foo") is expected instead. Previously
the code would continue, eventually calling `cj_get_type()` which
expects that `key->type` is a valid pointer, resulting in a segmentation
fault.
This patch does three things to ensure that this segmentation fault does
not happen again:
1. `cj_get_type()` checks its argument to make sure it is valid before
dereferencing any pointers.
2. In case a non-map is found when a map is expected, the code will
return instead of limping on.
3. After calling `cj_cb_inc_array_index()`, which may update the key,
make sure that it actually did and that key is valid now.
Fixes: #1896
collectd.conf(5): Document the semantics of the "TypesDB" option in more detail.
Fixed: #1241
Fixed: #1241
contrib/migrate-4-5.px: Don't convert "ps_code" and "ps_data" to derive.
Fixes: #1687
Fixes: #1687
Add missing option to write_graphite example
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
apache plugin: End statements with semi-colons.
If only I knew why this wasn't considered a syntax error …
If only I knew why this wasn't considered a syntax error …
Bump version to 5.6.0; Update ChangeLog.
Merge branch 'collectd-5.5' into collectd-5.6
src/types.db: Remove minimum value from "power".
The battery plugin reports negative power when the battery is discharging.
The battery plugin reports negative power when the battery is discharging.
Merge branch 'collectd-5.5' into collectd-5.6
Merge remote-tracking branch 'github/pr/1909' into collectd-5.5
Merge branch 'collectd-5.5' into collectd-5.6
target_set.c: rename 'MetaDataSet' option
Fixes #1910
Fixes #1910
plugin_dispatch_multivalue: Submit NAN when computing percantage of an empty set.
Also fix query_plans_by_table
#1905 happens here obviously, too.
#1905 happens here obviously, too.
pgsql plugin: avoid parsing error from query_plans
idx_scan/idx_tup_fetch can be NULL, avoid trying to parse that into a number.
This should fix #1905.
idx_scan/idx_tup_fetch can be NULL, avoid trying to parse that into a number.
This should fix #1905.
Fix compilation against >=xfsprogs-4.7.0
[backport of commit 225ee7bb45152c51c1c9508b2e776cef36d2682d]
Suggested-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Gentoo-Bug: https://bugs.gentoo.org/590998
Fixes: https://github.com/collectd/collectd/issues/1877
[backport of commit 225ee7bb45152c51c1c9508b2e776cef36d2682d]
Suggested-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Gentoo-Bug: https://bugs.gentoo.org/590998
Fixes: https://github.com/collectd/collectd/issues/1877
src/common.c: parse_value: Quote string that failed to parse.
Issue: #1905
Issue: #1905
network plugin: Initialize libgcrypt only when needed.
Previously, libgcrypt was initialized unconditionally in network_init(),
which may cause trouble on some systems. With this patch, gcrypt is
initialized if:
* A client socket as signing or encryption enabled, or
* a server socket has an auth_file configured.
Fixes: #1902
Previously, libgcrypt was initialized unconditionally in network_init(),
which may cause trouble on some systems. With this patch, gcrypt is
initialized if:
* A client socket as signing or encryption enabled, or
* a server socket has an auth_file configured.
Fixes: #1902
Merge pull request #1899 from rubenk/python-fixes-for-interactive-sessions
python plugin: Fixing possible problems with the GIL in interactive sessions.
python plugin: Fixing possible problems with the GIL in interactive sessions.
Try a different way to silence GCC.
On some distro's some versions of GCC warn about the unchecked result,
even though it is casted to void.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 for the
discussion.
On some distro's some versions of GCC warn about the unchecked result,
even though it is casted to void.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 for the
discussion.
python plugin: Fixing possible problems with the GIL.
If AfterFork is called after threads have been initialized.
Also handle SIGTERM while reading from an interactive session slightly more gracefully.
If AfterFork is called after threads have been initialized.
Also handle SIGTERM while reading from an interactive session slightly more gracefully.
Really fix tests on Solaris
3b264ee checked for KERNEL_SOLARIS, but this is only defined if config.h is included.
3b264ee checked for KERNEL_SOLARIS, but this is only defined if config.h is included.
Merge branch 'collectd-5.5' into collectd-5.6
Changelog: fix unresolved merge conflict introduced in dc2eb04
Removed the conflict markers left over, and copy-pasted the changes
added in c0f5748.
Removed the conflict markers left over, and copy-pasted the changes
added in c0f5748.
collectd.spec: mention new cpusleep plugin in changelog
Merge branch 'collectd-5.5' into collectd-5.6
collectd.spec: increment version number in changelog
collectd.spec: remove misleading items from changelog
python plugin: Don't shut down the Python interpreter as long as there might be callback methods around.
Merge remote-tracking branch 'github/pr/1890' into collectd-5.6
ceph plugin: Assert that the strings on the stack are non-NULL.
The static analyzer is whining about passing NULLs to strcmp().
The static analyzer is whining about passing NULLs to strcmp().
ceph plugin: Guard against g_num_daemons being zero.
clang scan-build flags this, because this variable is used to declare VLAs.
clang scan-build flags this, because this variable is used to declare VLAs.
write_kafka: Fix misleading indentation
Reported by GCC-6 with the `-Werror=misleading-indentation` option.
Thanks for Lucas Nussbaum for reporting this issue!
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831194
Reported by GCC-6 with the `-Werror=misleading-indentation` option.
Thanks for Lucas Nussbaum for reporting this issue!
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831194
8 years agopython plugin: Unregister all internal callback lists before Python interpreter shutdown.
python plugin: Unregister all internal callback lists before Python interpreter shutdown.
python plugin: Properly deal with identifier being NULL in a log callback.
python plugin: Grab GIL before freeing callbacks. If their refcount reaches 0 Python code will be executed.
Merge remote-tracking branch 'github/pr/1879'
Merge remote-tracking branch 'github/pr/1883'
CONTRIBUTING.md: Address review comments.
README: Point to CONTRIBUTING.md for bugs and PRs.
CONTRIBUTING.md: Address review comments.
configure.ac: rewrite liblua detection
Not all distro's have a lua.pc file.
This looks for the most common ones, newest versions first.
Not all distro's have a lua.pc file.
This looks for the most common ones, newest versions first.
support older versions of riemann-c-client
riemann_client_set_timeout() was added in 1.8.0, but this
version hasn't landed in all distro's yet.
Fixes #986
riemann_client_set_timeout() was added in 1.8.0, but this
version hasn't landed in all distro's yet.
Fixes #986