]> git.ipfire.org Git - thirdparty/collectd.git/log
thirdparty/collectd.git
8 weeks agoMerge pull request #4238 from kenhys/test-lua-plugin main
Florian Forster [Sat, 24 Feb 2024 20:56:54 +0000 (21:56 +0100)] 
Merge pull request #4238 from kenhys/test-lua-plugin

lua: add missing test case for #3779, #4235

2 months agolua: add missing test case for #3779, #4235 4238/head
Kentaro Hayashi [Wed, 17 Jan 2024 09:56:30 +0000 (18:56 +0900)] 
lua: add missing test case for #3779, #4235

* luaC_pushoconfigitem (indirectly lua_config)
* luaC_pushnotification

In the previous versions, there was no test code for Lua plugin.
Thus this is first step to improve such a situation.

Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
2 months agoMerge pull request #4279 from zzzyhtheonly/main
Florian Forster [Tue, 20 Feb 2024 19:28:40 +0000 (20:28 +0100)] 
Merge pull request #4279 from zzzyhtheonly/main

memory.c: workaround to let ValuesPercentage works again without "available"

2 months agomemory.c: workaround to let ValuesPercentage works again without "available" 4279/head
zzzyhtheonly [Tue, 20 Feb 2024 08:48:12 +0000 (16:48 +0800)] 
memory.c: workaround to let ValuesPercentage works again without "available"

Signed-off-by: zzzyhtheonly <zyhtheonly@yeah.net>
2 months agoMerge pull request #4281 from matwey/epics-deadlock
Florian Forster [Tue, 20 Feb 2024 06:53:10 +0000 (07:53 +0100)] 
Merge pull request #4281 from matwey/epics-deadlock

epics: Fix potential deadlock in handle_label_event

2 months agoepics: Fix potential deadlock in handle_label_event 4281/head
Matwey V. Kornilov [Sun, 18 Feb 2024 17:21:54 +0000 (20:21 +0300)] 
epics: Fix potential deadlock in handle_label_event

2 months agoMerge pull request #4276 from octo/ras
Florian Forster [Wed, 7 Feb 2024 17:34:07 +0000 (18:34 +0100)] 
Merge pull request #4276 from octo/ras

ras plugin: Remove unnecessary includes.

2 months agoMerge pull request #4148 from brd/freebsd-pf
Florian Forster [Wed, 7 Feb 2024 17:11:29 +0000 (18:11 +0100)] 
Merge pull request #4148 from brd/freebsd-pf

FreeBSD's PF has a new interface so leverage libpfctl to access it so…

2 months agoras plugin: Ensure each log message prints an appropriate prefix. 4276/head
Florian Forster [Wed, 7 Feb 2024 16:58:53 +0000 (17:58 +0100)] 
ras plugin: Ensure each log message prints an appropriate prefix.

2 months agoras plugin: Use `sysconf(_SC_NPROCESSORS_CONF)` instead of `get_nprocs_conf()`.
Florian Forster [Wed, 7 Feb 2024 16:55:51 +0000 (17:55 +0100)] 
ras plugin: Use `sysconf(_SC_NPROCESSORS_CONF)` instead of `get_nprocs_conf()`.

`get_nprocs_conf()` is a GNU extension.

2 months agoFreeBSD's PF has a new interface so leverage libpfctl to access it so the right inter... 4148/head
Brad Davis [Tue, 7 Nov 2023 10:35:47 +0000 (03:35 -0700)] 
FreeBSD's PF has a new interface so leverage libpfctl to access it so the right interface is used depending on the version

2 months agoras plugin: Remove unnecessary includes.
Florian Forster [Wed, 7 Feb 2024 16:39:01 +0000 (17:39 +0100)] 
ras plugin: Remove unnecessary includes.

2 months ago.github/workflows/release.yml: Import changes from `collectd-6.0`.
Florian Forster [Wed, 7 Feb 2024 09:09:53 +0000 (10:09 +0100)] 
.github/workflows/release.yml: Import changes from `collectd-6.0`.

2 months agoversion-gen.sh: Add the `--tags` flag to `git describe`.
Florian Forster [Tue, 6 Feb 2024 21:25:20 +0000 (22:25 +0100)] 
version-gen.sh: Add the `--tags` flag to `git describe`.

