utils_mount: use reentrant getmntent_r when we can
Fixes #1162
Fixes #1162
src/utils_latency_test.c: Disable the "-1" test for now.
Issue: #1139
Issue: #1139
src/utils_latency_test.c: Assure that large latency values also work.
The cdtime_t representation of 99s doesn't fit into 32bit anymore, thereby
assuring that cdtime_t is actually 64bit on platforms that currently
don't pass the test, i.e. EPEL {5,6} on i386.
Issue: #1139
The cdtime_t representation of 99s doesn't fit into 32bit anymore, thereby
assuring that cdtime_t is actually 64bit on platforms that currently
don't pass the test, i.e. EPEL {5,6} on i386.
Issue: #1139
src/utils_latency_test.c: Log result of DOUBLE_TO_CDTIME_T() conversion.
The test fails on some i386 architectures. Time for some printf debugging.
The test fails on some i386 architectures. Time for some printf debugging.
src/daemon/utils_time_mock.c: Mark static return value as "ULL".
Build on i386 squeeze fails with:
utils_time_mock.c:31: error: integer constant is too large for 'long' type
Build on i386 squeeze fails with:
utils_time_mock.c:31: error: integer constant is too large for 'long' type
Link libcommon.la with $(COMMON_LIBS).
This hopefully fixes link errors on Solaris:
CCLD test_utils_vl_lookup
Undefined first referenced
symbol in file
kstat_data_lookup daemon/.libs/libcommon.a(common.o)
kstat_lookup daemon/.libs/libcommon.a(common.o)
kstat_read daemon/.libs/libcommon.a(common.o)
getaddrinfo daemon/.libs/libcommon.a(common.o)
freeaddrinfo daemon/.libs/libcommon.a(common.o)
gai_strerror daemon/.libs/libcommon.a(common.o)
ld: fatal: symbol referencing errors. No output written to test_utils_vl_lookup
collect2: error: ld returned 1 exit status
This hopefully fixes link errors on Solaris:
CCLD test_utils_vl_lookup
Undefined first referenced
symbol in file
kstat_data_lookup daemon/.libs/libcommon.a(common.o)
kstat_lookup daemon/.libs/libcommon.a(common.o)
kstat_read daemon/.libs/libcommon.a(common.o)
getaddrinfo daemon/.libs/libcommon.a(common.o)
freeaddrinfo daemon/.libs/libcommon.a(common.o)
gai_strerror daemon/.libs/libcommon.a(common.o)
ld: fatal: symbol referencing errors. No output written to test_utils_vl_lookup
collect2: error: ld returned 1 exit status
src/utils_latency.c: Fix format string error.
src/utils_latency.c: Ensure that LLONG_MAX is defined.
EPEL5 doesn't have it in <limits.h> apparently.
EPEL5 doesn't have it in <limits.h> apparently.
plugin_mock.c: Declare "kc".
This hopefully fixes "make check" on Solaris, which currently fails
with:
CC common_test.o
CCLD test_common
Undefined first referenced
symbol in file
kc ./.libs/libcommon.a(common.o)
ld: fatal: symbol referencing errors. No output written to test_common
collect2: error: ld returned 1 exit status
This hopefully fixes "make check" on Solaris, which currently fails
with:
CC common_test.o
CCLD test_common
Undefined first referenced
symbol in file
kc ./.libs/libcommon.a(common.o)
ld: fatal: symbol referencing errors. No output written to test_common
collect2: error: ld returned 1 exit status
Merge remote-tracking branch 'github/pr/1124'
Merge remote-tracking branch 'github/pr/1130'
src/utils_latency.c: Add unit test.
This test successfully reproduces the crash reported in #1131 by calling
latency_counter_add (l, DOUBLE_TO_CDTIME_T (-1.0));
This test successfully reproduces the crash reported in #1131 by calling
latency_counter_add (l, DOUBLE_TO_CDTIME_T (-1.0));
Merge branch 'collectd-5.5'
src/utils_latency.c: Store "bin_width" as cdtime_t.
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
src/utils_latency.c: Fix change_bin_width().
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
Added option to choose redis database to use
Testing: Return failure from OK1() and other fixes.
* The tests for common and meta_data logged "not ok" but didn't signal
failure because OK1() didn't include a return(-1) line. Adding this line
caused some restructuring of the utils_vl_lookup test, because it used
that macro in non-int functions.
* Fix DBLEQ() to work correctly with an expected NaN. Previously, the
if condition would fall through to the "expect != actual" part, which
is true for "NaN != NaN".
* Let the mock cdtime() return a non-zero value, as the (invalid) zero
value is used in parse_values() to detect whether the time has been
parsed already. This lead to the "N:..." tests failing.
* Correct the expected behavior of meta_data_add_*() when keys already
exist: they're replaced rather than causing an error.
* The tests for common and meta_data logged "not ok" but didn't signal
failure because OK1() didn't include a return(-1) line. Adding this line
caused some restructuring of the utils_vl_lookup test, because it used
that macro in non-int functions.
* Fix DBLEQ() to work correctly with an expected NaN. Previously, the
if condition would fall through to the "expect != actual" part, which
is true for "NaN != NaN".
* Let the mock cdtime() return a non-zero value, as the (invalid) zero
value is used in parse_values() to detect whether the time has been
parsed already. This lead to the "N:..." tests failing.
* Correct the expected behavior of meta_data_add_*() when keys already
exist: they're replaced rather than causing an error.
varnish: fix leak on read
Since VSM_Close doesn't free the object we leak a few bytes
every interval
Since VSM_Close doesn't free the object we leak a few bytes
every interval
varnish: fix some leaks in error paths
src/daemon/meta_data.[ch]: Add unit test.
src/Makefile.am: Remove BUILD_WITH_LIBMOSQUITTO_CFLAGS.
This substitution is undefined.
This substitution is undefined.
Merge branch 'pr/36' into mqtt
mqtt plugin: properly set CPPFLAGS in Makefile
This fixes the build when the --with-libmosquitto option is used.
This fixes the build when the --with-libmosquitto option is used.
mqtt plugin: Add support for libmosquitto, major version >0.
network plugin: Fix function name in error output.
daemon: Fix -Wunused-parameter warnings.
oconfig: Fix -Wshadow and -Wsign-compare warnings.
Also re-indent oconfig_clone().
Also re-indent oconfig_clone().
Fix -Wshorten-64-to-32 warnings.
Fix -Wsign-conversion warnings.
daemon: Clean up the Upstart and Systemd notification code.
Document the use of "Linux abstract namespace sockets" and use sendto(2)
instead of sendmsg(2) to avoid having to initialize struct msghdr
and struct iovec. Removes the non-portable bzero() calls.
Document the use of "Linux abstract namespace sockets" and use sendto(2)
instead of sendmsg(2) to avoid having to initialize struct msghdr
and struct iovec. Removes the non-portable bzero() calls.
Merge branch 'collectd-5.5'
Merge branch 'collectd-5.4' into collectd-5.5
build: add libavltree, libcommon & libheap dependencies
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Add test-suite logs to .gitignore
collectd.conf: order plugins alphabetically again
Fix Perl errors
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
bind: fix zone count check
collectd.conf(5): Add documentation.
Also add example config to src/collectd.conf.in
Also add example config to src/collectd.conf.in
mqtt plugin: Change some default values.
* qos: 0 for publishers, 2 for subscribers
* store_rates: true
* clean_session: true
* qos: 0 for publishers, 2 for subscribers
* store_rates: true
* clean_session: true
mqtt plugin: Use the "name" argument for the callback name.
mqtt plugin: Increase keepalive interval to 60s.
This is the default used by the Mosquitto tools. The new define makes
it possible to easily override this at compile time.
This is the default used by the Mosquitto tools. The new define makes
it possible to easily override this at compile time.
mqtt plugin: Add myself to list of authors, copyright holders.
mqtt plugin: Add proof-of-concept subscriber code.
Publisher and subscriber should now be able to send metrics to one another.
Publisher and subscriber should now be able to send metrics to one another.
mqtt plugin: Send only the acutally used part of the payload buffer.
mqtt plugin: Let "client ID" default to the hostname.
The MQTT documentation says that this needs to be unique and stable, so
I think the hostname is the best match for this.
The MQTT documentation says that this needs to be unique and stable, so
I think the hostname is the best match for this.
mqtt plugin: Add support for multiple brokers.
Also adds support for authentication and configuring a couple of settings
(QoS, rates, retention).
Also adds support for authentication and configuring a couple of settings
(QoS, rates, retention).
mqtt plugin: Correctly check the return value of format_topic().
mqtt plugin: Use the thread-safe sstrerror().
mqtt plugin: Don't use <stdbool.h>.
Instead, use the standard _Bool type.
Instead, use the standard _Bool type.
mqtt plugin: Add preliminary configuration support.
mqtt plugin: Rename mqtt_publish_message() to publish().
mqtt plugin: Change message format to one topic per metric.
The payload now includes all data sources and the timestamp. The payload
is formatted with the existing format_values() function, which removed
quite a couple of lines of code.
The payload now includes all data sources and the timestamp. The payload
is formatted with the existing format_values() function, which removed
quite a couple of lines of code.
mqtt plugin: Concurrency fixes, pick up conf->lock in publish.
mqtt plugin: Compile fixes.
This compiles with libmosquitto 0.15.0. It appears newer versions of the
library have some interface changes, so we should add a version check.
Luckily, libmosquitto provides everything we need.
This compiles with libmosquitto 0.15.0. It appears newer versions of the
library have some interface changes, so we should add a version check.
Luckily, libmosquitto provides everything we need.
configure.ac, src/Makefile.am: Add mqtt to the build system.
Initial import
Initial commit
serial plugin: Fix -Wshorten-64-to-32 warning.
serial.c:87:28: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen (fields[0]) - 1;
~ ~~~~~~~~~~~~~~~~~~~^~~
serial.c:96:10: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen (fields[i]);
~ ^~~~~~~~~~~~~~~~~~
serial.c:87:28: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen (fields[0]) - 1;
~ ~~~~~~~~~~~~~~~~~~~^~~
serial.c:96:10: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen (fields[i]);
~ ^~~~~~~~~~~~~~~~~~
src/utils_ignorelist.c: Reimplement ignorelist_append_regex().
There's a signed / unsigned conversion in that function ...
... aaaaand it's fully rewritten. Oops.
There's a signed / unsigned conversion in that function ...
... aaaaand it's fully rewritten. Oops.
collectd-tg: Remove use of NAN.
This broke the build under Solaris, once again *sigh*.
collectd-tg.c: In function ‘dtime’:
collectd-tg.c:108:12: error: ‘NAN’ undeclared (first use in this function)
return NAN;
^
This broke the build under Solaris, once again *sigh*.
collectd-tg.c: In function ‘dtime’:
collectd-tg.c:108:12: error: ‘NAN’ undeclared (first use in this function)
return NAN;
^
Take out explicit definitions as they are already checked via enable_standards in configure.ac.
Fixes: #978
Fixes: #978
collectd-tg: Move _POSIX_C_SOURCE and friends to the Makefile.
Apparently defining this in the source files confuses Solaris' libc.
Thanks to @dago for looking into this.
Hopefully fixes: #978
Apparently defining this in the source files confuses Solaris' libc.
Thanks to @dago for looking into this.
Hopefully fixes: #978
collectdctl: Fix -Wsign-conversion warnings.
Also fixes a shadowed local variable warning.
Also fixes a shadowed local variable warning.
collectd-nagios: Fix -Wsign-conversion warnings.
collectd-tg: Fix unintentional cast from double to time_t.
This fix is likely incomplete: the printf() line is probably executed way
too often now.
This fix is likely incomplete: the printf() line is probably executed way
too often now.
utils_cache.c, scale target: Don't re-implement counter wrap-around logic.
src/daemon/utils_subst_test.c: Actually add unit test.
D'oh!
D'oh!
src/daemon/utils_subst.c: Sanitize buffer offsets better.
The previous implementation broke when off1 / off2 were outside of "string"
but within "buflen". It also had problems if the replacement string was
too long. This new implementation truncates the buffer as expected and
is properly tested.
The previous implementation broke when off1 / off2 were outside of "string"
but within "buflen". It also had problems if the replacement string was
too long. This new implementation truncates the buffer as expected and
is properly tested.
write_riemann plugin: Ensure that "statuses" is always initialized.
Hopefully fixes "Uninitialized argument value" warning.
Hopefully fixes "Uninitialized argument value" warning.
src/daemon/common.[ch]: Improve signature of value_to_rate().
Passing in "value" as a derive_t and returning the rate as a value_t is
just inconvenient and wrong. Instead, pass "value" as a value_t and return
the rate in a gauge_t. While at it, move the state pointer to the end of
the argument list.
Passing in "value" as a derive_t and returning the rate as a value_t is
just inconvenient and wrong. Instead, pass "value" as a value_t and return
the rate in a gauge_t. While at it, move the state pointer to the end of
the argument list.
src/daemon/common_test.c: Fix "decimal constant is unsigned only in ISO C90" warning.
Merge branch 'collectd-5.5'
Merge branch 'collectd-5.4' into collectd-5.5
src/daemon/common.c: Fix handling of counter_t in value_to_rate().
Also fixes an off-by-one error in counter_diff() and adds a unit test for
the function.
Also fixes an off-by-one error in counter_diff() and adds a unit test for
the function.
src/daemon/common.c: Fix off-by-one error in escape_slashes().
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
src/daemon/common.c: Add unit test for escape_string().
src/daemon/common.c: Fix off-by-one error in escape_slashes().
This also adds a unit test for this issue.
This also adds a unit test for this issue.
Merge branch 'collectd-5.5'
Conflicts:
src/write_redis.c
Conflicts:
src/write_redis.c
Merge remote-tracking branch 'github/pr/1097'
properly handle error cases when kvm_read fails (#1094)
Merge remote-tracking branch 'github/pr/1093'
don't report inodes if fs doesn't provide f_files and f_ffree
write_redis plugin: Call freeReplyObject() for each redisReply.
write_redis plugin: Use the prefix for the "values" set, too.
Make the code match the documentation and use the prefix for the set of all
metrics, too. Also add documentation for the "Prefix" option and let the
default prefix be set at compile time.
Make the code match the documentation and use the prefix for the set of all
metrics, too. Also add documentation for the "Prefix" option and let the
default prefix be set at compile time.
Merge remote-tracking branch 'github/pr/1082'
Fix signed / unsigned comparison errors.
A lot of loop counters need to be size_t now, because values_len and ds_num
are now of that type.
A lot of loop counters need to be size_t now, because values_len and ds_num
are now of that type.
src/daemon/common.c: Add parse_values() unit test.
src/daemon/plugin.h: Change "values_len" to type "size_t".
src/Makefile.am: Move tests towards the libraries tested.
removed separator between prefix and the rest of the key
Remove unmaintained Fedora contrib files
Merge branch 'collectd-5.5'
barometer plugin: Fix "Allocator sizeof operand mismatch" warning.
write_sensu plugin: Fix debug message.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
Merge branch 'collectd-5.5'
write_sensu plugin: Fix memory leak.
turbostat plugin: Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warning.
openvpn plugin: Fix "Dead assignment" warning.
Merge branch 'collectd-5.4' into collectd-5.5
src/utils_cmd_flush.c: Fix memory leak.