]> git.ipfire.org Git - thirdparty/collectd.git/log
thirdparty/collectd.git
17 months agogpu_sysman plugin: Fix double reporting of metric. 4203/head
Florian Forster [Wed, 20 Dec 2023 11:09:43 +0000 (12:09 +0100)] 
gpu_sysman plugin: Fix double reporting of metric.

This metric is already added to the metric family in line 1553. Adding
it twice leads to `uc_update` errors.

Fixes: #4200
17 months agoMerge pull request #4197 from octo/6/legacy_support
Florian Forster [Wed, 20 Dec 2023 10:52:48 +0000 (11:52 +0100)] 
Merge pull request #4197 from octo/6/legacy_support

[collectd 6] Generate better names and labels for legacy metrics.

17 months agovalue_list: Simplify the control flow when setting metric labels. 4197/head
Florian Forster [Tue, 19 Dec 2023 22:35:00 +0000 (23:35 +0100)] 
value_list: Simplify the control flow when setting metric labels.

17 months agovalue_list: Simplify by adding separating "." in the first `strbuf_print()` call.
Eero Tamminen [Tue, 19 Dec 2023 22:20:43 +0000 (23:20 +0100)] 
value_list: Simplify by adding separating "." in the first `strbuf_print()` call.

Co-authored-by: Florian Forster <octo@collectd.org>
17 months ago./contrib/format.sh src/utils/common/*.[ch]
Florian Forster [Mon, 18 Dec 2023 23:15:45 +0000 (00:15 +0100)] 
./contrib/format.sh src/utils/common/*.[ch]

17 months agovalue_list: Add special handling for "utilization" and "io" metrics.
Florian Forster [Mon, 18 Dec 2023 10:30:33 +0000 (11:30 +0100)] 
value_list: Add special handling for "utilization" and "io" metrics.

17 months agocommon: Add `string_has_suffix`.
Florian Forster [Mon, 18 Dec 2023 10:26:48 +0000 (11:26 +0100)] 
common: Add `string_has_suffix`.

17 months agovalue_list: Ensure that the plugin name is contained in the converted metric.
Florian Forster [Mon, 18 Dec 2023 10:11:14 +0000 (11:11 +0100)] 
value_list: Ensure that the plugin name is contained in the converted metric.

17 months agovalue_list: Improve generated metric names.
Florian Forster [Mon, 18 Dec 2023 09:19:25 +0000 (10:19 +0100)] 
value_list: Improve generated metric names.

This changes `plugin_value_list_to_metric_family` to generate metric
names that are more in line with OpenTelemetry's naming guidelines.

17 months agoMerge pull request #4195 from octo/6/value_list
Florian Forster [Mon, 18 Dec 2023 22:30:14 +0000 (23:30 +0100)] 
Merge pull request #4195 from octo/6/value_list

[collectd 6] Move legacy code into its own package.

17 months ago./contrib/format.sh src/utils/value_list/value_list_test.c 4195/head
Florian Forster [Mon, 18 Dec 2023 22:09:47 +0000 (23:09 +0100)] 
./contrib/format.sh src/utils/value_list/value_list_test.c

17 months agocurl_json plugin: Remove `value_list` from build deps.
Florian Forster [Mon, 18 Dec 2023 22:09:29 +0000 (23:09 +0100)] 
curl_json plugin: Remove `value_list` from build deps.

17 months agoLink `value_list` into `libplugin_mock`.
Florian Forster [Mon, 18 Dec 2023 18:53:02 +0000 (19:53 +0100)] 
Link `value_list` into `libplugin_mock`.

This is much simpler than adding the .c and .h files into all individual
tests.

17 months agointel_rdt plugin: Add the `value_list` utility to the unit test.
Florian Forster [Mon, 18 Dec 2023 14:20:50 +0000 (15:20 +0100)] 
intel_rdt plugin: Add the `value_list` utility to the unit test.

17 months agovalue_list: Migrate `parse_values` out of `common`.
Florian Forster [Mon, 18 Dec 2023 08:38:08 +0000 (09:38 +0100)] 
value_list: Migrate `parse_values` out of `common`.

17 months agovalue_list: Migrate functions related to `value_list_t` out of `common`.
Florian Forster [Mon, 18 Dec 2023 08:30:25 +0000 (09:30 +0100)] 
value_list: Migrate functions related to `value_list_t` out of `common`.

17 months agodaemon: Move `data_set_t` and related functions to its own file.
Florian Forster [Mon, 18 Dec 2023 08:26:28 +0000 (09:26 +0100)] 
daemon: Move `data_set_t` and related functions to its own file.

This is part of the legacy support for collectd 5 metrics. Because "data
sets" are a global resource, this has to remain within the daemon.

17 months agoMove functions related to `value_list_t` to a separate package.
Florian Forster [Mon, 18 Dec 2023 07:59:10 +0000 (08:59 +0100)] 
Move functions related to `value_list_t` to a separate package.

17 months agoMerge pull request #4196 from octo/6/resource_metrics
Florian Forster [Mon, 18 Dec 2023 22:29:14 +0000 (23:29 +0100)] 
Merge pull request #4196 from octo/6/resource_metrics

[collectd 6] New utility: `resource_metrics` to group metrics by resource.

17 months agoresource_metrics: Skip duplicate metrics instead of erroring out. 4196/head
Florian Forster [Sun, 17 Dec 2023 08:45:11 +0000 (09:45 +0100)] 
resource_metrics: Skip duplicate metrics instead of erroring out.

The semantics have been changed to simply ignore metrics that are already
in the set. The previous semantic was optimized for a "add and if that
fails flush and try again" plugin behavior. With the support for multiple
instances of the same metric (at different times), there no longer is a
need to ensure metrics in the set are unique.

17 months agoresource_metrics: Treat metrics with different time stamps as different metrics.
Florian Forster [Sun, 17 Dec 2023 08:19:00 +0000 (09:19 +0100)] 
resource_metrics: Treat metrics with different time stamps as different metrics.

17 months agoresource metrics: Add missing free to `resource_metrics_reset`.
Florian Forster [Sat, 16 Dec 2023 13:29:00 +0000 (14:29 +0100)] 
resource metrics: Add missing free to `resource_metrics_reset`.

17 months agoresource_metrics: Doc comment improvements.
Florian Forster [Sat, 16 Dec 2023 11:59:03 +0000 (12:59 +0100)] 
resource_metrics: Doc comment improvements.

17 months agoresource_metrics: Fix bugs surfaced by the unit test.
Florian Forster [Sat, 16 Dec 2023 11:58:37 +0000 (12:58 +0100)] 
resource_metrics: Fix bugs surfaced by the unit test.

* Sort metric families after inserting.
* Dereference the pointer-pointer returned by `bsearch` in `lookup_family`.
* Delete the metrics created by `metric_family_clone`.
* Run ./contrib/format.sh

17 months agoresource_metrics: Add unit test.
Florian Forster [Sat, 16 Dec 2023 11:53:53 +0000 (12:53 +0100)] 
resource_metrics: Add unit test.

17 months agoNew utility: resource_metrics.
Florian Forster [Sat, 16 Dec 2023 07:26:26 +0000 (08:26 +0100)] 
New utility: resource_metrics.

Resource metrics allows plugin to stage metric families, grouped by
resource. This is designed to work well with plugins that export the
OpenTelemetry protocol.

17 months agodaemon: Add `metric_family_compare` and `label_set_compare`.
Florian Forster [Thu, 14 Dec 2023 11:54:42 +0000 (12:54 +0100)] 
daemon: Add `metric_family_compare` and `label_set_compare`.

18 months agoMerge pull request #4191 from octo/6/load
Florian Forster [Fri, 15 Dec 2023 19:37:52 +0000 (20:37 +0100)] 
Merge pull request #4191 from octo/6/load

[collectd 6] Load plugin: Migrate to collectd 6 data structures.

18 months agosrc/daemon/metric.h: Improve doc comment for `metric_family_append`. 4191/head
Florian Forster [Thu, 14 Dec 2023 20:48:09 +0000 (21:48 +0100)] 
src/daemon/metric.h: Improve doc comment for `metric_family_append`.

18 months ago./contrib/format.sh src/load.c
Florian Forster [Thu, 14 Dec 2023 20:56:32 +0000 (21:56 +0100)] 
./contrib/format.sh src/load.c

18 months agoLoad plugin: Simplify libstatgrab implementation.
Florian Forster [Thu, 14 Dec 2023 20:56:17 +0000 (21:56 +0100)] 
Load plugin: Simplify libstatgrab implementation.

18 months agoLoad plugin: rewrite Linux implementation using `read_text_file_contents`.
Florian Forster [Thu, 14 Dec 2023 20:55:20 +0000 (21:55 +0100)] 
Load plugin: rewrite Linux implementation using `read_text_file_contents`.

18 months agoload plugin: Migrate to collectd 6 data structures.
Florian Forster [Thu, 14 Dec 2023 20:50:40 +0000 (21:50 +0100)] 
load plugin: Migrate to collectd 6 data structures.

18 months agoMerge pull request #4192 from octo/6/irq
Florian Forster [Fri, 15 Dec 2023 19:09:50 +0000 (20:09 +0100)] 
Merge pull request #4192 from octo/6/irq

 [collectd 6] IRQ plugin: Migrate to collectd 6 data structures.

18 months agoirq plugin: Remove special case for the "FIQ" interrupt. 4192/head
Florian Forster [Fri, 15 Dec 2023 19:02:24 +0000 (20:02 +0100)] 
irq plugin: Remove special case for the "FIQ" interrupt.

18 months agoformat_json: Improve the doc comment for `irq_strsplit`.
Eero Tamminen [Fri, 15 Dec 2023 18:53:21 +0000 (19:53 +0100)] 
format_json: Improve the doc comment for `irq_strsplit`.

Contrast the behavior to `strsplit`.

Co-authored-by: Florian Forster <octo@collectd.org>
18 months agoirq plugin: Parse counters as `DS_TYPE_DERIVE`.
Florian Forster [Fri, 15 Dec 2023 18:44:09 +0000 (19:44 +0100)] 
irq plugin: Parse counters as `DS_TYPE_DERIVE`.

18 months agoirq plugin: Document the return value of `irq_strsplit`.
Eero Tamminen [Fri, 15 Dec 2023 18:36:51 +0000 (19:36 +0100)] 
irq plugin: Document the return value of `irq_strsplit`.

18 months agocommon: Improve coding style of `strsplit`.
Florian Forster [Fri, 15 Dec 2023 08:44:52 +0000 (09:44 +0100)] 
common: Improve coding style of `strsplit`.

* Combine declaration and initialization.

18 months agoirq plugin: refactor the NetBSD code.
Florian Forster [Fri, 15 Dec 2023 08:44:12 +0000 (09:44 +0100)] 
irq plugin: refactor the NetBSD code.

* Declare local variables late.
* Initialize when declaring variables.
* Use `metric_family_append`.

18 months agoirq plugin: Add additional labels to the Linux implementation.
Florian Forster [Fri, 15 Dec 2023 08:42:44 +0000 (09:42 +0100)] 
irq plugin: Add additional labels to the Linux implementation.

The Linux implementation will now emit the following fields if available:

* device
* trigger
* kernel_module
* name (a human readable name, e.g. "Non-maskable interrupts")

18 months ago[collectd 6] irq: migration to v6.0
Manuel Luis Sanmartín Rozada [Thu, 18 Feb 2021 01:43:36 +0000 (02:43 +0100)] 
[collectd 6] irq: migration to v6.0

18 months agoMerge pull request #4187 from octo/6/resource
Florian Forster [Wed, 13 Dec 2023 21:46:05 +0000 (22:46 +0100)] 
Merge pull request #4187 from octo/6/resource

[collectd 6] RFC: Add resource attributes.

18 months agoMove resource attributes into `metric_family_t`. 4187/head
Florian Forster [Wed, 13 Dec 2023 20:00:14 +0000 (21:00 +0100)] 
Move resource attributes into `metric_family_t`.

18 months agosrc/daemon/metric.h: Fix typos in doc comment.
Florian Forster [Wed, 13 Dec 2023 14:37:13 +0000 (15:37 +0100)] 
src/daemon/metric.h: Fix typos in doc comment.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoChange the semantic of `label_set_clone`.
Florian Forster [Wed, 13 Dec 2023 14:35:23 +0000 (15:35 +0100)] 
Change the semantic of `label_set_clone`.

It checks to ensure that `dest` is empty and returns `EINVAL` otherwise.

18 months agosrc/daemon/metric.c: improve readability of "first_label" logic.
Florian Forster [Wed, 13 Dec 2023 14:30:37 +0000 (15:30 +0100)] 
src/daemon/metric.c: improve readability of "first_label" logic.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agosrc/daemon/metric.h: Fix typo.
Florian Forster [Wed, 13 Dec 2023 14:29:36 +0000 (15:29 +0100)] 
src/daemon/metric.h: Fix typo.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoformat_graphite: Add support for resource attributes.
Florian Forster [Wed, 13 Dec 2023 12:53:33 +0000 (13:53 +0100)] 
format_graphite: Add support for resource attributes.

18 months agoAdd resource labels to `metric_t`.
Florian Forster [Wed, 6 Dec 2023 07:51:31 +0000 (08:51 +0100)] 
Add resource labels to `metric_t`.

18 months agoMerge pull request #4176 from octo/6/write_http
Florian Forster [Tue, 12 Dec 2023 09:55:49 +0000 (10:55 +0100)] 
Merge pull request #4176 from octo/6/write_http

[collectd 6] add reference counting to plugins that register multiple callbacks with the same `user_data_t`.

18 months agowrite_riemann plugin: Unify reference counting code with other plugins. 4176/head
Florian Forster [Fri, 8 Dec 2023 13:31:58 +0000 (14:31 +0100)] 
write_riemann plugin: Unify reference counting code with other plugins.

18 months agowrite_http plugin: Unify coding style.
Florian Forster [Wed, 29 Nov 2023 12:59:52 +0000 (13:59 +0100)] 
write_http plugin: Unify coding style.

A few plugins implement reference counting. Ensure that they use locks
etc. consistently.

18 months agowrite_tsdb plugin: Implement reference counting.
Florian Forster [Wed, 29 Nov 2023 12:55:20 +0000 (13:55 +0100)] 
write_tsdb plugin: Implement reference counting.

18 months agowrite_syslog plugin: Implement reference counting.
Florian Forster [Wed, 29 Nov 2023 12:53:08 +0000 (13:53 +0100)] 
write_syslog plugin: Implement reference counting.

18 months agowrite_riemann plugin: use reference counting to when freeing user data.
Florian Forster [Wed, 29 Nov 2023 12:41:32 +0000 (13:41 +0100)] 
write_riemann plugin: use reference counting to when freeing user data.

While reference counting was present previously, it had problems:

*   The reference passed to `plugin_register_flush()` was not counted.
*   If a flush plugin was registered, `free_func` was set to NULL but
    the reference passed to `plugin_register_notification()` was still
    counted, meaning in that case the counter never went to zero.
*   Mutexes must be unlocked when calling `pthread_mutex_destroy()`.
*   The code limped on after an error, returning a failure eventually.
    This is unnecessarily complex control flow that has been simplified.

18 months agowrite_stackdriver plugin: Implement reference counting.
Florian Forster [Wed, 29 Nov 2023 12:24:00 +0000 (13:24 +0100)] 
write_stackdriver plugin: Implement reference counting.

18 months agosrc/write_http.c: use reference counting to decide when to free user_data
Leonard Göhrs [Fri, 24 Mar 2023 09:49:24 +0000 (10:49 +0100)] 
src/write_http.c: use reference counting to decide when to free user_data

The teardown code for the wh_callback_t struct previously relied on
the order in which the different callback functions are de-initialized
to be known and to never change.

This is prone to failure and is indeed currently broken, leading to a
segmentation fault on collectd exit.

Fix this by counting the active references to the user data and freeing
it once it reaches zero.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
18 months agoMerge pull request #4182 from octo/6/configure-write_http
Florian Forster [Wed, 6 Dec 2023 12:12:27 +0000 (13:12 +0100)] 
Merge pull request #4182 from octo/6/configure-write_http

configure: Disable the write_http plugin if libyajl2 is not found.

18 months agoconfigure: Disable the write_http plugin if libyajl2 is not found. 4182/head
Florian Forster [Tue, 5 Dec 2023 12:30:33 +0000 (13:30 +0100)] 
configure: Disable the write_http plugin if libyajl2 is not found.

18 months agoMerge pull request #4181 from octo/6/otep119
Florian Forster [Wed, 6 Dec 2023 12:04:56 +0000 (13:04 +0100)] 
Merge pull request #4181 from octo/6/otep119

Update standard system metric names in accordance with OpenTelemetry.

18 months agomemory plugin: Use standard system metric names (OTEP #119) 4181/head
Florian Forster [Tue, 5 Dec 2023 10:27:41 +0000 (11:27 +0100)] 
memory plugin: Use standard system metric names (OTEP #119)

https://github.com/open-telemetry/oteps/blob/main/text/0119-standard-system-metrics.md

18 months agodisk plugin: Use standard system metric names (OTEP #119)
Florian Forster [Tue, 5 Dec 2023 10:27:28 +0000 (11:27 +0100)] 
disk plugin: Use standard system metric names (OTEP #119)

https://github.com/open-telemetry/oteps/blob/main/text/0119-standard-system-metrics.md

18 months agodf plugin: Use standard system metric names (OTEP #119)
Florian Forster [Tue, 5 Dec 2023 10:27:15 +0000 (11:27 +0100)] 
df plugin: Use standard system metric names (OTEP #119)

https://github.com/open-telemetry/oteps/blob/main/text/0119-standard-system-metrics.md

18 months agocpu plugin: Use standard system metric names (OTEP #119)
Florian Forster [Tue, 5 Dec 2023 10:26:43 +0000 (11:26 +0100)] 
cpu plugin: Use standard system metric names (OTEP #119)

https://github.com/open-telemetry/oteps/blob/main/text/0119-standard-system-metrics.md

18 months agoMerge pull request #4179 from octo/6/write_log
Florian Forster [Mon, 4 Dec 2023 18:15:05 +0000 (19:15 +0100)] 
Merge pull request #4179 from octo/6/write_log

write_log plugin: Remove empty lines, add example config

18 months ago./contrib/format.sh src/write_log.c 4179/head
Florian Forster [Mon, 4 Dec 2023 17:44:09 +0000 (18:44 +0100)] 
./contrib/format.sh src/write_log.c

18 months agowrite_log plugin: Add example config block to `collectd.conf`.
Florian Forster [Fri, 1 Dec 2023 10:33:12 +0000 (11:33 +0100)] 
write_log plugin: Add example config block to `collectd.conf`.

18 months agowrite_log plugin: remove trailing newlines in the Graphite format.
Florian Forster [Fri, 1 Dec 2023 10:31:58 +0000 (11:31 +0100)] 
write_log plugin: remove trailing newlines in the Graphite format.

The `INFO()` log macro will add a newline, which was leading to empty lines
being printed.

18 months agoMerge pull request #4174 from octo/workflows6
Florian Forster [Fri, 1 Dec 2023 09:50:39 +0000 (10:50 +0100)] 
Merge pull request #4174 from octo/workflows6

[collectd 6.0] Fix the build

18 months agoIntel RDT plugin: use `pqos_mon_start_cores()` if available. 4174/head
Florian Forster [Fri, 24 Nov 2023 10:39:00 +0000 (11:39 +0100)] 
Intel RDT plugin: use `pqos_mon_start_cores()` if available.

18 months agoIntel RDT plugin: use `pqos_mon_start_pids2()` if available.
Florian Forster [Fri, 24 Nov 2023 10:20:01 +0000 (11:20 +0100)] 
Intel RDT plugin: use `pqos_mon_start_pids2()` if available.

Newer versions of the pqos library deprecate the previous function, so
we have to migrate even though it makes memory management quite ugly.

ChangeLog: Intel RDT plugin: support for PQOS ≥5.0.0 has been added.

18 months agomdevents plugin: Re-enable the `compile_regex` test.
Florian Forster [Wed, 29 Nov 2023 19:54:47 +0000 (20:54 +0100)] 
mdevents plugin: Re-enable the `compile_regex` test.

18 months agoconfigure.ac: De-cuplicate `plugin_foo` definitions.
Florian Forster [Wed, 29 Nov 2023 19:41:24 +0000 (20:41 +0100)] 
configure.ac: De-cuplicate `plugin_foo` definitions.

Apparently we defined a bunch of `plugin_foo` variables that were never
used. The generated list from the arguments to `AC_PLUGIN` now appear as
duplicates. This removes the previously unused definitions and leaves
the generated ones.

18 months agocapabilities plugin: Make state tracking clearer in the MDH handler.
Florian Forster [Wed, 29 Nov 2023 19:24:03 +0000 (20:24 +0100)] 
capabilities plugin: Make state tracking clearer in the MDH handler.

18 months agoprocevent plugin: Consistently mention the unit in log message.
Florian Forster [Wed, 29 Nov 2023 13:40:17 +0000 (14:40 +0100)] 
procevent plugin: Consistently mention the unit in log message.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoprocevent plugin: Reference buffer sizing guideline.
Florian Forster [Wed, 29 Nov 2023 13:32:30 +0000 (14:32 +0100)] 
procevent plugin: Reference buffer sizing guideline.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoprocevent plugin: report errors in human readable form.
Florian Forster [Wed, 29 Nov 2023 09:02:08 +0000 (10:02 +0100)] 
procevent plugin: report errors in human readable form.

18 months agoprocevent plugin: ensure the ring buffer length is not zero.
Florian Forster [Wed, 29 Nov 2023 09:00:43 +0000 (10:00 +0100)] 
procevent plugin: ensure the ring buffer length is not zero.

The manpage documents a default of 10, which was not implemented. This
change brings the implementation in line with the documentation.

18 months agoprocevent plugin: remove use of a nested flexible array member.
Florian Forster [Tue, 28 Nov 2023 18:31:11 +0000 (19:31 +0100)] 
procevent plugin: remove use of a nested flexible array member.

The previous code used an ad-hoc struct to construct or parse a Netlink
message. This relied on allocating a field _after_ the struct with the
flexible array member, which is prohibited by the C standard, leading to
compiler warnings.

18 months agoSMART plugin: initialize struct passed to `ioctl(2)`.
Florian Forster [Sat, 25 Nov 2023 13:12:59 +0000 (14:12 +0100)] 
SMART plugin: initialize struct passed to `ioctl(2)`.

Valgrind is complaining about a conditional jump based on uninitialized
memory:

```
==66462== Conditional jump or move depends on uninitialised value(s)
==66462==    at 0x10C500: smart_read_nvme_intel_disk (in /__w/collectd/collectd/test_plugin_smart)
==66462==    by 0x10D366: test_x (in /__w/collectd/collectd/test_plugin_smart)
==66462==    by 0x10D638: main (in /__w/collectd/collectd/test_plugin_smart)
```

This may be due to the `struct nvme_additional_smart_log` being
uninitialized when it's being passed to `ioctl(2)`.

This there, this removed an unnecessary level of indentation.

18 months agoNetlink plugin: complete initialize structs used for testing.
Florian Forster [Sat, 25 Nov 2023 12:51:57 +0000 (13:51 +0100)] 
Netlink plugin: complete initialize structs used for testing.

Valgrind complains about a conditional jump based on uninitialized
memory:

```
==66438== Conditional jump or move depends on uninitialised value(s)
==66438==    at 0x10CA06: vf_info_submit (in /__w/collectd/collectd/test_plugin_netlink)
==66438==    by 0x1110F2: test_vf_submit_test (in /__w/collectd/collectd/test_plugin_netlink)
==66438==    by 0x112EAC: main (in /__w/collectd/collectd/test_plugin_netlink)
```

This is likely caused by the `vf_stats_t` being only partially
initialized. Using a struct initializer is not only cleaner, it also
ensures the remainder of the struct is initialized to zero.

18 months agoAdd Valgrind suppression for libvirt memory leak.
Florian Forster [Thu, 23 Nov 2023 15:17:55 +0000 (16:17 +0100)] 
Add Valgrind suppression for libvirt memory leak.

18 months agoNUT plugin: import `<time.h>` before `<upsclient.h>`.
Florian Forster [Sun, 26 Nov 2023 14:27:28 +0000 (15:27 +0100)] 
NUT plugin: import `<time.h>` before `<upsclient.h>`.

18 months agoconfigure.ac: if neither UPSCONN{,_t} type was found, refuse to build NUT plugin
Jim Klimov [Wed, 31 Aug 2022 13:32:46 +0000 (15:32 +0200)] 
configure.ac: if neither UPSCONN{,_t} type was found, refuse to build NUT plugin

NOTE: src/nut.c also has pragmas to error out in this situation,
but that handling is compiler-dependent and happens too late in
the checkout/configure/build loop.

Presumably this inability to find the type in the earlier-found header file
is also triggered by build environment "inconsistencies" like lack of basic
types in the libc implementation (maybe highlighting the need for additional
headers or macros for the platform).

18 months agoconfigure.ac, src/nut.c: detect int types required by NUT API we build against
Jim Klimov [Wed, 31 Aug 2022 09:40:01 +0000 (11:40 +0200)] 
configure.ac, src/nut.c: detect int types required by NUT API we build against

Either use the stricter int types required by NUT headers since v2.8.0 release,
or the relaxed (arch-dependent) types required by older NUT releases - depending
on which NUT API version the collectd is building against at the moment.

Inspired by discussion at https://github.com/networkupstools/nut/issues/1638

18 months agocapabilities plugin: remove warning about "leaking" a pointer to a local variable.
Florian Forster [Tue, 28 Nov 2023 13:50:36 +0000 (14:50 +0100)] 
capabilities plugin: remove warning about "leaking" a pointer to a local variable.

```
src/capabilities.c: In function 'cap_http_handler':
src/capabilities.c:209:23: error: storing the address of local variable '({anonymous})' in '*connection_state' [-Werror=dangling-pointer=]
  209 |     *connection_state = &(int){44};
      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
src/capabilities.c:209:31: note: '({anonymous})' declared here
  209 |     *connection_state = &(int){44};
      |                               ^
src/capabilities.c:209:31: note: 'connection_state' declared here
```

18 months agocpu plugin: Fix potential buffer overflow.
Florian Forster [Tue, 28 Nov 2023 13:42:54 +0000 (14:42 +0100)] 
cpu plugin: Fix potential buffer overflow.

```
In function 'cpu_commit_without_aggregation',
    inlined from 'cpu_commit' at src/cpu.c:563:5,
    inlined from 'cpu_read' at src/cpu.c:925:3:
src/cpu.c:534:50: note: directive argument in the range [0, 18446744073709551614]
  534 |       snprintf(cpu_num_str, sizeof(cpu_num_str), "%zu", cpu_num);
      |                                                  ^~~~~
src/cpu.c:534:7: note: 'snprintf' output between 2 and 21 bytes into a destination of size 16
  534 |       snprintf(cpu_num_str, sizeof(cpu_num_str), "%zu", cpu_num);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

18 months agogmond plugin: Improve `mc_handle_metadata_msg()`.
Florian Forster [Sat, 25 Nov 2023 23:10:52 +0000 (00:10 +0100)] 
gmond plugin: Improve `mc_handle_metadata_msg()`.

This function was not properly formatted. While there:

* Handle the error instead of indenting the successful flow.
* Declare variables late.
* Initialize variables when declaring them.

18 months agogmond plugin: Look for RPC headers in /usr/include/tirpc.
Florian Forster [Sat, 25 Nov 2023 22:47:47 +0000 (23:47 +0100)] 
gmond plugin: Look for RPC headers in /usr/include/tirpc.

glibc removed the SunRPC headers, and the replacement headers are in a
different location. Try and look for them there.

18 months agogmond plugin: Import `<ganglia.h>`.
Florian Forster [Sat, 25 Nov 2023 16:35:27 +0000 (17:35 +0100)] 
gmond plugin: Import `<ganglia.h>`.

`<gm_protocol.h>` has been removed in new versions of libganglia.

18 months agocurl_stats: fix compatibility with new versions of cURL.
Florian Forster [Fri, 24 Nov 2023 07:28:06 +0000 (08:28 +0100)] 
curl_stats: fix compatibility with new versions of cURL.

Use integer based keys for metrics if available.

cURL ≥ 7.55.0 provides additional keys that allow getting certain
metrics as integers rather than doubles, e.g. content length. In some
newer versions of cURL, the original keys (using doubles) are marked as
deprecated.

ChangeLog: cURL, cURL-JSON, cURL-XML, Write HTTP plugins: fix compatibility with new versions of cURL.

18 months agoImport workflow definitions from `main`.
Florian Forster [Tue, 28 Nov 2023 10:06:22 +0000 (11:06 +0100)] 
Import workflow definitions from `main`.

18 months agoconfigure: disable all plugins not yet supporting collectd 6.
Florian Forster [Tue, 28 Nov 2023 12:56:27 +0000 (13:56 +0100)] 
configure: disable all plugins not yet supporting collectd 6.

This should allow us (and users) to just run `./configure` without
further flags, lowering the barrier to entry. It also allows us to
remove these configure flags from the CI configuration.

18 months agoconfigure: ensure there is a `plugin_foo` variable for each plugin.
Florian Forster [Tue, 28 Nov 2023 12:47:32 +0000 (13:47 +0100)] 
configure: ensure there is a `plugin_foo` variable for each plugin.

18 months agoMerge pull request #4173 from eero-t/log-metrics
Florian Forster [Wed, 29 Nov 2023 19:18:08 +0000 (20:18 +0100)] 
Merge pull request #4173 from eero-t/log-metrics

[Collectd 6] gpu_sysman: improve metric variants handling

18 months agogpu_sysman: minor improvements to Sysman plugin documentation 4173/head
Eero Tamminen [Tue, 21 Nov 2023 16:24:08 +0000 (18:24 +0200)] 
gpu_sysman: minor improvements to Sysman plugin documentation

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agogpu_sysman: rename "counter" output variant to more generic "base"
Eero Tamminen [Fri, 24 Nov 2023 17:05:51 +0000 (19:05 +0200)] 
gpu_sysman: rename "counter" output variant to more generic "base"

And make it control output for all base metric values, not just
counters.  That allows disabling output of values for:
- Memory usage
- Frequency
- Temperature
If one wants to see only their rates.

That will be useful with the new "LogMetrics" option in next commit.

Did also small optimization for output variant checks (no need for
free() if they're moved earlier).

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agogpu_sysman: better metrics check interval counter name
Eero Tamminen [Fri, 17 Nov 2023 16:48:55 +0000 (18:48 +0200)] 
gpu_sysman: better metrics check interval counter name

Collectd value_t struct has also "counter" field, so this makes Sysman
plugin check interval counter easier to find.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agogpu_sysman: add unit (s) to interval settings output
Eero Tamminen [Mon, 27 Nov 2023 13:48:48 +0000 (15:48 +0200)] 
gpu_sysman: add unit (s) to interval settings output

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>