2 months agoAdd GitHub Action to automatically build and upload release assets.
Florian Forster [Wed, 7 Feb 2024 08:21:19 +0000 (09:21 +0100)] 
Add GitHub Action to automatically build and upload release assets.

2 months agoMerge pull request #4247 from octo/interface-solaris
Florian Forster [Tue, 6 Feb 2024 06:42:05 +0000 (07:42 +0100)] 
Merge pull request #4247 from octo/interface-solaris

interface plugin: Reorder implementations to put kstat above getifaddrs.

2 months agoci: Remove the "statgrab" task from CirrusCI.
Florian Forster [Tue, 23 Jan 2024 12:14:02 +0000 (13:14 +0100)] 
ci: Remove the "statgrab" task from CirrusCI.

The "statgrab" job builds collectd with the "statgrab" library and then expects
certain plugins to be linked against it. However, since the build runs on
Linux, the plugins are actually using the "native" implementation. The linker,
noticing that the plugin is not referring to any symbol in the statgrab
library, does not actually produce a link, causing the test to fail.

The native implementations provide much richer metrics than the libstatgrab
based implementations, so we'll drop the test.

2 months ago.cirrus.yml: Rename `checks_script` to `make_distcheck_script`.
Florian Forster [Mon, 29 Jan 2024 13:17:40 +0000 (14:17 +0100)] 
.cirrus.yml: Rename `checks_script` to `make_distcheck_script`.

2 months ago.cirrus.yml: Upload `.log` files as artifacts.
Florian Forster [Mon, 29 Jan 2024 06:55:14 +0000 (07:55 +0100)] 
.cirrus.yml: Upload `.log` files as artifacts.

2 months agoAuto-Merge pull request #4260 from octo/write_redis
collectd bot [Mon, 29 Jan 2024 12:27:31 +0000 (13:27 +0100)] 
Auto-Merge pull request #4260 from octo/write_redis

Automatically merged due to "Automerge" label

2 months agowrite_redis plugin: Clean up allocated fields in `wr_config_free()`. 4260/head
Florian Forster [Mon, 29 Jan 2024 07:41:13 +0000 (08:41 +0100)] 
write_redis plugin: Clean up allocated fields in `wr_config_free()`.

2 months agoMerge pull request #4256 from zzzyhtheonly/main
Florian Forster [Fri, 26 Jan 2024 06:48:56 +0000 (07:48 +0100)] 
Merge pull request #4256 from zzzyhtheonly/main

disk.c: add config options to support diskstats 15-20 in KERNEL_LINUX

2 months agodisk.c: add config options to support diskstats 15-20 in KERNEL_LINUX 4256/head
zzzyhtheonly [Fri, 26 Jan 2024 03:44:50 +0000 (11:44 +0800)] 
disk.c: add config options to support diskstats 15-20 in KERNEL_LINUX

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
3 months agointerface plugin: Reorder implementations to put kstat above getifaddrs. 4247/head
Florian Forster [Mon, 22 Jan 2024 20:05:15 +0000 (21:05 +0100)] 
interface plugin: Reorder implementations to put kstat above getifaddrs.

Fixes: #4240
3 months agoMerge pull request #4248 from octo/disk-linux
Florian Forster [Tue, 23 Jan 2024 10:27:17 +0000 (11:27 +0100)] 
Merge pull request #4248 from octo/disk-linux

disk plugin: Build `disk_submit_single` on Linux only.

3 months agoMerge pull request #4249 from ffontaine/main
Florian Forster [Mon, 22 Jan 2024 22:11:58 +0000 (23:11 +0100)] 
Merge pull request #4249 from ffontaine/main

fix(configure.ac): fix grpc build

3 months agoconfigure.ac: fix grpc build 4249/head
Fabrice Fontaine [Mon, 22 Jan 2024 21:15:21 +0000 (22:15 +0100)] 
configure.ac: fix grpc build

abseil and other google tools are now subject to
"Google's Foundational C++ Support Policy" [0][1]. This currently
mandates gcc 7.3.1 and C++14 as minimum versions. So replace -std=c++11
by -std=c++14 to fix following build failure:

checking whether /home/buildroot/autobuild/instance-0/output-1/host/bin/sparc64-linux-g++ accepts -std=c++11
configure:25105: result: yes
configure:25127: checking grpc++/grpc++.h usability
configure:25127: /home/buildroot/autobuild/instance-0/output-1/host/bin/sparc64-linux-g++ -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=2 -std=c++11  -DNOMINMAX  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.cpp >&5
In file included from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/config.h:86,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/const_init.h:25,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/synchronization/mutex.h:67,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/impl/codegen/sync.h:32,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/completion_queue.h:41,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/channel.h:25,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpcpp/grpcpp.h:52,
                 from /home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/grpc++/grpc++.h:26,
                 from conftest.cpp:167:
/home/buildroot/autobuild/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~

[0] https://github.com/abseil/abseil-cpp/releases/tag/20230125.0
[1] https://github.com/google/oss-policies-info/blob/b842c39db88e6569dfe2cf98be434b03507cb503/foundational-cxx-support-matrix.md

Fixes:
 - http://autobuild.buildroot.org/results/e2cf909ab3c356f1881fd18cfa039e87faa10d7d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 months agodisk plugin: Build `disk_submit_single` on Linux only. 4248/head
Florian Forster [Mon, 22 Jan 2024 21:02:44 +0000 (22:02 +0100)] 
disk plugin: Build `disk_submit_single` on Linux only.

3 months agoMerge pull request #4242 from zzzyhtheonly/main
Florian Forster [Mon, 22 Jan 2024 13:21:02 +0000 (14:21 +0100)] 
Merge pull request #4242 from zzzyhtheonly/main

disk: add /proc/diskstats fields 15 to 20 in KERNEL_LINUX

3 months agodisk: add /proc/diskstats fields 15 to 20 in KERNEL_LINUX 4242/head
zzzyhtheonly [Fri, 19 Jan 2024 08:51:17 +0000 (16:51 +0800)] 
disk: add /proc/diskstats fields 15 to 20 in KERNEL_LINUX

Kernel 4.18+ appends four more fields for discard tracking putting
the total at 18.
Kernel 5.5+ appends two more fields for flush requests.
This patch makes collectd available for those fields.

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: yutongzhou <timefly2010@gmail.com>
3 months agoMerge pull request #4234 from octo/contributing
Florian Forster [Mon, 22 Jan 2024 10:20:36 +0000 (11:20 +0100)] 
Merge pull request #4234 from octo/contributing

docs: Document important labels and how to interact with them.

3 months agodocs/CONTRIBUTING.md: Change formulation examples to discourage verbatim copying. 4234/head
Florian Forster [Mon, 22 Jan 2024 10:03:39 +0000 (11:03 +0100)] 
docs/CONTRIBUTING.md: Change formulation examples to discourage verbatim copying.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agodocs/CONTRIBUTING.md: Replace remaining use of "Unlisted Change".
Florian Forster [Sat, 20 Jan 2024 22:43:02 +0000 (23:43 +0100)] 
docs/CONTRIBUTING.md: Replace remaining use of "Unlisted Change".

3 months agodocs/CONTRIBUTING.md: Document that PRs with features and fixes should be split.
Florian Forster [Sat, 20 Jan 2024 22:20:06 +0000 (23:20 +0100)] 
docs/CONTRIBUTING.md: Document that PRs with features and fixes should be split.

3 months agodocs/CONTRIBUTING.md: Rename "Unlisted Change" to "Maintenance".
Florian Forster [Sat, 20 Jan 2024 22:13:05 +0000 (23:13 +0100)] 
docs/CONTRIBUTING.md: Rename "Unlisted Change" to "Maintenance".

Also document that doc updates should default to "fix".

3 months agoMerge pull request #3917 from eero-t/gcc-warnings
Florian Forster [Fri, 19 Jan 2024 19:39:20 +0000 (20:39 +0100)] 
Merge pull request #3917 from eero-t/gcc-warnings

Fix some gcc warnings with more strict checks

3 months agowrite_riemann_threshold.c: fix switch-case fall through warning 3917/head
Eero Tamminen [Wed, 17 Jan 2024 15:28:07 +0000 (17:28 +0200)] 
write_riemann_threshold.c: fix switch-case fall through warning

