Code

collectd.git
9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Marc Fournier [Sat, 1 Aug 2015 07:30:22 +0000 (09:30 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agoAdd utils_parse_option.c/h to amqp plugin source files list
Shahul Hameed [Mon, 20 Jul 2015 17:06:23 +0000 (13:06 -0400)]
Add utils_parse_option.c/h to amqp plugin source files list

9 years agocollectd -T: fix memory leak
Ruben Kerkhof [Sat, 25 Jul 2015 09:57:12 +0000 (11:57 +0200)]
collectd -T: fix memory leak

9 years agoFix some small leaks on error paths
Ruben Kerkhof [Sat, 25 Jul 2015 17:17:07 +0000 (19:17 +0200)]
Fix some small leaks on error paths

9 years agoliboconfig: really fix lex warnings
Ruben Kerkhof [Sat, 25 Jul 2015 19:29:50 +0000 (21:29 +0200)]
liboconfig: really fix lex warnings

Flex has two options to disable input and unput.
Turn them on.

9 years agoAdd remark about length of HostnameFormat string in virt plugin
Wojtek Bocer [Mon, 27 Jul 2015 08:16:46 +0000 (09:16 +0100)]
Add remark about length of HostnameFormat string in virt plugin

9 years agoUse standard ints in write_kafka plugin for portability
Shahul Hameed [Wed, 29 Jul 2015 15:06:50 +0000 (11:06 -0400)]
Use standard ints in write_kafka plugin for portability

9 years agosrc/utils_latency.c: Fix format string error.
Florian Forster [Tue, 14 Jul 2015 06:42:15 +0000 (08:42 +0200)]
src/utils_latency.c: Fix format string error.

9 years agosrc/utils_latency.c: Ensure that LLONG_MAX is defined.
Florian Forster [Tue, 14 Jul 2015 06:34:52 +0000 (08:34 +0200)]
src/utils_latency.c: Ensure that LLONG_MAX is defined.

EPEL5 doesn't have it in <limits.h> apparently.

9 years agosrc/utils_latency.c: Store "bin_width" as cdtime_t.
Florian Forster [Mon, 13 Jul 2015 09:53:58 +0000 (11:53 +0200)]
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

9 years agosrc/utils_latency.c: Fix change_bin_width().
Florian Forster [Sun, 12 Jul 2015 10:58:20 +0000 (12:58 +0200)]
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.

9 years agovarnish: fix leak on read
Ruben Kerkhof [Sat, 4 Jul 2015 20:49:49 +0000 (22:49 +0200)]
varnish: fix leak on read

Since VSM_Close doesn't free the object we leak a few bytes
every interval

9 years agoRevert "fix leak on exit"
Florian Forster [Fri, 10 Jul 2015 09:29:45 +0000 (11:29 +0200)]
Revert "fix leak on exit"

This reverts commit 35e6b9d366016300178a55b163ac0173d7be5874.

9 years agovarnish: fix some leaks in error paths
Ruben Kerkhof [Sat, 4 Jul 2015 21:04:30 +0000 (23:04 +0200)]
varnish: fix some leaks in error paths

9 years agofix leak on exit
Ruben Kerkhof [Sat, 4 Jul 2015 18:02:57 +0000 (20:02 +0200)]
fix leak on exit

9 years agoplugin.c: plug leak on error
Ruben Kerkhof [Sat, 4 Jul 2015 17:56:20 +0000 (19:56 +0200)]
plugin.c: plug leak on error

9 years agomemcached: plug leak
Ruben Kerkhof [Sat, 4 Jul 2015 17:54:49 +0000 (19:54 +0200)]
memcached: plug leak

9 years agogmond: plug a small leak on exit
Ruben Kerkhof [Sat, 4 Jul 2015 15:35:03 +0000 (17:35 +0200)]
gmond: plug a small leak on exit

9 years agocollectd.conf.pod: correct a tiny typo
Marc Fournier [Wed, 8 Jul 2015 22:07:36 +0000 (00:07 +0200)]
collectd.conf.pod: correct a tiny typo

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Marc Fournier [Tue, 7 Jul 2015 22:29:58 +0000 (00:29 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agobuild: add libavltree, libcommon & libheap dependencies
Gustavo Zacarias [Mon, 6 Jul 2015 12:59:30 +0000 (09:59 -0300)]
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>
9 years agoAdd test-suite logs to .gitignore
Ruben Kerkhof [Sat, 4 Jul 2015 11:25:23 +0000 (13:25 +0200)]
Add test-suite logs to .gitignore

9 years agocollectd.conf: order plugins alphabetically again
Ruben Kerkhof [Sat, 4 Jul 2015 17:52:52 +0000 (19:52 +0200)]
collectd.conf: order plugins alphabetically again

9 years agoFix Perl errors
Ruud van Melick [Tue, 30 Jun 2015 16:08:49 +0000 (16:08 +0000)]
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 "}"

9 years agobind: fix zone count check
Michal Humpula [Mon, 6 Jul 2015 11:43:43 +0000 (13:43 +0200)]
bind: fix zone count check

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Sun, 28 Jun 2015 13:05:36 +0000 (15:05 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agosrc/daemon/common.c: Fix off-by-one error in escape_slashes().
Florian Forster [Sun, 28 Jun 2015 12:05:05 +0000 (14:05 +0200)]
src/daemon/common.c: Fix off-by-one error in escape_slashes().

Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.

9 years agoproperly handle error cases when kvm_read fails (#1094)
Landry Breuil [Wed, 24 Jun 2015 04:48:16 +0000 (06:48 +0200)]
properly handle error cases when kvm_read fails (#1094)

9 years agodon't report inodes if fs doesn't provide f_files and f_ffree
Marek Becka [Wed, 24 Jun 2015 15:39:55 +0000 (11:39 -0400)]
don't report inodes if fs doesn't provide f_files and f_ffree

9 years agowrite_redis plugin: Call freeReplyObject() for each redisReply.
Florian Forster [Thu, 25 Jun 2015 20:18:27 +0000 (22:18 +0200)]
write_redis plugin: Call freeReplyObject() for each redisReply.

9 years agobarometer plugin: Fix "Allocator sizeof operand mismatch" warning.
Florian Forster [Fri, 19 Jun 2015 18:03:08 +0000 (20:03 +0200)]
barometer plugin: Fix "Allocator sizeof operand mismatch" warning.

9 years agowrite_sensu plugin: Fix debug message.
Florian Forster [Fri, 19 Jun 2015 17:27:27 +0000 (19:27 +0200)]
write_sensu plugin: Fix debug message.

It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.

9 years agowrite_sensu plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 14:27:26 +0000 (16:27 +0200)]
write_sensu plugin: Fix memory leak.

9 years agoturbostat plugin: Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warning.
Florian Forster [Fri, 19 Jun 2015 14:26:53 +0000 (16:26 +0200)]
turbostat plugin: Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warning.

9 years agoopenvpn plugin: Fix "Dead assignment" warning.
Florian Forster [Fri, 19 Jun 2015 14:26:12 +0000 (16:26 +0200)]
openvpn plugin: Fix "Dead assignment" warning.

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Fri, 19 Jun 2015 13:11:39 +0000 (15:11 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agosrc/utils_cmd_flush.c: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 11:06:34 +0000 (13:06 +0200)]
src/utils_cmd_flush.c: Fix memory leak.

9 years agosrc/utils_rrdcreate.c: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
src/utils_rrdcreate.c: Fix memory leak.

9 years agosrc/utils_ignorelist.c: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
src/utils_ignorelist.c: Fix memory leak.

Turns out, regfree(3) cleans up the memory allocated by regcomp(3), but
not the pointer itself.

9 years agosrc/utils_cmd_putval.c: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
src/utils_cmd_putval.c: Fix memory leak.

9 years agoutils_cache plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
utils_cache plugin: Fix memory leak.

9 years agorrdtool plugin: Add assertion.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
rrdtool plugin: Add assertion.

This helps the static code analysis to figure out that memory is not
leaking after all.

9 years agopowerdns plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
powerdns plugin: Fix memory leak.

While at it, replace the powerdns_config_add_string() function.

9 years agomemcachec plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
memcachec plugin: Fix memory leak.

9 years agojava plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
java plugin: Fix memory leak.

9 years agoipvs plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
ipvs plugin: Fix memory leak.

9 years agogmond plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
gmond plugin: Fix memory leak.

9 years agocurl_xml plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
curl_xml plugin: Fix memory leak.

9 years agocurl_json plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
curl_json plugin: Fix memory leak.

9 years agocurl plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
curl plugin: Fix memory leak.

9 years agocollectdmon: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
collectdmon: Fix memory leak.

9 years agoapache plugin: Fix memory leak.
Florian Forster [Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)]
apache plugin: Fix memory leak.

9 years agosrc/utils_cache.c: Fix two memory leaks.
Florian Forster [Fri, 19 Jun 2015 05:05:22 +0000 (07:05 +0200)]
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.

9 years agosnmp plugin: Fix "Assigned value is garbage or undefined" warning.
Florian Forster [Thu, 18 Jun 2015 15:46:03 +0000 (17:46 +0200)]
snmp plugin: Fix "Assigned value is garbage or undefined" warning.

9 years agosrc/utils_latency.c: Fix "Assigned value is garbage or undefined" warning.
Florian Forster [Thu, 18 Jun 2015 15:45:52 +0000 (17:45 +0200)]
src/utils_latency.c: Fix "Assigned value is garbage or undefined" warning.

9 years agothreshold plugin: Fix "Dead assignment" warnings.
Florian Forster [Thu, 18 Jun 2015 15:31:03 +0000 (17:31 +0200)]
threshold plugin: Fix "Dead assignment" warnings.

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Thu, 18 Jun 2015 14:52:09 +0000 (16:52 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agomodbus plugin: Make sure variable is initialized.
Florian Forster [Thu, 18 Jun 2015 14:45:23 +0000 (16:45 +0200)]
modbus plugin: Make sure variable is initialized.

This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).

9 years agostats plugin: Link with libm (-lm).
Florian Forster [Thu, 18 Jun 2015 14:09:10 +0000 (16:09 +0200)]
stats plugin: Link with libm (-lm).

Fixes a bug reported by @Tenzer:

    symbol lookup error: /usr/lib/collectd/statsd.so: undefined symbol: log

9 years agotail plugin: Make sure variable is initialized.
Florian Forster [Thu, 18 Jun 2015 13:31:11 +0000 (15:31 +0200)]
tail plugin: Make sure variable is initialized.

This was introduced by the merge
(09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b).

9 years agoFix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warnings.
Florian Forster [Thu, 18 Jun 2015 13:27:54 +0000 (15:27 +0200)]
Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warnings.

9 years agothreshold plugin: Fix "Dead increment" warnings.
Florian Forster [Thu, 18 Jun 2015 12:45:02 +0000 (14:45 +0200)]
threshold plugin: Fix "Dead increment" warnings.

9 years agoFix "Argument with 'nonnull' attribute passed null" warnings.
Florian Forster [Thu, 18 Jun 2015 11:36:02 +0000 (13:36 +0200)]
Fix "Argument with 'nonnull' attribute passed null" warnings.

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Thu, 18 Jun 2015 11:05:14 +0000 (13:05 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agothreshold plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
threshold plugin: Fix "Dead assignment" warning.

9 years agoted plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
ted plugin: Fix "Dead assignment" warning.

9 years agotail_csv plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
tail_csv plugin: Fix "Dead assignment" warning.

9 years agotail plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 08:27:42 +0000 (10:27 +0200)]
tail plugin: Fix "Dead assignment" warning.

9 years agosnmp plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
snmp plugin: Fix "Dead assignment" warning.

9 years agopowerdns plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
powerdns plugin: Fix "Dead assignment" warning.

9 years agoping plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
ping plugin: Fix "Dead assignment" warning.

9 years agoonewire plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 08:25:41 +0000 (10:25 +0200)]
onewire plugin: Fix "Dead assignment" warning.

9 years agoopenvpn plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
openvpn plugin: Fix "Dead assignment" warning.

9 years agontpd plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
ntpd plugin: Fix "Dead assignment" warning.

9 years agonetwork plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
network plugin: Fix "Dead assignment" warning.

9 years agomodbus plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
modbus plugin: Fix "Dead assignment" warning.

9 years agoonewire plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
onewire plugin: Fix "Dead assignment" warning.

9 years agonfs plugin: Fix handling of servers with 42 or 44 fields.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
nfs plugin: Fix handling of servers with 42 or 44 fields.

9 years agobattery plugin: Fix file descriptor leak.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
battery plugin: Fix file descriptor leak.

9 years agosrc/libcollectdclient/client.c: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
src/libcollectdclient/client.c: Fix "Dead assignment" warning.

9 years agogmond plugin: Fix handling of COUNTER and ABSOLUTE data sources.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
gmond plugin: Fix handling of COUNTER and ABSOLUTE data sources.

9 years agoemail plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
email plugin: Fix "Dead assignment" warning.

9 years agosrc/daemon/filter_chain.c: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
src/daemon/filter_chain.c: Fix "Dead assignment" warning.

9 years agocurl_json plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
curl_json plugin: Fix "Dead assignment" warning.

9 years agoamqp plugin: Fix "Dead assignment" warning.
Florian Forster [Thu, 18 Jun 2015 07:16:18 +0000 (09:16 +0200)]
amqp plugin: Fix "Dead assignment" warning.

9 years agosrc/utils_avltree.c: Add assertions to rotate_{left,right}().
Florian Forster [Wed, 17 Jun 2015 20:08:19 +0000 (22:08 +0200)]
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.

9 years agosnmp plugin: Fix off-by-one array access.
Florian Forster [Wed, 17 Jun 2015 17:12:45 +0000 (19:12 +0200)]
snmp plugin: Fix off-by-one array access.

9 years agoexec plugin: Don't assign variable that is never read.
Florian Forster [Wed, 17 Jun 2015 15:38:41 +0000 (17:38 +0200)]
exec plugin: Don't assign variable that is never read.

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Wed, 17 Jun 2015 15:29:38 +0000 (17:29 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agosrc/utils_db_query.c: Fix use-after-free.
Florian Forster [Wed, 17 Jun 2015 15:28:39 +0000 (17:28 +0200)]
src/utils_db_query.c: Fix use-after-free.

"r_area->next" was evaluated after "r_area" was freed.

9 years agobarometer plugin: Initialize output arrays.
Florian Forster [Wed, 17 Jun 2015 15:19:01 +0000 (17:19 +0200)]
barometer plugin: Initialize output arrays.

9 years agosrc/daemon/common.c: Implement strjoin() with memcpy().
Florian Forster [Wed, 17 Jun 2015 14:19:25 +0000 (16:19 +0200)]
src/daemon/common.c: Implement strjoin() with memcpy().

The previous implementation used strncat() which has the unfortunate and
unintuitive behavior of copying n+1 bytes to the buffer.

9 years agosrc/utils_cache.c: Remove incorrect free.
Florian Forster [Wed, 17 Jun 2015 13:20:41 +0000 (15:20 +0200)]
src/utils_cache.c: Remove incorrect free.

"ce" is not updated / used in this loop, so it would be theoretically
possible for "ce" to be freed twice.

9 years agofix openldap segfatult when ldapi is used v2
Marek Becka [Tue, 16 Jun 2015 14:59:20 +0000 (10:59 -0400)]
fix openldap segfatult when ldapi is used  v2

9 years agofix openldap segfatult when ldapi is used
Marek Becka [Thu, 11 Jun 2015 17:52:41 +0000 (13:52 -0400)]
fix openldap segfatult when ldapi is used

9 years agoMerge branch 'collectd-5.4' into collectd-5.5
Florian Forster [Wed, 17 Jun 2015 12:52:22 +0000 (14:52 +0200)]
Merge branch 'collectd-5.4' into collectd-5.5

9 years agonetwork plugin: Avoid "status may be used uninitialized" warning.
Florian Forster [Wed, 17 Jun 2015 09:41:55 +0000 (11:41 +0200)]
network plugin: Avoid "status may be used uninitialized" warning.

9 years agoliboconfig: Declare yylex().
Florian Forster [Wed, 17 Jun 2015 08:48:27 +0000 (10:48 +0200)]
liboconfig: Declare yylex().

9 years agoemail plugin: Fix freeing linked lists.
Florian Forster [Wed, 17 Jun 2015 08:37:31 +0000 (10:37 +0200)]
email plugin: Fix freeing linked lists.

The previous code essentially did:

    for (…; …; ptr = ptr->next)
      free (ptr);

The "ptr->next" is a use-after-free.

9 years agonetwork plugin: Make sure all memory is freed when the receive thread fails.
Florian Forster [Wed, 17 Jun 2015 08:26:21 +0000 (10:26 +0200)]
network plugin: Make sure all memory is freed when the receive thread fails.

Not all that useful (your receive thread just died …) but hopefully
makes the static analysis happy.