Commit Graph

45 Commits

Author SHA1 Message Date
Alex Shumsky b5bf5927f7 collectd-mod-ipstatistics: fix handling of long `/proc` lines
`/proc/net/netstat` `TcpExt:` line is 2064 chars long on linux 6.1

Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
[PKG_RELEASE bump added]
2023-09-01 20:51:40 +03:00
Florian Eckert 896a0f0db6 collectd: smart: add patch to check udev_enumerate_scan_devices return value
The function udev_enumarte_scan_devices returns a value less than 0 on
failure. If this is the case then we terminate the read for this smart
information.

This change was already send upstream. And could be delete in feature
collectd versions.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-17 14:11:41 +01:00
Florian Eckert a9ea1cf6ed collectd: remove not needed fix
This was not a real fix but a workaround. It is no longer clear to me
why this was necessary. Deleting the patch restores the upstream
behaviour of the collected for the smart plugin. I have tested it and on
my system the hard disk to be monitored is recognised.

root@system ~ # cat /sys/class/block/sda/uevent
MAJOR=8
MINOR=0
DEVNAME=sda
DEVTYPE=disk

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-17 14:11:41 +01:00
Florian Eckert b4e24c12a6 collectd: add percent calculation of bad block to ubi plugin
This patche adds the percent evaluation for the bad blocks.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-03-23 10:20:27 +01:00
Florian Eckert 4927b53333 collectd: prepare ubi plugin for percent calculation
This patche change prepares the ubi plugin to add the bad block evaluation in
percent.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-03-23 10:16:29 +01:00
Florian Eckert 543a2a970c collectd: fix smart disk detection
On my system the attribute DEVTYPE was not set. The plugin could not
read any data and the function call blocked forever on this function and did
not returned. By removing it, all block devices under `/sys/class/block`
were checked.

Block devices that do not support SMART were not evaluated. The
collected displays the following message.

smart plugin: checking SMART status of /dev/loop4.
smart plugin: unable to open /dev/loop4.

If you do not like this message, you could only enable device in the uci that
does support SMART.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-03-16 13:23:08 +01:00
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00
Nick Hainke 93ff4cc743 collectd: add plugin to compare ipv4,ipv6 stats
Add "ipstatistics"-plugin. This plugin parses "/proc/net/netstat" and
"/proc/net/snmp6" to get the overall ipv4 and ipv6 usage.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-02-04 09:26:49 +02:00
Nick Hainke 213c694b75 collectd: snmp6 further improvements
Return with "-1" if parsing fails in read function.
Reduce buffersize of splitstring function.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-26 14:47:28 +01:00
Nick Hainke 922e5b1a8b collectd: fix snmp6 not showing all interfaces
Getifaddrs() is not working all the time (e.g. wireguard interfaces).
Instead we use if_nameindex() syscall as suggested in:
 https://stackoverflow.com/a/45796495/8474618

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-25 21:23:40 +01:00
Nick Hainke 014551314e collectd: fix snmp6 collector
We scraped multiple times the same interface in one run.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-11 15:16:43 +02:00
Nick Hainke 3c55d11aef collectd: add snmp6 interface
Add collectd plugin allowing to collect IPv6 interface statistics.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-09 10:12:20 +02:00
Nick Hainke 7f99516ce5 collectd: add dhcpleases plugin
Count the current dhcpleases. Currently, we use a bash script
that does the same job (Freifunk Berlin). We want to use native
collectd plugin for that.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-12-12 14:59:49 +01:00
Hannu Nyman 28747825df collectd: update to 5.12.0
Update collectd to version 5.12.0.

* Refresh patches
* Remove upstreamed patch 920-fix-ubi-data-source-type.patch
* Backport a patch from upstream to fix a missing define
  (920-backport-netlink-reg-noerror.patch)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-09-07 18:01:21 +03:00
