]> git.ipfire.org Git - thirdparty/collectd.git/log
thirdparty/collectd.git
18 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".

18 months agoMerge pull request #4166 from octo/cirrus
Florian Forster [Sun, 26 Nov 2023 21:07:07 +0000 (22:07 +0100)] 
Merge pull request #4166 from octo/cirrus

Improve tests run on the Cirrus CI platform.

18 months ago.cirrus.yml: Report failures from CentOS 9 and Fedora 39. 4166/head
Florian Forster [Sun, 26 Nov 2023 21:01:17 +0000 (22:01 +0100)] 
.cirrus.yml: Report failures from CentOS 9 and Fedora 39.

18 months ago.cirrus.yml: Fix reporting of test failure.
Florian Forster [Sat, 25 Nov 2023 14:49:54 +0000 (15:49 +0100)] 
.cirrus.yml: Fix reporting of test failure.

18 months ago.cirrus.yml: set parallelism to number of CPUs.
Florian Forster [Sat, 25 Nov 2023 14:47:28 +0000 (15:47 +0100)] 
.cirrus.yml: set parallelism to number of CPUs.

18 months ago.cirrus.yml: Add task for FreeBSD builds.
Florian Forster [Sat, 25 Nov 2023 14:04:10 +0000 (15:04 +0100)] 
.cirrus.yml: Add task for FreeBSD builds.

18 months ago.cirrus.yml: remove obsolete platforms, add recent ones.
Florian Forster [Sat, 25 Nov 2023 13:52:39 +0000 (14:52 +0100)] 
.cirrus.yml: remove obsolete platforms, add recent ones.

18 months ago.cirrus.yml: s/master/main/
Florian Forster [Sat, 25 Nov 2023 13:44:31 +0000 (14:44 +0100)] 
.cirrus.yml: s/master/main/

18 months agoMerge pull request #4169 from octo/nut/upsclient
Florian Forster [Sun, 26 Nov 2023 19:10:09 +0000 (20:10 +0100)] 
Merge pull request #4169 from octo/nut/upsclient

NUT plugin: improve support for faulty versions of libupsclient.

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

18 months agoMerge pull request #4167 from octo/ganglia
Florian Forster [Sat, 25 Nov 2023 23:17:18 +0000 (00:17 +0100)] 
Merge pull request #4167 from octo/ganglia

gmond plugin: Import `<ganglia.h>`.

18 months agogmond plugin: Improve `mc_handle_metadata_msg()`. 4167/head
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 agoMerge pull request #4168 from octo/workflow/upload
Florian Forster [Sat, 25 Nov 2023 21:57:02 +0000 (22:57 +0100)] 
Merge pull request #4168 from octo/workflow/upload

Workflow build: upload `config.log` and other log files.

18 months agoWorkflow build: upload `config.log` and other log files. 4168/head
Florian Forster [Sat, 25 Nov 2023 19:39:29 +0000 (20:39 +0100)] 
Workflow build: upload `config.log` and other log files.

18 months agoMerge pull request #4165 from octo/netlink/valgrind_issue
Florian Forster [Sat, 25 Nov 2023 13:22:21 +0000 (14:22 +0100)] 
Merge pull request #4165 from octo/netlink/valgrind_issue

Netlink plugin: complete initialize structs used for testing.

18 months agoSMART plugin: initialize struct passed to `ioctl(2)`. 4165/head
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 agoMerge pull request #4163 from octo/workflows/fedora39
Florian Forster [Fri, 24 Nov 2023 15:16:21 +0000 (16:16 +0100)] 
Merge pull request #4163 from octo/workflows/fedora39

Build workflow: Add Fedora 38 and 39.

18 months agoBuild workflow: report the status of `make check` after the test log has been uploaded. 4163/head
Florian Forster [Fri, 24 Nov 2023 14:56:12 +0000 (15:56 +0100)] 
Build workflow: report the status of `make check` after the test log has been uploaded.

18 months agoBuild workflow: use all available CPUs.
Florian Forster [Fri, 24 Nov 2023 14:53:44 +0000 (15:53 +0100)] 
Build workflow: use all available CPUs.

18 months agoBuild workflow: Add Fedora 38 and 39, remove Fedora 36.
Florian Forster [Fri, 24 Nov 2023 14:26:10 +0000 (15:26 +0100)] 
Build workflow: Add Fedora 38 and 39, remove Fedora 36.

18 months agoMerge pull request #4162 from octo/workflows/build
Florian Forster [Fri, 24 Nov 2023 14:46:55 +0000 (15:46 +0100)] 
Merge pull request #4162 from octo/workflows/build

Build workflow: remove old distros.

18 months ago./contrib/format.sh src/amqp.c
Florian Forster [Fri, 24 Nov 2023 13:25:01 +0000 (14:25 +0100)] 
./contrib/format.sh src/amqp.c

18 months agoUpdate README.md
Vatsalya Vyas [Tue, 31 Oct 2023 06:59:31 +0000 (12:29 +0530)] 
Update README.md

18 months agoAdd Ubuntu 22.04 ("Jammy Jellyfish") and Ubuntu 23.10 ("Mantic Minotaur"). 4162/head
Florian Forster [Fri, 24 Nov 2023 13:58:46 +0000 (14:58 +0100)] 
Add Ubuntu 22.04 ("Jammy Jellyfish") and Ubuntu 23.10 ("Mantic Minotaur").

18 months agoBuild workflow: also remove EL8 (based on CentOS 8).
Florian Forster [Fri, 24 Nov 2023 13:27:05 +0000 (14:27 +0100)] 
Build workflow: also remove EL8 (based on CentOS 8).

18 months agoBuild workflow: remove old distros.
Florian Forster [Fri, 24 Nov 2023 11:04:25 +0000 (12:04 +0100)] 
Build workflow: remove old distros.

This removes old and unsupported Linux distros:

*   Ubuntu 16 ("Xenial", support ended April 2021)
*   Ubuntu 18 ("Bionic Beaver", support ended June 2023)
*   Enterprise Linux 7 (technically still supported, but nine years old
    at this point)
*   Fedora 34 (support ended June 2022)
*   Fedora 35 (support ended December 2022)

Fedora 36 is also unsupported. We will keep the builder until we have
never versions of Fedora available (or at least Rawhide builds again).

18 months agoMerge pull request #4111 from mrunge/rabbitmq
Florian Forster [Fri, 24 Nov 2023 13:28:22 +0000 (14:28 +0100)] 
Merge pull request #4111 from mrunge/rabbitmq

Fix compile warning for amqp

18 months agoAMQP plugin: prefer the `rabbitmq-c/amqp.h` header if available. 4111/head
Florian Forster [Fri, 24 Nov 2023 13:14:05 +0000 (14:14 +0100)] 
AMQP plugin: prefer the `rabbitmq-c/amqp.h` header if available.

At some point, RabbitMQ has moved their headers to the `rabbitmq-c/`
subdirectory. The old locations still exist but throw an error, saying
the old headers are "deprecated".

This adds appropriate checks for the new headers to the configure script
and uses those if present.

To simplify both the configure script and plugin, support for ancient
versions of the library is removed. This affects versions that don't
have the `amqp_tcp_socket_new()` function yet.

18 months agoFix compile warning for amqp
Matthias Runge [Mon, 24 Apr 2023 08:16:55 +0000 (10:16 +0200)] 
Fix compile warning for amqp

warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."

18 months agoMerge pull request #4161 from octo/intel_rdt/pids2
Florian Forster [Fri, 24 Nov 2023 11:19:14 +0000 (12:19 +0100)] 
Merge pull request #4161 from octo/intel_rdt/pids2

Intel RDT plugin: use `pqos_mon_start_pids2()` if available.

18 months agoIntel RDT plugin: use `pqos_mon_start_cores()` if available. 4161/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 agoMerge pull request #4160 from octo/python/SetArgv
Florian Forster [Fri, 24 Nov 2023 09:28:59 +0000 (10:28 +0100)] 
Merge pull request #4160 from octo/python/SetArgv

Python plugin: use `PyConfig` to set argv.

18 months agoPython plugin: use `PyConfig` to set argv. 4160/head
Florian Forster [Fri, 24 Nov 2023 09:03:12 +0000 (10:03 +0100)] 
Python plugin: use `PyConfig` to set argv.

`PySys_SetArgv` has been deprecated in Python 3.11.

