apcups: Fix reconnect implementation
Implementation was broken, it doesn't reconnects as planned.
Implementation was broken, it doesn't reconnects as planned.
snmp plugin: Avoid allocation of temporary buffers on the heap.
Merge remote-tracking branch 'github/pr/2285'
Merge pull request #2290 from BrandonArp/snmp_agent_rpm
allow configuration of snmp_agent in rpm builds
allow configuration of snmp_agent in rpm builds
allow configuration of snmp_agent in rpm builds
Merge pull request #2287 from BrandonArp/fix_am_1_11
fix build on automake 1.11
fix build on automake 1.11
curl_json plugin: Work around a limitation in EPEL6's GCC.
Merge remote-tracking branch 'github/pr/2105'
Merge remote-tracking branch 'github/pr/2190'
chrony plugin: Re-run clang-format.
memcached plugin: Expand "del" to "delete" for clarity.
memcached plugin: Add delete_{hits,misses} metrics.
fix build on automake 1.11
snmp_agent plugin: Don't export the g_agent variable.
snmp_agent plugin: Remove parenthesis around return values.
See also: #2277
See also: #2277
snmp_agent plugin: Format with clang-format.
Merge remote-tracking branch 'github/pr/2277'
curl_json plugin: Refactor the way trees/keys are stored.
Previously, keys had a "magic" as their first member which was used to
differentiate between the two types when they were returned from the
binary search tree.
This patch creates a new struct, cj_tree_entry_t, which includes an enum
identifying which union member is valid.
Previously, keys had a "magic" as their first member which was used to
differentiate between the two types when they were returned from the
binary search tree.
This patch creates a new struct, cj_tree_entry_t, which includes an enum
identifying which union member is valid.
curl_json plugin: Expand unit tests.
This adds various tests involving arrays.
Issue: #2266
This adds various tests involving arrays.
Issue: #2266
Merge branch 'collectd-5.7'
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
Merge pull request #2283 from octo/ff/valgrind
valgrind.FreeBSD.suppress: parse_value(): Always suppress the strlen(…
valgrind.FreeBSD.suppress: parse_value(): Always suppress the strlen(…
valgrind.FreeBSD.suppress: parse_value(): Always suppress the strlen() false positive.
Previously, this was only suppressed when called via parse_values()
(note the plural).
Fixes: #2282
Previously, this was only suppressed when called via parse_values()
(note the plural).
Fixes: #2282
curl_json plugin: Implement a unit test.
Issue: #2266
Issue: #2266
src/testing.h: Fix result of EXPECT_EQ_DOUBLE() when actual is NAN.
src/daemon/plugin_mock.c: Add stubs for additional functions.
curl_json plugin: Split cj_append_key() out of cj_config_add_key().
curl_json plugin: Use struct initializer.
curl_json plugin: Remove unused field from cj_t.
Merge pull request #2279 from octo/ff/virt
virt plugin: Replace virTypedParamsFree() with virTypedParamsClear() …
virt plugin: Replace virTypedParamsFree() with virTypedParamsClear() …
virt plugin: Replace virTypedParamsFree() with virTypedParamsClear() and sfree().
The parameters are allocated with calloc(), freeing them with a library
function is unintuitive at best. Also, the library functions appears to
be missing the appropriate function attribute to tell clang / GCC that
it will free the pointer, resulting in a false-positive scan-build
report.
The parameters are allocated with calloc(), freeing them with a library
function is unintuitive at best. Also, the library functions appears to
be missing the appropriate function attribute to tell clang / GCC that
it will free the pointer, resulting in a false-positive scan-build
report.
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.
Remove parentheses around return arguments
They don't do any harm but they are not really needed either.
Contributors are not used to following this style, and reviewers have to
keep pointing it out in reviews. This takes up valuable time for both
the contributor and the reviewer and distracts from the more important
issues.
I used the following Coccinelle patch:
@@
expression e;
@@
- return (e);
+ return e;
spatch is having trouble with some files so I have cleaned up the rest
with a few regexes.
They don't do any harm but they are not really needed either.
Contributors are not used to following this style, and reviewers have to
keep pointing it out in reviews. This takes up valuable time for both
the contributor and the reviewer and distracts from the more important
issues.
I used the following Coccinelle patch:
@@
expression e;
@@
- return (e);
+ return e;
spatch is having trouble with some files so I have cleaned up the rest
with a few regexes.
Merge branch 'collectd-5.7'
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.
configure.ac: Remove empty else-block from AC_CHECK_LIB.
Fixes: #2272
Fixes: #2272
Merge branch 'collectd-5.7'
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 pull request #2265 from velotraveler/master
fix BIND timezone parsing issue
fix BIND timezone parsing issue
fix BIND timezone parsing issue
Merge pull request #2260 from bufadu/evol_redis
redis: adding support for keys count per database
redis: adding support for keys count per database
redis: fix parser and comments
redis: fixing maintainer requests
systemd.collectd.service: fix a typo
redis: removing sprintf() calls
redis: adding support for key count per database
Merge pull request #2255 from clemensg/sensors_support_current
sensors: support current values
sensors: support current values
sensors: support current values
Add support for current sensor data collection.
Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
Add support for current sensor data collection.
Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
Merge pull request #2252 from jaroug/kairosdb_ttl_support
Kairosdb ttl support
Kairosdb ttl support
fix spelling
Merge pull request #2253 from LionelCons/master
data-sets are in fact supported (issues#2244)
data-sets are in fact supported (issues#2244)
correct spelling
data-sets are in fact supported (issues#2244)
replace spaces by tabs
Add support for the new TTL parameter - kairosdb only
add documentation on the new TTL parameter
Merge branch 'collectd-5.7'
Merge branch 'collectd-5.6' into collectd-5.7
Tree-wide: remove last remnants of sizeof(char)
sizeof(char) is 1 by definition.
sizeof(char) is 1 by definition.
Merge pull request #2168 from maryamtahhan/feat_libvirt_upstream
virt: add support for new metrics
virt: add support for new metrics
Update mongodb write code to use latest API (Fixes: #492) (#2236)
Update mongodb write code to use latest API (Fixes: #492)
Update mongodb write code to use latest API (Fixes: #492)
Remove utils_ignorelist.[ch] from daemon; link plugins directly.
The collectd daemon isn't using the "ignorelist" functionality itself --
it was only linked in to provide it to loaded plugins. Since the code is
under the GPL, this interfers with our intend of having an MIT licensed
daemon.
This patch changes the build system to link plugins with the ignorelist
directly instead of expecting the symbols to be in the daemon.
The collectd daemon isn't using the "ignorelist" functionality itself --
it was only linked in to provide it to loaded plugins. Since the code is
under the GPL, this interfers with our intend of having an MIT licensed
daemon.
This patch changes the build system to link plugins with the ignorelist
directly instead of expecting the symbols to be in the daemon.
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 #2051 from dsilakov/virt_list_domains
virt plugin: get domains using virConnectListAllDomains
virt plugin: get domains using virConnectListAllDomains
Merge pull request #1989 from rpv-tomsk/processes
processes plugin: Code cleanup + add per-process open files count
processes plugin: Code cleanup + add per-process open files count
processes plugin: collect per-process open files count on Linux
Closes: #836
Closes: #836
processes plugin: Update all counters via ps_update_counter()
Fix counting when matched processes are started and terminated often.
Fix counting when matched processes are started and terminated often.
processes plugin: Code cleanup
Merge pull request #2199 from jaroug/support_attributes_kairosdb
Add support for 'Attribute' option on KAIROSDB output format
Add support for 'Attribute' option on KAIROSDB output format
Merge pull request #2223 from maryamtahhan/intel_rdt_core_id_fix
intel_rdt: fix validation of configured core id values
intel_rdt: fix validation of configured core id values
Merge pull request #2225 from maryamtahhan/dpdstat_portmask_fix
dpdkstat: Enable all ports by default.
dpdkstat: Enable all ports by default.
snmp_agent: generate table OID based on instance as a key in case index is not specfified.
Based on the SNMP rules when table column is represented as a key
of string type, key should be used while generating OID for each row.
When index is not specified, then it's assumed that instance value is
the key for the specified table.
Change-Id: I9f3fbd9aa018bc9037bd3202e2ed107a302fe1b3
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Based on the SNMP rules when table column is represented as a key
of string type, key should be used while generating OID for each row.
When index is not specified, then it's assumed that instance value is
the key for the specified table.
Change-Id: I9f3fbd9aa018bc9037bd3202e2ed107a302fe1b3
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
dpdkstat: Enable all ports by default.
If "EnabledPortMask" option is not set
all DPDK ports will be monitored.
Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
If "EnabledPortMask" option is not set
all DPDK ports will be monitored.
Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
intel_rdt: fix validation of configured core id values
Change-Id: Ia009635c93e1cecd9852326b01c62fc6d2b090b5
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Change-Id: Ia009635c93e1cecd9852326b01c62fc6d2b090b5
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Merge pull request #2215 from maryamtahhan/dpdkstats_upstream
dpdkstat: doc updated with initialization time notice
dpdkstat: doc updated with initialization time notice
dpdkstat: doc updated with initialization time notice
Change-Id: Ia13c35e4112e74990896edb597d39c1f8ab14b6e
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
Change-Id: Ia13c35e4112e74990896edb597d39c1f8ab14b6e
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
Merge pull request #2210 from rpv-tomsk/processes-fix-init
processes plugin: Fix broken compilation on AIX
processes plugin: Fix broken compilation on AIX
Merge pull request #2213 from maryamtahhan/ovs_enable_platforms
ovs: enable only supported platforms (#2203)
ovs: enable only supported platforms (#2203)
ovs: enable only supported platforms
fixes GitHub issue #2203
Change-Id: I4d19b38b776f6b98fa3e4eb42e11b92dee7f8399
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
fixes GitHub issue #2203
Change-Id: I4d19b38b776f6b98fa3e4eb42e11b92dee7f8399
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
Merge pull request #2211 from maryamtahhan/feat_ovs_events_change_defaults
ovs_events: change configuration option defaults
ovs_events: change configuration option defaults
Merge pull request #2212 from maryamtahhan/ovs_events_scan_build
ovs_events: fixes issue #2205
ovs_events: fixes issue #2205
virt: add support for new metrics
Add support for new libvirt metrics:
- Performance monitoring events
- Domain state & reason
- Percentage CPU usage
- CPU pinning (affinity)
- Disk errors
- File system info
- Job stats
Change-Id: I233fb18653d218c7e906a157743606c6818f9feb
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Add support for new libvirt metrics:
- Performance monitoring events
- Domain state & reason
- Percentage CPU usage
- CPU pinning (affinity)
- Disk errors
- File system info
- Job stats
Change-Id: I233fb18653d218c7e906a157743606c6818f9feb
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
ovs_events: fix scan-build warnings #2205
src/utils_ovs.c:366:20: warning: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'jval')
(int)(jval)->type);
^~~~~~~~~~~~
...
Change-Id: Ic856d21f2121f920bdd2043c69620555bb3d1cb8
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
src/utils_ovs.c:366:20: warning: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'jval')
(int)(jval)->type);
^~~~~~~~~~~~
...
Change-Id: Ic856d21f2121f920bdd2043c69620555bb3d1cb8
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
ovs_events: change configuration option defaults
Right now, the plugin dispatches values by default and doesn't send
any notification messages. The expected behaviour of the event plugin
is to send notification by default. So, changed default value of
SendNotification & DispatchValues options to opposite.
Change-Id: I908799da1b2e75d2089765769ce56af00246c440
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
Right now, the plugin dispatches values by default and doesn't send
any notification messages. The expected behaviour of the event plugin
is to send notification by default. So, changed default value of
SendNotification & DispatchValues options to opposite.
Change-Id: I908799da1b2e75d2089765769ce56af00246c440
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
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 pull request #2207 from maryamtahhan/fix_for_2201
ovs_stats: Increase devname buffer
ovs_stats: Increase devname buffer
Increase devname buffer buffer to ensure that snprintf output
would not be truncated before the last format character
Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
would not be truncated before the last format character
Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
collectd.spec: move new plugins to subpackages
collectd.spec: add ovs_stats plugin
virt plugin: fix build warning
CC src/virt_la-virt.lo
src/virt.c:417:37: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if ((tag_index < 0) || (tag_index >= STATIC_ARRAY_SIZE(tags))) {
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
CC src/virt_la-virt.lo
src/virt.c:417:37: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if ((tag_index < 0) || (tag_index >= STATIC_ARRAY_SIZE(tags))) {
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Merge branch 'collectd-5.7'
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec