Merge branch 'collectd-5.6' into collectd-5.7
curl_json plugin: Fix array index and key handling.
Previously, the "key" was loaded by calling cj_cb_map_key() from
cj_cb_inc_array_index(). That means that the key for the previous element
was loaded as the array index was updated for the next element, resulting
in an off-by-one error. Also the key was not unset in time, resulting in
two metrics with the same identifier being created.
This patch fixes this with the following changes:
* cj_advance_array() (nee cj_cb_inc_array_index()) now loads the key for
the new index position instead of the previous one.
* The initial "0" key is loaded from cj_cb_start_array().
* cj_advance_array() always updates the key. The "update_key" argument
has been removed.
* Refactoring: key loading has been moved out of cj_cb_map_key() and
into its own function, cj_load_key().
Unit tests are in a separate commit for easier cherry-picking.
Fixes: #2266
Previously, the "key" was loaded by calling cj_cb_map_key() from
cj_cb_inc_array_index(). That means that the key for the previous element
was loaded as the array index was updated for the next element, resulting
in an off-by-one error. Also the key was not unset in time, resulting in
two metrics with the same identifier being created.
This patch fixes this with the following changes:
* cj_advance_array() (nee cj_cb_inc_array_index()) now loads the key for
the new index position instead of the previous one.
* The initial "0" key is loaded from cj_cb_start_array().
* cj_advance_array() always updates the key. The "update_key" argument
has been removed.
* Refactoring: key loading has been moved out of cj_cb_map_key() and
into its own function, cj_load_key().
Unit tests are in a separate commit for easier cherry-picking.
Fixes: #2266
collectd.conf(5): Fix typo ("queries" vs. "queried").
By avoiding the word: "metrics" is bettern than "statistics".
By avoiding the word: "metrics" is bettern than "statistics".
Merge pull request #2278 from octo/ff/perl
perl plugin: Fix potential double-free.
perl plugin: Fix potential double-free.
perl plugin: Fix potential double-free.
The av2notification_meta() function updated it's parameter by doing
(*m) = malloc();
Afterwards, if an error occurred, it would call `free(*m);` and (potentially)
return, leaving an invalid pointer stored in `m`. The caller would then try to
free the returned pointer because it was non-NULL.
This patch fixes this by doing several code cleanups:
* The meta argument is not updated unnecessarily. Instead, a local variable
is allocated and used within the loop and only on success is the return
pointer updated.
* Introduce additional local variables instead of re-using the `tmp` variable
multiple times.
* Name the variable pointing to the end of the linked list appropriately
`tail` and remove one level of indirection. Reading code that is using
pointers to pointers is unnecessarily hard.
The av2notification_meta() function updated it's parameter by doing
(*m) = malloc();
Afterwards, if an error occurred, it would call `free(*m);` and (potentially)
return, leaving an invalid pointer stored in `m`. The caller would then try to
free the returned pointer because it was non-NULL.
This patch fixes this by doing several code cleanups:
* The meta argument is not updated unnecessarily. Instead, a local variable
is allocated and used within the loop and only on success is the return
pointer updated.
* Introduce additional local variables instead of re-using the `tmp` variable
multiple times.
* Name the variable pointing to the end of the linked list appropriately
`tail` and remove one level of indirection. Reading code that is using
pointers to pointers is unnecessarily hard.
Merge pull request #2275 from octo/ff/prometheus
write_prometheus plugin: Fix incorrect use of realloc().
write_prometheus plugin: Fix incorrect use of realloc().
Merge pull request #2274 from octo/ff/putval
src/utils_cmd_putval.c: Fix multi-value PUTVAL.
src/utils_cmd_putval.c: Fix multi-value PUTVAL.
src/utils_cmd_putval.c: Fix multi-value PUTVAL.
vl.values was allocated outside of the loop and then copied into each
ret_putval->vl[]. This means that later values overwrote the values
stored in previous ret_putval->vl[].
vl.values was allocated outside of the loop and then copied into each
ret_putval->vl[]. This means that later values overwrote the values
stored in previous ret_putval->vl[].
write_prometheus plugin: Fix incorrect use of realloc().
Calling realloc(ptr, 0) is undefined. Call free() explicitly.
Calling realloc(ptr, 0) is undefined. Call free() explicitly.
Merge branch 'collectd-5.6' into collectd-5.7
bind plugin: Use timegm() to convert to time_t if available.
FreeBSD doesn't provide the "extern long timezone", presumably because
it's "only" an XSI extension, leading to a portability issue with the
previous approach.
timegm() is a non-standard function available in GNU's and BSD's libc
which is doing exactly what we need. The previous code is left as a
fallback.
Fixes: #1268
FreeBSD doesn't provide the "extern long timezone", presumably because
it's "only" an XSI extension, leading to a portability issue with the
previous approach.
timegm() is a non-standard function available in GNU's and BSD's libc
which is doing exactly what we need. The previous code is left as a
fallback.
Fixes: #1268
fix BIND timezone parsing issue
collectd.conf(5): Add section documenting the ignorelist functionality.
Fixes: #2267
Fixes: #2267
Merge branch 'collectd-5.6' into collectd-5.7
network plugin: Fix endless loop DOS in parse_packet()
When correct 'Signature part' is received by Collectd, configured without
AuthFile option, condition for endless loop occurs due to missing increase
of pointer to next unprocessed part.
This is a forward-port of #2233.
Fixes: CVE-2017-7401
Closes: #2174
Signed-off-by: Florian Forster <octo@collectd.org>
When correct 'Signature part' is received by Collectd, configured without
AuthFile option, condition for endless loop occurs due to missing increase
of pointer to next unprocessed part.
This is a forward-port of #2233.
Fixes: CVE-2017-7401
Closes: #2174
Signed-off-by: Florian Forster <octo@collectd.org>
Merge pull request #2210 from rpv-tomsk/processes-fix-init
processes plugin: Fix broken compilation on AIX
processes plugin: Fix broken compilation on AIX
processes plugin: Fix broken compilation on AIX
After a bb0000acfc57e230fc1c26099bc7acb913680f1a an extra pse.cpu_system
statement was left in the AIX / elif HAVE_PROCINFO_H section, which caused
the compilation to fail.
Fixes: #1981
After a bb0000acfc57e230fc1c26099bc7acb913680f1a an extra pse.cpu_system
statement was left in the AIX / elif HAVE_PROCINFO_H section, which caused
the compilation to fail.
Fixes: #1981
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec
collectd.spec: Don't enable XFS support on RHEL6
It is missing for i386.
If there's strong interest in having support for xfs in the df plugin in
RHEL6 we can do some macro magic to only BuildRequire xfsprogs-devel if
were not on rhel6 i386, but this was the easiest fix and unblocks our
package builds.
It is missing for i386.
If there's strong interest in having support for xfs in the df plugin in
RHEL6 we can do some macro magic to only BuildRequire xfsprogs-devel if
were not on rhel6 i386, but this was the easiest fix and unblocks our
package builds.
Merge branch 'collectd-5.6' into collectd-5.7
Merge pull request #2204 from collectd/check-for-cap-is-supported
Check for the CAP_IS_SUPPORTED macro
Check for the CAP_IS_SUPPORTED macro
Check for the CAP_IS_SUPPORTED macro
On EPEL6:
src/daemon/common.c: In function 'check_capability':
src/daemon/common.c:1571: error: implicit declaration of function 'CAP_IS_SUPPORTED'
make[1]: *** [src/daemon/common.lo] Error 1
On EPEL6:
src/daemon/common.c: In function 'check_capability':
src/daemon/common.c:1571: error: implicit declaration of function 'CAP_IS_SUPPORTED'
make[1]: *** [src/daemon/common.lo] Error 1
Merge branch 'collectd-5.6' into collectd-5.7
look for cap_get_proc instead of cap_get_bound
a2ddc38 switched the capability check from cap_get_bound() to
cap_get_proc()
a2ddc38 switched the capability check from cap_get_bound() to
cap_get_proc()
Merge pull request #2151 from mfournier/check_capability-rewrite-fix
daemon/common.c: Fix check_capability() by using cap_get_proc()
daemon/common.c: Fix check_capability() by using cap_get_proc()
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
src/utils_match.c
Conflicts:
src/utils_match.c
smart: log warning if CAP_SYS_RAWIO is missing
Related to #2143
Related to #2143
Merge pull request #2192 from maryamtahhan/bugfix_regex_memleak
fix for memory leak in utils_match.c
fix for memory leak in utils_match.c
fix for memory leak in utils_match.c
Change-Id: I058afae8c0a99115bda70e125840fc6bd224b358
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
Change-Id: I058afae8c0a99115bda70e125840fc6bd224b358
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
Merge branch 'collectd-5.6' into collectd-5.7
src/daemon/collectd.c: do not refer to syslog in error message
... as the message the user would be looking for can be found on
stderr/stdout or in any configured logfile.
... as the message the user would be looking for can be found on
stderr/stdout or in any configured logfile.
logfile: send log messages to STDERR by default
This prevents early startup log messages from going unnoticed if the
default logfile isn't writeable.
Fixes: #2057
This prevents early startup log messages from going unnoticed if the
default logfile isn't writeable.
Fixes: #2057
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec
collectd.spec: enable XFS support in df plugin
Fixes #2178
Fixes #2178
Merge branch 'collectd-5.6' into collectd-5.7
Merge pull request #2167 from maryamtahhan/feat_dpdkstat_bugfix_5_7
dpdkstat: Fix metrics' types
dpdkstat: Fix metrics' types
Merge pull request #2170 from javicacheiro/fix_redhat_spec_file
Fix rpm spec file for 5.7.1
Fix rpm spec file for 5.7.1
Fix release
Fix rpm spec file for 5.7.1
Merge pull request #2165 from maryamtahhan/feat_rdt_bugfix
intel_rdt: bugfix configuration
intel_rdt: bugfix configuration
dpdkstat: Fix metrics' types
This patch fixes parsing of metrics' types. Some statistics, such as
rx_q0errors, rx_q0bytes or rx_q0packet, don't contain suffix _errors, _bytes or
_packets. This has caused them to use generic type 'derive', rather than
more specific one, for instance 'if_rx_errors'. Additionally, some
statistics contain string 'error', rather than 'errors'.
Change-Id: I51dfa9c4d98346a654adbc4041b64ebd3897278c
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
This patch fixes parsing of metrics' types. Some statistics, such as
rx_q0errors, rx_q0bytes or rx_q0packet, don't contain suffix _errors, _bytes or
_packets. This has caused them to use generic type 'derive', rather than
more specific one, for instance 'if_rx_errors'. Additionally, some
statistics contain string 'error', rather than 'errors'.
Change-Id: I51dfa9c4d98346a654adbc4041b64ebd3897278c
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
intel_rdt: bugfix configuration
Fix the configuration to stop collectd bombing out and deal with configuration
errors gracefully. Otherwise collectd will fail at the configuration phase
with: "Error: Reading the config file failed!".
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
Fix the configuration to stop collectd bombing out and deal with configuration
errors gracefully. Otherwise collectd will fail at the configuration phase
with: "Error: Reading the config file failed!".
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
notify_email: don't explicitly link against libssl and libcrypto
libesmtp takes care of this.
Pointed out by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852924
libesmtp takes care of this.
Pointed out by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852924
daemon/common.c: Fix check_capability() by using cap_get_proc()
Rewrite this function, as 58acba67f made it a no-op.
Rewrite this function, as 58acba67f made it a no-op.
Merge branch 'collectd-5.6' into collectd-5.7
dpdkstat plugin: jump to the right label
Bump version to 5.7.1; Update ChangeLog.
mqtt plugin: Fix invalid symbols in topic name.
mqtt plugin: Fix resource leak.
Fixes: #2123
Fixes: #2123
Merge pull request #2122 from octo/issue/2108
src/daemon/plugin.c: Register plugin_update_internal_statistics() as …
src/daemon/plugin.c: Register plugin_update_internal_statistics() as …
Merge branch 'collectd-5.6' into collectd-5.7
src/daemon/plugin.c: explicitly declare vl.interval
This properly gets rid of the warning reported in #2108
Thanks to @charliesignalfx for suggesting this and reporting the issue !
This properly gets rid of the warning reported in #2108
Thanks to @charliesignalfx for suggesting this and reporting the issue !
src/daemon/plugin.c: avoid deprecated statement
As suggested by @rubenk in #2122
As suggested by @rubenk in #2122
collectd.spec: ensure write_riemann build deps are installed
collectd.spec: fixes to previous commit
collectd.spec: re-enable write_riemann on EL7, as build dep is now available in EPEL7
Merge branch 'collectd-5.6' into collectd-5.7
curl_json: use configured interval as default timeout value
When no timeout is specified, the default timeout should be set to the
configured interval, not the default timeout (which is -1, no timeout).
This bug got introduced in bce14a848.
When no timeout is specified, the default timeout should be set to the
configured interval, not the default timeout (which is -1, no timeout).
This bug got introduced in bce14a848.
intel_rdt: check libpqos library version.
Change-Id: I83d42b63873569445d4c6339d7a69761e16ead14
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Change-Id: I83d42b63873569445d4c6339d7a69761e16ead14
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
src/daemon/plugin.c: Register plugin_update_internal_statistics() as a read callback.
The previous special-snowflake-solution had issues since it didn't set a plugin
context up.
Fixes: #2108
The previous special-snowflake-solution had issues since it didn't set a plugin
context up.
Fixes: #2108
Merge branch 'collectd-5.6' into collectd-5.7
src/daemon/common.c: Change swrite() to return errno if possible.
Merge pull request #2121 from octo/netapp
netapp plugin: Fix complation problems.
netapp plugin: Fix complation problems.
netapp plugin: Fix compilation problems.
Fixes: #2120
Fixes: #2120
Auto-Merge pull request #2113 from rubenk/dpdk-double-close
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
Merge pull request #2114 from mfournier/dpdkstat-formatstring
dpdkstat: use portable format strings
dpdkstat: use portable format strings
dpdkstat: use portable format strings
Merge pull request #2112 from rubenk/battery-plugin-nul-terminate-buffer
Battery plugin: nul-terminate buffer
Battery plugin: nul-terminate buffer
dpdkstat: don't close already closed fd on failure
CID #158525
CID #158525
battery plugin: null-terminate buffer
We call strstripnewline on it, which expects a null-terminated string.
CID #158524
We call strstripnewline on it, which expects a null-terminated string.
CID #158524
Fix parallel build
Fixes #2110
Fixes #2110
Auto-Merge pull request #2111 from octo/cid/157643
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
src/utils_cmd_getthreshold.c: Fix formatting.
set target: Avoid casting negative int to size_t.
CID: 157643
CID: 157643
Auto-Merge pull request #2099 from tokkee/sh/booleans
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
update README to mention write_prometheus & support lib
Auto-Merge pull request #2096 from rubenk/target-set-plug-leak
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
Auto-Merge pull request #2092 from rubenk/prometheus-plug-leak
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
Bump version to 5.7.0; Update ChangeLog.
configfile: Reintroduce support for boolean string config values.
For the network plugin, this was changed in ac73c75aed7 (which landed in 5.6)
which was a backward incompatible change breaking user configuration. Adding
support back in a central location ensures a more consistent behavior across
plugins. At the same time, we issue a warning message that this behavior is
deprecated.
GH #2083, #2098
For the network plugin, this was changed in ac73c75aed7 (which landed in 5.6)
which was a backward incompatible change breaking user configuration. Adding
support back in a central location ensures a more consistent behavior across
plugins. At the same time, we issue a warning message that this behavior is
deprecated.
GH #2083, #2098
target_set: plug leak on error
CID 157645
CID 157645
email plugin: initialize structure
CID 38125
CID 38125
write_prometheus: plug a small leak
Found by scan-build
Found by scan-build
Merge branch 'collectd-5.6' into collectd-5.7
Merge remote-tracking branch 'github/pr/2081' into collectd-5.7
smart plugin: Refactor, demote warnings to debug.
Fixes: #2062
Fixes: #2062
src/utils_cmd_*.[ch]: Remove unused and redundant includes.
src/Makefile.am: Fix linking with libcmds.la.
Issue: #2067
Issue: #2067
dpdkstats: fix detection of local libdpdk
- Fix typo.
Change-Id: I7cfb6dff4e1c2728650cd1d44aaaa36169880809
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
- Fix typo.
Change-Id: I7cfb6dff4e1c2728650cd1d44aaaa36169880809
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
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().
Merge pull request #2069 from octo/issue/2067
src/Makefile.am: Fix dependencies for the "tail" and "match" utilities.
src/Makefile.am: Fix dependencies for the "tail" and "match" utilities.
src/Makefile.am: Fix dependencies for the "tail" and "match" utilities.
Since being pulled out of the core daemon, the daemon no longer provides
all the required symbols for these shared objects. The "tail", "match"
and "tail_match" utils need to be compiled in explicitly. Also, we need
to link with the liblatency.la convenience library for the
"Distribution" handling in the "match" util.
Issue: #2067
Since being pulled out of the core daemon, the daemon no longer provides
all the required symbols for these shared objects. The "tail", "match"
and "tail_match" utils need to be compiled in explicitly. Also, we need
to link with the liblatency.la convenience library for the
"Distribution" handling in the "match" util.
Issue: #2067
Bump version to 5.6.1; Update ChangeLog.
Merge pull request #2064 from rubenk/fix-make-distcheck
Fix make distcheck
Fix make distcheck
Collected podtypo
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec