contrib/format.sh src/msr-index.h src/turbostat.c
msr-index: include GPLv2 header
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
turbostat: import msr-index header from linux
Since Linux 4.12, the kernel does not expose msr-index.h to the userland
anymore. This commit pulls and hardcode the required definitions.
Signed-off-by: Florian Forster <octo@collectd.org>
Since Linux 4.12, the kernel does not expose msr-index.h to the userland
anymore. This commit pulls and hardcode the required definitions.
Signed-off-by: Florian Forster <octo@collectd.org>
src/daemon/meta_data.c: Fix double unlock.
CID: 179245
CID: 179245
Fix documentation typo for PostgreSQL plugin
In collectd/src/postgresql_default.conf the name for the backends
query is plural, yet in the documentation it is singular. This caused
me some lost time when running this plugin.
It is also wrongly listed on the wiki:
https://collectd.org/wiki/index.php/Plugin:PostgreSQL
Signed-off-by: Florian Forster <octo@collectd.org>
In collectd/src/postgresql_default.conf the name for the backends
query is plural, yet in the documentation it is singular. This caused
me some lost time when running this plugin.
It is also wrongly listed on the wiki:
https://collectd.org/wiki/index.php/Plugin:PostgreSQL
Signed-off-by: Florian Forster <octo@collectd.org>
postgresql: fix last sum() related parse errors
These queries return empty values when a database doesn't have any
tables yet, which results in collectd logging this error every Interval:
```
db query utils: udb_result_submit: Parsing `' as derive failed.
```
Related to #1905
These queries return empty values when a database doesn't have any
tables yet, which results in collectd logging this error every Interval:
```
db query utils: udb_result_submit: Parsing `' as derive failed.
```
Related to #1905
Auto-Merge pull request #2518 from octo/issue/2510
Automatically merged due to "Automerge" label
Automatically merged due to "Automerge" label
netlink plugin: Improve error reporting for mnl_attr_validate2() and mnl_socket_recvfrom().
Issue: #2510
Issue: #2510
Merge branch 'collectd-5.6' into collectd-5.7
[2475] write_prometheus plugin: Fix port listening
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
write_prometheus plugin: Implement logging callback.
memcached: Fix CPU usage reporting
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
statsd: Document collectd behaviour when receiving the 0.000 timer value
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
collectd-python(5): Fix documentation of Notification.dispatch().
Cherry-picked from PR #2135
Signed-off-by: Florian Forster <octo@collectd.org>
Cherry-picked from PR #2135
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.6' into collectd-5.7
Bump version to 5.6.3; Update ChangeLog.
Merge remote-tracking branch 'github/pr/2466' into collectd-5.7
write_prometheus plugin: Don't construct struct sockaddr_in6 manually.
On FreeBSD, the struct is an incomplete type.
On FreeBSD, the struct is an incomplete type.
write_prometheus plugin: Add support for libmicrohttpd < 0.9.0.
0.9.0 was released in July 2010, yet Precise, which we're still building for,
ships 0.4.6. *sigh*
0.9.0 was released in July 2010, yet Precise, which we're still building for,
ships 0.4.6. *sigh*
write_prometheus plugin: Fall back to IPv4 socket if IPv6 fails.
Unfortunately, for libmicrohttpd "dual stack" means "enforce IPv6 (but
allow IPv4, too)". That means that on systems without IPv6,
libmicrohttpd'd initialization fails (when the dual stack flag is set).
To work around this limitation we open the socket ourselves and pass it
to libmicrohttpd to use.
Fixes: #2149
Unfortunately, for libmicrohttpd "dual stack" means "enforce IPv6 (but
allow IPv4, too)". That means that on systems without IPv6,
libmicrohttpd'd initialization fails (when the dual stack flag is set).
To work around this limitation we open the socket ourselves and pass it
to libmicrohttpd to use.
Fixes: #2149
Merge branch 'collectd-5.6' into collectd-5.7
dbi plugin: Fix additional memory leaks.
dbi plugin: Fix memory leak.
Some memory was leaked when shutting down.
This is a partial back-port of 5ee365a.
Signed-off-by: Florian Forster <octo@collectd.org>
Some memory was leaked when shutting down.
This is a partial back-port of 5ee365a.
Signed-off-by: Florian Forster <octo@collectd.org>
Merge remote-tracking branch 'github/pr/2451' into collectd-5.6
snmp plugin: Style fix
Issue: #2291
Signed-off-by: Florian Forster <octo@collectd.org>
Issue: #2291
Signed-off-by: Florian Forster <octo@collectd.org>
snmp plugin: Fix double free of request PDU
snmp_sess_synch_response() always frees request PDU, in both case of request
error and success. If error condition occurs inside of `while (status == 0)`
loop, double free of `req` happens.
Issue: #2291
Signed-off-by: Florian Forster <octo@collectd.org>
snmp_sess_synch_response() always frees request PDU, in both case of request
error and success. If error condition occurs inside of `while (status == 0)`
loop, double free of `req` happens.
Issue: #2291
Signed-off-by: Florian Forster <octo@collectd.org>
email, exec and unixsock plugins: Use _SC_GETPW_R_SIZE_MAX.
Fixes: #2208
Fixes: #2208
Merge branch 'collectd-5.6' into collectd-5.7
perl plugin: Improve error message.
Merge remote-tracking branch 'github/pr/2391' into collectd-5.6
Merge pull request #2417 from bluca/dpdk_pkgconfig_backport
configure.ac: dpdk: use pkg-config - 5.7
configure.ac: dpdk: use pkg-config - 5.7
collectd.spec: avoid accidentally picking an ancient/unsupported java version
ntpd: Correct loop offset and error calculation
Stop the scaling calculation dropping the sign of the underlying value
Fixes: #2188
Stop the scaling calculation dropping the sign of the underlying value
Fixes: #2188
configure.ac: dpdk: use pkg-config
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
perl plugin: Added check of proper interpreter initialization.
Closes: #927
Closes: #927
Merge pull request #2375 from rpv-tomsk/small-fix
network: Fix free() before use
network: Fix free() before use
network: Fix free() before use
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
src/rrdtool.c
Conflicts:
src/rrdtool.c
rrdtool plugin: Changes after review
* Handle "CacheFlush" as a double
* Updated documentation spelling
* Handle "CacheFlush" as a double
* Updated documentation spelling
rrdtool plugin: Respect RandomTimeout while calling CacheFlush handler
The CacheFlush implementation does not respect RandomTimeout value.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
The CacheFlush implementation does not respect RandomTimeout value.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
rrdtool plugin: Configuration check moved to init callback
The "RandomTimeout" option value check moved from rrd_get_random_variation()
to rrd_init(). This will save few CPU cycles.
The "RandomTimeout" option value check moved from rrd_get_random_variation()
to rrd_init(). This will save few CPU cycles.
rrdtool plugin: Remove excessive complain
The plugin complains `Adjusting "RandomTimeout" to 0.000 seconds.` even
if no 'CacheTimeout' was set.
The plugin complains `Adjusting "RandomTimeout" to 0.000 seconds.` even
if no 'CacheTimeout' was set.
rrdtool plugin: Raise interval of random_variation to match documentation
Documentation states what the actual timeout for each value is chosen randomly
between <CacheTimeout>-<RandomTimeout> and <CacheTimeout>+<RandomTimeout>.
The implementation did not match this.
Documentation states what the actual timeout for each value is chosen randomly
between <CacheTimeout>-<RandomTimeout> and <CacheTimeout>+<RandomTimeout>.
The implementation did not match this.
rrdtool plugin: Fix flushing
* Value from wrong option was passed to rrd_cache_flush()
* Variable cache_flush_timeout was used as cdtime_t type time while value was set as simple seconds
* Added info message about CacheFlush ajusting
* Documentation updated
* Value from wrong option was passed to rrd_cache_flush()
* Variable cache_flush_timeout was used as cdtime_t type time while value was set as simple seconds
* Added info message about CacheFlush ajusting
* Documentation updated
Merge branch 'collectd-5.6' into collectd-5.7
collectd.service: remove NoNewPrivileges setting
There are various issues with it in combination with SELinux.
See https://marc.info/?l=selinux&m=149971836431361&w=2 for some
background.
There are various issues with it in combination with SELinux.
See https://marc.info/?l=selinux&m=149971836431361&w=2 for some
background.
Merge pull request #2357 from rpv-tomsk/issue-2305
Fixed failed compilation on AIX
Fixed failed compilation on AIX
Fixed failed compilation on AIX
Caused by typo in 2761915bed8c6caea41018be3e675aa712cc0b0a / #1842.
Closes: #2305
Caused by typo in 2761915bed8c6caea41018be3e675aa712cc0b0a / #1842.
Closes: #2305
Merge branch 'collectd-5.6' into collectd-5.7
Merge pull request #2341 from rpv-tomsk/issue-2328
curl plugins: Use configured URL for all poll cycles
curl plugins: Use configured URL for all poll cycles
curl plugins: Use configured URL for all poll cycles
After redirect received, Collectd send subsequent requests to new location.
That is wrong - Collectd should use configured URL for all poll cycles, regardless of the responses received previously.
Problem was caused by libcurl issue 1631. To avoid that we set request url in each poll cycle.
Closes: #2328
After redirect received, Collectd send subsequent requests to new location.
That is wrong - Collectd should use configured URL for all poll cycles, regardless of the responses received previously.
Problem was caused by libcurl issue 1631. To avoid that we set request url in each poll cycle.
Closes: #2328
tcpconns plugin: fix build on FreeBSD current
FreeBSD commit https://github.com/freebsd/freebsd/commit/3a5c9aaf2b2ea107bcaf0ba28b706238d92bdbbd
hides inpcb and tcpcb from userland.
Patch taken from FreeBSD ports tree, thanks glebius@.
FreeBSD commit https://github.com/freebsd/freebsd/commit/3a5c9aaf2b2ea107bcaf0ba28b706238d92bdbbd
hides inpcb and tcpcb from userland.
Patch taken from FreeBSD ports tree, thanks glebius@.
Merge branch 'collectd-5.6' into collectd-5.7
email, exec and unixsock plugins: enlarge buffer for getgrnam_r result
Thanks to Jeremie Courreges-Anglas and Daniel Jakots.
Thanks to Jeremie Courreges-Anglas and Daniel Jakots.
email, exec and unixsock plugins: fix error handling
Diff from Jeremie Courreges-Anglas, via Daniel Jakots
Diff from Jeremie Courreges-Anglas, via Daniel Jakots
Merge pull request #2331 from mfournier/ldap_unbind-segfault
openldap: check ld structure before passing it to ldap_unbind()
openldap: check ld structure before passing it to ldap_unbind()
openldap: check ld structure before passing it to ldap_unbind()
This prevents collectd from segfaulting when the ldap session setup
fails before opening a connection to openldap (syntax error in the URL
option for example).
This prevents collectd from segfaulting when the ldap session setup
fails before opening a connection to openldap (syntax error in the URL
option for example).
Bump version to 5.7.2; Update ChangeLog.
Merge pull request #2310 from octo/ff/intel_rdt
intel_rdt plugin: Remove unnecessary goto.
intel_rdt plugin: Remove unnecessary goto.
intel_rdt plugin: Remove unnecessary goto.
Merge branch 'collectd-5.6' into collectd-5.7
Bind plugin: plug a few leaks
Fixes: #2303
Fixes: #2303
format_graphite: Error if call to uc_get_rate fails to return a value.
This prevents a wrong value being sent to graphite for DERIVE types.
See #2209
Signed-off-by: Florian Forster <octo@collectd.org>
This prevents a wrong value being sent to graphite for DERIVE types.
See #2209
Signed-off-by: Florian Forster <octo@collectd.org>
src/daemon/utils_cache.c: Add debug message for lookup of missing metrics.
Issue: #1234
Issue: #1234
src/daemon/utils_cache.c: Remove unnecessary cast.
(data_set_t).ds_num has been changed to be a size_t.
(data_set_t).ds_num has been changed to be a size_t.
src/daemon/utils_cache.c: Read time *after* acquiring the lock.
Fixes: #1193
Fixes: #1193
amqp plugin: Enable the "ExchangeType" for publishers, too.
Fixes: #2286
Fixes: #2286
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