18 months agoMerge pull request #4158 from octo/write_mongodb/format-truncation
Florian Forster [Fri, 24 Nov 2023 08:27:16 +0000 (09:27 +0100)] 
Merge pull request #4158 from octo/write_mongodb/format-truncation

Write MongoDB plugin: fix format trunction errors.

18 months agoWrite MongoDB plugin: fix format trunction errors. 4158/head
Florian Forster [Fri, 24 Nov 2023 08:15:04 +0000 (09:15 +0100)] 
Write MongoDB plugin: fix format trunction errors.

When a `size_t` is a 64bit integer, the 16 byte buffer could potentially
overflow. Fix this by using a larger buffer and also collectd's own
`ssnprintf()` function which guarantees to result in a null terminated
string.

```
In function 'wm_create_bson',
    inlined from 'wm_write' at src/write_mongodb.c:229:17:
src/write_mongodb.c:99:32: error: '%zu' directive output may be truncated writing between 1 and 20 bytes into a region of size 16 [-Werror=format-truncation=]
   99 |     snprintf(key, sizeof(key), "%" PRIsz, i);
      |                                ^~~
src/write_mongodb.c: In function 'wm_write':
src/write_mongodb.c:99:33: note: format string is defined here
   99 |     snprintf(key, sizeof(key), "%" PRIsz, i);
```

18 months agoMerge pull request #4157 from octo/distcheck
Florian Forster [Fri, 24 Nov 2023 08:09:41 +0000 (09:09 +0100)] 
Merge pull request #4157 from octo/distcheck

Add new GitHub action for running `make distcheck`.

18 months agoGive the action and job better names. 4157/head
Florian Forster [Fri, 24 Nov 2023 08:03:39 +0000 (09:03 +0100)] 
Give the action and job better names.

18 months agoRemove `make distcheck` from the regular "build" action.
Florian Forster [Fri, 24 Nov 2023 08:01:34 +0000 (09:01 +0100)] 
Remove `make distcheck` from the regular "build" action.

18 months agoDistcheck action: use Debian 11 ("Bullseye") for now.
Florian Forster [Fri, 24 Nov 2023 07:55:34 +0000 (08:55 +0100)] 
Distcheck action: use Debian 11 ("Bullseye") for now.

Debian 12 does not compile yet.

18 months agoAdd new GitHub action for running `make distcheck`.
Florian Forster [Fri, 24 Nov 2023 07:46:59 +0000 (08:46 +0100)] 
Add new GitHub action for running `make distcheck`.

18 months agoMerge pull request #4156 from octo/curl_off_t
Florian Forster [Fri, 24 Nov 2023 07:48:03 +0000 (08:48 +0100)] 
Merge pull request #4156 from octo/curl_off_t

curl_stats: fix compatibility with new versions of cURL.

18 months agocurl_stats: fix compatibility with new versions of cURL. 4156/head
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 agoBuild workflow: add Debian 12 ("Bookworm") and remove Debian 9 ("Stretch").
Florian Forster [Thu, 23 Nov 2023 21:55:56 +0000 (22:55 +0100)] 
Build workflow: add Debian 12 ("Bookworm") and remove Debian 9 ("Stretch").

18 months agoMerge pull request #4155 from octo/valgrind
Florian Forster [Thu, 23 Nov 2023 15:46:43 +0000 (16:46 +0100)] 
Merge pull request #4155 from octo/valgrind

Add Valgrind suppression for libvirt memory leak.

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

18 months agoMerge pull request #4154 from octo/intel_rdt
Florian Forster [Thu, 23 Nov 2023 15:35:56 +0000 (16:35 +0100)] 
Merge pull request #4154 from octo/intel_rdt

Intel RDT: fix compilation with libpqos < 4.4.

18 months agoIntel RDT: fix compilation with libpqos < 4.4. 4154/head
Florian Forster [Thu, 23 Nov 2023 13:14:19 +0000 (14:14 +0100)] 
Intel RDT: fix compilation with libpqos < 4.4.

18 months agoRevert "GitHub actions: upgrade to actions/checkout@v4"
Florian Forster [Thu, 23 Nov 2023 15:25:52 +0000 (16:25 +0100)] 
Revert "GitHub actions: upgrade to actions/checkout@v4"

This reverts commit 8a451bca30011fbfd249bbd3aa78922cb03aef2d.

Some older platforms use an incompatible glibc version.

18 months agoGitHub actions: upgrade to actions/checkout@v4
Florian Forster [Thu, 23 Nov 2023 14:39:58 +0000 (15:39 +0100)] 
GitHub actions: upgrade to actions/checkout@v4

18 months agoGitHub actions: include job name in artifact name.
Florian Forster [Thu, 23 Nov 2023 14:22:28 +0000 (15:22 +0100)] 
GitHub actions: include job name in artifact name.

Otherwise a random job would "win" and the entire workflow only produces one artifact.

18 months agoGitHub actions: continue on error and upload test logs.
Florian Forster [Thu, 23 Nov 2023 13:58:54 +0000 (14:58 +0100)] 
GitHub actions: continue on error and upload test logs.

When `make check` fails, continue so that the "upload logs" step is
performed. Use the `upload-artifact` action instead of just `cat`ing the
file.

18 months agoMerge pull request #3773 from drNowak/bugfix-negative-cpu
Florian Forster [Thu, 23 Nov 2023 12:44:06 +0000 (13:44 +0100)] 
Merge pull request #3773 from drNowak/bugfix-negative-cpu

Compare both PID and process start time to avoid issues with immediate PID reuse on Linux

18 months agoclang format 3773/head
Krzysztof Nowak [Thu, 12 Nov 2020 09:53:02 +0000 (10:53 +0100)] 
clang format

18 months agoCompare both PID and process start time to avoid issues with immediate PID reuse...
Krzysztof Nowak [Thu, 12 Nov 2020 09:19:14 +0000 (10:19 +0100)] 
Compare both PID and process start time to avoid issues with immediate PID reuse on Linux platform.

18 months agowrite_prometheus: don't use AI_ADDRCONFIG for resolving bind address
Wolf480pl [Tue, 21 Nov 2023 10:53:59 +0000 (11:53 +0100)] 
write_prometheus: don't use AI_ADDRCONFIG for resolving bind address

Fixes #4150

write_prometheus uses getaddrinfo to resolve the bind address.
The AI_ADDRCONFIG flag causes getaddrinfo to refuse to resolve
0.0.0.0 when the system has no non-loopback IPv4 addresses configured
and refuse to resolve :: when the system has no non-loopback IPv6 configured.

We want binding to a wildcard address (0.0.0.0 or ::) to always work,
even if the network is down.

To achieve that, don't pass the AI_ADDRCONFIG flag
when resolving a bind address.

19 months agoConvert src/collectdctl.pod to UTF-8.
Florian Forster [Tue, 14 Nov 2023 07:36:06 +0000 (08:36 +0100)] 
Convert src/collectdctl.pod to UTF-8.

19 months agoAdd .md to README in redhat specfile
Laura Hild [Mon, 23 Oct 2023 20:47:28 +0000 (16:47 -0400)] 
Add .md to README in redhat specfile

19 months agoPut README(.md) back in the dist
Laura Hild [Mon, 23 Oct 2023 20:47:06 +0000 (16:47 -0400)] 
Put README(.md) back in the dist

19 months agoEnsure %perl_vendorlib in redhat specfile
Laura Hild [Mon, 23 Oct 2023 20:40:47 +0000 (16:40 -0400)] 
Ensure %perl_vendorlib in redhat specfile

19 months agoUpdate IPTables plugin build-dep in redhat specfile
Laura Hild [Mon, 23 Oct 2023 20:38:30 +0000 (16:38 -0400)] 
Update IPTables plugin build-dep in redhat specfile

19 months agoAdd RAS plugin to redhat specfile
Laura Hild [Mon, 23 Oct 2023 20:36:32 +0000 (16:36 -0400)] 
Add RAS plugin to redhat specfile

19 months agoAdd MMC plugin to redhat specfile
Laura Hild [Mon, 23 Oct 2023 20:36:06 +0000 (16:36 -0400)] 
Add MMC plugin to redhat specfile

19 months agoRemoved extra call to swap_submit_usage.
Carl Hakan Engvall [Fri, 15 Sep 2023 02:28:45 +0000 (22:28 -0400)] 
Removed extra call to swap_submit_usage.

20 months agoUpdate README.md
schorsch1976 [Tue, 29 Aug 2023 16:22:53 +0000 (18:22 +0200)] 
Update README.md

20 months agoUpdate contrib/postgresql/README.md
schorsch1976 [Tue, 29 Aug 2023 16:20:44 +0000 (18:20 +0200)] 
Update contrib/postgresql/README.md

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
20 months agoUpdate contrib/postgresql/README.md
schorsch1976 [Tue, 29 Aug 2023 16:15:10 +0000 (18:15 +0200)] 
Update contrib/postgresql/README.md

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
20 months agoUpdate contrib/postgresql/README.md
schorsch1976 [Tue, 29 Aug 2023 16:14:35 +0000 (18:14 +0200)] 
Update contrib/postgresql/README.md

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
20 months agocontrib/postgresql: Second postgresql database layout.
Georg Gast [Sun, 27 Aug 2023 11:20:11 +0000 (13:20 +0200)] 
contrib/postgresql: Second postgresql database layout.

Changelog: contrib/postgresql: Second postgresql database layout.

Motivation for that second possible postgresql layout:
------------------------------------------------------

The first layout from Sebastian 'tokkee' Harl is like that:

```
+-------------------+  +----------------+
|Identifiers        |  |values          |
+-------------------+  +----------------+
|ID          int   <-- >ID        int   |
|plugin      text   |  |tstamp    time  |
|plugin_inst text   |  |name      text  |
|type        text   |  |value     double|
|type_inst   text   |  |                |
+-------------------+  +----------------+
```

The ID connects the two tables. The plugin, plugin_inst, type and tpye_inst
create s so called identifier. The timestamp, name and value get inserted into
the value table.

collectd/postgresql calles the collectd_insert function.
```
collectd_insert(timestamp with time zone, -- tstamp
character varying, -- host
character varying, -- plugin
character varying, -- plugin_inst
character varying, -- type
character varying, -- type_inst
character varying[], -- value_name
character varying[], -- type_name
double precision[]) -- values
```

This seems to represents the user_data_t/notification_t structure.
https://github.com/collectd/collectd/blob/ef1e157de1a4f2cff10f6f902002066d0998232c/src/daemon/plugin.h#L172

Lets take the ping plugin as an example. It collects 3 values: ping, ping_stddev, ping_droprate.

The current structure creates 3 identifiers and 3 lines for each entry. The identifiers get reused. It reports "192.168.myping.ip" as type.

To draw a diagram with e.g. grafana i would like all 3 values near each other for that host that i am pinging. See the graph in the wiki. The current setup must join through all collected values to scrap the ping values out of it. Each value must do the same again because it has an other identifier.

This second setup creates two tables:

```
+--------------------+  +--------------------+
|Instance            |  |plugin_ping         |
+--------------------+  +--------------------+
|ID          int    <-- >ID            int   |
|plugin      text    |  |tstamp        time  |
|plugin_inst text    |  |ping          double|
|                    |  |ping_stddev   double|
|                    |  |ping_droprate double|
|                    |  |                    |
+--------------------+  +--------------------+
```

The instance ID get reused. The plugin data get its own table. All relevant measurement values are on one line. Get out the data is much more easy.

What could get argued is that i must admit, maybe take the creation of the instance table, sequence out of the collectd_insert function.

The type, type_inst and value_name get used to create the name of the value volumn. The impl_location() function handles this "data anomalies" like the ping plugin.

Description:
------------

My development was done on postgresql 15.

It has some advantages: The data has much higher data locality as it stays in one table and much less unneeded text columns.
This leads to much smaller table spaces. In my case the first setup created about 300 MB per day. The new setup about 50 MB with the advantage of depending data near each other.
You can also think about changing the datatype of the plugin_$plugin table to real. Just think if you realy need the double precission that double vs real. This just cuts the needed space in half.

Sample configuration:
---------------------
```

<Plugin postgresql>
    <Writer sqlstore>
        Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);"
    </Writer>
    <Database collectd>
        Host "127.0.0.1"
        Port 5432
        User collector
        Password "mypassword"
        SSLMode "prefer"
        Writer sqlstore
    </Database>
</Plugin>
```
Please make sure that your database user (in this collector) has the rights to create tables, insert and update. The user that drops data must have the delete right.

