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

2 years agoHugepages plugin skips reading write-only file
Yadnesh Kulkarni [Wed, 22 Feb 2023 12:27:55 +0000 (17:57 +0530)] 
Hugepages plugin skips reading write-only file

Since 'demote' is a write-only file do not attempt to
to read it. This also prevents the plugin from generating
incessant logs about the failure to open it.

Fixes: #3993
https://docs.kernel.org/admin-guide/mm/hugetlbpage.html

2 years agoUpdate the format of contrib/snmp-data.conf
Vit Kabele [Tue, 12 Jul 2022 20:19:52 +0000 (22:19 +0200)] 
Update the format of contrib/snmp-data.conf

Update the format of snmp-data.conf file to not issue deprecation
warning on startup.

s/InstancePrefix/TypeInstancePrefix/g
s/Instance/TypeInstanceOID/g

Signed-off-by: Vit Kabele <vit@kabele.me>
2 years ago[cleanup] Fix typo in comment and remove executable bits of config file
Thomas Renninger [Tue, 31 Jan 2023 16:06:37 +0000 (17:06 +0100)] 
[cleanup] Fix typo in comment and remove executable bits of config file

2 years agoFix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set
Thomas Renninger [Tue, 31 Jan 2023 15:40:42 +0000 (16:40 +0100)] 
Fix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set

Otherwise one gets:
src/snmp.c: In function 'csnmp_config_add_host_auth_protocol':
src/snmp.c:678:25: error: 'usmHMACMD5AuthProtocol' undeclared (first use in this function); did you mean 'usmHMACSHA1AuthProtocol'?
   678 |     hd->auth_protocol = usmHMACMD5AuthProtocol;
       |                         ^~~~~~~~~~~~~~~~~~~~~~
       |                         usmHMACSHA1AuthProtocol

2 years agoFix formatting in mdadm events table
Dominika [Fri, 13 Jan 2023 16:19:40 +0000 (17:19 +0100)] 
Fix formatting in mdadm events table

2 years agoAdd new exec-borg script to contrib/
Darshit Shah [Sat, 31 Dec 2022 02:36:53 +0000 (03:36 +0100)] 
Add new exec-borg script to contrib/

2 years agoChangeLog: v5.12 milestone: Fix issue #3127
Paul [Fri, 9 Dec 2022 15:43:03 +0000 (16:43 +0100)] 
ChangeLog: v5.12 milestone: Fix issue #3127

write_graphite connection closed message always zero

2 years agouse derive_t instead of int inside ovs_stats_get_port_stat_value
Antti Nykanen [Fri, 10 Dec 2021 10:36:53 +0000 (12:36 +0200)] 
use derive_t instead of int inside ovs_stats_get_port_stat_value

2 years agoformatting
Clay Caviness [Fri, 15 Jul 2022 18:09:19 +0000 (14:09 -0400)] 
formatting

2 years agoIn macOS 12, `IOMasterPort` is deprecated in favor of `IOMainPort`
Clay Caviness [Fri, 15 Jul 2022 17:29:11 +0000 (13:29 -0400)] 
In macOS 12, `IOMasterPort` is deprecated in favor of `IOMainPort`

```
src/battery.c:250:7: error: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations]
      kIOMasterPortDefault, IOServiceNameMatching("battery"), &iterator);
      ^~~~~~~~~~~~~~~~~~~~
      kIOMainPortDefault
```

2 years agoUpdate build.yml
Alex [Mon, 29 Aug 2022 18:57:45 +0000 (19:57 +0100)] 
Update build.yml

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
2 years ago- allow alertmanager correlation and resolve
Carlos Peon Costa [Mon, 17 Oct 2022 08:02:46 +0000 (10:02 +0200)] 
- allow alertmanager correlation and resolve
- fix meta names with ':'

2 years agofix drop probability
Carlos Peon Costa [Fri, 25 Nov 2022 18:09:10 +0000 (19:09 +0100)] 
fix drop probability

2 years agoadd config option to write metadata
Carlos Peon Costa [Mon, 21 Nov 2022 19:39:35 +0000 (20:39 +0100)] 
add config option to write metadata

2 years agocpython: fix build with Python 3.11
Đoàn Trần Công Danh [Wed, 21 Sep 2022 15:21:58 +0000 (22:21 +0700)] 
cpython: fix build with Python 3.11

Python 3.11 moves longintrepr.h into cpython sub-directory.
However, in this version, longintrepr.h is always included.

2 years agommc: cache open file descriptors to block devices 3934/head
Leonard Göhrs [Tue, 27 Sep 2022 06:03:14 +0000 (08:03 +0200)] 
mmc: cache open file descriptors to block devices

Udev rules can contain a "watch" option, which is described in the man page as:

  Watch the device node with inotify; when the node is closed after being
  opened for writing, a change uevent is synthesized.

This watch option is enabled by default for all block devices[1].
The intention behind this is to be notified about changes to the partition
table. The mmc plugin does however also need to open the block device for
writing, even though it never modifies its content, in order to be able to
issue ioctls with vendor defined MMC-commands.

Reduce the amount of generated change events from one per read to one per
collectd runtime by caching the open file descriptor.

[1]: https://github.com/systemd/systemd/blob/ef2ad30aee9fa99b0fdb8fe7efda397513cec6af/rules.d/60-block.rules