Checking also warning limits was just executing redundant code, but
otherwise harmless as later code checks failure count first.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agoPass strcmp() to c_avl_create() as function pointer, not data one
Eero Tamminen [Wed, 17 Jan 2024 15:19:16 +0000 (17:19 +0200)] 
Pass strcmp() to c_avl_create() as function pointer, not data one

Matches how strcmp() is passed to c_avl_create() elsewhere.

Reported by -Wpendantic:
------------------------------------
write_prometheus.c: In function ‘prom_init’:
write_prometheus.c:900:28: error: ISO C forbids conversion of function pointer to object pointer type [-Werror=pedantic]
  900 |     metrics = c_avl_create((void *)strcmp);
      |                            ^
write_prometheus.c:900:28: error: ISO C forbids passing argument 1 of ‘c_avl_create’ between function pointer and ‘void *’ [-Werror=pedantic]
  900 |     metrics = c_avl_create((void *)strcmp);
      |                            ^~~~~~~~~~~~~~
In file included from write_prometheus.c:30:
utils/avltree/avltree.h:54:34: note: expected ‘int (*)(const void *, const void *)’ but argument is of type ‘void *’
   54 | c_avl_tree_t *c_avl_create(int (*compare)(const void *, const void *));
      |
                                   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agoturbostat, format_json: Satisfy clang-format CI check
Eero Tamminen [Fri, 4 Feb 2022 10:24:40 +0000 (12:24 +0200)] 
turbostat, format_json: Satisfy clang-format CI check

CI has changed since this code was added to collectd.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agoFix signedness mismatch GCC warnings in few of the plugins
Eero Tamminen [Fri, 4 Feb 2022 10:21:51 +0000 (12:21 +0200)] 
Fix signedness mismatch GCC warnings in few of the plugins

Based on "-O3 -Werror -Wall -Wextra -Wformat-security" output.

3 months agodaemon/utils_cache: remove unused functions and function args
Eero Tamminen [Tue, 16 Jan 2024 12:57:05 +0000 (14:57 +0200)] 
daemon/utils_cache: remove unused functions and function args

Arg update required touching also threshold.c & write_riemann plugin.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agoRemove unused function arguments from few of the plugins
Eero Tamminen [Fri, 4 Feb 2022 10:19:06 +0000 (12:19 +0200)] 
Remove unused function arguments from few of the plugins

Based on "-O3 -Werror -Wall -Wextra -Wformat-security" output.

3 months agoAttribute unused function args as such in few of the plugins
Eero Tamminen [Fri, 4 Feb 2022 10:20:27 +0000 (12:20 +0200)] 
Attribute unused function args as such in few of the plugins

Based on "-O3 -Werror -Wall -Wextra -Wformat-security" output.

3 months agowrite_prometheus: annotate unused args and fix comments
Eero Tamminen [Fri, 9 Jul 2021 15:43:38 +0000 (18:43 +0300)] 
write_prometheus: annotate unused args and fix comments

Fix obsolete comment to match MHD docs:
  https://www.gnu.org/software/libmicrohttpd/  ("Queueing responses" section)
  https://git.gnunet.org/libmicrohttpd.git/tree/src/include/microhttpd.h#n2398

3 months agoformat_json, network_parse: annotate unused args as unused
Eero Tamminen [Fri, 9 Jul 2021 15:44:28 +0000 (18:44 +0300)] 
format_json, network_parse: annotate unused args as unused

Based on output of:
 gcc -O3 -Werror -Wall -Wextra -Wno-missing-field-initializers -Wformat-security

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agodocs/CONTRIBUTING.md: Rename "Bug" to "Fix"; improve wording.
Florian Forster [Mon, 15 Jan 2024 18:57:36 +0000 (19:57 +0100)] 
docs/CONTRIBUTING.md: Rename "Bug" to "Fix"; improve wording.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
3 months agoMerge pull request #4230 from octo/workflows
Florian Forster [Mon, 15 Jan 2024 10:38:50 +0000 (11:38 +0100)] 
Merge pull request #4230 from octo/workflows

