View | Details | Raw Unified | Return to bug 181443
Collapse All | Expand All

(-)net-mgmt/collectd5/Makefile (-4 / +5 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	collectd
4
PORTNAME=	collectd
5
PORTVERSION=	5.3.0
5
PORTVERSION=	5.4.0
6
PORTREVISION=	4
7
CATEGORIES=	net-mgmt
6
CATEGORIES=	net-mgmt
8
MASTER_SITES=	http://collectd.org/files/
7
MASTER_SITES=	http://collectd.org/files/
9
8
Lines 10-19 Link Here
10
MAINTAINER=	ports@bsdserwis.com
9
MAINTAINER=	ports@bsdserwis.com
11
COMMENT=	Systems & network statistics collection daemon
10
COMMENT=	Systems & network statistics collection daemon
12
11
13
USES=		gmake
12
USES=		gmake pkgconfig
14
USE_BZIP2=	yes
13
USE_BZIP2=	yes
15
GNU_CONFIGURE=	yes
14
GNU_CONFIGURE=	yes
16
USE_AUTOTOOLS=	autoconf autoheader automake libltdl
15
USE_AUTOTOOLS=	aclocal autoconf autoheader automake libltdl libtool
16
USE_GNOME=	glib20
17
17
18
LATEST_LINK=	collectd5
18
LATEST_LINK=	collectd5
19
19
Lines 28-33 Link Here
28
MEMCACHEC_DESC=		Enable memcachec plugin
28
MEMCACHEC_DESC=		Enable memcachec plugin
29
MODBUS_DESC=		Enable modbus plugin
29
MODBUS_DESC=		Enable modbus plugin
30
MYSQL_DESC=		Enable mysql-based plugins
30
MYSQL_DESC=		Enable mysql-based plugins
31
NOTIFYEMAIL_DESC=	Enable notifications via email
31
NUTUPS_DESC=		Enable nut (ups) plugin
32
NUTUPS_DESC=		Enable nut (ups) plugin
32
PGSQL_DESC=		Enable postgresql-based plugins
33
PGSQL_DESC=		Enable postgresql-based plugins
33
PING_DESC=		Enable ping plugin
34
PING_DESC=		Enable ping plugin
(-)net-mgmt/collectd5/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (collectd-5.3.0.tar.bz2) = 5b04150f3c79f90f1a610ed22a2287ef5d8a07dcc2d0fa7a6a650edd9dc1ea01
1
SHA256 (collectd-5.4.0.tar.bz2) = 90973894a1f10775d409fe23ce7bc4d89c1b7c6f4d9918b305d160605871923e
2
SIZE (collectd-5.3.0.tar.bz2) = 1501308
2
SIZE (collectd-5.4.0.tar.bz2) = 1506520
(-)net-mgmt/collectd5/files/patch-configure.in (-44 / +9 lines)
Lines 1-16 Link Here
1
--- ./configure.in.orig	2013-05-21 21:43:30.000000000 +0000
1
--- configure.in.orig	2013-08-18 04:24:25.049973000 -0600
2
+++ ./configure.in	2013-05-21 21:43:14.000000000 +0000
2
+++ configure.in	2013-08-19 10:46:53.000000000 -0600
3
@@ -74,6 +74,9 @@
3
@@ -110,7 +110,7 @@
4
 	*openbsd*)
5
 	ac_system="OpenBSD"
6
 	;;
7
+	*freebsd*)
8
+	ac_system="FreeBSD"
9
+	;;
10
 	*aix*)
11
 	AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
12
 	ac_system="AIX"
13
@@ -106,7 +109,7 @@
14
 fi
4
 fi
15
 
5
 
16
 # Where to install .pc files.
6
 # Where to install .pc files.
Lines 19-25 Link Here
19
 AC_SUBST(pkgconfigdir)
9
 AC_SUBST(pkgconfigdir)
20
 
10
 
21
 # Check for standards compliance mode
11
 # Check for standards compliance mode
22
@@ -1413,6 +1416,7 @@
12
@@ -1419,6 +1419,7 @@
23
 then
13
 then
24
 	AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
14
 	AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
25
 fi
15
 fi
Lines 27-33 Link Here
27
 if test "x$with_kstat" = "xyes"
17
 if test "x$with_kstat" = "xyes"
28
 then
18
 then
29
 	AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
19
 	AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
30
@@ -1422,6 +1426,8 @@
20
@@ -1428,6 +1429,8 @@
31
 then
21
 then
32
 	AC_DEFINE(HAVE_LIBKSTAT, 1,
22
 	AC_DEFINE(HAVE_LIBKSTAT, 1,
33
 		  [Define to 1 if you have the 'kstat' library (-lkstat)])
23
 		  [Define to 1 if you have the 'kstat' library (-lkstat)])
Lines 36-42 Link Here
36
 fi
26
 fi
37
 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
27
 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
38
 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
28
 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
39
@@ -1841,12 +1847,6 @@
29
@@ -1904,12 +1907,6 @@
40
 	AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
30
 	AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
41
 		[with_libgcrypt="yes"],
31
 		[with_libgcrypt="yes"],
42
 		[with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
32
 		[with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
Lines 49-55 Link Here
49
 fi
39
 fi
50
 
40
 
51
 CPPFLAGS="$SAVE_CPPFLAGS"
41
 CPPFLAGS="$SAVE_CPPFLAGS"
52
@@ -3408,7 +3408,7 @@
42
@@ -3454,7 +3451,7 @@
53
 if test "x$with_python" = "xyes"
43
 if test "x$with_python" = "xyes"
54
 then
44
 then
55
 	AC_MSG_CHECKING([for Python LIBS])
45
 	AC_MSG_CHECKING([for Python LIBS])
Lines 58-64 Link Here
58
 	python_config_status=$?
48
 	python_config_status=$?
59
 
49
 
60
 	if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
50
 	if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
61
@@ -3423,7 +3423,7 @@
51
@@ -3469,7 +3466,7 @@
62
 if test "x$with_python" = "xyes"
52
 if test "x$with_python" = "xyes"
63
 then
53
 then
64
 	LDFLAGS="-L$python_library_path $LDFLAGS"
54
 	LDFLAGS="-L$python_library_path $LDFLAGS"
Lines 67-73 Link Here
67
 
57
 
68
 	AC_CHECK_FUNC(PyObject_CallFunction,
58
 	AC_CHECK_FUNC(PyObject_CallFunction,
69
 		      [with_python="yes"],
59
 		      [with_python="yes"],
70
@@ -4168,7 +4168,7 @@
60
@@ -4339,7 +4336,7 @@
71
 	then
61
 	then
72
 		AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
62
 		AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
73
 		with_libvarnish_cflags="-I$withval/include"
63
 		with_libvarnish_cflags="-I$withval/include"
Lines 76-103 Link Here
76
 		with_libvarnish="yes"
66
 		with_libvarnish="yes"
77
 	fi; fi; fi
67
 	fi; fi; fi
78
 ],
68
 ],
79
@@ -4693,6 +4693,12 @@
80
 	plugin_zfs_arc="yes"
81
 fi
82
 
83
+# FreeBSD
84
+if test "x$have_struct_kinfo_proc_freebsd" = "xyes"
85
+then
86
+	plugin_zfs_arc="yes"
87
+fi
88
+
89
 if test "x$with_devinfo$with_kstat" = "xyesyes"
90
 then
91
 	plugin_cpu="yes"
92
@@ -4866,6 +4872,12 @@
93
 	plugin_users="yes"
94
 fi
95
 
96
+# FreeBSD
97
+if test "x$have_struct_kinfo_proc_freebsd" = "xyes"
98
+then
99
+	plugin_zfs_arc="yes"
100
+fi
101
+
102
 m4_divert_once([HELP_ENABLE], [
103
 collectd plugins:])
(-)net-mgmt/collectd5/files/patch-src__Makefile.am (-20 / +11 lines)
Lines 1-5 Link Here
1
--- ./src/Makefile.am.orig	2013-04-10 15:34:36.000000000 +0000
1
--- src/Makefile.am.orig	2013-08-18 04:24:25.061973000 -0600
2
+++ ./src/Makefile.am	2013-05-21 23:57:02.000000000 +0000
2
+++ src/Makefile.am	2013-08-20 21:34:14.000000000 -0600
3
@@ -10,7 +10,7 @@
3
@@ -10,7 +10,7 @@
4
 AM_CPPFLAGS = -DPREFIX='"${prefix}"'
4
 AM_CPPFLAGS = -DPREFIX='"${prefix}"'
5
 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
5
 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
Lines 18-24 Link Here
18
 endif
18
 endif
19
 if BUILD_WITH_LIBDEVINFO
19
 if BUILD_WITH_LIBDEVINFO
20
 collectd_LDADD += -ldevinfo
20
 collectd_LDADD += -ldevinfo
21
@@ -257,7 +257,7 @@
21
@@ -275,7 +275,7 @@
22
 cpu_la_LDFLAGS = -module -avoid-version
22
 cpu_la_LDFLAGS = -module -avoid-version
23
 cpu_la_LIBADD = 
23
 cpu_la_LIBADD = 
24
 if BUILD_WITH_LIBKSTAT
24
 if BUILD_WITH_LIBKSTAT
Lines 27-33 Link Here
27
 endif
27
 endif
28
 if BUILD_WITH_LIBDEVINFO
28
 if BUILD_WITH_LIBDEVINFO
29
 cpu_la_LIBADD += -ldevinfo
29
 cpu_la_LIBADD += -ldevinfo
30
@@ -355,7 +355,7 @@
30
@@ -373,7 +373,7 @@
31
 disk_la_LDFLAGS = -module -avoid-version
31
 disk_la_LDFLAGS = -module -avoid-version
32
 disk_la_LIBADD = 
32
 disk_la_LIBADD = 
33
 if BUILD_WITH_LIBKSTAT
33
 if BUILD_WITH_LIBKSTAT
Lines 36-42 Link Here
36
 endif
36
 endif
37
 if BUILD_WITH_LIBDEVINFO
37
 if BUILD_WITH_LIBDEVINFO
38
 disk_la_LIBADD += -ldevinfo
38
 disk_la_LIBADD += -ldevinfo
39
@@ -462,7 +462,7 @@
39
@@ -480,7 +480,7 @@
40
 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
40
 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
41
 else
41
 else
42
 if BUILD_WITH_LIBKSTAT
42
 if BUILD_WITH_LIBKSTAT
Lines 45-51 Link Here
45
 endif
45
 endif
46
 if BUILD_WITH_LIBDEVINFO
46
 if BUILD_WITH_LIBDEVINFO
47
 interface_la_LIBADD += -ldevinfo
47
 interface_la_LIBADD += -ldevinfo
48
@@ -667,7 +667,7 @@
48
@@ -694,7 +694,7 @@
49
 collectd_LDADD += "-dlopen" memory.la
49
 collectd_LDADD += "-dlopen" memory.la
50
 collectd_DEPENDENCIES += memory.la
50
 collectd_DEPENDENCIES += memory.la
51
 if BUILD_WITH_LIBKSTAT
51
 if BUILD_WITH_LIBKSTAT
Lines 54-60 Link Here
54
 endif
54
 endif
55
 if BUILD_WITH_LIBDEVINFO
55
 if BUILD_WITH_LIBDEVINFO
56
 memory_la_LIBADD += -ldevinfo
56
 memory_la_LIBADD += -ldevinfo
57
@@ -796,7 +796,7 @@
57
@@ -823,7 +823,7 @@
58
 pkglib_LTLIBRARIES += notify_email.la
58
 pkglib_LTLIBRARIES += notify_email.la
59
 notify_email_la_SOURCES = notify_email.c
59
 notify_email_la_SOURCES = notify_email.c
60
 notify_email_la_LDFLAGS = -module -avoid-version
60
 notify_email_la_LDFLAGS = -module -avoid-version
Lines 63-69 Link Here
63
 collectd_LDADD += "-dlopen" notify_email.la
63
 collectd_LDADD += "-dlopen" notify_email.la
64
 collectd_DEPENDENCIES += notify_email.la
64
 collectd_DEPENDENCIES += notify_email.la
65
 endif
65
 endif
66
@@ -1061,7 +1061,7 @@
66
@@ -1108,7 +1108,7 @@
67
 collectd_LDADD += "-dlopen" swap.la
67
 collectd_LDADD += "-dlopen" swap.la
68
 collectd_DEPENDENCIES += swap.la
68
 collectd_DEPENDENCIES += swap.la
69
 if BUILD_WITH_LIBKSTAT
69
 if BUILD_WITH_LIBKSTAT
Lines 72-78 Link Here
72
 endif
72
 endif
73
 if BUILD_WITH_LIBDEVINFO
73
 if BUILD_WITH_LIBDEVINFO
74
 swap_la_LIBADD += -ldevinfo
74
 swap_la_LIBADD += -ldevinfo
75
@@ -1115,7 +1115,7 @@
75
@@ -1162,7 +1162,7 @@
76
 pkglib_LTLIBRARIES += tape.la
76
 pkglib_LTLIBRARIES += tape.la
77
 tape_la_SOURCES = tape.c
77
 tape_la_SOURCES = tape.c
78
 tape_la_LDFLAGS = -module -avoid-version
78
 tape_la_LDFLAGS = -module -avoid-version
Lines 81-87 Link Here
81
 collectd_LDADD += "-dlopen" tape.la
81
 collectd_LDADD += "-dlopen" tape.la
82
 collectd_DEPENDENCIES += tape.la
82
 collectd_DEPENDENCIES += tape.la
83
 endif
83
 endif
84
@@ -1238,7 +1238,7 @@
84
@@ -1285,7 +1285,7 @@
85
 uptime_la_LDFLAGS = -module -avoid-version
85
 uptime_la_LDFLAGS = -module -avoid-version
86
 uptime_la_LIBADD =
86
 uptime_la_LIBADD =
87
 if BUILD_WITH_LIBKSTAT
87
 if BUILD_WITH_LIBKSTAT
Lines 90-105 Link Here
90
 endif
90
 endif
91
 if BUILD_WITH_PERFSTAT
91
 if BUILD_WITH_PERFSTAT
92
 uptime_la_LIBADD += -lperfstat
92
 uptime_la_LIBADD += -lperfstat
93
@@ -1375,7 +1375,7 @@
93
@@ -1519,12 +1519,7 @@
94
 zfs_arc_la_SOURCES = zfs_arc.c
95
 zfs_arc_la_CFLAGS = $(AM_CFLAGS)
96
 zfs_arc_la_LDFLAGS = -module -avoid-version
97
-zfs_arc_la_LIBADD = -lkstat
98
+zfs_arc_la_LIBADD = $(BUILD_WITH_LIBKSTAT_LIBS)
99
 collectd_LDADD += "-dlopen" zfs_arc.la
100
 collectd_DEPENDENCIES += zfs_arc.la
101
 endif
102
@@ -1458,12 +1458,7 @@
103
 
94
 
104
 install-exec-hook:
95
 install-exec-hook:
105
 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
96
 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
(-)net-mgmt/collectd5/files/patch-src__zfs_arc.c (-220 lines)
Lines 1-220 Link Here
1
diff --git src/zfs_arc.c src/zfs_arc.c
2
index aa90019..17e8513 100644
3
--- src/zfs_arc.c
4
+++ src/zfs_arc.c
5
@@ -19,6 +19,8 @@
6
  * Authors:
7
  *   Anthony Dewhurst <dewhurst at gmail>
8
  *   Aurelien Rougemont <beorn at gandi.net>
9
+ *   Brad Davis <brd at FreeBSD.org>
10
+ *   William Grzybowski <william88 at gmail>
11
  **/
12
 
13
 #include "collectd.h"
14
@@ -29,7 +31,14 @@
15
  * Global variables
16
  */
17
 
18
+#if defined(HAVE_LIBKSTAT)
19
+static kstat_t *ksp;
20
 extern kstat_ctl_t *kc;
21
+#elif defined(HAVE_SYSCTLBYNAME)
22
+  typedef void kstat_t;
23
+# include <sys/types.h>
24
+# include <sys/sysctl.h>
25
+#endif /* HAVE_SYSCTLBYNAME */
26
 
27
 static void za_submit (const char* type, const char* type_instance, value_t* values, int values_len)
28
 {
29
@@ -57,37 +66,56 @@ static void za_submit_gauge (const char* type, const char* type_instance, gauge_
30
 static int za_read_derive (kstat_t *ksp, const char *kstat_value,
31
     const char *type, const char *type_instance)
32
 {
33
-  long long tmp;
34
-  value_t v;
35
-
36
-  tmp = get_kstat_value (ksp, (char *)kstat_value);
37
-  if (tmp == -1LL)
38
-  {
39
-    ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
40
-    return (-1);
41
-  }
42
-
43
-  v.derive = (derive_t) tmp;
44
-  za_submit (type, type_instance, /* values = */ &v, /* values_num = */ 1);
45
-  return (0);
46
+	long long tmp;
47
+	value_t v;
48
+
49
+#if defined(HAVE_LIBKSTAT)
50
+	tmp = get_kstat_value (ksp, (char *)kstat_value);
51
+	if (tmp == -1LL)
52
+	{
53
+		ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
54
+		return (-1);
55
+	}
56
+#elif defined(HAVE_SYSCTLBYNAME)
57
+	size_t size;
58
+	size = sizeof(tmp);
59
+	if (sysctlbyname(kstat_value, &tmp, &size, NULL, 0) < 0) {
60
+		ERROR ("zfs_arc plugin: Reading sysctl \"%s\" failed.", kstat_value);
61
+		return (-1);
62
+	}
63
+#endif /* HAVE_LIBKSTAT */
64
+
65
+	v.derive = (derive_t) tmp;
66
+	za_submit (type, type_instance, /* values = */ &v, /* values_num = */ 1);
67
+	return (0);
68
 }
69
 
70
 static int za_read_gauge (kstat_t *ksp, const char *kstat_value,
71
     const char *type, const char *type_instance)
72
 {
73
-  long long tmp;
74
-  value_t v;
75
-
76
-  tmp = get_kstat_value (ksp, (char *)kstat_value);
77
-  if (tmp == -1LL)
78
-  {
79
-    ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
80
-    return (-1);
81
-  }
82
-
83
-  v.gauge = (gauge_t) tmp;
84
-  za_submit (type, type_instance, /* values = */ &v, /* values_num = */ 1);
85
-  return (0);
86
+	long long tmp;
87
+	value_t v;
88
+
89
+#if defined(HAVE_LIBKSTAT)
90
+	tmp = get_kstat_value (ksp, (char *)kstat_value);
91
+	if (tmp == -1LL)
92
+	{
93
+		ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
94
+		return (-1);
95
+	}
96
+
97
+#elif defined(HAVE_SYSCTLBYNAME)
98
+	size_t size;
99
+	size = sizeof(tmp);
100
+	if (sysctlbyname(kstat_value, &tmp, &size, NULL, 0) < 0) {
101
+		ERROR ("zfs_arc plugin: Reading sysctl \"%s\" failed.", kstat_value);
102
+		return (-1);
103
+	}
104
+#endif /* HAVE_LIBKSTAT */
105
+
106
+	v.gauge = (gauge_t) tmp;
107
+	za_submit (type, type_instance, /* values = */ &v, /* values_num = */ 1);
108
+	return (0);
109
 }
110
 
111
 static void za_submit_ratio (const char* type_instance, gauge_t hits, gauge_t misses)
112
@@ -105,11 +133,67 @@ static void za_submit_ratio (const char* type_instance, gauge_t hits, gauge_t mi
113
 	za_submit_gauge ("cache_ratio", type_instance, ratio);
114
 }
115
 
116
-static int za_read (void)
117
+#if defined(HAVE_SYSCTLBYNAME)
118
+static int za_read_freebsd (void)
119
+{
120
+	// Sizes
121
+	za_read_gauge (NULL, "kstat.zfs.misc.arcstats.size", "cache_size", "arc");
122
+	za_read_gauge (NULL, "kstat.zfs.misc.arcstats.l2_size", "cache_size", "L2");
123
+
124
+	/* Operations */
125
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.allocated", "cache_operation", "allocated");
126
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.deleted",   "cache_operation", "deleted");
127
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.stolen",    "cache_operation", "stolen");
128
+
129
+	/* Issue indicators */
130
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.mutex_miss",      "mutex_operation", "miss");
131
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.hash_collisions", "hash_collisions", "");
132
+
133
+	/* Evictions */
134
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.evict_l2_cached",     "cache_eviction", "cached");
135
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.evict_l2_eligible",   "cache_eviction", "eligible");
136
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.evict_l2_ineligible", "cache_eviction", "ineligible");
137
+
138
+	/* Hits / misses */
139
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.demand_data_hits",         "cache_result", "demand_data-hit");
140
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.demand_metadata_hits",     "cache_result", "demand_metadata-hit");
141
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.prefetch_data_hits",       "cache_result", "prefetch_data-hit");
142
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.prefetch_metadata_hits",   "cache_result", "prefetch_metadata-hit");
143
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.demand_data_misses",       "cache_result", "demand_data-miss");
144
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.demand_metadata_misses",   "cache_result", "demand_metadata-miss");
145
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.prefetch_data_misses",     "cache_result", "prefetch_data-miss");
146
+	za_read_derive (NULL, "kstat.zfs.misc.arcstats.prefetch_metadata_misses", "cache_result", "prefetch_metadata-miss");
147
+
148
+	/* Ratios */
149
+	gauge_t arc_hits;
150
+	gauge_t arc_misses;
151
+	gauge_t l2_hits;
152
+	gauge_t l2_misses;
153
+	value_t  l2_io[2];
154
+
155
+	size_t size;
156
+	size = sizeof(arc_hits);
157
+	sysctlbyname("kstat.zfs.misc.arcstats.hits", &arc_hits, &size, NULL, 0);
158
+	sysctlbyname("kstat.zfs.misc.arcstats.misses", &arc_misses, &size, NULL, 0);
159
+	sysctlbyname("kstat.zfs.misc.arcstats.l2_hits", &l2_hits, &size, NULL, 0);
160
+	sysctlbyname("kstat.zfs.misc.arcstats.l2_misses", &l2_misses, &size, NULL, 0);
161
+
162
+	za_submit_ratio ("arc", arc_hits, arc_misses);
163
+	za_submit_ratio ("L2", l2_hits, l2_misses);
164
+
165
+	/* I/O */
166
+	sysctlbyname("kstat.zfs.misc.arcstats.l2_read_bytes", &l2_io[0].derive, &size, NULL, 0);
167
+	sysctlbyname("kstat.zfs.misc.arcstats.l2_write_bytes", &l2_io[1].derive, &size, NULL, 0);
168
+
169
+	za_submit ("io_octets", "L2", l2_io, /* num values = */ 2);
170
+
171
+	return (0);
172
+}
173
+#elif defined(HAVE_LIBKSTAT)
174
+static int za_read_solaris (void)
175
 {
176
 	gauge_t  arc_hits, arc_misses, l2_hits, l2_misses;
177
 	value_t  l2_io[2];
178
-	kstat_t	 *ksp	= NULL;
179
 
180
 	get_kstat (&ksp, "zfs", 0, "arcstats");
181
 	if (ksp == NULL)
182
@@ -163,15 +247,20 @@ static int za_read (void)
183
 
184
 	return (0);
185
 } /* int za_read */
186
+#endif
187
 
188
 static int za_init (void) /* {{{ */
189
 {
190
+#if defined(HAVE_LIBKSTAT)
191
+	ksp = NULL;
192
+
193
 	/* kstats chain already opened by update_kstat (using *kc), verify everything went fine. */
194
 	if (kc == NULL)
195
 	{
196
 		ERROR ("zfs_arc plugin: kstat chain control structure not available.");
197
 		return (-1);
198
 	}
199
+#endif /* HAVE_LIBKSTAT */
200
 
201
 	return (0);
202
 } /* }}} int za_init */
203
@@ -179,7 +268,16 @@ static int za_init (void) /* {{{ */
204
 void module_register (void)
205
 {
206
 	plugin_register_init ("zfs_arc", za_init);
207
-	plugin_register_read ("zfs_arc", za_read);
208
+
209
+#if defined(HAVE_LIBKSTAT)
210
+	plugin_register_read ("zfs_arc", za_read_solaris);
211
+#elif defined(HAVE_SYSCTLBYNAME)
212
+	plugin_register_read ("zfs_arc", za_read_freebsd);
213
+#else
214
+	ERROR ("Unable to determine which OS we are on");
215
+	return (-1);
216
+#endif /* HAVE_SYSCTLBYNAME */
217
+
218
 } /* void module_register */
219
 
220
 /* vmi: set sw=8 noexpandtab fdm=marker : */
(-)net-mgmt/collectd5/files/patch-version-gen.sh (-7 / +7 lines)
Lines 1-10 Link Here
1
--- ./version-gen.sh.orig	2013-05-21 21:22:23.000000000 +0000
1
--- version-gen.sh.orig	2013-08-19 10:57:47.000000000 -0600
2
+++ ./version-gen.sh	2013-05-21 21:23:19.000000000 +0000
2
+++ version-gen.sh	2013-08-19 10:58:15.000000000 -0600
3
@@ -1,13 +1,3 @@
3
@@ -1,13 +1,3 @@
4
-#!/usr/bin/env bash
4
-#!/usr/bin/env bash
5
+#!/bin/sh
6
 
7
-DEFAULT_VERSION="5.4.0.git"
5
-
8
-
6
-DEFAULT_VERSION="5.3.0.git"
7
-
8
-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
9
-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
9
-
10
-
10
-if test -z "$VERSION"; then
11
-if test -z "$VERSION"; then
Lines 12-18 Link Here
12
-fi
13
-fi
13
-
14
-
14
-VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
15
-VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
15
+#!/bin/sh
16
-
16
 
17
-echo -n "$VERSION"
17
-echo -n "$VERSION"
18
+echo -n "5.3.0.git"
18
+echo -n '5.4.0.git'
(-)net-mgmt/collectd5/pkg-plist (+71 lines)
Lines 16-162 Link Here
16
include/collectd/lcc_features.h
16
include/collectd/lcc_features.h
17
include/collectd/network.h
17
include/collectd/network.h
18
include/collectd/network_buffer.h
18
include/collectd/network_buffer.h
19
lib/collectd/aggregation.a
19
lib/collectd/aggregation.so
20
lib/collectd/aggregation.so
20
lib/collectd/aggregation.la
21
lib/collectd/aggregation.la
22
%%CURL%%lib/collectd/apache.a
21
%%CURL%%lib/collectd/apache.so
23
%%CURL%%lib/collectd/apache.so
22
%%CURL%%lib/collectd/apache.la
24
%%CURL%%lib/collectd/apache.la
25
lib/collectd/apcups.a
23
lib/collectd/apcups.so
26
lib/collectd/apcups.so
24
lib/collectd/apcups.la
27
lib/collectd/apcups.la
28
%%CURL_XML%%lib/collectd/ascent.a
25
%%CURL_XML%%lib/collectd/ascent.so
29
%%CURL_XML%%lib/collectd/ascent.so
26
%%CURL_XML%%lib/collectd/ascent.la
30
%%CURL_XML%%lib/collectd/ascent.la
31
%%CURL_XML%%lib/collectd/bind.a
27
%%CURL_XML%%lib/collectd/bind.so
32
%%CURL_XML%%lib/collectd/bind.so
28
%%CURL_XML%%lib/collectd/bind.la
33
%%CURL_XML%%lib/collectd/bind.la
34
lib/collectd/contextswitch.a
29
lib/collectd/contextswitch.so
35
lib/collectd/contextswitch.so
30
lib/collectd/contextswitch.la
36
lib/collectd/contextswitch.la
37
lib/collectd/cpu.a
31
lib/collectd/cpu.so
38
lib/collectd/cpu.so
32
lib/collectd/cpu.la
39
lib/collectd/cpu.la
40
lib/collectd/csv.a
33
lib/collectd/csv.so
41
lib/collectd/csv.so
34
lib/collectd/csv.la
42
lib/collectd/csv.la
43
%%CURL%%lib/collectd/curl.a
35
%%CURL%%lib/collectd/curl.so
44
%%CURL%%lib/collectd/curl.so
36
%%CURL%%lib/collectd/curl.la
45
%%CURL%%lib/collectd/curl.la
46
%%CURL_JSON%%lib/collectd/curl_json.a
37
%%CURL_JSON%%lib/collectd/curl_json.so
47
%%CURL_JSON%%lib/collectd/curl_json.so
38
%%CURL_JSON%%lib/collectd/curl_json.la
48
%%CURL_JSON%%lib/collectd/curl_json.la
49
%%CURL_XML%%lib/collectd/curl_xml.a
39
%%CURL_XML%%lib/collectd/curl_xml.so
50
%%CURL_XML%%lib/collectd/curl_xml.so
40
%%CURL_XML%%lib/collectd/curl_xml.la
51
%%CURL_XML%%lib/collectd/curl_xml.la
52
%%DBI%%lib/collectd/dbi.a
41
%%DBI%%lib/collectd/dbi.so
53
%%DBI%%lib/collectd/dbi.so
42
%%DBI%%lib/collectd/dbi.la
54
%%DBI%%lib/collectd/dbi.la
55
lib/collectd/df.a
43
lib/collectd/df.so
56
lib/collectd/df.so
44
lib/collectd/df.la
57
lib/collectd/df.la
58
%%STATGRAB%%lib/collectd/disk.a
45
%%STATGRAB%%lib/collectd/disk.so
59
%%STATGRAB%%lib/collectd/disk.so
46
%%STATGRAB%%lib/collectd/disk.la
60
%%STATGRAB%%lib/collectd/disk.la
61
lib/collectd/dns.a
47
lib/collectd/dns.so
62
lib/collectd/dns.so
48
lib/collectd/dns.la
63
lib/collectd/dns.la
64
lib/collectd/email.a
49
lib/collectd/email.so
65
lib/collectd/email.so
50
lib/collectd/email.la
66
lib/collectd/email.la
67
lib/collectd/exec.a
51
lib/collectd/exec.so
68
lib/collectd/exec.so
52
lib/collectd/exec.la
69
lib/collectd/exec.la
70
lib/collectd/filecount.a
53
lib/collectd/filecount.so
71
lib/collectd/filecount.so
54
lib/collectd/filecount.la
72
lib/collectd/filecount.la
73
%%STATGRAB%%lib/collectd/interface.a
55
%%STATGRAB%%lib/collectd/interface.so
74
%%STATGRAB%%lib/collectd/interface.so
56
%%STATGRAB%%lib/collectd/interface.la
75
%%STATGRAB%%lib/collectd/interface.la
76
lib/collectd/load.a
57
lib/collectd/load.so
77
lib/collectd/load.so
58
lib/collectd/load.la
78
lib/collectd/load.la
79
lib/collectd/logfile.a
59
lib/collectd/logfile.so
80
lib/collectd/logfile.so
60
lib/collectd/logfile.la
81
lib/collectd/logfile.la
82
lib/collectd/match_empty_counter.a
61
lib/collectd/match_empty_counter.so
83
lib/collectd/match_empty_counter.so
62
lib/collectd/match_empty_counter.la
84
lib/collectd/match_empty_counter.la
85
lib/collectd/match_hashed.a
63
lib/collectd/match_hashed.so
86
lib/collectd/match_hashed.so
64
lib/collectd/match_hashed.la
87
lib/collectd/match_hashed.la
88
lib/collectd/match_regex.a
65
lib/collectd/match_regex.so
89
lib/collectd/match_regex.so
66
lib/collectd/match_regex.la
90
lib/collectd/match_regex.la
91
lib/collectd/match_timediff.a
67
lib/collectd/match_timediff.so
92
lib/collectd/match_timediff.so
68
lib/collectd/match_timediff.la
93
lib/collectd/match_timediff.la
94
lib/collectd/match_value.a
69
lib/collectd/match_value.so
95
lib/collectd/match_value.so
70
lib/collectd/match_value.la
96
lib/collectd/match_value.la
97
lib/collectd/mbmon.a
71
lib/collectd/mbmon.so
98
lib/collectd/mbmon.so
72
lib/collectd/mbmon.la
99
lib/collectd/mbmon.la
100
%%MEMCACHEC%%lib/collectd/memcachec.a
73
%%MEMCACHEC%%lib/collectd/memcachec.so
101
%%MEMCACHEC%%lib/collectd/memcachec.so
74
%%MEMCACHEC%%lib/collectd/memcachec.la
102
%%MEMCACHEC%%lib/collectd/memcachec.la
103
lib/collectd/memcached.a
75
lib/collectd/memcached.so
104
lib/collectd/memcached.so
76
lib/collectd/memcached.la
105
lib/collectd/memcached.la
106
lib/collectd/memory.a
77
lib/collectd/memory.so
107
lib/collectd/memory.so
78
lib/collectd/memory.la
108
lib/collectd/memory.la
109
%%MYSQL%%lib/collectd/mysql.a
79
%%MYSQL%%lib/collectd/mysql.so
110
%%MYSQL%%lib/collectd/mysql.so
80
%%MYSQL%%lib/collectd/mysql.la
111
%%MYSQL%%lib/collectd/mysql.la
112
lib/collectd/network.a
81
lib/collectd/network.so
113
lib/collectd/network.so
82
lib/collectd/network.la
114
lib/collectd/network.la
115
%%CURL%%lib/collectd/nginx.a
83
%%CURL%%lib/collectd/nginx.so
116
%%CURL%%lib/collectd/nginx.so
84
%%CURL%%lib/collectd/nginx.la
117
%%CURL%%lib/collectd/nginx.la
118
lib/collectd/ntpd.a
85
lib/collectd/ntpd.so
119
lib/collectd/ntpd.so
86
lib/collectd/ntpd.la
120
lib/collectd/ntpd.la
121
%%NUTUPS%%lib/collectd/nut.a
87
%%NUTUPS%%lib/collectd/nut.so
122
%%NUTUPS%%lib/collectd/nut.so
88
%%NUTUPS%%lib/collectd/nut.la
123
%%NUTUPS%%lib/collectd/nut.la
124
lib/collectd/openvpn.a
89
lib/collectd/openvpn.so
125
lib/collectd/openvpn.so
90
lib/collectd/openvpn.la
126
lib/collectd/openvpn.la
127
%%PING%%lib/collectd/ping.a
91
%%PING%%lib/collectd/ping.so
128
%%PING%%lib/collectd/ping.so
92
%%PING%%lib/collectd/ping.la
129
%%PING%%lib/collectd/ping.la
130
%%PGSQL%%lib/collectd/postgresql.a
93
%%PGSQL%%lib/collectd/postgresql.so
131
%%PGSQL%%lib/collectd/postgresql.so
94
%%PGSQL%%lib/collectd/postgresql.la
132
%%PGSQL%%lib/collectd/postgresql.la
133
lib/collectd/powerdns.a
95
lib/collectd/powerdns.so
134
lib/collectd/powerdns.so
96
lib/collectd/powerdns.la
135
lib/collectd/powerdns.la
136
lib/collectd/pf.a
97
lib/collectd/pf.so
137
lib/collectd/pf.so
98
lib/collectd/pf.la
138
lib/collectd/pf.la
139
lib/collectd/processes.a
99
lib/collectd/processes.so
140
lib/collectd/processes.so
100
lib/collectd/processes.la
141
lib/collectd/processes.la
142
%%REDIS%%lib/collectd/redis.a
101
%%REDIS%%lib/collectd/redis.so
143
%%REDIS%%lib/collectd/redis.so
102
%%REDIS%%lib/collectd/redis.la
144
%%REDIS%%lib/collectd/redis.la
145
%%ROUTEROS%%lib/collectd/routeros.a
103
%%ROUTEROS%%lib/collectd/routeros.so
146
%%ROUTEROS%%lib/collectd/routeros.so
104
%%ROUTEROS%%lib/collectd/routeros.la
147
%%ROUTEROS%%lib/collectd/routeros.la
148
%%RRDTOOL%%lib/collectd/rrdcached.a
105
%%RRDTOOL%%lib/collectd/rrdcached.so
149
%%RRDTOOL%%lib/collectd/rrdcached.so
106
%%RRDTOOL%%lib/collectd/rrdcached.la
150
%%RRDTOOL%%lib/collectd/rrdcached.la
151
%%RRDTOOL%%lib/collectd/rrdtool.a
107
%%RRDTOOL%%lib/collectd/rrdtool.so
152
%%RRDTOOL%%lib/collectd/rrdtool.so
108
%%RRDTOOL%%lib/collectd/rrdtool.la
153
%%RRDTOOL%%lib/collectd/rrdtool.la
154
%%SNMP%%lib/collectd/snmp.a
109
%%SNMP%%lib/collectd/snmp.so
155
%%SNMP%%lib/collectd/snmp.so
110
%%SNMP%%lib/collectd/snmp.la
156
%%SNMP%%lib/collectd/snmp.la
157
lib/collectd/swap.a
111
lib/collectd/swap.so
158
lib/collectd/swap.so
112
lib/collectd/swap.la
159
lib/collectd/swap.la
160
lib/collectd/syslog.a
113
lib/collectd/syslog.so
161
lib/collectd/syslog.so
114
lib/collectd/syslog.la
162
lib/collectd/syslog.la
163
lib/collectd/table.a
115
lib/collectd/table.so
164
lib/collectd/table.so
116
lib/collectd/table.la
165
lib/collectd/table.la
166
lib/collectd/tail.a
117
lib/collectd/tail.so
167
lib/collectd/tail.so
118
lib/collectd/tail.la
168
lib/collectd/tail.la
169
lib/collectd/target_notification.a
119
lib/collectd/target_notification.so
170
lib/collectd/target_notification.so
120
lib/collectd/target_notification.la
171
lib/collectd/target_notification.la
172
lib/collectd/target_replace.a
121
lib/collectd/target_replace.so
173
lib/collectd/target_replace.so
122
lib/collectd/target_replace.la
174
lib/collectd/target_replace.la
175
lib/collectd/target_scale.a
123
lib/collectd/target_scale.so
176
lib/collectd/target_scale.so
124
lib/collectd/target_scale.la
177
lib/collectd/target_scale.la
178
lib/collectd/target_set.a
125
lib/collectd/target_set.so
179
lib/collectd/target_set.so
126
lib/collectd/target_set.la
180
lib/collectd/target_set.la
181
lib/collectd/target_v5upgrade.a
127
lib/collectd/target_v5upgrade.so
182
lib/collectd/target_v5upgrade.so
128
lib/collectd/target_v5upgrade.la
183
lib/collectd/target_v5upgrade.la
184
lib/collectd/tcpconns.a
129
lib/collectd/tcpconns.so
185
lib/collectd/tcpconns.so
130
lib/collectd/tcpconns.la
186
lib/collectd/tcpconns.la
187
lib/collectd/teamspeak2.a
131
lib/collectd/teamspeak2.so
188
lib/collectd/teamspeak2.so
132
lib/collectd/teamspeak2.la
189
lib/collectd/teamspeak2.la
190
lib/collectd/ted.a
133
lib/collectd/ted.so
191
lib/collectd/ted.so
134
lib/collectd/ted.la
192
lib/collectd/ted.la
193
lib/collectd/threshold.a
135
lib/collectd/threshold.so
194
lib/collectd/threshold.so
136
lib/collectd/threshold.la
195
lib/collectd/threshold.la
196
%%TOKYOTYRANT%%lib/collectd/tokyotyrant.a
137
%%TOKYOTYRANT%%lib/collectd/tokyotyrant.so
197
%%TOKYOTYRANT%%lib/collectd/tokyotyrant.so
138
%%TOKYOTYRANT%%lib/collectd/tokyotyrant.la
198
%%TOKYOTYRANT%%lib/collectd/tokyotyrant.la
199
lib/collectd/unixsock.a
139
lib/collectd/unixsock.so
200
lib/collectd/unixsock.so
140
lib/collectd/unixsock.la
201
lib/collectd/unixsock.la
202
lib/collectd/uptime.a
141
lib/collectd/uptime.so
203
lib/collectd/uptime.so
142
lib/collectd/uptime.la
204
lib/collectd/uptime.la
205
lib/collectd/users.a
143
lib/collectd/users.so
206
lib/collectd/users.so
144
lib/collectd/users.la
207
lib/collectd/users.la
208
lib/collectd/uuid.a
145
lib/collectd/uuid.so
209
lib/collectd/uuid.so
146
lib/collectd/uuid.la
210
lib/collectd/uuid.la
211
%%VIRT%%lib/collectd/libvirt.a
147
%%VIRT%%lib/collectd/libvirt.so
212
%%VIRT%%lib/collectd/libvirt.so
148
%%VIRT%%lib/collectd/libvirt.la
213
%%VIRT%%lib/collectd/libvirt.la
214
lib/collectd/write_graphite.a
149
lib/collectd/write_graphite.so
215
lib/collectd/write_graphite.so
150
lib/collectd/write_graphite.la
216
lib/collectd/write_graphite.la
217
%%CURL%%lib/collectd/write_http.a
151
%%CURL%%lib/collectd/write_http.so
218
%%CURL%%lib/collectd/write_http.so
152
%%CURL%%lib/collectd/write_http.la
219
%%CURL%%lib/collectd/write_http.la
220
%%REDIS%%lib/collectd/write_redis.a
153
%%REDIS%%lib/collectd/write_redis.so
221
%%REDIS%%lib/collectd/write_redis.so
154
%%REDIS%%lib/collectd/write_redis.la
222
%%REDIS%%lib/collectd/write_redis.la
223
%%XMMS%%lib/collectd/xmms.a
155
%%XMMS%%lib/collectd/xmms.so
224
%%XMMS%%lib/collectd/xmms.so
156
%%XMMS%%lib/collectd/xmms.la
225
%%XMMS%%lib/collectd/xmms.la
226
lib/collectd/zfs_arc.a
157
lib/collectd/zfs_arc.so
227
lib/collectd/zfs_arc.so
158
lib/collectd/zfs_arc.la
228
lib/collectd/zfs_arc.la
159
lib/libcollectdclient.la
229
lib/libcollectdclient.la
230
lib/libcollectdclient.a
160
lib/libcollectdclient.so
231
lib/libcollectdclient.so
161
lib/libcollectdclient.so.1
232
lib/libcollectdclient.so.1
162
libdata/pkgconfig/libcollectdclient.pc
233
libdata/pkgconfig/libcollectdclient.pc

Return to bug 181443