Hi, here's two diffs, a simple one to update liboping to 1.10 (https://github.com/octo/liboping/releases/tag/liboping-1.10.0), backporting a fix to have oping working as regular use via suid (cf https://github.com/octo/liboping/issues/34) and a larger one updating collectd to 5.8.0: - see http://collectd.org/news.shtml#news106 for news - enable prometheus, redis, and mqtt plugins (cf https://collectd.org/wiki/index.php/Plugin:Write_Prometheus, https://collectd.org/wiki/index.php/Plugin:MQTT, https://collectd.org/wiki/index.php/Plugin:Write_Redis and https://collectd.org/wiki/index.php/Plugin:Redis) - i havent tested them so feedback on those is welcome. - subpackage the ping plugin so that the dependency on liboping is optional (since oping is setuid and ppl dont like having them on their systems..) - remove the .la files in post-install instead of @comment'ing them in PLISTs.
Seems to work here with the rest of the influxdb/facette/grafana stack. Landry
? liboping-1.10.0-liboping.so.0.0 ? liboping-1.9.0-liboping.so.0.0 Index: Makefile =================================================================== RCS file: /cvs/ports/net/liboping/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- Makefile 23 Sep 2017 10:13:19 -0000 1.5 +++ Makefile 25 Apr 2018 13:31:44 -0000 @@ -2,9 +2,8 @@ COMMENT = library and tools to generate ICMP echo requests -DISTNAME = liboping-1.9.0 -REVISION = 1 -SHARED_LIBS += oping 0.0 # 2.11 +DISTNAME = liboping-1.10.0 +SHARED_LIBS += oping 0.1 # 3.0 CATEGORIES = net @@ -13,7 +12,7 @@ # LGPL v2.1+ (lib) GPLv2+ (binaries) PERMIT_PACKAGE_CDROM = Yes -WANTLIB += c m ncursesw perl +WANTLIB += c m curses perl MASTER_SITES = http://noping.cc/files/ CONFIGURE_STYLE = gnu Index: distinfo =================================================================== RCS file: /cvs/ports/net/liboping/distinfo,v retrieving revision 1.2 diff -u -r1.2 distinfo --- distinfo 5 Jul 2016 09:07:43 -0000 1.2 +++ distinfo 25 Apr 2018 13:31:44 -0000 @@ -1,2 +1,2 @@ -SHA256 (liboping-1.9.0.tar.gz) = hrRPaEoxUb1LW3UzaHZjXssPbP5UovspptoGQy8tuwA= -SIZE (liboping-1.9.0.tar.gz) = 389502 +SHA256 (liboping-1.10.0.tar.gz) = wgawV0PQcwgUvjEVtIq9CwABZndSUVPHhzDaMHq6CEY= +SIZE (liboping-1.10.0.tar.gz) = 395596 Index: patches/patch-src_liboping_c =================================================================== RCS file: patches/patch-src_liboping_c diff -N patches/patch-src_liboping_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_liboping_c 25 Apr 2018 13:31:44 -0000 @@ -0,0 +1,75 @@ +$OpenBSD$ + +https://github.com/tfheen/liboping/commit/a88c51f38dafa1fba9118045176754bec05d3c94.patch + +Index: src/liboping.c +--- src/liboping.c.orig ++++ src/liboping.c +@@ -1344,43 +1344,12 @@ int ping_send (pingobj_t *obj) + struct timeval nowtime; + struct timeval timeout; + +- _Bool need_ipv4_socket = 0; +- _Bool need_ipv6_socket = 0; +- + for (ptr = obj->head; ptr != NULL; ptr = ptr->next) + { + ptr->latency = -1.0; + ptr->recv_ttl = -1; +- +- if (ptr->addrfamily == AF_INET) +- need_ipv4_socket = 1; +- else if (ptr->addrfamily == AF_INET6) +- need_ipv6_socket = 1; + } + +- if (!need_ipv4_socket && !need_ipv6_socket) +- { +- ping_set_error (obj, "ping_send", "No hosts to ping"); +- return (-1); +- } +- +- if (need_ipv4_socket && obj->fd4 == -1) +- { +- obj->fd4 = ping_open_socket(obj, AF_INET); +- if (obj->fd4 == -1) +- return (-1); +- ping_set_ttl (obj, obj->ttl); +- ping_set_qos (obj, obj->qos); +- } +- if (need_ipv6_socket && obj->fd6 == -1) +- { +- obj->fd6 = ping_open_socket(obj, AF_INET6); +- if (obj->fd6 == -1) +- return (-1); +- ping_set_ttl (obj, obj->ttl); +- ping_set_qos (obj, obj->qos); +- } +- + if (gettimeofday (&nowtime, NULL) == -1) + { + ping_set_errno (obj, errno); +@@ -1699,6 +1668,23 @@ int ping_host_add (pingobj_t *obj, const char *host) + + ph->table_next = obj->table[ph->ident % PING_TABLE_LEN]; + obj->table[ph->ident % PING_TABLE_LEN] = ph; ++ ++ if (ph->addrfamily == AF_INET && obj->fd4 == -1) ++ { ++ obj->fd4 = ping_open_socket(obj, AF_INET); ++ if (obj->fd4 == -1) ++ return (-1); ++ ping_set_ttl (obj, obj->ttl); ++ ping_set_qos (obj, obj->qos); ++ } ++ if (ph->addrfamily == AF_INET6 && obj->fd6 == -1) ++ { ++ obj->fd6 = ping_open_socket(obj, AF_INET6); ++ if (obj->fd6 == -1) ++ return (-1); ++ ping_set_ttl (obj, obj->ttl); ++ ping_set_qos (obj, obj->qos); ++ } + + return (0); + } /* int ping_host_add */ Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/net/liboping/pkg/PLIST,v retrieving revision 1.2 diff -u -r1.2 PLIST --- pkg/PLIST 5 Jul 2016 09:07:43 -0000 1.2 +++ pkg/PLIST 25 Apr 2018 13:31:44 -0000 @@ -9,8 +9,7 @@ @lib lib/liboping.so.${LIBoping_VERSION} lib/pkgconfig/liboping.pc @comment libdata/perl5/${MACHINE_ARCH}-openbsd/ -@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.2/ -@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.2/perllocal.pod +@comment libdata/perl5/${MACHINE_ARCH}-openbsd/perllocal.pod libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/ libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/Net/ libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/Net/Oping.pm
? build.log Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/collectd/Makefile,v retrieving revision 1.54 diff -u -r1.54 Makefile --- Makefile 15 Feb 2018 11:17:05 -0000 1.54 +++ Makefile 25 Apr 2018 13:32:42 -0000 @@ -8,10 +8,14 @@ COMMENT-virt = collectd libvirt plugin COMMENT-python = collectd python plugin COMMENT-memcachec = collectd memcachec plugin +COMMENT-mqtt = collectd mqtt plugin COMMENT-nut = collectd nut plugin COMMENT-riemann = collectd riemann plugin +COMMENT-redis = collectd redis plugin +COMMENT-prometheus = collectd prometheus plugin +COMMENT-ping = collectd ping plugin -V = 5.7.2 +V = 5.8.0 DISTNAME = collectd-$V PKGNAME-main = collectd-$V PKGNAME-mysql = collectd-mysql-$V @@ -21,13 +25,14 @@ PKGNAME-virt = collectd-virt-$V PKGNAME-python = collectd-python-$V PKGNAME-memcachec = collectd-memcachec-$V +PKGNAME-mqtt = collectd-mqtt-$V PKGNAME-nut = collectd-nut-$V PKGNAME-riemann = collectd-riemann-$V +PKGNAME-redis = collectd-redis-$V +PKGNAME-prometheus = collectd-prometheus-$V +PKGNAME-ping = collectd-ping-$V CATEGORIES = sysutils -REVISION = 1 -REVISION-main = 3 - HOMEPAGE = http://www.collectd.org/ SHARED_LIBS += collectdclient 1.0 @@ -40,7 +45,7 @@ MODULES = lang/python MODPY_RUNDEP = No -MULTI_PACKAGES = -main -mysql -pgsql -rrdtool -snmp -virt -python -memcachec -nut -riemann +MULTI_PACKAGES = -main -mysql -pgsql -rrdtool -snmp -virt -python -memcachec -mqtt -nut -riemann -redis -prometheus -ping WANTLIB-mysql = crypto m ssl z mysqlclient_r pthread LIB_DEPENDS-mysql = databases/mariadb @@ -88,15 +93,31 @@ unistring z RUN_DEPENDS-riemann = collectd-$V:${BASE_PKGPATH},-main +LIB_DEPENDS-mqtt = net/mosquitto +RUN_DEPENDS-mqtt = collectd-$V:${BASE_PKGPATH},-main +WANTLIB-mqtt = mosquitto pthread + +LIB_DEPENDS-prometheus = www/libmicrohttpd \ + devel/protobuf-c +RUN_DEPENDS-prometheus = collectd-$V:${BASE_PKGPATH},-main +WANTLIB-prometheus = c ffi gmp gnutls hogweed iconv idn2 intl microhttpd \ + nettle p11-kit protobuf-c pthread tasn1 unistring z + +LIB_DEPENDS-redis = databases/libhiredis +RUN_DEPENDS-redis = collectd-$V:${BASE_PKGPATH},-main +WANTLIB-redis = hiredis pthread + +LIB_DEPENDS-ping = net/liboping +RUN_DEPENDS-ping = collectd-$V:${BASE_PKGPATH},-main +WANTLIB-ping = m oping pthread + LIB_DEPENDS += net/curl \ - net/liboping \ textproc/libxml \ sysutils/libstatgrab \ security/libgcrypt \ - devel/libtool,-ltdl \ devel/libyajl -WANTLIB += c crypto gpg-error kvm curl xml2 ltdl lzma oping nghttp2 +WANTLIB += c crypto gpg-error kvm curl xml2 lzma nghttp2 WANTLIB += m pcap pthread ssl xml2 z statgrab gcrypt iconv intl WANTLIB += yajl @@ -104,13 +125,9 @@ # uses -export-symbol-regex USE_LIBTOOL= gnu LIBTOOL_FLAGS = --tag=disable-static -CONFIGURE_ARGS +=--with-ltdl-include=${LOCALBASE}/include \ - --with-ltdl-lib=${LOCALBASE}/lib \ - --with-librrd=${LOCALBASE} \ +CONFIGURE_ARGS +=--with-librrd=${LOCALBASE} \ --with-libstatgrab=${LOCALBASE} \ --with-libnetsnmp=${LOCALBASE} \ - --with-python=${MODPY_BIN} \ - --with-libprotobuf-c=no \ --enable-all-plugins=no # no, varnishapi.h not in our varnish package @@ -121,12 +138,12 @@ logfile match_empty_counter match_hashed match_regex \ match_timediff match_value memcached memory mysql \ network nginx ntpd olsrd openvpn ping postgresql powerdns \ - processes rrdtool rrdcached snmp swap syslog table tail tail_csv \ + processes redis rrdtool rrdcached snmp snmp_agent swap syslog table tail tail_csv \ target_notification target_replace target_scale \ target_set target_v5upgrade tcpconns teamspeak2 ted unixsock uptime \ users uuid write_http write_graphite pf python virt memcachec nut \ - aggregation curl_json log_logstash memcached \ - threshold write_log write_riemann + aggregation curl_json log_logstash memcached mqtt \ + threshold write_log write_prometheus write_redis write_riemann .for _plugin in ${ENABLED_PLUGINS} CONFIGURE_ARGS += --enable-${_plugin} @@ -135,5 +152,8 @@ CONFIGURE_ENV += PYTHON_CONFIG='${LOCALBASE}/bin/python${MODPY_VERSION}-config' \ CPPFLAGS='-I${LOCALBASE}/include' \ LDFLAGS='-L${LOCALBASE}/lib -L${X11BASE}/lib -pthread' + +post-install: + rm -f ${PREFIX}/lib/collectd/*.la .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/sysutils/collectd/distinfo,v retrieving revision 1.10 diff -u -r1.10 distinfo --- distinfo 12 Jun 2017 17:22:42 -0000 1.10 +++ distinfo 25 Apr 2018 13:32:42 -0000 @@ -1,2 +1,2 @@ -SHA256 (collectd-5.7.2.tar.bz2) = nSCgIhVpqNa4C7xSuG5ehJZfW6/b9d/DeQ4P7Qdj5ZI= -SIZE (collectd-5.7.2.tar.bz2) = 1798777 +SHA256 (collectd-5.8.0.tar.bz2) = sG/0drvwVTPLl65nSSYsw8dsmWnwMr2ElmkAhN3rFck= +SIZE (collectd-5.8.0.tar.bz2) = 1686017 Index: patches/patch-Makefile_in =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-Makefile_in,v retrieving revision 1.8 diff -u -r1.8 patch-Makefile_in --- patches/patch-Makefile_in 30 Apr 2017 17:52:15 -0000 1.8 +++ patches/patch-Makefile_in 25 Apr 2018 13:32:42 -0000 @@ -1,13 +1,41 @@ $OpenBSD: patch-Makefile_in,v 1.8 2017/04/30 17:52:15 landry Exp $ ---- Makefile.in.orig Mon Jan 23 10:54:26 2017 -+++ Makefile.in Sun Feb 26 20:22:04 2017 -@@ -1003,9 +1003,6 @@ uninstall-am: +Index: Makefile.in +--- Makefile.in.orig ++++ Makefile.in +@@ -98,7 +98,7 @@ check_PROGRAMS = test_common$(EXEEXT) test_format_grap + @BUILD_WITH_LIBSOCKET_TRUE@am__append_4 = -lsocket + @BUILD_WITH_LIBKSTAT_TRUE@am__append_5 = -lkstat + @BUILD_WITH_LIBDEVINFO_TRUE@am__append_6 = -ldevinfo +-@BUILD_FEATURE_DAEMON_TRUE@am__append_7 = -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"' ++@BUILD_FEATURE_DAEMON_TRUE@am__append_7 = -DPIDFILE='"${localstatedir}/${PACKAGE_NAME}/${PACKAGE_NAME}.pid"' + # The daemon needs to call sg_init, so we need to link it against libstatgrab, + # too. -octo +@@ -3183,7 +3183,7 @@ AM_CPPFLAGS = \ + -DPREFIX='"${prefix}"' \ + -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \ + -DLOCALSTATEDIR='"${localstatedir}"' \ +- -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"' \ ++ -DPKGLOCALSTATEDIR='"${localstatedir}/${PACKAGE_NAME}"' \ + -DPLUGINDIR='"${pkglibdir}"' \ + -DPKGDATADIR='"${pkgdatadir}"' + +@@ -7720,16 +7720,8 @@ uninstall-man: uninstall-man1 uninstall-man5 + @HAVE_GRPC_CPP_TRUE@@HAVE_PROTOC3_TRUE@ $(V_PROTOC)$(PROTOC) -I$(srcdir)/proto --cpp_out=$(builddir) $< install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME) - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log - - maintainer-clean-local: - -rm -f -r libltdl +- $(mkinstalldirs) $(DESTDIR)$(sysconfdir) +- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \ +- then \ +- $(INSTALL) -m 0640 $(srcdir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \ +- else \ +- $(INSTALL) -m 0640 $(srcdir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \ +- fi; \ ++ $(mkinstalldirs) ${PREFIX}/share/examples ++ $(INSTALL) -m 0644 $(srcdir)/src/collectd.conf ${PREFIX}/share/examples/collectd.conf; + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL) -m 0644 $(srcdir)/src/types.db $(DESTDIR)$(pkgdatadir)/types.db; + $(INSTALL) -m 0644 $(srcdir)/src/postgresql_default.conf \ Index: patches/patch-src_Makefile_in =================================================================== RCS file: patches/patch-src_Makefile_in diff -N patches/patch-src_Makefile_in --- patches/patch-src_Makefile_in 30 Apr 2017 17:52:15 -0000 1.11 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -$OpenBSD: patch-src_Makefile_in,v 1.11 2017/04/30 17:52:15 landry Exp $ ---- src/Makefile.in.orig Mon Jan 23 10:54:27 2017 -+++ src/Makefile.in Sun Feb 26 20:27:29 2017 -@@ -80,7 +80,7 @@ POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ - @BUILD_WITH_OWN_LIBOCONFIG_TRUE@am__append_1 = liboconfig --@BUILD_FEATURE_DAEMON_TRUE@am__append_2 = -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"' -+@BUILD_FEATURE_DAEMON_TRUE@am__append_2 = -DPIDFILE='"${localstatedir}/${PACKAGE_NAME}/${PACKAGE_NAME}.pid"' - check_PROGRAMS = test_format_graphite$(EXEEXT) $(am__EXEEXT_1) \ - test_utils_latency$(EXEEXT) test_utils_cmds$(EXEEXT) \ - test_utils_vl_lookup$(EXEEXT) test_utils_mount$(EXEEXT) \ -@@ -2698,7 +2698,7 @@ PLUGIN_LDFLAGS = -module -avoid-version -export-symbol - AM_CPPFLAGS = -I$(srcdir)/daemon -DPREFIX='"${prefix}"' \ - -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \ - -DLOCALSTATEDIR='"${localstatedir}"' \ -- -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"' \ -+ -DPKGLOCALSTATEDIR='"${localstatedir}/${PACKAGE_NAME}"' \ - $(am__append_2) -DPLUGINDIR='"${pkglibdir}"' \ - -DPKGDATADIR='"${pkgdatadir}"' - LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_top_srcdir)/testwrapper.sh -@@ -5709,13 +5709,8 @@ uninstall-man: uninstall-man1 uninstall-man5 - @BUILD_PLUGIN_WRITE_PROMETHEUS_TRUE@ $(AM_V_PROTOC_C)$(PROTOC_C) -I$(top_srcdir)/proto --c_out=$(builddir) $(top_srcdir)/proto/prometheus.proto - - install-exec-hook: -- $(mkinstalldirs) $(DESTDIR)$(sysconfdir) -- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \ -- then \ -- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \ -- else \ -- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \ -- fi; \ -+ $(mkinstalldirs) ${PREFIX}/share/examples -+ $(INSTALL) -m 0644 collectd.conf ${PREFIX}/share/examples/collectd.conf; \ - $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) - $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db; - $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \ Index: patches/patch-src_daemon_Makefile_in =================================================================== RCS file: patches/patch-src_daemon_Makefile_in diff -N patches/patch-src_daemon_Makefile_in --- patches/patch-src_daemon_Makefile_in 30 Apr 2017 17:52:15 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_daemon_Makefile_in,v 1.4 2017/04/30 17:52:15 landry Exp $ ---- src/daemon/Makefile.in.orig Mon Jan 23 10:54:27 2017 -+++ src/daemon/Makefile.in Sun Feb 26 20:22:04 2017 -@@ -79,7 +79,7 @@ PRE_UNINSTALL = : - POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ --@BUILD_FEATURE_DAEMON_TRUE@am__append_1 = -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"' -+@BUILD_FEATURE_DAEMON_TRUE@am__append_1 = -DPIDFILE='"${localstatedir}/${PACKAGE_NAME}/${PACKAGE_NAME}.pid"' - @BUILD_WITH_CAPABILITY_TRUE@am__append_2 = -lcap - @BUILD_WITH_LIBRT_TRUE@am__append_3 = -lrt - @BUILD_WITH_LIBPOSIX4_TRUE@am__append_4 = -lposix4 -@@ -787,7 +787,7 @@ top_srcdir = @top_srcdir@ - AM_CPPFLAGS = -I$(top_srcdir)/src -DPREFIX='"${prefix}"' \ - -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \ - -DLOCALSTATEDIR='"${localstatedir}"' \ -- -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"' \ -+ -DPKGLOCALSTATEDIR='"${localstatedir}/${PACKAGE_NAME}"' \ - $(am__append_1) -DPLUGINDIR='"${pkglibdir}"' \ - -DPKGDATADIR='"${pkgdatadir}"' - Index: patches/patch-src_email_c =================================================================== RCS file: patches/patch-src_email_c diff -N patches/patch-src_email_c --- patches/patch-src_email_c 1 Jul 2017 13:35:30 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -$OpenBSD: patch-src_email_c,v 1.2 2017/07/01 13:35:30 danj Exp $ - -2048 is not enough to get getgrnam_r result - -Committed upstream: -https://github.com/collectd/collectd/commit/24bdf52decaf93359aab0364fb11420af5cd4a21 - -Index: src/email.c ---- src/email.c.orig -+++ src/email.c -@@ -403,7 +403,7 @@ static void *open_connection(void __attribute__((unuse - { - struct group sg; - struct group *grp; -- char grbuf[2048]; -+ char grbuf[4096]; - int status; - - grp = NULL; Index: patches/patch-src_exec_c =================================================================== RCS file: patches/patch-src_exec_c diff -N patches/patch-src_exec_c --- patches/patch-src_exec_c 1 Jul 2017 13:35:30 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ -$OpenBSD: patch-src_exec_c,v 1.2 2017/07/01 13:35:30 danj Exp $ - -- 2048 is not enough to get getgrnam_r result -- fix errno handling - -Committed upstream: -https://github.com/collectd/collectd/commit/24bdf52decaf93359aab0364fb11420af5cd4a21 -https://github.com/collectd/collectd/commit/71f65087f9d5f42f8944fa7ce416cb0e2f7f043e - -Index: src/exec.c ---- src/exec.c.orig -+++ src/exec.c -@@ -369,7 +369,7 @@ static int fork_child(program_list_t *pl, int *fd_in, - - struct passwd *sp_ptr; - struct passwd sp; -- char nambuf[2048]; -+ char nambuf[4096]; - - if (pl->pid != 0) - return (-1); -@@ -382,7 +382,7 @@ static int fork_child(program_list_t *pl, int *fd_in, - status = getpwnam_r(pl->user, &sp, nambuf, sizeof(nambuf), &sp_ptr); - if (status != 0) { - ERROR("exec plugin: Failed to get user information for user ``%s'': %s", -- pl->user, sstrerror(errno, errbuf, sizeof(errbuf))); -+ pl->user, sstrerror(status, errbuf, sizeof(errbuf))); - goto failed; - } - -@@ -410,7 +410,7 @@ static int fork_child(program_list_t *pl, int *fd_in, - if (0 != status) { - ERROR("exec plugin: Failed to get group information " - "for group ``%s'': %s", -- pl->group, sstrerror(errno, errbuf, sizeof(errbuf))); -+ pl->group, sstrerror(status, errbuf, sizeof(errbuf))); - goto failed; - } - if (NULL == gr_ptr) { Index: patches/patch-src_libcollectdclient_server_c =================================================================== RCS file: patches/patch-src_libcollectdclient_server_c diff -N patches/patch-src_libcollectdclient_server_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_libcollectdclient_server_c 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ + +Index: src/libcollectdclient/server.c +--- src/libcollectdclient/server.c.orig ++++ src/libcollectdclient/server.c +@@ -34,11 +34,12 @@ + #include "collectd/server.h" + + #include <errno.h> ++#include <sys/time.h> ++#include <sys/socket.h> + #include <net/if.h> + #include <netdb.h> + #include <netinet/in.h> + #include <string.h> +-#include <sys/socket.h> + #include <sys/types.h> + #include <unistd.h> + Index: patches/patch-src_processes_c =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-src_processes_c,v retrieving revision 1.10 diff -u -r1.10 patch-src_processes_c --- patches/patch-src_processes_c 30 Apr 2017 17:52:15 -0000 1.10 +++ patches/patch-src_processes_c 25 Apr 2018 13:32:42 -0000 @@ -1,11 +1,9 @@ -$OpenBSD: patch-src_processes_c,v 1.10 2017/04/30 17:52:15 landry Exp $ +$OpenBSD$ -https://github.com/collectd/collectd/issues/2061 -https://github.com/collectd/collectd/pull/2088 - ---- src/processes.c.orig Mon Jan 23 10:53:57 2017 -+++ src/processes.c Sun Feb 26 20:22:04 2017 -@@ -155,7 +155,7 @@ +Index: src/processes.c +--- src/processes.c.orig ++++ src/processes.c +@@ -157,7 +157,7 @@ #if defined(ARG_MAX) && (ARG_MAX < 4096) #define CMDLINE_BUFFER_SIZE ARG_MAX #else @@ -14,12 +12,3 @@ #endif #endif -@@ -1916,7 +1916,7 @@ static int ps_read(void) { - ps_list_reset(); - - /* Open the kvm interface, get a descriptor */ -- kd = kvm_open(NULL, NULL, NULL, 0, errbuf); -+ kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); - if (kd == NULL) { - ERROR("processes plugin: Cannot open kvm interface: %s", errbuf); - return (0); Index: patches/patch-src_tcpconns_c =================================================================== RCS file: patches/patch-src_tcpconns_c diff -N patches/patch-src_tcpconns_c --- patches/patch-src_tcpconns_c 30 Apr 2017 17:52:15 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,126 +0,0 @@ -$OpenBSD: patch-src_tcpconns_c,v 1.13 2017/04/30 17:52:15 landry Exp $ - -https://github.com/collectd/collectd/issues/2061 -https://github.com/collectd/collectd/pull/2088 - ---- src/tcpconns.c.orig Mon Jan 23 10:53:57 2017 -+++ src/tcpconns.c Sun Feb 26 20:22:04 2017 -@@ -62,11 +62,16 @@ - #include "common.h" - #include "plugin.h" - --#if defined(__OpenBSD__) || defined(__NetBSD__) -+/* Maybe usable on NetBSD? */ -+#if defined(__OpenBSD__) -+#define HAVE_KVM_GETFILES 1 -+#endif -+ -+#if defined(__NetBSD__) - #undef HAVE_SYSCTLBYNAME /* force HAVE_LIBKVM_NLIST path */ - #endif - --#if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_LIBKVM_NLIST && !KERNEL_AIX -+#if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_KVM_GETFILES && !HAVE_LIBKVM_NLIST && !KERNEL_AIX - #error "No applicable input method." - #endif - -@@ -105,15 +110,27 @@ - #include <netinet/tcpip.h> - /* #endif HAVE_SYSCTLBYNAME */ - --/* This is for OpenBSD and NetBSD. */ -+#elif HAVE_KVM_GETFILES -+#include <sys/types.h> -+#include <sys/sysctl.h> -+#define _KERNEL /* for DTYPE_SOCKET */ -+#include <sys/file.h> -+#undef _KERNEL -+ -+#include <netinet/in.h> -+ -+#include <kvm.h> -+/* #endif HAVE_KVM_GETFILES */ -+ -+/* This is for NetBSD. */ - #elif HAVE_LIBKVM_NLIST - #include <arpa/inet.h> - #include <net/route.h> - #include <netdb.h> - #include <netinet/in.h> -+#include <netinet/ip.h> - #include <netinet/in_pcb.h> - #include <netinet/in_systm.h> --#include <netinet/ip.h> - #include <netinet/ip_var.h> - #include <netinet/tcp.h> - #include <netinet/tcp_timer.h> -@@ -169,6 +186,19 @@ static const char *tcp_state[] = {"CLOSED", "LISTEN - #define TCP_STATE_MAX 10 - /* #endif HAVE_SYSCTLBYNAME */ - -+#elif HAVE_KVM_GETFILES -+static const char *tcp_state[] = {"CLOSED", "LISTEN", "SYN_SENT", -+ "SYN_RECV", "ESTABLISHED", "CLOSE_WAIT", -+ "FIN_WAIT1", "CLOSING", "LAST_ACK", -+ "FIN_WAIT2", "TIME_WAIT"}; -+ -+#define TCP_STATE_LISTEN 1 -+#define TCP_STATE_MIN 0 -+#define TCP_STATE_MAX 10 -+ -+static kvm_t *kvmd; -+/* #endif HAVE_KVM_GETFILES */ -+ - #elif HAVE_LIBKVM_NLIST - static const char *tcp_state[] = {"CLOSED", "LISTEN", "SYN_SENT", - "SYN_RECV", "ESTABLISHED", "CLOSE_WAIT", -@@ -774,6 +804,49 @@ static int conn_read(void) { - return (0); - } /* int conn_read */ - /* #endif HAVE_SYSCTLBYNAME */ -+ -+#elif HAVE_KVM_GETFILES -+ -+static int conn_init(void) { -+ char buf[_POSIX2_LINE_MAX]; -+ -+ kvmd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, buf); -+ if (kvmd == NULL) { -+ ERROR("tcpconns plugin: kvm_openfiles failed: %s", buf); -+ return (-1); -+ } -+ -+ return (0); -+} /* int conn_init */ -+ -+static int conn_read(void) { -+ struct kinfo_file *kf; -+ int i, fcnt; -+ -+ conn_reset_port_entry(); -+ -+ kf = kvm_getfiles(kvmd, KERN_FILE_BYFILE, DTYPE_SOCKET, -+ sizeof(*kf), &fcnt); -+ if (kf == NULL) { -+ ERROR("tcpconns plugin: kvm_getfiles failed."); -+ return (-1); -+ } -+ -+ for (i = 0; i < fcnt; i++) { -+ if (kf[i].so_protocol != IPPROTO_TCP) -+ continue; -+ if (kf[i].inp_fport == 0) -+ continue; -+ conn_handle_ports(ntohs(kf[i].inp_lport), ntohs(kf[i].inp_fport), -+ kf[i].t_state); -+ } -+ -+ conn_submit_all(); -+ -+ return (0); -+} -+/* int conn_read */ -+/* #endif HAVE_KVM_GETFILES */ - - #elif HAVE_LIBKVM_NLIST - static int kread(u_long addr, void *buf, int size) { Index: patches/patch-src_unixsock_c =================================================================== RCS file: patches/patch-src_unixsock_c diff -N patches/patch-src_unixsock_c --- patches/patch-src_unixsock_c 1 Jul 2017 13:35:30 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -$OpenBSD: patch-src_unixsock_c,v 1.2 2017/07/01 13:35:30 danj Exp $ - -2048 is not enough to get getgrnam_r result - -Committed upstream: -https://github.com/collectd/collectd/commit/24bdf52decaf93359aab0364fb11420af5cd4a21 - -Index: src/unixsock.c ---- src/unixsock.c.orig -+++ src/unixsock.c -@@ -134,7 +134,7 @@ static int us_open_socket(void) { - const char *grpname; - struct group *g; - struct group sg; -- char grbuf[2048]; -+ char grbuf[4096]; - - grpname = (sock_group != NULL) ? sock_group : COLLECTD_GRP_NAME; - g = NULL; Index: pkg/DESCR-mqtt =================================================================== RCS file: pkg/DESCR-mqtt diff -N pkg/DESCR-mqtt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-mqtt 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1 @@ +MQTT plugin for collectd. Index: pkg/DESCR-ping =================================================================== RCS file: pkg/DESCR-ping diff -N pkg/DESCR-ping --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-ping 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1 @@ +Ping plugin for collectd. Index: pkg/DESCR-prometheus =================================================================== RCS file: pkg/DESCR-prometheus diff -N pkg/DESCR-prometheus --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-prometheus 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1 @@ +Prometheus write plugin for collectd. Index: pkg/DESCR-redis =================================================================== RCS file: pkg/DESCR-redis diff -N pkg/DESCR-redis --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-redis 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1 @@ +Redis plugins for collectd. Index: pkg/PLIST-main =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-main,v retrieving revision 1.11 diff -u -r1.11 PLIST-main --- pkg/PLIST-main 3 Dec 2016 11:44:41 -0000 1.11 +++ pkg/PLIST-main 25 Apr 2018 13:32:42 -0000 @@ -9,127 +9,71 @@ include/collectd/lcc_features.h include/collectd/network.h include/collectd/network_buffer.h +include/collectd/network_parse.h +include/collectd/server.h +include/collectd/types.h lib/collectd/ -@comment lib/collectd/aggregation.la lib/collectd/aggregation.so -@comment lib/collectd/apache.la lib/collectd/apache.so -@comment lib/collectd/apcups.la lib/collectd/apcups.so -@comment lib/collectd/ascent.la lib/collectd/ascent.so -@comment lib/collectd/bind.la lib/collectd/bind.so -@comment lib/collectd/cpu.la lib/collectd/cpu.so -@comment lib/collectd/csv.la lib/collectd/csv.so -@comment lib/collectd/curl.la lib/collectd/curl.so -@comment lib/collectd/curl_json.la lib/collectd/curl_json.so -@comment lib/collectd/curl_xml.la lib/collectd/curl_xml.so -@comment lib/collectd/df.la lib/collectd/df.so -@comment lib/collectd/disk.la lib/collectd/disk.so -@comment lib/collectd/dns.la lib/collectd/dns.so -@comment lib/collectd/email.la lib/collectd/email.so -@comment lib/collectd/exec.la lib/collectd/exec.so -@comment lib/collectd/filecount.la lib/collectd/filecount.so -@comment lib/collectd/interface.la lib/collectd/interface.so -@comment lib/collectd/load.la lib/collectd/load.so -@comment lib/collectd/log_logstash.la lib/collectd/log_logstash.so -@comment lib/collectd/logfile.la lib/collectd/logfile.so -@comment lib/collectd/match_empty_counter.la lib/collectd/match_empty_counter.so -@comment lib/collectd/match_hashed.la lib/collectd/match_hashed.so -@comment lib/collectd/match_regex.la lib/collectd/match_regex.so -@comment lib/collectd/match_timediff.la lib/collectd/match_timediff.so -@comment lib/collectd/match_value.la lib/collectd/match_value.so -@comment lib/collectd/memcached.la lib/collectd/memcached.so -@comment lib/collectd/memory.la lib/collectd/memory.so -@comment lib/collectd/network.la lib/collectd/network.so -@comment lib/collectd/nginx.la lib/collectd/nginx.so -@comment lib/collectd/ntpd.la lib/collectd/ntpd.so -@comment lib/collectd/olsrd.la lib/collectd/olsrd.so -@comment lib/collectd/openvpn.la lib/collectd/openvpn.so -@comment lib/collectd/pf.la lib/collectd/pf.so -@comment lib/collectd/ping.la -lib/collectd/ping.so -@comment lib/collectd/powerdns.la lib/collectd/powerdns.so -@comment lib/collectd/processes.la lib/collectd/processes.so -@comment lib/collectd/swap.la lib/collectd/swap.so -@comment lib/collectd/syslog.la lib/collectd/syslog.so -@comment lib/collectd/table.la lib/collectd/table.so -@comment lib/collectd/tail.la lib/collectd/tail.so -@comment lib/collectd/tail_csv.la lib/collectd/tail_csv.so -@comment lib/collectd/target_notification.la lib/collectd/target_notification.so -@comment lib/collectd/target_replace.la lib/collectd/target_replace.so -@comment lib/collectd/target_scale.la lib/collectd/target_scale.so -@comment lib/collectd/target_set.la lib/collectd/target_set.so -@comment lib/collectd/target_v5upgrade.la lib/collectd/target_v5upgrade.so -@comment lib/collectd/tcpconns.la lib/collectd/tcpconns.so -@comment lib/collectd/teamspeak2.la lib/collectd/teamspeak2.so -@comment lib/collectd/ted.la lib/collectd/ted.so -@comment lib/collectd/threshold.la lib/collectd/threshold.so -@comment lib/collectd/unixsock.la lib/collectd/unixsock.so -@comment lib/collectd/uptime.la lib/collectd/uptime.so -@comment lib/collectd/users.la lib/collectd/users.so -@comment lib/collectd/uuid.la lib/collectd/uuid.so -@comment lib/collectd/write_graphite.la lib/collectd/write_graphite.so -@comment lib/collectd/write_http.la lib/collectd/write_http.so -@comment lib/collectd/write_log.la lib/collectd/write_log.so @comment lib/libcollectdclient.la @lib lib/libcollectdclient.so.${LIBcollectdclient_VERSION} lib/pkgconfig/libcollectdclient.pc @comment libdata/perl5/${MACHINE_ARCH}-openbsd/ -@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.3/ -@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.3/perllocal.pod +@comment libdata/perl5/${MACHINE_ARCH}-openbsd/perllocal.pod libdata/perl5/site_perl/Collectd/ libdata/perl5/site_perl/Collectd.pm libdata/perl5/site_perl/Collectd/Plugins/ Index: pkg/PLIST-memcachec =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-memcachec,v retrieving revision 1.1 diff -u -r1.1 PLIST-memcachec --- pkg/PLIST-memcachec 3 May 2015 10:41:35 -0000 1.1 +++ pkg/PLIST-memcachec 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-memcachec,v 1.1 2015/05/03 10:41:35 landry Exp $ -@comment lib/collectd/memcachec.la lib/collectd/memcachec.so Index: pkg/PLIST-mqtt =================================================================== RCS file: pkg/PLIST-mqtt diff -N pkg/PLIST-mqtt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-mqtt 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1,2 @@ +@comment $OpenBSD$ +lib/collectd/mqtt.so Index: pkg/PLIST-mysql =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-mysql,v retrieving revision 1.2 diff -u -r1.2 PLIST-mysql --- pkg/PLIST-mysql 24 Jun 2010 06:53:37 -0000 1.2 +++ pkg/PLIST-mysql 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-mysql,v 1.2 2010/06/24 06:53:37 landry Exp $ -@comment lib/collectd/mysql.la lib/collectd/mysql.so Index: pkg/PLIST-nut =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-nut,v retrieving revision 1.1 diff -u -r1.1 PLIST-nut --- pkg/PLIST-nut 3 May 2015 10:41:35 -0000 1.1 +++ pkg/PLIST-nut 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-nut,v 1.1 2015/05/03 10:41:35 landry Exp $ -@comment lib/collectd/nut.la lib/collectd/nut.so Index: pkg/PLIST-pgsql =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-pgsql,v retrieving revision 1.2 diff -u -r1.2 PLIST-pgsql --- pkg/PLIST-pgsql 24 Jun 2010 06:53:37 -0000 1.2 +++ pkg/PLIST-pgsql 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-pgsql,v 1.2 2010/06/24 06:53:37 landry Exp $ -@comment lib/collectd/postgresql.la lib/collectd/postgresql.so Index: pkg/PLIST-ping =================================================================== RCS file: pkg/PLIST-ping diff -N pkg/PLIST-ping --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-ping 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1,2 @@ +@comment $OpenBSD$ +lib/collectd/ping.so Index: pkg/PLIST-prometheus =================================================================== RCS file: pkg/PLIST-prometheus diff -N pkg/PLIST-prometheus --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-prometheus 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1,2 @@ +@comment $OpenBSD$ +lib/collectd/write_prometheus.so Index: pkg/PLIST-python =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-python,v retrieving revision 1.1 diff -u -r1.1 PLIST-python --- pkg/PLIST-python 3 May 2015 10:41:35 -0000 1.1 +++ pkg/PLIST-python 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-python,v 1.1 2015/05/03 10:41:35 landry Exp $ -@comment lib/collectd/python.la lib/collectd/python.so Index: pkg/PLIST-redis =================================================================== RCS file: pkg/PLIST-redis diff -N pkg/PLIST-redis --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-redis 25 Apr 2018 13:32:42 -0000 @@ -0,0 +1,3 @@ +@comment $OpenBSD$ +lib/collectd/redis.so +lib/collectd/write_redis.so Index: pkg/PLIST-riemann =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-riemann,v retrieving revision 1.1 diff -u -r1.1 PLIST-riemann --- pkg/PLIST-riemann 3 Dec 2016 11:44:41 -0000 1.1 +++ pkg/PLIST-riemann 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-riemann,v 1.1 2016/12/03 11:44:41 landry Exp $ -@comment lib/collectd/write_riemann.la lib/collectd/write_riemann.so Index: pkg/PLIST-rrdtool =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-rrdtool,v retrieving revision 1.4 diff -u -r1.4 PLIST-rrdtool --- pkg/PLIST-rrdtool 1 Dec 2014 09:07:12 -0000 1.4 +++ pkg/PLIST-rrdtool 25 Apr 2018 13:32:42 -0000 @@ -1,5 +1,3 @@ @comment $OpenBSD: PLIST-rrdtool,v 1.4 2014/12/01 09:07:12 landry Exp $ -@comment lib/collectd/rrdcached.la lib/collectd/rrdcached.so -@comment lib/collectd/rrdtool.la lib/collectd/rrdtool.so Index: pkg/PLIST-snmp =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-snmp,v retrieving revision 1.2 diff -u -r1.2 PLIST-snmp --- pkg/PLIST-snmp 24 Jun 2010 06:53:37 -0000 1.2 +++ pkg/PLIST-snmp 25 Apr 2018 13:32:42 -0000 @@ -1,4 +1,4 @@ @comment $OpenBSD: PLIST-snmp,v 1.2 2010/06/24 06:53:37 landry Exp $ -@comment lib/collectd/snmp.la lib/collectd/snmp.so +lib/collectd/snmp_agent.so @man man/man5/collectd-snmp.5 Index: pkg/PLIST-virt =================================================================== RCS file: /cvs/ports/sysutils/collectd/pkg/PLIST-virt,v retrieving revision 1.2 diff -u -r1.2 PLIST-virt --- pkg/PLIST-virt 23 Jul 2015 07:33:17 -0000 1.2 +++ pkg/PLIST-virt 25 Apr 2018 13:32:42 -0000 @@ -1,3 +1,2 @@ @comment $OpenBSD: PLIST-virt,v 1.2 2015/07/23 07:33:17 landry Exp $ -@comment lib/collectd/virt.la lib/collectd/virt.so