From 8c86f1488e58dc6a638001a5b9745f5bd673ded1 Mon Sep 17 00:00:00 2001 From: brd Date: Fri, 14 Aug 2015 19:30:11 +0000 Subject: Add native disk metrics thanks to delphij, Ruben Kerkhof , and myself. [1] Fix Python option when building with debug enabled python [2] PR: 202327 [1] PR: 201773 [2] Submitted by: brd [1] Submitted by: Suraj Ravichandran [2] Approved by: Krzysztof (maintainer), bdrewery (mentor) --- net-mgmt/collectd5/Makefile | 5 +- net-mgmt/collectd5/files/patch-configure.ac | 64 ++++++++++++++++++++++++- net-mgmt/collectd5/files/patch-src__Makefile.am | 34 +++++++++---- net-mgmt/collectd5/pkg-plist | 2 +- 4 files changed, 93 insertions(+), 12 deletions(-) (limited to 'net-mgmt') diff --git a/net-mgmt/collectd5/Makefile b/net-mgmt/collectd5/Makefile index ca108cb51b0f..83c7e185da86 100644 --- a/net-mgmt/collectd5/Makefile +++ b/net-mgmt/collectd5/Makefile @@ -3,6 +3,7 @@ PORTNAME= collectd PORTVERSION= 5.5.0 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= https://collectd.org/files/ \ http://collectd.org/files/ @@ -59,7 +60,7 @@ ROUTEROS_DESC= Enable routeros plugin RRDTOOL_DESC= Enable rrdtool plugin (also rrdcached plugin) SIGROK_DESC= Enable sigrok plugin SNMP_DESC= Enable SNMP plugin -STATGRAB_DESC= Enable statgrab-based plugins (disk, interface, etc) +STATGRAB_DESC= Enable statgrab-based plugins (interface, etc) STATSD_DESC= Enable statsd plugin TOKYOTYRANT_DESC= Enable tokyotyrant plugin VARNISH_DESC= Enable varnish 4.x cache statistics @@ -114,6 +115,7 @@ CONFIGURE_ARGS+= \ --enable-cpu \ --enable-csv \ --enable-df \ + --enable-disk \ --enable-dns \ --enable-email \ --enable-exec \ @@ -455,7 +457,6 @@ PLIST_SUB+= RRDTOOL="@comment " LIB_DEPENDS+= libstatgrab.so:${PORTSDIR}/devel/libstatgrab LIBS+= `pkg-config --libs libstatgrab` CONFIGURE_ARGS+=--with-libstatgrab=${LOCALBASE} \ - --enable-disk \ --enable-interface PLIST_SUB+= STATGRAB="" .else diff --git a/net-mgmt/collectd5/files/patch-configure.ac b/net-mgmt/collectd5/files/patch-configure.ac index 4d26a525dcfc..218b6a732f86 100644 --- a/net-mgmt/collectd5/files/patch-configure.ac +++ b/net-mgmt/collectd5/files/patch-configure.ac @@ -1,4 +1,4 @@ ---- configure.ac.orig 2015-02-26 11:49:16 UTC +--- configure.ac.orig 2015-05-27 07:51:35 UTC +++ configure.ac @@ -120,7 +120,7 @@ then fi @@ -9,6 +9,24 @@ AC_SUBST(pkgconfigdir) # Check for standards compliance mode +@@ -641,7 +641,7 @@ SAVE_CFLAGS="$CFLAGS" + # Emulate behavior of src/Makefile.am + if test "x$GCC" = "xyes" + then +- CFLAGS="$CFLAGS -Wall -Werror" ++ CFLAGS="$CFLAGS -Wall " + fi + + AC_CACHE_CHECK([for strtok_r], +@@ -770,7 +770,7 @@ AC_CHECK_FUNCS(getutxent, [have_getutxen + if test "x$GCC" = "xyes" + then + SAVE_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -Wall -Wextra -Werror" ++ CFLAGS="$CFLAGS -Wall -Wextra " + fi + + AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"]) @@ -1495,6 +1495,7 @@ if test "x$with_kstat" = "xyes" then AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], []) @@ -26,6 +44,42 @@ fi AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") +@@ -3346,7 +3349,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 " + LIBS="$LIBS $PERL_LIBS" + + AC_CACHE_CHECK([for broken Perl_load_module()], +@@ -3576,7 +3579,7 @@ fi + if test "x$with_python" = "xyes" + then + AC_MSG_CHECKING([for Python CPPFLAGS]) +- python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1` ++ python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>/dev/null` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x" +@@ -3599,7 +3602,7 @@ fi + if test "x$with_python" = "xyes" + then + AC_MSG_CHECKING([for Python LDFLAGS]) +- python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>&1` ++ python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>/dev/null` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x" +@@ -3614,7 +3617,7 @@ fi + if test "x$with_python" = "xyes" + then + AC_MSG_CHECKING([for Python LIBS]) +- python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1` ++ python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>/dev/null` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x" @@ -3629,7 +3632,7 @@ fi if test "x$with_python" = "xyes" then @@ -46,3 +100,11 @@ with_libvarnish="yes" fi; fi; fi ], +@@ -5263,6 +5266,7 @@ fi + + if test "x$ac_system" = "xFreeBSD" + then ++ plugin_disk="yes" + plugin_zfs_arc="yes" + fi + diff --git a/net-mgmt/collectd5/files/patch-src__Makefile.am b/net-mgmt/collectd5/files/patch-src__Makefile.am index 037b4a567666..d849d50c6ab4 100644 --- a/net-mgmt/collectd5/files/patch-src__Makefile.am +++ b/net-mgmt/collectd5/files/patch-src__Makefile.am @@ -1,6 +1,14 @@ --- src/Makefile.am.orig 2015-05-26 19:38:14 UTC +++ src/Makefile.am -@@ -14,7 +14,7 @@ AM_CPPFLAGS = -I$(srcdir)/daemon +@@ -7,14 +7,14 @@ SUBDIRS += daemon + PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\' + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + AM_CPPFLAGS = -I$(srcdir)/daemon AM_CPPFLAGS += -DPREFIX='"${prefix}"' AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"' @@ -27,7 +35,17 @@ endif if BUILD_WITH_LIBDEVINFO disk_la_LIBADD += -ldevinfo -@@ -408,7 +408,7 @@ interface_la_CFLAGS += $(BUILD_WITH_LIBS +@@ -321,6 +321,9 @@ endif + if BUILD_WITH_PERFSTAT + disk_la_LIBADD += -lperfstat + endif ++if BUILD_FREEBSD ++disk_la_LIBADD += -ldevstat -lgeom ++endif + endif + + if BUILD_PLUGIN_DNS +@@ -408,7 +411,7 @@ interface_la_CFLAGS += $(BUILD_WITH_LIBS interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS) else if BUILD_WITH_LIBKSTAT @@ -36,7 +54,7 @@ endif if BUILD_WITH_LIBDEVINFO interface_la_LIBADD += -ldevinfo -@@ -591,7 +591,7 @@ memory_la_CFLAGS = $(AM_CFLAGS) +@@ -591,7 +594,7 @@ memory_la_CFLAGS = $(AM_CFLAGS) memory_la_LDFLAGS = $(PLUGIN_LDFLAGS) memory_la_LIBADD = if BUILD_WITH_LIBKSTAT @@ -45,7 +63,7 @@ endif if BUILD_WITH_LIBDEVINFO memory_la_LIBADD += -ldevinfo -@@ -964,7 +964,7 @@ swap_la_CFLAGS = $(AM_CFLAGS) +@@ -964,7 +967,7 @@ swap_la_CFLAGS = $(AM_CFLAGS) swap_la_LDFLAGS = $(PLUGIN_LDFLAGS) swap_la_LIBADD = if BUILD_WITH_LIBKSTAT @@ -54,7 +72,7 @@ endif if BUILD_WITH_LIBDEVINFO swap_la_LIBADD += -ldevinfo -@@ -1010,7 +1010,7 @@ if BUILD_PLUGIN_TAPE +@@ -1010,7 +1013,7 @@ if BUILD_PLUGIN_TAPE pkglib_LTLIBRARIES += tape.la tape_la_SOURCES = tape.c tape_la_LDFLAGS = $(PLUGIN_LDFLAGS) @@ -63,7 +81,7 @@ endif if BUILD_PLUGIN_TARGET_NOTIFICATION -@@ -1116,7 +1116,7 @@ uptime_la_CFLAGS = $(AM_CFLAGS) +@@ -1116,7 +1119,7 @@ uptime_la_CFLAGS = $(AM_CFLAGS) uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS) uptime_la_LIBADD = if BUILD_WITH_LIBKSTAT @@ -72,7 +90,7 @@ endif if BUILD_WITH_PERFSTAT uptime_la_LIBADD += -lperfstat -@@ -1275,7 +1275,7 @@ if BUILD_LINUX +@@ -1275,7 +1278,7 @@ if BUILD_LINUX # zfs_arc requires no library on linux else # solaris @@ -81,7 +99,7 @@ endif endif endif -@@ -1364,12 +1364,7 @@ endif +@@ -1364,12 +1367,7 @@ endif install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(sysconfdir) diff --git a/net-mgmt/collectd5/pkg-plist b/net-mgmt/collectd5/pkg-plist index f44242112c6f..f33ee3458322 100644 --- a/net-mgmt/collectd5/pkg-plist +++ b/net-mgmt/collectd5/pkg-plist @@ -26,7 +26,7 @@ lib/collectd/csv.so %%CURL_XML%%lib/collectd/curl_xml.so %%DBI%%lib/collectd/dbi.so lib/collectd/df.so -%%STATGRAB%%lib/collectd/disk.so +lib/collectd/disk.so lib/collectd/dns.so lib/collectd/email.so lib/collectd/exec.so -- cgit