Function description:
---------------------
The function collectd_insert() creates all tables and columns by itself.
1. The instance table consists of host/plugin/plugin_inst
2. The plugin_$plugin table (e.g. plugin_apache) contain all data for that plugin. The function collectd_insert() inserts the value into the column that its type/type_inst/name determines. There is one sad thing about collectd. The times that are submitted dont match 100%, so there is a epsilon (0.5 sec) that is used to check to what row a value belongs. If the column is not yet present it is added by this function.

The function impl_location() removes some data anomalies that are there when the data get submitted. There is a default that matches most cases. The plugins cpufreq, ping and memory get their names, plugin_inst get adjusted.

My tested plugins are:
- apache
- cpu
- cpufreq
- df
- disk
- entropy
- interface
- irq
- load
- memory
- network
- openvpn
- ping
- postgresql
- processes
- sensors
- thermal
- uptime
- users

The procedure collectd_cleanup() is the maintainance function. It has as an argument the number of days where to keep the data. It can be called by pgagent or a similar mechanism like "CALL collectd_cleanup(180)". This delete all data that is older than 180 days.

21 months agointel_rdt: added support for LLC references monitoring event
Michał Aleksiński [Wed, 16 Aug 2023 10:50:01 +0000 (12:50 +0200)] 
intel_rdt: added support for LLC references monitoring event

21 months agointel_rdt: start only supported events
Michał Aleksiński [Wed, 16 Aug 2023 10:23:44 +0000 (12:23 +0200)] 
intel_rdt: start only supported events

21 months agoadd questions metric for mysql plugin
Konstantin Pilnik [Wed, 2 Aug 2023 14:32:27 +0000 (19:32 +0500)] 
add questions metric for mysql plugin

21 months agoplugin processes: fix doc typo
Coda [Sun, 20 Aug 2023 10:28:55 +0000 (03:28 -0700)] 
plugin processes: fix doc typo

21 months agoChange AMQP queue drops from DEBUG to WARNING
Chris Sibbitt [Fri, 25 Aug 2023 19:04:16 +0000 (15:04 -0400)] 
Change AMQP queue drops from DEBUG to WARNING

Debug messages are only available if collectd is compiled with debug enabled, making it hard to troubleshoot the situation where the amqp queue is being overrun.

2 years agovmem: add metrics starting with `pgrefill`
zzzyhtheonly [Fri, 26 May 2023 08:25:11 +0000 (16:25 +0800)] 
vmem: add metrics starting with `pgrefill`

Signed-off-by: zzzyhtheonly <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years ago3052: Renamed README to README.md and added TOC.
Adam Jovanovic [Sun, 21 May 2023 03:52:56 +0000 (13:52 +1000)] 
3052: Renamed README to README.md and added TOC.

2 years agoprocesses: format array size def in read fork_rate & ctxt
tiozhang [Sat, 6 May 2023 04:59:34 +0000 (12:59 +0800)] 
processes: format array size def in read fork_rate & ctxt

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: fix prints & remove useless comments
tiozhang [Sat, 6 May 2023 03:12:28 +0000 (11:12 +0800)] 
processes: fix prints & remove useless comments

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: simpler illustration in conf.pod
tiozhang [Fri, 5 May 2023 11:33:44 +0000 (19:33 +0800)] 
processes: simpler illustration in conf.pod

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: eliminate hardcoded arraysize in read ctxt & fork_rate
tiozhang [Fri, 5 May 2023 11:30:25 +0000 (19:30 +0800)] 
processes: eliminate hardcoded arraysize in read ctxt & fork_rate

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: determine if ctxt is enabled before read_sys_ctxt_switch
tiozhang [Fri, 5 May 2023 03:36:33 +0000 (11:36 +0800)] 
processes: determine if ctxt is enabled before read_sys_ctxt_switch

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: format `/proc/stat` WARNING & ERROR
tiozhang [Fri, 5 May 2023 03:31:26 +0000 (11:31 +0800)] 
processes: format `/proc/stat` WARNING & ERROR

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: use buffer to read /proc/stat once according to procs_running
tiozhang [Wed, 26 Apr 2023 11:52:05 +0000 (19:52 +0800)] 
processes: use buffer to read /proc/stat once according to procs_running

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoprocesses: remove running++ since we calc it in procs_running later
tiozhang [Wed, 26 Apr 2023 11:24:09 +0000 (19:24 +0800)] 
processes: remove running++ since we calc it in procs_running later

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
2 years agoprocesses: make contextswitches configurable
tiozhang [Wed, 26 Apr 2023 11:20:33 +0000 (19:20 +0800)] 
processes: make contextswitches configurable

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoRunning contrib/format.sh.
sparked435 [Tue, 25 Apr 2023 00:47:46 +0000 (20:47 -0400)] 
Running contrib/format.sh.