Florian Eckert e7054e7e79 collectd: fix ubi data source type
Currently the values are stored in the ubi plugin as data source type
`counter`. But this makes no sense, because the values change very slowly
and I don't want to know the rate of change. It is better to store the
value as data source type `gauge`. Then I can see the current value.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-06-24 13:20:26 +02:00
Kevin Darbyshire-Bryant 38235de9c3 collectd: SQM collect data from some qdiscs
Add a script that can collect data from mq (multi queue) and cake
qdiscs.

Script is reliant on collectd's 'exec' module.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-05-05 12:00:56 +01:00
Hannu Nyman 1d11a0c892 collectd: update to 5.11.0
* Update collectd to version 5.11.0
* Refresh patches

Release notes:
https://github.com/collectd/collectd/releases/tag/collectd-5.11.0

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-03-22 22:48:31 +02:00
Hannu Nyman 4cdc7d1cec collectd: update to 5.10.0
Update collectd to 5.10.0
* leave new plugins as disabled for now (procevent, sysevent)
* refresh patches. Remove unenecessary version fix

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-11-16 14:46:05 +02:00
Hannu Nyman b295c9cff2 collectd: adjust reaction to ntp time at boot time
Adjust the reaction to a polling interval timestamp that references
to a past time.

Past timestamps can happen when ntpd adjusts router's time after network
connectivity is obtained after boot. Collectd shows warnings for each plugin
as it tries to enter new values with the same timestamp as the previous one.

This patch adjusts the next polling time to be now+2 seconds for the main
loop and for the plugin-specific read loops. That avoids the warnings, but
does not overreact in case there are shorter polling intervals or the time
gets adjusted for other reasons.

Additionally some debug statements are aded, but they are visible only
when --enable-debug configure option is used in Makefile.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-11-03 17:54:22 +02:00
Hannu Nyman fa9163824b collectd: fix upstream bug in 5.9.2 version string
Fix the missing version bump in the upstream source code
to display the correct version 5.9.2

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-10-13 11:21:24 +03:00
Hannu Nyman 213969e6e4 collectd: update to 5.9.2
Update collectd to 5.9.2

Mainly bug fixes:
dfb9dd09fe/ChangeLog

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-10-09 20:56:21 +03:00
Yousong Zhou 2f66fa5c23 collectd: remove the patch scaling ping_droprate from 0-1 to 0-100
Upstream project's behaviour of reporting this data source in range 0-1
is used by at least CentOS 7 collectd 5.8.1, very likely the same
behaviour is also in widely use by other distributions.

The change is important for providing consistent experience across
collectd deployments on different environments

Ref: https://github.com/collectd/collectd/pull/3244
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-08-10 09:52:22 +08:00
Hannu Nyman 08d759f14a collectd: update to 5.9.0
Update collectd to version 5.9.0

* remove backported upstream patches (sensors, modbus)
* remove lua patch that has been been implemented upstream
  (See collectd PR 3144)
* refresh patches and accommodate into upstream path changes
* place the 'stations' datatype for iwinfo in alpbetically
  correct place in types.db
* add libmnl dependency to 'processes' plugin required for the
  new Linux process Delay Accounting capability.
  (Alternatively the capability & requirement might be patched away
   in Makefile.am, HAVE_LIBTASKSTATS from collectd_4ea7a572)

* new plugins (disabled): ampq1, gpu_nvidia, pcie_errors,
                          write_stackdriver, write_syslog

compile-tested: ar71xx/WNDR3700 (all plugins)
run-tested: ar71xx/WNDR3700 (selected plugins)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-06-16 22:18:04 +03:00
Florian Eckert 6382a043b0
Merge pull request #8138 from TDT-AG/pr/20190206-collectd
collectd: enable lua support
2019-04-25 12:44:31 +02:00
Florian Eckert 30db5cc1c1 collectd: fix lua callback registration
If you want to register more than one lua plugin, you cannot start the
collectd.

You get always the error message:

"The read function "lua/(null)" is already registered. Check for
duplicates in your configuration!"

This is not what I expect and what the documenation says.
With this change it is now possible to registrate more then one lua
Script.

