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.
src/utils_rrdcreate.c: Fix memory leak.
src/utils_ignorelist.c: Fix memory leak.
Turns out, regfree(3) cleans up the memory allocated by regcomp(3), but
not the pointer itself.
Turns out, regfree(3) cleans up the memory allocated by regcomp(3), but
not the pointer itself.
src/utils_cmd_putval.c: Fix memory leak.
utils_cache plugin: Fix memory leak.
rrdtool plugin: Add assertion.
This helps the static code analysis to figure out that memory is not
leaking after all.
This helps the static code analysis to figure out that memory is not
leaking after all.
powerdns plugin: Fix memory leak.
While at it, replace the powerdns_config_add_string() function.
While at it, replace the powerdns_config_add_string() function.
memcachec plugin: Fix memory leak.
java plugin: Fix memory leak.
ipvs plugin: Fix memory leak.
gmond plugin: Fix memory leak.
curl_xml plugin: Fix memory leak.
curl_json plugin: Fix memory leak.
curl plugin: Fix memory leak.
collectdmon: Fix memory leak.
apache plugin: Fix memory leak.
src/utils_cache.c: Fix two memory leaks.
* Free "times" pointer if it is not returned to the user.
* Free (re)alloc'ed pointers when strdup() fails.
* Free "times" pointer if it is not returned to the user.
* Free (re)alloc'ed pointers when strdup() fails.
snmp plugin: Fix "Assigned value is garbage or undefined" warning.
src/utils_latency.c: Fix "Assigned value is garbage or undefined" warning.
threshold plugin: Fix "Dead assignment" warnings.
Merge branch 'collectd-5.5'
Merge branch 'collectd-5.4' into collectd-5.5
modbus plugin: Make sure variable is initialized.
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
stats plugin: Link with libm (-lm).
Fixes a bug reported by @Tenzer:
symbol lookup error: /usr/lib/collectd/statsd.so: undefined symbol: log
Fixes a bug reported by @Tenzer:
symbol lookup error: /usr/lib/collectd/statsd.so: undefined symbol: log
tail plugin: Make sure variable is initialized.
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).
Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warnings.
threshold plugin: Fix "Dead increment" warnings.
Fix "Argument with 'nonnull' attribute passed null" warnings.
Merge branch 'collectd-5.5'
Merge branch 'collectd-5.4' into collectd-5.5
threshold plugin: Fix "Dead assignment" warning.
ted plugin: Fix "Dead assignment" warning.
tail_csv plugin: Fix "Dead assignment" warning.
tail plugin: Fix "Dead assignment" warning.
snmp plugin: Fix "Dead assignment" warning.
powerdns plugin: Fix "Dead assignment" warning.
ping plugin: Fix "Dead assignment" warning.
onewire plugin: Fix "Dead assignment" warning.
openvpn plugin: Fix "Dead assignment" warning.
ntpd plugin: Fix "Dead assignment" warning.
network plugin: Fix "Dead assignment" warning.
modbus plugin: Fix "Dead assignment" warning.
onewire plugin: Fix "Dead assignment" warning.
nfs plugin: Fix handling of servers with 42 or 44 fields.
battery plugin: Fix file descriptor leak.
src/libcollectdclient/client.c: Fix "Dead assignment" warning.
gmond plugin: Fix handling of COUNTER and ABSOLUTE data sources.
email plugin: Fix "Dead assignment" warning.
src/daemon/filter_chain.c: Fix "Dead assignment" warning.
curl_json plugin: Fix "Dead assignment" warning.
amqp plugin: Fix "Dead assignment" warning.
src/utils_avltree.c: Add assertions to rotate_{left,right}().
clang's static code analysis thought that x->right / x->left could be NULL,
reporting false positives. Let's see if this fixes it.
clang's static code analysis thought that x->right / x->left could be NULL,
reporting false positives. Let's see if this fixes it.