src/utils_llist.c: Handle unlikely corner case.
This handles the following (unlikely) case:
(l->head == NULL) && (e == NULL)
In this case, the following code will dereference a NULL pointer:
if (l->head == e)
l->head = e->next;
This handles the following (unlikely) case:
(l->head == NULL) && (e == NULL)
In this case, the following code will dereference a NULL pointer:
if (l->head == e)
l->head = e->next;
src/utils_avltree.c: Rewrite checks in c_avl_pick().
The previous code made the (correct) assumption that "height" is always
greater than zero. This tripped up clang's "scan-build".
This confuses the static analysis in two more places in this file, which
are not as easy to fix :(
The previous code made the (correct) assumption that "height" is always
greater than zero. This tripped up clang's "scan-build".
This confuses the static analysis in two more places in this file, which
are not as easy to fix :(
network plugin: Explicitly initialize "fd_num" to zero.
I have the feeling that initialization via memset() and unions in the sockent
structure confuse clang's scan-build.
I have the feeling that initialization via memset() and unions in the sockent
structure confuse clang's scan-build.
notification target: Pass void** to tn_destroy().
The previous call was bad, resulting in errors in free().
The previous call was bad, resulting in errors in free().
perl plugin: Fix invalid free().
notification_meta_t.name is a char[], which we must not free.
notification_meta_t.name is a char[], which we must not free.
In rrd synchronous file creation use lock_file
to prevent the creation of the same file at the same time multiple times
and obtain a corrupt rrd file.
to prevent the creation of the same file at the same time multiple times
and obtain a corrupt rrd file.
Allow empty Plugin blocks.
Corrected text in README
collectd.conf.pod: update libyajl URL
Fixes #1081
Thanks to @msalmonse for pointing this out!
Fixes #1081
Thanks to @msalmonse for pointing this out!
Fix a libtool warning
libtool: warning: '-version-info/-version-number' is ignored for
convenience libraries
libtool: warning: '-version-info/-version-number' is ignored for
convenience libraries
write_redis plugin: Check the return value of format_values().
write_redis: Increase parsability by using format_values from common.h
write_redis: Increase parsability of multi-valued keys by insterting delimiting characters
configure.ac: Move all checks for "struct ip6_ext" into one place.
Fixes: #348
Fixes: #348
Automatically add -DSOLARIS2=8 if required for ip6_ext
Fixes: #348
Fixes: #348
dns plugin: Check for "struct ip6_ext".
Solaris appears to declare the struct, but only when The Right defines
are specified at compile time. As a quick and dirty fix, only build with
IPv6 support when the struct is usable.
Fixes: #348
Solaris appears to declare the struct, but only when The Right defines
are specified at compile time. As a quick and dirty fix, only build with
IPv6 support when the struct is usable.
Fixes: #348
vmem plugin: fix types for nr_dirtied and nr_written
tcpconns plugin: Fix memory leak.
"prev" was set to NULL and never updated, leading to "port_list_head" to
be set to an entry later in the list. This leaks memory because earlier
entries in the list are now unreachable.
Fixes: #1074
"prev" was set to NULL and never updated, leading to "port_list_head" to
be set to an entry later in the list. This leaks memory because earlier
entries in the list are now unreachable.
Fixes: #1074
src/configfile.c: Set a plugin context when autoloading plugins.
Fixes: #1069
Fixes: #1069
statsd plugin: Dispatch NaN when no timer event was recorded.
This makes timing events appear faster when writing to RRD files.
Fixes: #1038, #1049
This makes timing events appear faster when writing to RRD files.
Fixes: #1038, #1049
tail_csv plugin: Print warning and continue when metric is not found.
Previously, when multiple metrics were specified on one "Collect" line and one
didn't exist, all *following* metrics would be ignored. This patch changes this
to continue in this case and configure as many metrics as possible.
Previously, when multiple metrics were specified on one "Collect" line and one
didn't exist, all *following* metrics would be ignored. This patch changes this
to continue in this case and configure as many metrics as possible.
Plugin tail_csv: the manual says that you can use multiple times the
Collect option but the code expecs t"Collect n1 n2 n3 n4", fix
to allow to put the option Collect multiple times.
Collect option but the code expecs t"Collect n1 n2 n3 n4", fix
to allow to put the option Collect multiple times.
Plugin tail_csv: if TimeFrom is not specified in config file
the default value for time_from is -1 and the type of fileds_num
is size_t, so the comparsion of signed and unsigned not work as espected
the default value for time_from is -1 and the type of fileds_num
is size_t, so the comparsion of signed and unsigned not work as espected
stats plugin: Fix reference of undeclared symbol.
Issue: #997
Issue: #997
statsd plugin: Free latency counter and AVL trees.
latency counters (used by TIMER metrics) and AVL trees (used by SET metrics)
were not freed when cleaning up unused metrics. This resulted in leaked memory.
Fixes: #997
latency counters (used by TIMER metrics) and AVL trees (used by SET metrics)
were not freed when cleaning up unused metrics. This resulted in leaked memory.
Fixes: #997
Merge remote-tracking branch 'origin/collectd-5.3' into collectd-5.4
bindings/java/Makefile.am: Add "uninstall-local" target.
Otherwise "make distcheck" will complain about leftover files.
Otherwise "make distcheck" will complain about leftover files.
bindings/java/Makefile.am: Use $(srcdir) when specifying dependencies.
This fixes out-of-tree builds, like "make distcheck" does.
This fixes out-of-tree builds, like "make distcheck" does.
write_redis: Fix timestamp sent to Redis.
Various plugins: Use the global GAUGE_FORMAT.
This fixes the postgresql, rrdtool, target_notification, write_graphite and
write_redis plugins to use the globally defined format for gauges.
Issue #1039
This fixes the postgresql, rrdtool, target_notification, write_graphite and
write_redis plugins to use the globally defined format for gauges.
Issue #1039
src/collectd.h: Define GAUGE_FORMAT.
This format is also used in format_values(), so exported gauges follow a common
format.
See also issue #1039
This format is also used in format_values(), so exported gauges follow a common
format.
See also issue #1039
src/utils_format_json.[ch]: Export gauges with 15 decimal places of precision.
Fixes: #1039
Fixes: #1039
Merge branch 'collectd-5.3' into collectd-5.4
Merge branch 'collectd-4.10' into collectd-5.3
curl_xml: fix 3 small memory leaks
Discovered while testing the previous 2 commits. NB: valgrind
already complained about these before 0afea606 was applied, so this
isn't related to issue #935.
Discovered while testing the previous 2 commits. NB: valgrind
already complained about these before 0afea606 was applied, so this
isn't related to issue #935.
Fix test for tables and empty instance
Change-Id: I9a3fc3ded9566bd68c80e5fbce2d8b717ea1848d
Change-Id: I9a3fc3ded9566bd68c80e5fbce2d8b717ea1848d
Revert "curl_xml plugin: Fixed tautological pointer comparison error."
Fixes #931
This reverts commit 0afea60611f115a28b8ec331aba610e3038c1ef2.
Fixes #931
This reverts commit 0afea60611f115a28b8ec331aba610e3038c1ef2.
Enable the processes plugin by default on Solaris.
It now builds and works correctly in both 32-bit and 64-bit mode.
It now builds and works correctly in both 32-bit and 64-bit mode.
processes: Solaris: Consistently use long to represent a pid
pid_t may be defined as an int or a long depending on circumstances.
Use a long everywhere so we don't have to fiddle with typecasts.
This fixes an issue where an incorrect printf format string would
be used for a pid_t in 32-bit builds.
pid_t may be defined as an int or a long depending on circumstances.
Use a long everywhere so we don't have to fiddle with typecasts.
This fixes an issue where an incorrect printf format string would
be used for a pid_t in 32-bit builds.
processes: Fix build for Solaris 32-bit binary
Work around a #error in <sys/procfs.h> that occurs when building a
32-bit binary with _FILE_OFFSET_BITS=64. This uses a hack similar
to the one in swap.c.
Work around a #error in <sys/procfs.h> that occurs when building a
32-bit binary with _FILE_OFFSET_BITS=64. This uses a hack similar
to the one in swap.c.
processes: Fix ps_get_cmdline() on Solaris.
Return value of read_file_contents() was checked incorrectly.
Return value of read_file_contents() was checked incorrectly.
zfs_arc: Don't spam the log if we fail to read the "l2_size" kstat value.
The value got lost with some patch to Solaris 10 and has only reappeared
recently in 11.2. If we ever fail to read this value, stop trying, so we
don't report an error on every interval.
The value got lost with some patch to Solaris 10 and has only reappeared
recently in 11.2. If we ever fail to read this value, stop trying, so we
don't report an error on every interval.
oconfig: fix oconfig_free to free all elements
The recursive nature of this function made it difficult to free the root
node of the config tree. Splitting it in 2 allows to work around this
problem.
The recursive nature of this function made it difficult to free the root
node of the config tree. Splitting it in 2 allows to work around this
problem.
Merge branch 'collectd-5.3' into collectd-5.4
/bin/sh on OSX doesn't understand -n
This breaks PACKAGEVERSION since the -n is left verbatim in the string.
Use the more portable printf instead
This breaks PACKAGEVERSION since the -n is left verbatim in the string.
Use the more portable printf instead
Merge pull request #1014 from mfournier/fix-path-to-java
improve java detection/defaults in configure script
improve java detection/defaults in configure script
RPM specfile: update summary to be consistent with .deb packages
RPM specfile: remove superfluous '--without-*' configure flags
- use _POSIX2_LINE_MAX for errbuf as stated by kvm(3).
- fix error msg on kvm_openfiles failure
- fix error msg on kvm_openfiles failure
fixes swap plugin on FreeBSD Jail
fixes processes plugin on FreeBSD Jail
configure: add return() statements in 3 AC_LANG_PROGRAM() blocks
This allows the dns and df plugins to get built also in the case the
configure script is run with `CC="gcc -Wall -Werror"`.
This allows the dns and df plugins to get built also in the case the
configure script is run with `CC="gcc -Wall -Werror"`.
RPM specfile: correct copy-paste error
make java components discovery follow symlinks
When `--with-java` points to a symlink, `find` should resolve it, making
the configure script work seamlessly with symlinks pointing to JDK
installations.
This fixes the confusing discrepancy between `--with-java=/path/to/java`
failing and `--with-java=/path/to/java/` working.
When `--with-java` points to a symlink, `find` should resolve it, making
the configure script work seamlessly with symlinks pointing to JDK
installations.
This fixes the confusing discrepancy between `--with-java=/path/to/java`
failing and `--with-java=/path/to/java/` working.
Fallback to /usr/lib/jvm if JAVA_HOME is not set
This makes the java plugin build out of the box
on systems with a JDK installed.
/usr/lib/jvm is the default location for the JDK
on at least Fedora, Red Hat and Debian.
This makes the java plugin build out of the box
on systems with a JDK installed.
/usr/lib/jvm is the default location for the JDK
on at least Fedora, Red Hat and Debian.
Merge branch 'collectd-4.10' into collectd-5.3
check if AMQP_VERSION exists
fix build with librabbitmq 0.6.0
Update meta_data.c
In the function meta_data_get_string(), when the type mismatchs,the ERROR statement should be
ERROR ("meta_data_get_string: Type mismatch for key `%s'", e->key);
not
ERROR ("meta_data_get_signed_int: Type mismatch for key `%s'", e->key);
In the function meta_data_get_string(), when the type mismatchs,the ERROR statement should be
ERROR ("meta_data_get_string: Type mismatch for key `%s'", e->key);
not
ERROR ("meta_data_get_signed_int: Type mismatch for key `%s'", e->key);
Merge branch 'collectd-5.3' into collectd-5.4
Merge branch 'collectd-4.10' into collectd-5.3
notify_email: avoid linking against libdl
This flag seems to have been accidentally added in 451d75bae1 and
prevents building the plugin on platforms which don't have GNU libc.
Conflicts:
src/Makefile.am
This flag seems to have been accidentally added in 451d75bae1 and
prevents building the plugin on platforms which don't have GNU libc.
Conflicts:
src/Makefile.am
Merge branch 'collectd-5.3' into collectd-5.4
Revert "version-gen.sh: Switch to bash due to bashisms."
The last bashism was removed in 4d376681. Reverting to /bin/sh prevents
build errors on platforms without bash installed by default.
This reverts commit 3bda88e8b425f43644e303e6957e38ae59c1bc83.
The last bashism was removed in 4d376681. Reverting to /bin/sh prevents
build errors on platforms without bash installed by default.
This reverts commit 3bda88e8b425f43644e303e6957e38ae59c1bc83.
network: set ttl before opening server sockets
If TimeToLive is defined in collectd.conf after Server options, the
net_config_ttl value is updated after network_config_add_server and
the desired ttl is not used.
If TimeToLive is defined in collectd.conf after Server options, the
net_config_ttl value is updated after network_config_add_server and
the desired ttl is not used.
Warn if ttl is out of bounds
openvpn plugin: Don't signal an error when no clients are connected.
In the multi1_read() function, an error (zero) was returned when no
clients were currently connected to the OpenVPN server, because the
"read" variable was initialized to zero and the while loop exited before
it was set to one. This is not the intended behavior.
Thanks to @srix for reporting this issue!
Fixes: #731
In the multi1_read() function, an error (zero) was returned when no
clients were currently connected to the OpenVPN server, because the
"read" variable was initialized to zero and the while loop exited before
it was set to one. This is not the intended behavior.
Thanks to @srix for reporting this issue!
Fixes: #731
Merge branch 'collectd-5.3' into collectd-5.4
dbi plugin: fix a warning mentioning snmp plugin
curl: correct typo in error message
doc & comments: s/mili/milli/
Merge branch 'collectd-4.10' into collectd-5.3
Fix type instance sanitization in bind plugin
Upgrade spec to 5.4.2
Merge branch 'collectd-5.3' into collectd-5.4
Conflicts:
contrib/redhat/collectd.spec
src/collectd.conf.pod
Conflicts:
contrib/redhat/collectd.spec
src/collectd.conf.pod
RPM specfile: bump version number
Thanks to @Poil for pointing that out !
Thanks to @Poil for pointing that out !
collectd.conf(5): move misplaced block in postgresql section
Remove more references to the Globals option
This is a follow up to commit 5eabeb9248
At this point, the last reference to Globals in the doc & examples is
the detailed explanation in collectd.conf(5).
This is a follow up to commit 5eabeb9248
At this point, the last reference to Globals in the doc & examples is
the detailed explanation in collectd.conf(5).
Makefile.am: s/INCLUDES/AM_CPPFLAGS/
Fixes the following warning:
Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Fixes the following warning:
Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
write_mongodb plugin: Fix BSON memory handling even further.
According to the mongo-c-driver 0.8.1 documentation, each call to
bson_alloc() needs to be matched by a call to bson_dealloc() and each
call to bson_init() needs to be matched by a call to bson_destroy().
Additionally, this patch adds macros for mongo-c-driver < 0.8.0 to map
the new bson_alloc() and bson_deallow() names to the old bson_create()
and bson_dispose() symbol names.
Tested with mongo-c-driver 0.8.1 and 0.7.1.
Fixes: #331, #956
According to the mongo-c-driver 0.8.1 documentation, each call to
bson_alloc() needs to be matched by a call to bson_dealloc() and each
call to bson_init() needs to be matched by a call to bson_destroy().
Additionally, this patch adds macros for mongo-c-driver < 0.8.0 to map
the new bson_alloc() and bson_deallow() names to the old bson_create()
and bson_dispose() symbol names.
Tested with mongo-c-driver 0.8.1 and 0.7.1.
Fixes: #331, #956
write_mongodb plugin: s/bson_dispose/bson_destroy/
Thanks to @eremenko for providing the initial patch!
Fixes: #331, #956
Thanks to @eremenko for providing the initial patch!
Fixes: #331, #956
Statsd: avoid doing a division by zero when calculating the percentile with an empty histogram.
Statsd: avoid doing a division by zero when calculating the average if we didn't get any values.
utils_latency: use portable format string
statsd histogram to support more than 1 second
Summary:
Problem: Collectd/Statsd supports configurable percentiles for timers but it limits the value to be 1 to 1000ms. If the timer value is more than 1000ms, it uses for min, max, average,... and drops it for percentile computation.
Solution: Added support for increasing bin width when the value is above histogram's range.
Test Plan: Tested by sending metrics within range and out-of-range (ie above 1000 ms)
Reviewers: skhajamo, shalstea
Reviewed By: skhajamo
CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D156454
Summary:
Problem: Collectd/Statsd supports configurable percentiles for timers but it limits the value to be 1 to 1000ms. If the timer value is more than 1000ms, it uses for min, max, average,... and drops it for percentile computation.
Solution: Added support for increasing bin width when the value is above histogram's range.
Test Plan: Tested by sending metrics within range and out-of-range (ie above 1000 ms)
Reviewers: skhajamo, shalstea
Reviewed By: skhajamo
CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D156454
configure: add liblvm2app to summary output
Merge branch 'collectd-5.3' into collectd-5.4
Conflicts:
configure.ac
Conflicts:
configure.ac
configure: add missing entries in summary output
... and reorder alphabetically.
... and reorder alphabetically.
Merge pull request #951 from tokkee/sh/debian-patches
plugin: Use strcasecmp rather than strncasecmp to find a plugin.
plugin: Use strcasecmp rather than strncasecmp to find a plugin.
Powerdns plugin: fix logging on failed lookup
Don't look past the end of the array but check the boundary first.
Don't look past the end of the array but check the boundary first.
plugin: Use strcasecmp rather than strncasecmp to find a plugin.
This makes collectd resistant against vulnerable copies of libltdl
(CVE-2009-3736). See <http://bugs.debian.org/559801#15> for further
details.
This makes collectd resistant against vulnerable copies of libltdl
(CVE-2009-3736). See <http://bugs.debian.org/559801#15> for further
details.
Bump version to 5.4.2; Update ChangeLog.
Merge branch 'collectd-5.3' into collectd-5.4
ChangeLog: Add libdbi fix.
dbi plugin: Switch to libdbi's thread-safe interface.
Macros are in place to make buliding with libdbi <0.9.0 possible.
Fixes: #950
Macros are in place to make buliding with libdbi <0.9.0 possible.
Fixes: #950
Bump version to 5.3.2; Update ChangeLog.
collectd-exec(5): Clarify the format of the Time: header.
Revert "Plugin exec: change notification time to integer."
This was working as intended.
This reverts commit 07e4683f7f985668641d79137b64d148bc18ba8a.
This was working as intended.
This reverts commit 07e4683f7f985668641d79137b64d148bc18ba8a.