pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils collectd*: update to 5.12.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/86e20283bbfc
branches:  trunk
changeset: 448355:86e20283bbfc
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Mar 07 14:19:41 2021 +0000

description:
collectd*: update to 5.12.0

Provided by Edgar Fuß.

Changes:

collectd: Build fix: duplicate switch case has been removed. Thanks to Sebastian Schmidt. #3536
collectd: Updated specfile for EL8. Thanks to Fabien Wernli. #3346
types.db(5): Documentation of metric definitions has been improved. Thanks to @octo. #3458
collection3: Some small titles has been improved from {type_instance} to {instance}. Thanks to Christian Tacke. #3476
AMQP1 plugin: New options to limit send queue length has been added. Thanks to Ryan McCabe. #3432
AMQP plugin: Updated option to allow multiple hosts to support failover. Thanks to Märt Bakhoff. #3410
capabilities plugin: Conditionalized return type for microhttpd callback functions. Thanks to José M. Guisado. #3512
Ceph plugin: An incorrect close on file descriptor 0 has been fixed. Thanks to @octo. #3459
CPU plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3496
Curl Jolokia plugin: New plugin has been added to integrate jolokia to fetch jmx counters via HTTP/json. Thanks to Wilfried Goesgens. #2470
cURL plugin: Memory leak has been fixed. Thanks to Barbara Kaczorowska. #3547
Disk plugin: Provided an udev rule with ID_SERIAL based attribute so disk and partition data don't get mixed incorrectly in udev-based disk naming. Thanks to Maciej S. Szmigiero. #3441
DPDK Telemetry plugin: Build issues has been fixed. Thanks to Fabrice Fontaine. #3439
Entropy plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3497
InfiniBand plugin: New plugin to collect metrics about IB ports has been added. Thanks to Luke Yeager. #3494
InfiniBand plugin: The build has been fixed by linking with libignorelist. Thanks to Luke Yeager. #3516
Intel PMU plugin: Check for libjevents version has been improved. Thanks to Kamil Wiatrowski. #3407
Intel PMU plugin: The possible crash on plugin init has been fixed. Thanks to Kamil Wiatrowski. #3480
IntelRDT plugin: A build issue of the plugin's unit test has been fixed. Thanks to @octo. #3566
IntelRDT plugin: NaN values in csv output has been fixed. Thanks to Michał Aleksiński, Paweł Tomaszewski. #3503
IRQ plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3498
Mdevents plugin: New plugin to generate notifications about events in RAID arrays. Thanks to Krzysztof Kazimierczak, Maciej Fijałkowskii, Michał Kobyliński. #2841
Memory plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3499
MQTT plugin: A problem with stuck after 20 (qos=1) messages has been fixed. Thanks to Viulian. #2730
MQTT plugin: Resubscribe after a reconnect. Thanks to Maciej S. Szmigiero. #3452
MySQL plugin: Compatibility with MariaDB >=10.5 has been fixed. Thanks to Alexander Meshcheryakov. #3548
MySQL plugin: Reporting of the fields Slave_IO_Running and Slave_SQL_Running has been added. Thanks to Thomas Mieslinger. #3463
Netlink plugin: VFs statistics and link info has been added. Thanks to Kamil Wiatrowski. #3487
Netstat UDP plugin: New plugin ((currently NetBSD-only) to report UDP summary statistics has been aded. Thanks to Håvard Eidnes, Edgar Fuß. #3502
Network plugin: Initialization of sockent_t has been simplified. Thanks to @octo, Dagobert Michelsen. #3543
NFS plugin: NetBSD implementation has been fixed, undefined suppress_warning variable has been removed. Thanks to Edgar Fuß. #3495
OpenVPN plugin: Parsing of empty fields has been fixed. Thanks to @rpv-tomsk. #3425
Processes plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3500
Processes plugin: Size of reading buffer for /proc/stat has been increased. Thanks to Mhumpula. #3479
Python plugin: Error-handling code of PyType_Ready has been added. Thanks to Jia Zhouyang. #3402
Sensors plugin: The documentation has been improved. Thanks to @octo. #3443
Slurm plugin: Compatibility with Slurm versions >= 20.02 has been provided. Thanks to Pablo Llopis. #3518
SMART plugin: SMART plugin has been extended with NVMe device functionality. Thanks to Bartłomiej Kotłowski, Paweł Żak, Sławomir Strehlau. #3510
SNMP Agent plugin: A strncat() truncation warning has been fixed. Thanks to @octo. #3564
SNMP plugin: Count option was added allowing to gather the number of table entries (matching given criteria) rather than their values. Thanks to Edgar Fuß. #3504
Swap plugin: Implementation for NetBSD has been added. Thanks to Håvard Eidnes, Edgar Fuß. #3501
UBI plugin: Data source type has been fixed from counter to gauge. Thanks to Florian Eckert. #3486
Varnish plugin: Added varnish 6 support. Thanks to Charly Koza, Ismael Puerto. #3445
Varnish plugin: Target in category for varnish 6 has been added. Thanks to Charly Koza. #3446
Write HTTP plugin: libcurl default HTTP response has been moved to a buffer instead of stdout. Thanks to Duane Waddle. #3263
Write Prometheus plugin: fix for libmicrohttpd api change. Thanks to Bernd Zeimetz. #3514
Write Sensu plugin: IncludeSource option has been added. Thanks to Märt Bakhoff. #3398
Zookeeper plugin: Missing 3.5 mntr fields has been added. Thanks to Théophane Charbonnier. #3450
Zookeeper plugin: Missing mntr fields has been fixed. Thanks to Théophane Charbonnier. #3449

diffstat:

 sysutils/collectd-curl/Makefile                 |    3 +-
 sysutils/collectd-gps/Makefile                  |    3 +-
 sysutils/collectd-grpc/Makefile                 |    3 +-
 sysutils/collectd-mongodb/Makefile              |    3 +-
 sysutils/collectd-rrdtool/Makefile              |    3 +-
 sysutils/collectd-virt/Makefile                 |    3 +-
 sysutils/collectd-write_prometheus/Makefile     |    3 +-
 sysutils/collectd/Makefile.common               |    4 +-
 sysutils/collectd/distinfo                      |   20 +-
 sysutils/collectd/patches/patch-Makefile.am     |   14 +-
 sysutils/collectd/patches/patch-configure.ac    |   48 ----
 sysutils/collectd/patches/patch-src_cpu.c       |   58 -----
 sysutils/collectd/patches/patch-src_entropy.c   |  109 ---------
 sysutils/collectd/patches/patch-src_irq.c       |   99 ---------
 sysutils/collectd/patches/patch-src_memory.c    |   98 --------
 sysutils/collectd/patches/patch-src_nfs.c       |   31 --
 sysutils/collectd/patches/patch-src_processes.c |  264 ------------------------
 sysutils/collectd/patches/patch-src_swap.c      |  144 -------------
 18 files changed, 23 insertions(+), 887 deletions(-)

diffs (truncated from 1069 to 300 lines):

diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-curl/Makefile
--- a/sysutils/collectd-curl/Makefile   Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-curl/Makefile   Sun Mar 07 14:19:41 2021 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.29 2020/11/05 09:09:06 ryoon Exp $
+# $NetBSD: Makefile,v 1.30 2021/03/07 14:19:41 wiz Exp $
 
 COLLECTD_PACKAGE=      curl
 COLLECTD_PLUGINS=      curl curl_json curl_xml apache bind nginx write_http ascent
 
 COMMENT=               Statistics collection daemon - curl-based plugins
-PKGREVISION=           1
 
 .include "../../devel/yajl/buildlink3.mk"
 .include "../../textproc/libxml2/buildlink3.mk"
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-gps/Makefile
--- a/sysutils/collectd-gps/Makefile    Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-gps/Makefile    Sun Mar 07 14:19:41 2021 +0000
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2021/01/09 19:50:53 gdt Exp $
+# $NetBSD: Makefile,v 1.3 2021/03/07 14:19:41 wiz Exp $
 
 COLLECTD_PACKAGE=      gps
 
 COMMENT=               Statistics collection daemon - gps plugin
-PKGREVISION=           1
 
 .include "../../geography/gpsd/buildlink3.mk"
 COLLECTD_LIB.gps=      ${BUILDLINK_PREFIX.gpsd}
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-grpc/Makefile
--- a/sysutils/collectd-grpc/Makefile   Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-grpc/Makefile   Sun Mar 07 14:19:41 2021 +0000
@@ -1,6 +1,5 @@
-# $NetBSD: Makefile,v 1.2 2020/12/06 10:50:51 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2021/03/07 14:19:41 wiz Exp $
 
-PKGREVISION=           1
 COLLECTD_PACKAGE=      grpc
 
 COMMENT=               Statistics collection daemon - grpc plugin
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-mongodb/Makefile
--- a/sysutils/collectd-mongodb/Makefile        Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-mongodb/Makefile        Sun Mar 07 14:19:41 2021 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2020/11/05 09:09:06 ryoon Exp $
+# $NetBSD: Makefile,v 1.3 2021/03/07 14:19:42 wiz Exp $
 
 COLLECTD_PACKAGE=      mongodb
 COLLECTD_PLUGINS=      write_mongodb
 
 COMMENT=               Statistics collection daemon - write_mongodb plugin
-PKGREVISION=           1
 
 .include "../../databases/mongo-c-driver/buildlink3.mk"
 COLLECTD_LIB.mongoc=   yes # help says argument is the path, but everything but "yes" disables
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-rrdtool/Makefile
--- a/sysutils/collectd-rrdtool/Makefile        Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-rrdtool/Makefile        Sun Mar 07 14:19:41 2021 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.21 2020/11/05 09:09:06 ryoon Exp $
+# $NetBSD: Makefile,v 1.22 2021/03/07 14:19:42 wiz Exp $
 
 COLLECTD_PACKAGE=      rrdtool
 COLLECTD_PLUGINS=      rrdtool rrdcached
 
 COMMENT=               Statistics collection daemon - rrdtool plugins
-PKGREVISION=           1
 
 .include "../../databases/rrdtool/buildlink3.mk"
 COLLECTD_LIB.rrd=      ${BUILDLINK_PREFIX.rrdtool}
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-virt/Makefile
--- a/sysutils/collectd-virt/Makefile   Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-virt/Makefile   Sun Mar 07 14:19:41 2021 +0000
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2020/11/05 09:09:07 ryoon Exp $
+# $NetBSD: Makefile,v 1.3 2021/03/07 14:19:42 wiz Exp $
 
 COLLECTD_PACKAGE=      virt
 
 COMMENT=               Statistics collection daemon - virt plugin
-PKGREVISION=           1
 
 .include "../../sysutils/libvirt/buildlink3.mk"
 COLLECTD_LIB.virt=     ${BUILDLINK_PREFIX.libvirt}
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd-write_prometheus/Makefile
--- a/sysutils/collectd-write_prometheus/Makefile       Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd-write_prometheus/Makefile       Sun Mar 07 14:19:41 2021 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.11 2021/01/14 16:13:40 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2021/03/07 14:19:42 wiz Exp $
 
 COLLECTD_PACKAGE=      write_prometheus
-PKGREVISION=           1
 
 COMMENT=               Statistics collection daemon - write_prometheus plugin
 
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd/Makefile.common
--- a/sysutils/collectd/Makefile.common Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd/Makefile.common Sun Mar 07 14:19:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.25 2020/10/24 22:39:45 wiz Exp $
+# $NetBSD: Makefile.common,v 1.26 2021/03/07 14:19:41 wiz Exp $
 #
 # used by sysutils/collectd/Makefile
 # used by sysutils/collectd-amqp/Makefile
@@ -34,7 +34,7 @@
 # used by sysutils/p5-collectd/Makefile
 # used by sysutils/py-collectd/Makefile
 
-DISTNAME=      collectd-5.11.0
+DISTNAME=      collectd-5.12.0
 MASTER_SITES=  http://collectd.org/files/
 CATEGORIES=    sysutils
 EXTRACT_SUFX=  .tar.bz2
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd/distinfo
--- a/sysutils/collectd/distinfo        Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd/distinfo        Sun Mar 07 14:19:41 2021 +0000
@@ -1,24 +1,16 @@
-$NetBSD: distinfo,v 1.46 2020/10/24 22:39:45 wiz Exp $
+$NetBSD: distinfo,v 1.47 2021/03/07 14:19:41 wiz Exp $
 
-SHA1 (collectd-5.11.0.tar.bz2) = 18bfb0be0493ed4a1b5d73c8bcc3f28d37652480
-RMD160 (collectd-5.11.0.tar.bz2) = 12ac883a22828d0c181459fe95f4701bf74b4407
-SHA512 (collectd-5.11.0.tar.bz2) = 87671545e3d01770c204ba4439265d1c0add6a105bf04ff02dc04db3731fd933d32ecb9b0dc15f2e504d70c3e421a64cf19728c897aa4fb1fda86e393ffc15bf
-Size (collectd-5.11.0.tar.bz2) = 1851663 bytes
-SHA1 (patch-Makefile.am) = 2762640d219125e0aa85d3c5c5354af5e659b257
-SHA1 (patch-configure.ac) = 77874524ded19078356a303b984c19bc85a86647
+SHA1 (collectd-5.12.0.tar.bz2) = af36fe83e2995270b5632fc21e5a001e6702cdce
+RMD160 (collectd-5.12.0.tar.bz2) = 9f21d334bbf6a791d3553c16cc533532056cd87f
+SHA512 (collectd-5.12.0.tar.bz2) = 7a15e4c0ae587db4987d673a790a4f3bea1cab29ce24a506fb21fa7bd2f60bfec70867eaa1c1395cb5b0e0ae81a024fb6109b064da0ef50e7c146d2198871c70
+Size (collectd-5.12.0.tar.bz2) = 1902756 bytes
+SHA1 (patch-Makefile.am) = 03739025e31bfa862a7194ba0e6c86a5031dbe16
 SHA1 (patch-src_bind.c) = ee9f6c5e7828010b4beecff4b2d3d8ff2aebc7ac
 SHA1 (patch-src_collectd.conf.in) = ee885263d5dca87857c8d56069952db0d4ffef37
-SHA1 (patch-src_cpu.c) = 099f04b0a156ae78f5f5809d6db639534d4556a1
 SHA1 (patch-src_df.c) = de699d221b003b70c22308cf43f4d61daa4071f7
-SHA1 (patch-src_entropy.c) = 77ddaf1df7ab898d3009f94bfcca82d16e22f9fe
-SHA1 (patch-src_irq.c) = 51f0e61a58b439f5e4e8de873e887700fc3dd67e
 SHA1 (patch-src_libcollectdclient_network__buffer.c) = 541332bcffcbcbb2e398275f93e2aa1ae8861598
-SHA1 (patch-src_memory.c) = ddfa79d68ebbaeed3bf1f35acbadda111d0387af
 SHA1 (patch-src_netstat__udp.c) = 4763c9c26a5639a84d1ed306b40c5b761110f632
-SHA1 (patch-src_nfs.c) = a38e2b2096b0b7c1d52bba18dcbb78f3cdc264a9
-SHA1 (patch-src_processes.c) = c1e4a5e45c2f489067b83164381b569f270b1a4e
 SHA1 (patch-src_statsd.c) = 35f4349d2d2c9bddc0f4770344f969157cd012f6
-SHA1 (patch-src_swap.c) = 4ef887e0eddf5c21c121c951f64262781f71e984
 SHA1 (patch-src_tcpconns.c) = dc6c1d361561f16623933b53ec127d88052236b2
 SHA1 (patch-src_utils_dns_dns.c) = aebb564540a51088fbd8ed56c031e7e0acc1b2e3
 SHA1 (patch-src_utils_format__kairosdb_format__kairosdb.c) = 9d6a1567645a5beafb22e3704866b0fcaa6b6c35
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd/patches/patch-Makefile.am
--- a/sysutils/collectd/patches/patch-Makefile.am       Sun Mar 07 14:18:48 2021 +0000
+++ b/sysutils/collectd/patches/patch-Makefile.am       Sun Mar 07 14:19:41 2021 +0000
@@ -1,9 +1,11 @@
-$NetBSD: patch-Makefile.am,v 1.4 2020/10/24 22:39:45 wiz Exp $
+$NetBSD: patch-Makefile.am,v 1.5 2021/03/07 14:19:41 wiz Exp $
 
 Use other data directory.
 
---- Makefile.am.orig   2020-03-08 16:57:09.000000000 +0100
-+++ Makefile.am        2020-07-06 19:13:59.289684798 +0200
+Add netstat_udp plugin.
+
+--- Makefile.am.orig   2020-09-03 17:12:19.000000000 +0200
++++ Makefile.am        2021-03-01 15:45:39.679956727 +0100
 @@ -8,7 +8,7 @@
  else
  cpkgdatadir=$(pkgdatadir)
@@ -13,8 +15,8 @@
  endif
  
  BUILT_SOURCES = \
-@@ -1478,6 +1478,12 @@
- netlink_la_LIBADD = $(BUILD_WITH_LIBMNL_LIBS)
+@@ -1515,6 +1515,12 @@
+ TESTS += test_plugin_netlink
  endif
  
 +if BUILD_PLUGIN_NETSTAT_UDP
@@ -26,7 +28,7 @@
  if BUILD_PLUGIN_NETWORK
  pkglib_LTLIBRARIES += network.la
  network_la_SOURCES = \
-@@ -2352,6 +2358,8 @@
+@@ -2399,6 +2405,8 @@
  if BUILD_PLUGIN_WRITE_PROMETHEUS
  BUILT_SOURCES += prometheus.pb-c.c prometheus.pb-c.h
  
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd/patches/patch-configure.ac
--- a/sysutils/collectd/patches/patch-configure.ac      Sun Mar 07 14:18:48 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-$NetBSD: patch-configure.ac,v 1.13 2020/10/24 22:39:45 wiz Exp $
-
-Add KERNEL_NETBSD, add entry and netstat_udp plugin definition,
-and also do swap for "have_swapctl_three_args" (as for NetBSD).
-Also, the start of process support, but that's not yet finished.
-
---- configure.ac.orig  2020-03-19 09:52:56.000000000 +0100
-+++ configure.ac       2020-07-06 19:24:03.404718013 +0200
-@@ -114,6 +114,7 @@
- AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
- AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
- AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
-+AM_CONDITIONAL([BUILD_NETBSD], [test "x$ac_system" = "xNetBSD"])
- AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
- AM_CONDITIONAL([BUILD_WIN32], [test "x$ac_system" = "xWindows"])
- 
-@@ -6595,6 +6596,7 @@
- plugin_mcelog="no"
- plugin_memory="no"
- plugin_multimeter="no"
-+plugin_netstat_udp="no"
- plugin_nfs="no"
- plugin_numa="no"
- plugin_ovs_events="no"
-@@ -6708,6 +6710,7 @@
-   plugin_irq="yes"
-   plugin_nfs="yes"
-   plugin_processes="yes"
-+  plugin_netstat_udp="yes"
- fi
- 
- # Mac OS X devices
-@@ -7077,6 +7080,7 @@
- AC_PLUGIN([mysql],               [$with_libmysql],            [MySQL statistics])
- AC_PLUGIN([netapp],              [$with_libnetapp],           [NetApp plugin])
- AC_PLUGIN([netlink],             [$with_libmnl],              [Enhanced Linux network statistics])
-+AC_PLUGIN([netstat_udp],         [$plugin_netstat_udp],       [UDP network statistics])
- AC_PLUGIN([network],             [yes],                       [Network communication plugin])
- AC_PLUGIN([nfs],                 [$plugin_nfs],               [NFS statistics])
- AC_PLUGIN([nginx],               [$with_libcurl],             [nginx statistics])
-@@ -7521,6 +7525,7 @@
- AC_MSG_RESULT([    mysql . . . . . . . . $enable_mysql])
- AC_MSG_RESULT([    netapp  . . . . . . . $enable_netapp])
- AC_MSG_RESULT([    netlink . . . . . . . $enable_netlink])
-+AC_MSG_RESULT([    netstat_udp . . . . . $enable_netstat_udp])
- AC_MSG_RESULT([    network . . . . . . . $enable_network])
- AC_MSG_RESULT([    nfs . . . . . . . . . $enable_nfs])
- AC_MSG_RESULT([    nginx . . . . . . . . $enable_nginx])
diff -r 1493bb9bd4ae -r 86e20283bbfc sysutils/collectd/patches/patch-src_cpu.c
--- a/sysutils/collectd/patches/patch-src_cpu.c Sun Mar 07 14:18:48 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-$NetBSD: patch-src_cpu.c,v 1.4 2020/10/24 22:39:45 wiz Exp $
-
-Port this too to NetBSD.
-
---- src/cpu.c.orig     2020-03-08 16:57:09.000000000 +0100
-+++ src/cpu.c  2020-07-07 12:08:28.927383000 +0200
-@@ -78,13 +78,16 @@
- #endif
- #endif /* HAVE_SYS_DKSTAT_H */
- 
--#define CAN_USE_SYSCTL 0
- #if (defined(HAVE_SYSCTL) && defined(HAVE_SYSCTLBYNAME)) || defined(__OpenBSD__)
- /* Implies BSD variant */
- #if defined(CTL_HW) && defined(HW_NCPU) && defined(CTL_KERN) &&                \
--    defined(KERN_CPTIME) && defined(CPUSTATES)
-+    (defined(KERN_CPTIME) || defined(KERN_CP_TIME)) && defined(CPUSTATES)
- #define CAN_USE_SYSCTL 1
-+#else
-+#define CAN_USE_SYSCTL 0
- #endif
-+#else
-+#define CAN_USE_SYSCTL 0
- #endif /* HAVE_SYSCTL_H && HAVE_SYSCTLBYNAME || __OpenBSD__ */
- 
- #define COLLECTD_CPU_STATE_USER 0
-@@ -746,6 +749,24 @@ static int cpu_read(void) {
- 
-   memset(cpuinfo, 0, sizeof(cpuinfo));
- 
-+#if defined(KERN_CP_TIME) && defined(KERNEL_NETBSD)
-+  {
-+    int mib[] = {CTL_KERN, KERN_CP_TIME};
-+
-+    cpuinfo_size = sizeof(cpuinfo[0]) * numcpu * CPUSTATES;
-+    status = sysctl(mib, 2, cpuinfo, &cpuinfo_size, NULL, 0);
-+    if (status == -1) {
-+      char errbuf[1024];
-+
-+      ERROR ("cpu plugin: sysctl failed: %s.",
-+             sstrerror (errno, errbuf, sizeof (errbuf)));
-+      return -1;
-+    }
-+    if (cpuinfo_size == (sizeof(cpuinfo[0]) * CPUSTATES)) {
-+      numcpu = 1;
-+    }
-+  }
-+#else /* defined(KERN_CP_TIME) && defined(KERNEL_NETBSD) */
- #if defined(KERN_CPTIME2)
-   if (numcpu > 1) {
-     for (int i = 0; i < numcpu; i++) {
-@@ -779,6 +800,7 @@ static int cpu_read(void) {
-       cpuinfo[0][i] = cpuinfo_tmp[i];
-     }
-   }
-+#endif /* defined(KERN_CP_TIME) && defined(KERNEL_NETBSD) */
- 
-   for (int i = 0; i < numcpu; i++) {
-     cpu_stage(i, COLLECTD_CPU_STATE_USER, (derive_t)cpuinfo[i][CP_USER], now);


Home | Main Index | Thread Index | Old Index