Fixes: 2f15c704 (mmc: add more vendor specific and generic data sources (#4006))
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
2 years agoCorrect description of FQDNLookup in manpage of collectd.conf. FQDNLookup uses getadd...
Oskar Roesler (bionade24) [Thu, 21 Jul 2022 19:08:59 +0000 (21:08 +0200)] 
Correct description of FQDNLookup in manpage of collectd.conf. FQDNLookup uses getaddrinfo() and not gethostname().

2 years agoAllow date setting in files generated by the CSV plugin
Francisco Jose Alvarez [Mon, 29 Aug 2022 11:15:06 +0000 (13:15 +0200)] 
Allow date setting in files generated by the CSV plugin

2 years agoFix anonymous connection_state pointer
Ismael Luceno [Mon, 15 Aug 2022 12:25:26 +0000 (14:25 +0200)] 
Fix anonymous connection_state pointer

Returning an anonymous pointer (which is limited to the scope of the
function) causes a build error with -Werror.

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
2 years agoRequire systemd-devel to rpmbuild SMART plugin
Laura Hild [Thu, 8 Sep 2022 20:32:41 +0000 (16:32 -0400)] 
Require systemd-devel to rpmbuild SMART plugin

2 years agoAdd more RPM build instructions
Laura Hild [Thu, 8 Sep 2022 20:32:30 +0000 (16:32 -0400)] 
Add more RPM build instructions

2 years 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).

2 years 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

2 years agoFixed duplicate datarootdir
brianna [Wed, 13 Jul 2022 07:45:10 +0000 (04:45 -0300)] 
Fixed duplicate datarootdir

2 years agoIncrease buffer for OAuth access token. Another fix for #3897.
tonypelle [Fri, 19 Aug 2022 17:18:56 +0000 (10:18 -0700)] 
Increase buffer for OAuth access token.  Another fix for #3897.

2 years agoFix-configure.ac: define PREFIX in config.h
lns [Wed, 15 Jun 2022 18:08:32 +0000 (20:08 +0200)] 
Fix-configure.ac: define PREFIX in config.h

PREFIX was never defined and therefore set to the
default value `/opt/collectd`. collectd searched in
this path for desired files e.g. typesdb, plugins, etc
no matter if it was configured with `--prefix`.

Signed-off-by: lns <matzeton@googlemail.com>
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
3 years ago[gha] Add el9_x86_64 to tested distros
Emma Foley [Thu, 9 Jun 2022 17:43:46 +0000 (18:43 +0100)] 
[gha] Add el9_x86_64 to tested distros

3 years ago[CI] Update Fedora versions used in GHA
Emma Foley [Thu, 9 Jun 2022 13:49:26 +0000 (14:49 +0100)] 
[CI] Update Fedora versions used in GHA

3 years agoFix compile of the prometheus plugin
Matthias Runge [Wed, 8 Jun 2022 14:44:07 +0000 (16:44 +0200)] 
Fix compile of the prometheus plugin

3 years agomodbus: add support for double values (#4009)
Simon Peeters [Wed, 8 Jun 2022 09:53:25 +0000 (11:53 +0200)] 
modbus: add support for double values (#4009)

3 years agoAdd scalloc() and use it in src/processes.c (#4014)
Eero Tamminen [Wed, 8 Jun 2022 09:31:07 +0000 (12:31 +0300)] 
Add scalloc() and use it in src/processes.c (#4014)

* Add scalloc() wrapper similar to smalloc() to common utils

scalloc() wraps calloc() with exit on alloc failure,
similarly to what smalloc() does for malloc().

* Handle (Solaris-only) ps_read_process calloc fails by using scalloc

Everything else checks and handles calloc failures except this function.

As I cannot test Solaris specific code, I've just replaced calloc with
scalloc, which gracefully exits collectd with error message on alloc
failures (instead of corrupting memory / crashing, as would happen
with current code).

3 years agoFix the virt plugin for Openstack wallaby and later use (#4011)
Matthias Runge [Tue, 7 Jun 2022 09:16:34 +0000 (11:16 +0200)] 
Fix the virt plugin for Openstack wallaby and later use (#4011)

* Fix formatting for the send queue option

* Later OpenStack versions use Nova version 1.1

In later OpenStack versions, the namespace for Nova changed, reflecting
in a change for the XML description for the virtual machine.

3 years agommc: add more vendor specific and generic data sources (#4006)
Leonard Göhrs [Fri, 3 Jun 2022 13:31:54 +0000 (15:31 +0200)] 
mmc: add more vendor specific and generic data sources (#4006)

* mmc plugin: integrate into configure.ac

The mmc plugin is not fully integrated in the configure.ac.
Change that.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: Skip mmc paths in /sys that start with a '.' (like "." and "..")

The plugin tries to (and obiously fails to) use "." and "..", that come out of
listdir, as mmc devices.
Filter these two out by skipping hidden files/directories.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: read standard eMMC 5.0 health metrics

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: remove type-name defines

These defines can become confusing, especially when combined with the defines
for attribute names in the sysfs. This will only get worse when more
vendor-specific metrics are supported.
Remove the defines and use the type names directly.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: remove sysfs-attribute defines

These defines are used only once or twice and do not help with readability.
Replace them with just the raw strings.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: port to libudev

While using the sysfs directly works fine for the swissbit and generic eMMC
driver it does not scale well to other vendor-specific interfaces where one has
to open the block device in /dev to perform ioctls.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: add micron eMMC support

While this patch was only tested with a single product (MTFC16GAPALBH) I am
fairly confident that it will generalize to others as well, as micron
themselves ship a single tool[1], which this patch uses as a reference, to read
similar info from all of their eMMCs.

This patch also increases the maximum value of mmc_bad_blocks to infinity,
as it can be any 16 bit integer for micron eMMC but could be even larger for
other vendors.

[1]: https://github.com/arcus-smart-home/arcushubos/blob/master/meta-iris/recipes-core/iris-utils/files/emmcparm_1.0.c

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
* mmc plugin: add sandisk eMMC support

While this patch was only tested with a single product (SDINBDG4-8G), I am
fairly confident that it should generalize to other devices as well,
as the current product portfolio on their website looks very similar to the one
I tested and new devies will likely use a Western Digital manufacturer ID.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
3 years agouse correct path for libgcrypt-config (#4008)
Marcus Furlong [Fri, 3 Jun 2022 13:24:58 +0000 (09:24 -0400)] 
use correct path for libgcrypt-config (#4008)

3 years agoMQTT: fix off-by-one error in published message length (#4005)
Leonard Göhrs [Wed, 1 Jun 2022 06:04:28 +0000 (08:04 +0200)] 
MQTT: fix off-by-one error in published message length (#4005)

The mqtt plugin publishes messages including the trailing '\0'-Byte,
as can be verified using e.g. the mosquitto_sub command with a HEX message
formatter:

  $ mosquitto_sub -t "#" -F "%t: %X"
  metrics/loragw1/users/users: 313635323334303737392E3938353A3000
                                                               ^^
While the the MQTT PUBLISH payload is, according to the specification,
application specific and most (C-Based) consumers will not notice the trailing
'\0'-Byte, it is rather uncommon to publish messages like this.

We stumbled upon this error while using Telegraf to ingest metrics via MQTT,
as it is Go-Based and does not use '\0'-terminated strings, leading to issues
parsing these strings into numbers.

Fix the off-by-one error by using the result of strlen() as-is.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
3 years agoSome improvements for InfluxDB support (#3938)
Matwey V. Kornilov [Thu, 28 Apr 2022 16:29:17 +0000 (19:29 +0300)] 
Some improvements for InfluxDB support (#3938)

* write_http: Make use of CURLOPT_POSTFIELDSIZE

CURLOPT_POSTFIELDSIZE allows to specify the data size, which is known in
advance and equals to cb->send_buffer_fill. When CURLOPT_POSTFIELDSIZE is not
set (or set to -1), then curl evaluates data size using strlen() function,
which have O(N) complexity, so we save a few CPU cycles here.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
* write_influxdb_udp: Split formatting functions to format_influxdb

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
* write_http: Add influxdb format

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
* write_http: Enable using unix socket in libcurl

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
* meta_data: Introduce basic iterator interface

Currently, meta_data supports only the key lookup over forward list data
structure, so iterating over the list would take O(N^2).

Here we introduce meta_data_iter() and meta_data_iter_next() functions dealing
with opaque iterator type.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
* format_influxdb: Support serializing meta_data

collectd 6.0 supports serializing series labels as influxdb tags. Here we
backport this feature serializing string-values meta data keys as influxdb
tags.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
3 years agoFix formatting for the send queue option
Matthias Runge [Thu, 21 Apr 2022 18:04:53 +0000 (20:04 +0200)] 
Fix formatting for the send queue option

3 years agosmart: check udev_enumerate_scan_devices() return value and unify log messages (...
Florian Eckert [Thu, 17 Mar 2022 07:34:33 +0000 (08:34 +0100)] 
smart: check udev_enumerate_scan_devices() return value and unify log messages (#3984)

* Check udev_enumerate_scan_devices return value

This change checks the return value of the function and cancels the call
if the returned integer is not greater than or equal to 0.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* Unify and fix log messages

The error log messages were not consistent and had no prefix. This
commit adds the uniform prefix 'smart plugin:' to each log message. While
we're at it, I also removed the punctuation mark at the end of the
sentences.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years ago[ci][gha] Miscellaneous improvements and sync with cirrus (#3976)
Emma Foley [Tue, 15 Feb 2022 14:14:15 +0000 (14:14 +0000)] 
[ci][gha] Miscellaneous improvements and sync with cirrus (#3976)

* [ci][gha] Rename tasks

* [ci][gha] Update and use MAKEFLAGS

* [ci][gha] Remove continue-on-error from ``make distcheck`` tasks

Installation of bzip2 and make distcheck were failing on el8.
This was resolved by updating it to use CentOS Stream 8 in [1]

[1] https://github.com/collectd/ci-docker/pull/55

3 years agomemory: add laundry and user wired pages (#3962)
François Charlier [Tue, 15 Feb 2022 12:02:55 +0000 (13:02 +0100)] 
memory: add laundry and user wired pages (#3962)

Changelog: memory: report for laundry and user_wire pages on FreeBSD

Add the `vm.stats.vm.v_laundry_count` and
`vm.stats.vm.v_user_wire_count`  which have been present on FreeBSD for
a little while now.

3 years ago[gha] Add a test log when the tests fail (#3971)
Emma Foley [Tue, 15 Feb 2022 11:41:38 +0000 (11:41 +0000)] 
[gha] Add a test log when the tests fail (#3971)

* [ci][gha] Add a test log when the tests fail

* [ci][cirrus] Update CI to provide test logs on failure

Co-authored-by: Matthias Runge <mrunge@redhat.com>
3 years agoFix CI failures caused by unsupported distros and updates to dependencies (#3975)
Emma Foley [Tue, 15 Feb 2022 07:46:21 +0000 (07:46 +0000)] 
Fix CI failures caused by unsupported distros and updates to dependencies (#3975)

* [ci][gha] Replace trusy with Bionic and Focal

Ubuntu 14.04 (Trusty) is out of standard support [1].
``make check`` fails for test_capabilities, as noted in [2].
[3] indicates that the cause is glibc, but that updates are not expected
to the version in trusty.

This PR replaces trusty with Ubuntu 18.04 (Bionic) and 20.04 (Focal).

[1] https://wiki.ubuntu.com/Releases
[2] #3936
[3] #3927 (comment)

* [ci][cirrus] Make Valgrind error on defininte memory leaks only

Valgrind gives errors when it find possible leaks;
update the options to only error on definite leaks.

This is done using the VALGRIND_OPTS env var, which is used by valgrind
when it is invoked.

* [ci][gha] Make Valgrind error on defininte memory leaks only

Valgrind gives errors when it find possible leaks;
update the options to only error on definite leaks.

This is done using the VALGRIND_OPTS env var, which is used by valgrind
when it is invoked.

3 years agodisk: add utilization (#3967)
Marek Bečka [Fri, 4 Feb 2022 07:13:17 +0000 (08:13 +0100)] 
disk: add utilization (#3967)

* added disk utilization

* fix disk utilization

* fix interval back to ms

3 years ago[ci][cirrus] Replace trusty with bionic/focal in debian_default_toolchain
Emma Foley [Fri, 5 Nov 2021 19:20:31 +0000 (19:20 +0000)] 
[ci][cirrus] Replace trusty with bionic/focal in debian_default_toolchain

Ubuntu 14.04 (Trusty) is out of standard support [1].
``make check`` fails for test_capabilities, as noted in [2].
[3] indicates that the cause is glibc, but that updates are not expected
to the version in trusty.

This PR replaces trusty with Ubuntu 18.04 (Bionic) and 20.04 (Focal).

[1] https://wiki.ubuntu.com/Releases
[2] https://github.com/collectd/collectd/pull/3936
[3] https://github.com/collectd/collectd/pull/3927#issuecomment-953350598

3 years ago[intel_rdt] Fix build for LIBPQOS < 2
Emma Foley [Fri, 3 Dec 2021 20:59:29 +0000 (15:59 -0500)] 
[intel_rdt] Fix build for LIBPQOS < 2

ChangeLog: intel_rdt: Update intel_rdt to build on libpqos < 2

3 years agoMerge pull request #3948 from elfiesmelfie/bug/3932
Emma Foley [Fri, 3 Dec 2021 12:57:50 +0000 (12:57 +0000)] 
Merge pull request #3948 from elfiesmelfie/bug/3932

virt plugin: Add hugetlb_ metrics

3 years agoMerge pull request #3774 from kwiatrox/intel_rdt_metrics
Kamil Wiatrowski [Wed, 1 Dec 2021 10:57:49 +0000 (11:57 +0100)] 
Merge pull request #3774 from kwiatrox/intel_rdt_metrics

Intel rdt metrics improvments

3 years agoDo not account reclaimable slab as used
Weiping Zhang [Mon, 17 May 2021 07:59:50 +0000 (15:59 +0800)] 
Do not account reclaimable slab as used

ChangeLog: memory plugin: do not account reclaimable slab as used.

Align this counter with free(1).
https://gitlab.com/procps-ng/procps/-/blob/v3.3.17/proc/sysinfo.c#L789

Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>