Import changes to `.github/workflows/` from the `collectd-6.0` branch.

3 months agoMerge pull request #4235 from clear-code/lua-notification
Florian Forster [Sat, 13 Jan 2024 20:31:01 +0000 (21:31 +0100)] 
Merge pull request #4235 from clear-code/lua-notification

 lua: add missing notification callback

3 months agolua: update explanation about register_notification callback 4235/head
Kentaro Hayashi [Sat, 13 Jan 2024 11:37:43 +0000 (20:37 +0900)] 
lua: update explanation about register_notification callback

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
3 months agolua: add missing notification callback
Kentaro Hayashi [Sat, 13 Jan 2024 08:27:32 +0000 (17:27 +0900)] 
lua: add missing notification callback

* register_notification

In this version, it support callback function something like:

  function notification(notif)
     print(inspect(notif))
     return 0
  end

  collectd.register_notification(notification)

It accepts PUTNOTIF event via plugin_dispatch_notification then you can
handle it.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
3 months agodocs: Document important labels and how to interact with them.
Florian Forster [Fri, 12 Jan 2024 17:33:21 +0000 (18:33 +0100)] 
docs: Document important labels and how to interact with them.

3 months ago.github/workflows/distcheck.yml: Run on Debian12 (current stable). 4230/head
Florian Forster [Thu, 21 Dec 2023 13:06:02 +0000 (14:06 +0100)] 
.github/workflows/distcheck.yml: Run on Debian12 (current stable).

3 months agoMerge pull request #4232 from octo/write_riemann
Florian Forster [Fri, 12 Jan 2024 09:40:15 +0000 (10:40 +0100)] 
Merge pull request #4232 from octo/write_riemann

write_riemann plugin: Terminate `riemann_event_set` arguments with `RIEMANN_EVENT_FIELD_NONE`.