See https://github.com/collectd/collectd/pull/2379

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-25 11:13:52 +02:00
Daniel Golle f70364df8b collectd: backport modbus improvements
* 938897a2 Add scale and shift to modbus plugin
 * 60280b80 correcting all the wrongs
 * a00ab529 Add support for RS485 to modbus plugin

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-04-14 03:18:24 +02:00
Hannu Nyman 1f0a005722 collectd: remove lm-sensors version upper limit
Backport an upstream patch to remove the upper limit of
lm-sensors version check, so that using lm-sensors 3.5.0
will work.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-01-12 10:39:24 +02:00
Hannu Nyman 29eac13d8f collectd: update to 5.8.1
Update collectd to version 5.8.1

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-26 21:46:24 +03:00
Daniel Golle 59ec4cc5d7 collectd: modbus: backport support for little-endian values
Support for little-endian word-order of 32-bit fields was added
upstream recently. Import the corresponding PR
https://github.com/collectd/collectd/pull/2660
into a local patch and bump package release.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2018-02-28 12:51:28 +01:00
Thomas Huehn 55e530747f collectd: upgrade package collectd to version 5.8.0
This patch upgrades the collectd package from 5.7.2 to 5.8.2.
All openwrt patches got either updated or deleted in case they
are already included into upstream collectd.
The new collectd 5.8.0 package compiles and got tested on current
lede trunk with latest luci on an PCengines APU. All default plugins
(enabled via Openwrt  Makefile) - so also iwinfo - are running fine
with the new version.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>

Amended with the following changes:

* preserve git file history by avoiding unnecessary patch renames
* mark new plugins introduced with 5.8 branch as disabled

Compile tested all plugins with ipq806x

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-12-06 10:44:11 +02:00
Hannu Nyman 63a45e6de3 collectd: uptime plugin: apply fix from upstream
Uptime plugin fails to adjust for system time changes after boot.
As Openwrt/LEDE routers usually do not have a RTC, the system time
gets adjusted with NTP possibly after collectd has already started.
But collectd continues to use the initial time set by 'sysfixtime',
which can lead to incorrect uptime calculations.

Apply a proposed fix from upstream that uses /proc/uptime
Reference to https://github.com/collectd/collectd/pull/2034

Fixes #4819

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-09-15 00:18:34 +03:00
Hannu Nyman afeb8d0caa collectd: update to 5.7.2
* update collectd to 5.7.2
* drop backported upstream patch that is now in release
* refresh patches

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-06-10 22:12:52 +03:00
Hannu Nyman b7ae80dc69 collectd: upstream fix for vulnerability in network plugin
Import an upstream fix for a DDoS vulnerability in the
network plugin: CVE-2017-7401

Refresh patches.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-04-20 18:52:08 +03:00
Hannu Nyman d1441d0424 collectd: avoid libcap dependency
Buildbot revealed that Collectd 5.7.1 uses libcap to evaluate system
capabilities and display advice on some plugins (dns, iptables, exec,
ping, ceph, turbostat).

Disable the check in configure.ac in order to avoid a dependency
for libcap. (It is not that big, only 6 kB .ipk, but still avoid that.)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-02-06 16:40:43 +02:00
Hannu Nyman 2fc5a82b48 collectd: update to 5.7.1
Update collectd to version 5.7.1

* replace 003-remove-werror.patch with configure option
* remove 200-fix-git-describe-error.patch that is now unnecessary
* reformat other patches due to whitespace changes
* add new plugins to the list as disabled

* correct download & homepage links
* add myself as the second maintainer

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-02-06 11:32:38 +02:00
Hannu Nyman ea44014936 collectd: update to 5.5.3
Update collectd to 5.5.3

Release notes at https://github.com/collectd/collectd/releases/tag/collectd-5.5.3

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-12-22 17:25:05 +02:00
Hannu Nyman 5148a67262 collectd: bump version to 5.5.2
* Bump collectd version to 5.5.2.
* Refresh patches.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-08-14 12:10:26 +03:00
Hannu Nyman 11d3b98950 collectd: Update to 5.5.1
Update collectd, the backbone of Luci statistics, to 5.5.1

Refresh patches. Main changes:
 - Remove 500-upstream-parallel-build-fix.patch (implemented upstream)
 - Add 600-fix-libmodbus-detection.patch to revert an upstream change
   that broke libmodbus detection in collectd's configure script

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-02-03 18:59:37 +02:00
Hannu Nyman 91041ead33 collectd: Delay first data read cycle by 1s
Some collectd plugins launch third-party plugins that have variation in
initialisation time (like libpcap). Recently (since kernel bump to 4.1)
the DNS plugin has been causing collectd to crash semi-randomly at startup
on MIPS based WNDR3700.

Debugging led to realisation that the DNS plugin seems to require at least
0.1s time to start, before the first data reading attempt starts.

By default, the first data read cycle starts immediately, while apaprently
some of the plugins may still be asyncronously initialising. To make things
safe, this patch adds 1 second delay before the first data read cycle.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-10-07 12:51:33 +03:00
Hannu Nyman e2699e23f6 collectd: backport parallel build fix from upstream
Backport a fix for parallel build from upstream,
where it has been commited to both trunk and 5.5 branch.

https://github.com/collectd/collectd/issues/1146
780e6a7602

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-10-02 20:31:42 +03:00
Hannu Nyman d91cd622c0 collectd: interface plugin: revert to Linux defaults from BSD-like operations
Change the interface plugin to operate with collectd's default way for Linux
instead of trying to use BSD functionality with patches.

Openwrt's collectd Makefile has set "enable-getifaddrs" option since r7980
(in 2007, no explanations given for the reasons to add that config option),
causing the addition of 110-net-device-stats.patch in 2010 to fix things,
and then later (with 5.4.1 upgrade in 2014) 150-fix-interface-af-link
to undo BSD-specific changes in collectd code meant for only BSD systems
(as AF_LINK does not exist in Linux).

Revert to collectd's intended way in Linux by removing the config option
and deleting the two corresponding patches.

The same data fieds should be provided, so there is no visbile change to users.

References:
===========

Collectd changes introducing/explaining the option and later breaking things:
http://git.verplant.org/?p=collectd.git;a=commit;h=a05e34a0d4fdb2c15db8226689268a27f6f7163d
http://git.verplant.org/?p=collectd.git;a=commit;h=14740db4b415655abc58307352e406442f9933a0
http://git.verplant.org/?p=collectd.git;a=commitdiff;h=645dadb3fcc466e8880fda4eb23b21ad433631fc

Openwrt:
intro at r7980: https://dev.openwrt.org/changeset/7980
fix1 due to kernel 2.6.36 at r23467: https://dev.openwrt.org/changeset/23467
fix2 due to collectd 5.4.1: https://github.com/openwrt/packages/pull/298

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-08-19 00:34:03 +03:00
Hannu Nyman 106fd6a3a2 collectd: update to 5.5.0
Update collectd, base of Luci statistics, to 5.5.0.

Patches have been refreshed.
write-graphite plugin is now enabled. (see #1351)

I have compile-tested all plugins with ar71xx,
and real-life tested the following plugins:
Conntrack, Processor (CPU), DNS, Interfaces, Wireless, System Load,
Memory, Ping, Uptime

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-07-16 15:15:22 +03:00
Hannu Nyman 5dfdf5374c collectd: update to 5.4.2
Update collectd, base of Luci statistics, to 5.4.2.

Patches have been refreshed.
905-fix-sigrok-upstream-patch-post-541 was removed as unnecessary.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-03-02 19:52:46 +02:00
Hannu Nyman 1b0bd00838 collectd: Update to 5.4.1
-update collectd to the current release 5.4.1
-fix sigrok glib check (upstream patch after 5.4.1)

Note:
Changes are required also to luci-statistics in Luci source.
Patch in http://patchwork.openwrt.org/patch/5303/

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2014-09-09 19:45:14 +03:00
Jo-Philipp Wich 56fd1eaa78 collectd: import from packages, add myself as maintainer
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-11 16:43:00 +02:00