Hi, here's an update to collectd 5.4.2, enabling plugins for libvirt, memcachec and python upon aja's request. Testing & feedback welcome. See https://collectd.org/wiki/index.php/Version_5.4#Release_5.4.2 for details. Note that most of our patches were merged upstream but only in the master branch.
Landry
Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/collectd/Makefile,v retrieving revision 1.27 diff -u -r1.27 Makefile --- Makefile 22 Jan 2015 20:26:43 -0000 1.27 +++ Makefile 2 May 2015 21:09:24 -0000 @@ -5,19 +5,22 @@ COMMENT-pgsql = collectd postgresql plugin COMMENT-rrdtool = collectd rrdtool plugin COMMENT-snmp = collectd snmp plugin +COMMENT-virt = collectd libvirt plugin +COMMENT-python = collectd python plugin +COMMENT-memcachec = collectd memcachec plugin -V = 5.4.1 +V = 5.4.2 DISTNAME = collectd-$V PKGNAME-main = collectd-$V PKGNAME-mysql = collectd-mysql-$V PKGNAME-pgsql = collectd-pgsql-$V PKGNAME-rrdtool = collectd-rrdtool-$V PKGNAME-snmp = collectd-snmp-$V +PKGNAME-virt = collectd-virt-$V +PKGNAME-python = collectd-python-$V +PKGNAME-memcachec = collectd-memcachec-$V CATEGORIES = sysutils -REVISION-main = 1 -REVISION-rrdtool = 1 - HOMEPAGE = http://www.collectd.org/ SHARED_LIBS += collectdclient 1.0 SHARED_ONLY = Yes @@ -27,9 +30,9 @@ MASTER_SITES = ${HOMEPAGE}/files/ -MODULES = devel/gettext +MODULES = devel/gettext lang/python -MULTI_PACKAGES = -main -mysql -pgsql -rrdtool -snmp +MULTI_PACKAGES = -main -mysql -pgsql -rrdtool -snmp -virt -python -memcachec WANTLIB-mysql = crypto m ssl z mysqlclient_r stdc++ pthread LIB_DEPENDS-mysql = databases/mariadb @@ -52,6 +55,17 @@ LIB_DEPENDS-snmp = net/net-snmp RUN_DEPENDS-snmp = collectd-$V:${BASE_PKGPATH},-main +LIB_DEPENDS-virt = sysutils/libvirt +WANTLIB-virt = avahi-client avahi-common dbus-1 ffi gmp gnutls hogweed \ + nettle p11-kit ssh2 tasn1 util virt crypto curl iconv \ + idn intl lzma m pthread ssl xml2 z + +LIB_DEPENDS-python = ${MODPY_LIB_DEPENDS} +WANTLIB-python = ${MODPY_WANTLIB} util m pthread + +LIB_DEPENDS-memcachec = devel/libmemcached +WANTLIB-memcachec = memcached sasl2 m pthread + LIB_DEPENDS += net/curl \ net/liboping \ textproc/libxml \ @@ -69,9 +83,11 @@ --with-librrd=${LOCALBASE} \ --with-libstatgrab=${LOCALBASE} \ --with-libnetsnmp=${LOCALBASE}/bin/net-snmp-config \ - --without-python \ + --with-python=${MODPY_BIN} \ --enable-all-plugins=no +# no, varnishapi.h not in our varnish package +# --with-libvarnish=${LOCALBASE} ENABLED_PLUGINS = apache apcups ascent bind cpu csv curl curl_xml \ df disk dns email exec filecount interface load \ logfile match_empty_counter match_hashed match_regex \ @@ -80,7 +96,7 @@ processes rrdtool rrdcached snmp 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 + users uuid write_http write_graphite pf python libvirt memcachec .for _plugin in ${ENABLED_PLUGINS} CONFIGURE_ARGS += --enable-${_plugin} Index: distinfo =================================================================== RCS file: /cvs/ports/sysutils/collectd/distinfo,v retrieving revision 1.4 diff -u -r1.4 distinfo --- distinfo 25 Sep 2014 20:10:13 -0000 1.4 +++ distinfo 2 May 2015 21:09:24 -0000 @@ -1,2 +1,2 @@ -SHA256 (collectd-5.4.1.tar.gz) = hTaAk2iT3wC/wr5Y9hq5GB/ssc9F/Fzdy30l2piFX2U= -SIZE (collectd-5.4.1.tar.gz) = 1894132 +SHA256 (collectd-5.4.2.tar.gz) = l3gIDunuZ2xxMLHOhsKEPHNZ4pub0cHA5I/NnMzwies= +SIZE (collectd-5.4.2.tar.gz) = 2024679 Index: patches/patch-Makefile_in =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-Makefile_in,v retrieving revision 1.3 diff -u -r1.3 patch-Makefile_in --- patches/patch-Makefile_in 25 Sep 2014 20:10:13 -0000 1.3 +++ patches/patch-Makefile_in 2 May 2015 21:09:24 -0000 @@ -1,8 +1,8 @@ $OpenBSD: patch-Makefile_in,v 1.3 2014/09/25 20:10:13 landry Exp $ dont create var/{run,lib,log} ---- Makefile.in.orig Sun Jan 26 09:09:57 2014 -+++ Makefile.in Mon Sep 22 16:59:12 2014 -@@ -881,9 +881,6 @@ uninstall-am: +--- Makefile.in.orig Thu Feb 26 15:07:46 2015 ++++ Makefile.in Sat May 2 20:11:03 2015 +@@ -935,9 +935,6 @@ uninstall-am: install-exec-hook: Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-configure,v retrieving revision 1.6 diff -u -r1.6 patch-configure --- patches/patch-configure 27 Oct 2014 09:07:07 -0000 1.6 +++ patches/patch-configure 2 May 2015 21:09:24 -0000 @@ -3,9 +3,9 @@ dont check for pcap-bpf.h, not installed on openbsd need to include sys/param.h and unistd.h to properly reach swapctl() prototype https://github.com/collectd/collectd/pull/779 ---- configure.orig Sun Jan 26 09:10:00 2014 -+++ configure Fri Oct 24 10:41:43 2014 -@@ -12793,7 +12793,7 @@ eval "LTDLOPEN=\"$libname_spec\"" +--- configure.orig Thu Feb 26 15:07:49 2015 ++++ configure Sat May 2 20:22:14 2015 +@@ -12873,7 +12873,7 @@ eval "LTDLOPEN=\"$libname_spec\"" @@ -14,7 +14,7 @@ -@@ -16812,7 +16812,7 @@ SAVE_CFLAGS="$CFLAGS" +@@ -16954,7 +16954,7 @@ SAVE_CFLAGS="$CFLAGS" # Emulate behavior of src/Makefile.am if test "x$GCC" = "xyes" then @@ -23,7 +23,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtok_r" >&5 -@@ -17524,8 +17524,11 @@ else +@@ -17666,8 +17666,11 @@ else # undef _LARGEFILE64_SOURCE #endif #include <sys/stat.h> @@ -35,7 +35,7 @@ int main () { -@@ -17561,7 +17564,9 @@ else +@@ -17703,7 +17706,9 @@ else # undef _LARGEFILE64_SOURCE #endif #include <sys/stat.h> @@ -45,7 +45,7 @@ int main () -@@ -18562,16 +18567,16 @@ else +@@ -18740,16 +18745,16 @@ else fi @@ -65,7 +65,7 @@ _ACEOF -@@ -18585,16 +18590,16 @@ else +@@ -18763,16 +18768,16 @@ else have_struct_kinfo_proc_openbsd="no" fi @@ -85,7 +85,7 @@ _ACEOF -@@ -22812,23 +22817,7 @@ fi +@@ -22990,23 +22995,7 @@ fi done fi @@ -109,16 +109,16 @@ if test "x$with_libpcap" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libpcap has PCAP_ERROR_IFACE_NOT_UP" >&5 -@@ -23057,7 +23046,7 @@ then - SAVE_LDFLAGS="$LDFLAGS" +@@ -23235,7 +23224,7 @@ then + SAVE_LIBS="$LIBS" # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3) # (see issues #41 and #42) - CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror" + CFLAGS="$CFLAGS $PERL_CFLAGS -Wall" - LDFLAGS="$LDFLAGS $PERL_LDFLAGS" + LIBS="$LIBS $PERL_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken Perl_load_module()" >&5 -@@ -26629,7 +26618,7 @@ then +@@ -26803,7 +26792,7 @@ then plugin_processes="yes" fi Index: patches/patch-src_Makefile_in =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-src_Makefile_in,v retrieving revision 1.6 diff -u -r1.6 patch-src_Makefile_in --- patches/patch-src_Makefile_in 25 Sep 2014 20:10:13 -0000 1.6 +++ patches/patch-src_Makefile_in 2 May 2015 21:09:24 -0000 @@ -1,8 +1,8 @@ $OpenBSD: patch-src_Makefile_in,v 1.6 2014/09/25 20:10:13 landry Exp $ Install config file in examples/ ---- src/Makefile.in.orig Sun Jan 26 09:09:56 2014 -+++ src/Makefile.in Mon Sep 22 17:27:47 2014 -@@ -36,7 +36,7 @@ POST_UNINSTALL = : +--- src/Makefile.in.orig Thu Feb 26 15:07:47 2015 ++++ src/Makefile.in Sat May 2 20:11:03 2015 +@@ -80,7 +80,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @BUILD_WITH_OWN_LIBOCONFIG_TRUE@am__append_1 = liboconfig @@ -11,7 +11,7 @@ sbin_PROGRAMS = collectd$(EXEEXT) collectdmon$(EXEEXT) bin_PROGRAMS = collectd-nagios$(EXEEXT) collectdctl$(EXEEXT) \ collectd-tg$(EXEEXT) $(am__EXEEXT_1) -@@ -2235,11 +2235,11 @@ top_build_prefix = @top_build_prefix@ +@@ -2316,11 +2316,11 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libcollectdclient $(am__append_1) @@ -25,7 +25,7 @@ $(am__append_2) -DPLUGINDIR='"${pkglibdir}"' \ -DPKGDATADIR='"${pkgdatadir}"' collectd_SOURCES = collectd.c collectd.h \ -@@ -2655,7 +2655,7 @@ CLEANFILES = $(am__append_449) +@@ -2736,7 +2736,7 @@ CLEANFILES = $(am__append_449) @BUILD_PLUGIN_NOTIFY_DESKTOP_TRUE@notify_desktop_la_LIBADD = $(LIBNOTIFY_LIBS) @BUILD_PLUGIN_NOTIFY_EMAIL_TRUE@notify_email_la_SOURCES = notify_email.c @BUILD_PLUGIN_NOTIFY_EMAIL_TRUE@notify_email_la_LDFLAGS = -module -avoid-version @@ -34,7 +34,7 @@ @BUILD_PLUGIN_NTPD_TRUE@ntpd_la_SOURCES = ntpd.c @BUILD_PLUGIN_NTPD_TRUE@ntpd_la_LDFLAGS = -module -avoid-version @BUILD_PLUGIN_NTPD_TRUE@ntpd_la_LIBADD = $(am__append_254) -@@ -4856,13 +4856,8 @@ uninstall-man: uninstall-man1 uninstall-man5 +@@ -5039,13 +5039,8 @@ uninstall-man: uninstall-man1 uninstall-man5 @HAVE_PROTOC_C_TRUE@ protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto install-exec-hook: Index: patches/patch-src_libcollectdclient_Makefile_in =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-src_libcollectdclient_Makefile_in,v retrieving revision 1.1 diff -u -r1.1 patch-src_libcollectdclient_Makefile_in --- patches/patch-src_libcollectdclient_Makefile_in 25 Sep 2014 20:10:13 -0000 1.1 +++ patches/patch-src_libcollectdclient_Makefile_in 2 May 2015 21:09:24 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-src_libcollectdclient_Makefile_in,v 1.1 2014/09/25 20:10:13 landry Exp $ ---- src/libcollectdclient/Makefile.in.orig Mon Sep 22 17:21:37 2014 -+++ src/libcollectdclient/Makefile.in Mon Sep 22 17:21:47 2014 -@@ -386,7 +386,7 @@ top_build_prefix = @top_build_prefix@ +--- src/libcollectdclient/Makefile.in.orig Thu Feb 26 15:07:48 2015 ++++ src/libcollectdclient/Makefile.in Sat May 2 20:11:03 2015 +@@ -461,7 +461,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies Index: patches/patch-src_tcpconns_c =================================================================== RCS file: /cvs/ports/sysutils/collectd/patches/patch-src_tcpconns_c,v retrieving revision 1.4 diff -u -r1.4 patch-src_tcpconns_c --- patches/patch-src_tcpconns_c 17 Nov 2014 15:23:12 -0000 1.4 +++ patches/patch-src_tcpconns_c 2 May 2015 21:09:24 -0000 @@ -1,9 +1,9 @@ $OpenBSD: patch-src_tcpconns_c,v 1.4 2014/11/17 15:23:12 landry Exp $ https://github.com/collectd/collectd/pull/779 https://github.com/collectd/collectd/pull/808 ---- src/tcpconns.c.orig Sun Jan 26 09:09:14 2014 -+++ src/tcpconns.c Mon Sep 22 16:59:13 2014 -@@ -896,7 +896,6 @@ static int conn_init (void) +--- src/tcpconns.c.orig Thu Feb 26 11:43:48 2015 ++++ src/tcpconns.c Sat May 2 20:11:03 2015 +@@ -909,7 +909,6 @@ static int conn_init (void) static int conn_read (void) { struct inpcbtable table; @@ -11,7 +11,7 @@ struct inpcb *next; struct inpcb inpcb; struct tcpcb tcpcb; -@@ -909,18 +908,16 @@ static int conn_read (void) +@@ -922,18 +921,16 @@ static int conn_read (void) if (status != 0) return (-1); @@ -33,7 +33,7 @@ /* Ignore sockets, that are not connected. */ #ifdef __NetBSD__ -@@ -937,7 +934,7 @@ static int conn_read (void) +@@ -950,7 +947,7 @@ static int conn_read (void) kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb)); conn_handle_ports (ntohs(inpcb.inp_lport), ntohs(inpcb.inp_fport), tcpcb.t_state); Index: pkg/DESCR-memcachec =================================================================== RCS file: pkg/DESCR-memcachec diff -N pkg/DESCR-memcachec --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-memcachec 2 May 2015 21:09:25 -0000 @@ -0,0 +1 @@ +Memcache client plugin for collectd. Index: pkg/DESCR-python =================================================================== RCS file: pkg/DESCR-python diff -N pkg/DESCR-python --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-python 2 May 2015 21:09:25 -0000 @@ -0,0 +1 @@ +Python plugin for collectd. Index: pkg/DESCR-virt =================================================================== RCS file: pkg/DESCR-virt diff -N pkg/DESCR-virt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/DESCR-virt 2 May 2015 21:09:25 -0000 @@ -0,0 +1 @@ +Libvirt plugin for collectd. Index: pkg/PLIST-memcachec =================================================================== RCS file: pkg/PLIST-memcachec diff -N pkg/PLIST-memcachec --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-memcachec 2 May 2015 21:09:25 -0000 @@ -0,0 +1,3 @@ +@comment $OpenBSD$ +@comment lib/collectd/memcachec.la +lib/collectd/memcachec.so Index: pkg/PLIST-python =================================================================== RCS file: pkg/PLIST-python diff -N pkg/PLIST-python --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-python 2 May 2015 21:09:25 -0000 @@ -0,0 +1,3 @@ +@comment $OpenBSD$ +@comment lib/collectd/python.la +lib/collectd/python.so Index: pkg/PLIST-virt =================================================================== RCS file: pkg/PLIST-virt diff -N pkg/PLIST-virt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PLIST-virt 2 May 2015 21:09:25 -0000 @@ -0,0 +1,3 @@ +@comment $OpenBSD$ +@comment lib/collectd/libvirt.la +lib/collectd/libvirt.so