3 months agowrite_riemann plugin: Terminate `riemann_event_set` arguments with `RIEMANN_EVENT_FIE... 4232/head
Florian Forster [Thu, 11 Jan 2024 19:35:30 +0000 (20:35 +0100)] 
write_riemann plugin: Terminate `riemann_event_set` arguments with `RIEMANN_EVENT_FIELD_NONE`.

`riemann_event_set` is a variadic function, that means it accepts a variable
number of arguments. That means it needs some way to determine – at runtime
– how many arguments there are. It appears to be doing so by using
`RIEMANN_EVENT_FIELD_NONE` to indicate the last element in the argument
list. Unfortunately I was unable to find the library's documentation and
code and could not verify this.

That means that the argument list passed to `riemann_event_set` was not
always terminated, causing it to read past where it was supposed to and
adding random crap into the message it crafted.

Issue: #4050

3 months agoMerge pull request #3779 from clear-code/main-more-lua-callbacks
Florian Forster [Thu, 11 Jan 2024 18:15:09 +0000 (19:15 +0100)] 
Merge pull request #3779 from clear-code/main-more-lua-callbacks

lua: Add functions to register some missing callbacks

3 months ago.cirrus.yml: Provide expected plugin list to `check-built-plugins.sh` if present.
Florian Forster [Thu, 21 Dec 2023 12:34:41 +0000 (13:34 +0100)] 
.cirrus.yml: Provide expected plugin list to `check-built-plugins.sh` if present.

3 months ago.cirrus.yml: Rename container images.
Florian Forster [Thu, 21 Dec 2023 13:42:21 +0000 (14:42 +0100)] 
.cirrus.yml: Rename container images.

* bookworm_amd64 → debian12
* mantic_amd64 → ubuntu23.10
* el9_x86_64 → centos9
* fedora_rawhide_x86_64 → fedora_main

3 months ago.github/workflows/build.yml: Add "Check expected plugins" to "experimental".
Florian Forster [Thu, 21 Dec 2023 16:22:53 +0000 (17:22 +0100)] 
.github/workflows/build.yml: Add "Check expected plugins" to "experimental".

3 months ago.github/workflows/build.yml: Add a "Check expected plugins" step.
Florian Forster [Thu, 21 Dec 2023 15:54:19 +0000 (16:54 +0100)] 
.github/workflows/build.yml: Add a "Check expected plugins" step.

3 months ago.github/workflows/: Rename container images.
Florian Forster [Thu, 21 Dec 2023 13:05:32 +0000 (14:05 +0100)] 
.github/workflows/: Rename container images.

* bookworm_amd64 → debian12
* bullseye_amd64 → debian11
* buster_amd64 → debian10
* mantic_amd64 → ubuntu23.10
* jammy_amd64 → ubuntu22.04
* focal_amd64 → ubuntu20.04
* el9_x86_64 → centos9
* fedora38_x86_64 -> fedora38
* fedora_rawhide_x86_64 → fedora_main

3 months ago.github/workflows/build.yml: Remove Ubuntu Bionic.
Florian Forster [Thu, 14 Dec 2023 07:28:35 +0000 (08:28 +0100)] 
.github/workflows/build.yml: Remove Ubuntu Bionic.

It is too old to work with `actions/checkout@v4`.

3 months agolua: Add functions to register some missing callbacks 3779/head
Kentaro Hayashi [Tue, 10 Nov 2020 01:29:38 +0000 (10:29 +0900)] 
lua: Add functions to register some missing callbacks

* register_init
* register_shutdown
* register_config

In this version, the configuration for each Script is
supported.

  Script "foo.lua"
  Script "bar.lua"
  <Module "foo.lua">
    Key1 Value1
  </Module>
  <Module "bar.lua">
    Key2 Value2
  </Module>

The scope of accessible key-value pair is limited to under <Module>
This feature is similar to collectd-python.

  ref. https://www.collectd.org/documentation/manpages/collectd-python.html

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
3 months agoMerge pull request #3777 from clear-code/change-lock-scope
Florian Forster [Sat, 30 Dec 2023 20:20:13 +0000 (21:20 +0100)] 
Merge pull request #3777 from clear-code/change-lock-scope

lua: Use a global lock to call Lua's API

3 months agoMerge pull request #3778 from clear-code/detect-luajit
Florian Forster [Sat, 30 Dec 2023 20:18:19 +0000 (21:18 +0100)] 
Merge pull request #3778 from clear-code/detect-luajit

lua: support to detect LuaJIT automatically

3 months agolua: Use a global lock to call Lua's API 3777/head
Takuro Ashie [Mon, 26 Oct 2020 02:22:29 +0000 (11:22 +0900)] 
lua: Use a global lock to call Lua's API

Since vanilla Lua isn't multi-thread-safe, a global lock should be used
when calling their functions. The previous code causes unstable behavior
especially on loading Lua's C modules with both read & write threads.

e.g.)

  collectd.register_read(function()
    require('cqueues')
    return 0
  end)

  collectd.register_write(function()
    return 0
  end)

Note that you need to add the following config to your collectd.conf to
load C modules:

  <LoadPlugin lua>
    Globals true
  </LoadPlugin>

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
3 months agoMerge pull request #4022 from matwey/epics
Florian Forster [Fri, 29 Dec 2023 15:21:19 +0000 (16:21 +0100)] 
Merge pull request #4022 from matwey/epics

EPICS plugin

3 months agoInitial implementation for epics plugin 4022/head
Matwey V. Kornilov [Wed, 5 Jan 2022 14:20:06 +0000 (17:20 +0300)] 
Initial implementation for epics plugin

EPICS is Experimental Physics and Industrial Control System.

Reference: https://epics-controls.org/

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
4 months agolua: add fallback to detect LuaJIT 3778/head
Kentaro Hayashi [Mon, 5 Oct 2020 06:36:18 +0000 (15:36 +0900)] 
lua: add fallback to detect LuaJIT

Before:
  LIBLUA_PKG_CONFIG_NAME=luajit ./configure --enable-lua

After:
  ./configure --enable-lua

In the previous versions, for enabling LuaJIT,
it needs to specify LIBLUA_PKG_CONFIG_NAME=luajit explicitly.

In this commit, add fallback to detect LuaJIT without specifying
LIBLUA_PKG_CONFIG_NAME=luajit explicitly by default (just use
--enable-lua).

Note that if both of lua and luajit exists, then lua is used.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
4 months agocollection3: Fix inappropriate usage of CGI:param
Kentaro Hayashi [Mon, 8 Feb 2021 12:26:16 +0000 (21:26 +0900)] 
collection3: Fix inappropriate usage of CGI:param

When using collection3 as a CGI, the following error is sent to logs
repeatedly.

  FastCGI sent in stderr: "CGI::param called in list context from
  /usr/share/doc/collectd-core/examples/collection3/lib/Collectd/Graph/Common.pm
  line 529, this can lead to vulnerabilities. See the warning in
  "Fetching the value or values of a single named parameter" at
  /usr/share/perl5/CGI.pm line 412"

This is caused inappropriate usage of param(), it should be handled as
a scalar or should be treated by multi_param() explicitly.

Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
4 months agoMerge pull request #4205 from octo/putval
Florian Forster [Thu, 21 Dec 2023 12:37:41 +0000 (13:37 +0100)] 
Merge pull request #4205 from octo/putval

cmds: Add a unittest for `cmd_parse_putval`.

4 months agocommon: Use `sstrncpy` to get around misinformed compiler error. 4205/head
Florian Forster [Thu, 21 Dec 2023 11:15:52 +0000 (12:15 +0100)] 
common: Use `sstrncpy` to get around misinformed compiler error.

4 months agocommon: Fix compiler warning in unit test.
Florian Forster [Thu, 21 Dec 2023 11:05:45 +0000 (12:05 +0100)] 
common: Fix compiler warning in unit test.

Some compilers complained about using a value that depends on the input for the
size argument passed to `strncpy`. They missed that the size of `buf` also
depends on the source argument and therefore this use is fine.

```
  CC       src/utils/common/common_test.o