2 years agoPass precise size of struct sockaddr, whichever type of struct sockaddr, to getnamein...
sparked435 [Fri, 30 Dec 2022 17:19:16 +0000 (12:19 -0500)] 
Pass precise size of struct sockaddr, whichever type of struct sockaddr, to getnameinfo() on NetBSD.

2 years agocpufreq: init max_avail_freqs with 128
tiozhang [Sun, 23 Apr 2023 10:02:54 +0000 (18:02 +0800)] 
cpufreq: init max_avail_freqs with 128

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
2 years agocpufreq: dynamically alloc max_avail_freqs according to time_in_state
tiozhang [Sun, 23 Apr 2023 09:22:22 +0000 (17:22 +0800)] 
cpufreq: dynamically alloc max_avail_freqs according to time_in_state

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agocpufreq: format.sh cpufreq.c
tiozhang [Thu, 20 Apr 2023 10:04:16 +0000 (18:04 +0800)] 
cpufreq: format.sh cpufreq.c

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
2 years agocpufreq: make MAX_AVAIL_FREQS configurable in conf
tiozhang [Thu, 20 Apr 2023 09:02:04 +0000 (17:02 +0800)] 
cpufreq: make MAX_AVAIL_FREQS configurable in conf

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
2 years agoFix glibc feature macro handling for timegm
Florian Weimer [Thu, 6 Apr 2023 17:00:08 +0000 (19:00 +0200)] 
Fix glibc feature macro handling for timegm

The way strptime is activated using feature macros, _DEFAULT_SOURCE
(successor to _BSD_SOURCE) is disabled implicitly, so timegm is
hidden.  Defining _DEFAULT_SOURCE at the same time as the other
feature macros solves this, and removes the need for the
TIMEGM_NEEDS_BSD configure macro.

This avoids an implicit declaration of timegm in src/bind.c, and build
failures with future compilers.

2 years agoMerge pull request #4101 from agrue/write_stackdriver_leaks
Florian Forster [Sun, 23 Apr 2023 08:38:08 +0000 (10:38 +0200)] 
Merge pull request #4101 from agrue/write_stackdriver_leaks

Fix a memory leak in the `write_stackdriver` plugin

2 years agovmem: add "scan" metrics starting with "pgscan_"
zzzyhtheonly [Mon, 20 Mar 2023 11:41:36 +0000 (19:41 +0800)] 
vmem: add "scan" metrics starting with "pgscan_"

replace "pgscan_kswapd_" and "pgscan_direct_" with "pgscan_" according to `man proc`

2 years agovmem: add "pgscan_"
zzzyhtheonly [Tue, 7 Mar 2023 03:19:33 +0000 (11:19 +0800)] 
vmem: add "pgscan_"

add "pgscan_" when "pgscan_kswapd_" or "pgscan_direct_" is not exist

2 years agovmem: add metrics start with "pgscan_" in Kernel Linux
tiozhang [Wed, 1 Mar 2023 06:19:15 +0000 (14:19 +0800)] 
vmem: add metrics start with "pgscan_" in Kernel Linux

Some Linux Kernel versions have metrics start with "pgscan_"
in /proc/vmstat, for instance:
```
cat /proc/vmstat | grep pgscan
pgscan_kswapd 0
pgscan_direct 0
pgscan_direct_throttle 0
```

Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
Co-authored-by: luffysong <zsfz_one@163.com>
2 years agoFix a memory leak in the `write_stackdriver` plugin 4101/head
Aden Grue [Thu, 23 Mar 2023 18:48:10 +0000 (11:48 -0700)] 
Fix a memory leak in the `write_stackdriver` plugin

The `payload` was never freed. This was affecting potentially every call to both the "write" and "flush" callbacks.