../../src/utils/common/common_test.c: In function 'test_parse_values':
../../src/utils/common/common_test.c:316:5: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  316 |     strncpy(buf, cases[i].buffer, buf_sz);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/utils/common/common_test.c:314:21: note: length computed here
  314 |     size_t buf_sz = strlen(cases[i].buffer) + 1;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
```

4 months agocontrib/format.sh src/utils/common/common_test.c
Florian Forster [Wed, 20 Dec 2023 20:08:49 +0000 (21:08 +0100)] 
contrib/format.sh src/utils/common/common_test.c

4 months agocmds: Add a test for `cmd_parse_putval`.
Florian Forster [Wed, 20 Dec 2023 19:59:52 +0000 (20:59 +0100)] 
cmds: Add a test for `cmd_parse_putval`.

4 months agocmds: Prevent `cmd_parse_putval` from modifying its `argv` argument.
Florian Forster [Wed, 20 Dec 2023 19:56:13 +0000 (20:56 +0100)] 
cmds: Prevent `cmd_parse_putval` from modifying its `argv` argument.

4 months agocommon: Change `parse_values` so it doesn't modify the parsed string.
Florian Forster [Wed, 20 Dec 2023 19:45:49 +0000 (20:45 +0100)] 
common: Change `parse_values` so it doesn't modify the parsed string.

4 months agoMerge pull request #4184 from octo/issue/4137
Florian Forster [Wed, 6 Dec 2023 09:11:06 +0000 (10:11 +0100)] 
Merge pull request #4184 from octo/issue/4137

MySQL plugin: Fix incorrect WSREP/Galera metric types.

4 months agoMySQL plugin: Fix incorrect WSREP/Galera metric types. 4184/head
Florian Forster [Wed, 6 Dec 2023 08:19:49 +0000 (09:19 +0100)] 
MySQL plugin: Fix incorrect WSREP/Galera metric types.

Fixes: #4137
4 months agoMerge pull request #4065 from carlospeon/flush-buffer
Florian Forster [Tue, 5 Dec 2023 12:14:29 +0000 (13:14 +0100)] 
Merge pull request #4065 from carlospeon/flush-buffer

evaluate flush condition with oldest value in the buffer

4 months agoevaluate flush condition with oldest value in the buffer 4065/head
Carlos Peon Costa [Tue, 5 Dec 2023 11:39:16 +0000 (12:39 +0100)] 
evaluate flush condition with oldest value in the buffer

4 months agoMerge pull request #4178 from octo/convigure-virt
Florian Forster [Fri, 1 Dec 2023 12:57:15 +0000 (13:57 +0100)] 
Merge pull request #4178 from octo/convigure-virt

configure: Improve the reporting when the "virt" plugin cannot be built.

4 months agoMakefile.am: Build `test_virt_plugin` with the same `CFLAGS` as the *virt plugin*. 4178/head
Florian Forster [Fri, 1 Dec 2023 09:44:03 +0000 (10:44 +0100)] 
Makefile.am: Build `test_virt_plugin` with the same `CFLAGS` as the *virt plugin*.

Using different flags leads to build errors if libvirt is in a non-system location.

4 months agoconfigure: Use `elif` instead of two separate `if` blocks.
Florian Forster [Fri, 1 Dec 2023 09:43:09 +0000 (10:43 +0100)] 
configure: Use `elif` instead of two separate `if` blocks.

4 months agoconfigure: Improve the reporting when the "virt" plugin cannot be built.
Florian Forster [Thu, 30 Nov 2023 09:10:07 +0000 (10:10 +0100)] 
configure: Improve the reporting when the "virt" plugin cannot be built.

4 months agoMerge pull request #4172 from octo/procevent
Florian Forster [Wed, 29 Nov 2023 15:35:15 +0000 (16:35 +0100)] 
Merge pull request #4172 from octo/procevent

procevent plugin: Remove embedded flexible array member to fix compiler warning.

4 months agoprocevent plugin: Consistently mention the unit in log message. 4172/head
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>
4 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>
4 months agowrite_log plugin: remove the "write_log values:" line when logging metrics.
Florian Forster [Wed, 29 Nov 2023 09:54:40 +0000 (10:54 +0100)] 
write_log plugin: remove the "write_log values:" line when logging metrics.

4 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.

4 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.

4 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.

4 months agoMerge pull request #4171 from octo/workflow
Florian Forster [Tue, 28 Nov 2023 12:02:17 +0000 (13:02 +0100)] 
Merge pull request #4171 from octo/workflow

Improve CI workflows

4 months agoMerge pull request #4164 from octo/notify_upstart_systemd
Florian Forster [Mon, 27 Nov 2023 15:57:32 +0000 (16:57 +0100)] 
Merge pull request #4164 from octo/notify_upstart_systemd

Notify upstart/systemd after initialization is complete.

4 months agoBuild workflow: request that clang produce DWARF v4 debug symbols. 4171/head
Florian Forster [Mon, 27 Nov 2023 15:50:00 +0000 (16:50 +0100)] 
Build workflow: request that clang produce DWARF v4 debug symbols.

4 months agoDisable "exit on error" when running `make check`.
Florian Forster [Mon, 27 Nov 2023 15:34:06 +0000 (16:34 +0100)] 
Disable "exit on error" when running `make check`.

4 months agoprocevent plugin: Disable the `-Wgnu-variable-sized-type-not-at-end` warning.
Florian Forster [Mon, 27 Nov 2023 13:59:05 +0000 (14:59 +0100)] 
procevent plugin: Disable the `-Wgnu-variable-sized-type-not-at-end` warning.

4 months ago.cirrus.yml: Update list of compilers to match the `debian_unstable` container.
Florian Forster [Mon, 27 Nov 2023 10:17:05 +0000 (11:17 +0100)] 
.cirrus.yml: Update list of compilers to match the `debian_unstable` container.

4 months agoBuild workflow: add builds for `--enable-debug` and `CC=clang`.
Florian Forster [Mon, 27 Nov 2023 10:15:51 +0000 (11:15 +0100)] 
Build workflow: add builds for `--enable-debug` and `CC=clang`.

4 months agoMerge pull request #4170 from octo/debian_sid
Florian Forster [Mon, 27 Nov 2023 09:35:08 +0000 (10:35 +0100)] 
Merge pull request #4170 from octo/debian_sid

Workflows: rename "sid_amd64" to "debian_unstable".

4 months agoWorkflows: rename "sid_amd64" to "debian_sid". 4170/head
Florian Forster [Mon, 27 Nov 2023 08:11:07 +0000 (09:11 +0100)] 
Workflows: rename "sid_amd64" to "debian_sid".