aboutsummaryrefslogtreecommitdiff
path: root/sysutils/ganglia-monitor-core
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2003-06-07 12:59:36 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2003-06-07 12:59:36 +0000
commitf8b77d0feb14cfe329eea853d04583b10192fe99 (patch)
tree1376fc2d5c58d6d5077e57f2b9b9555e6769e08f /sysutils/ganglia-monitor-core
parent9ed57ea3339ebbefd9bd22052c4e1bf6849bdd0f (diff)
downloadports-f8b77d0feb14cfe329eea853d04583b10192fe99.tar.gz
ports-f8b77d0feb14cfe329eea853d04583b10192fe99.zip
Notes
Diffstat (limited to 'sysutils/ganglia-monitor-core')
-rw-r--r--sysutils/ganglia-monitor-core/Makefile3
-rw-r--r--sysutils/ganglia-monitor-core/distinfo2
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c33
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c176
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in13
-rw-r--r--sysutils/ganglia-monitor-core/pkg-plist53
6 files changed, 252 insertions, 28 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile
index 0930c59102f3..c1d97ce7348b 100644
--- a/sysutils/ganglia-monitor-core/Makefile
+++ b/sysutils/ganglia-monitor-core/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= ganglia-monitor-core
-PORTVERSION= 2.5.2
+PORTVERSION= 2.5.3
CATEGORIES= sysutils net parallel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ganglia
@@ -24,6 +24,7 @@ LIB_DEPENDS= rrd.0:${PORTSDIR}/net/rrdtool
GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LIBS="-L${LOCALBASE}/lib"
+CONFIGURE_ARGS+= --includedir=${PREFIX}/include/ganglia
.if !defined (WITHOUT_GMETAD)
CONFIGURE_ARGS+= --with-gmetad
.endif
diff --git a/sysutils/ganglia-monitor-core/distinfo b/sysutils/ganglia-monitor-core/distinfo
index 3812061efc8f..7286b7766047 100644
--- a/sysutils/ganglia-monitor-core/distinfo
+++ b/sysutils/ganglia-monitor-core/distinfo
@@ -1 +1 @@
-MD5 (ganglia-monitor-core-2.5.2.tar.gz) = a1a01a24156eb6d375b0dd47490aa9b5
+MD5 (ganglia-monitor-core-2.5.3.tar.gz) = c6bd5f5d21b3b84286d474f7e57f5101
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c b/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c
new file mode 100644
index 000000000000..c3dfe5b94738
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c
@@ -0,0 +1,33 @@
+
+$FreeBSD$
+
+--- gmond/gmond.c.orig Tue Jan 7 09:05:04 2003
++++ gmond/gmond.c Thu Apr 3 16:40:22 2003
+@@ -163,6 +163,13 @@
+ print_gmond_config();
+ */
+
++ /* in machine.c */
++ initval = metric_init();
++ if ( initval.int32 <0)
++ {
++ err_quit("metric_init() returned an error");
++ }
++
+ if(!gmond_config.no_setuid)
+ become_a_nobody(gmond_config.setuid);
+
+@@ -266,13 +273,6 @@
+ return -1;
+ }
+ debug_msg("multicasting on channel %s %d", gmond_config.mcast_channel, gmond_config.mcast_port);
+-
+- /* in machine.c */
+- initval = metric_init();
+- if ( initval.int32 <0)
+- {
+- err_quit("monitor_init() returned an error");
+- }
+
+ pthread_create(&tid, &attr, monitor_thread, NULL);
+ debug_msg("created monitor thread");
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c b/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c
new file mode 100644
index 000000000000..6f73c8d24160
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c
@@ -0,0 +1,176 @@
+
+$FreeBSD$
+
+--- gmond/machines/freebsd.c.orig Thu Aug 15 10:17:25 2002
++++ gmond/machines/freebsd.c Wed May 28 12:51:18 2003
+@@ -10,11 +10,36 @@
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/user.h>
++#if __FreeBSD_version < 500101
+ #include <sys/dkstat.h>
++#else
++#include <sys/resource.h>
++#endif
++#include <sys/stat.h>
++#include <vm/vm_param.h>
+ #include <unistd.h>
+ #include "ganglia.h"
+ #include "metric_typedefs.h"
+
++#define MIB_SWAPINFO_SIZE 3
++
++#ifndef XSWDEV_VERSION
++#define XSWDEV_VERSION 1
++struct xswdev {
++ u_int xsw_version;
++ udev_t xsw_dev;
++ int xsw_flags;
++ int xsw_nblks;
++ int xsw_used;
++};
++#endif
++
++static int use_vm_swap_info = 0;
++static int mibswap[MIB_SWAPINFO_SIZE];
++static size_t mibswap_size;
++static kvm_t *kd = NULL;
++static int pagesize;
++
+ /* Function prototypes */
+ long percentages(int cnt, int *out, register long *new,
+ register long *old, long *diffs);
+@@ -27,6 +52,19 @@
+ metric_init(void)
+ {
+ g_val_t val;
++
++ /*
++ * Try to use the vm.swap_info sysctl to gather swap data. If it
++ * isn't implemented, fall back to trying to old kvm based interface.
++ */
++ mibswap_size = MIB_SWAPINFO_SIZE;
++ if (sysctlnametomib("vm.swap_info", mibswap, &mibswap_size) == -1) {
++ kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()");
++ } else {
++ use_vm_swap_info = 1;
++ }
++ pagesize = getpagesize();
++
+ val.int32 = SYNAPSE_SUCCESS;
+ return val;
+ }
+@@ -81,21 +119,33 @@
+ swap_total_func ( void )
+ {
+ g_val_t val;
+-
+ struct kvm_swap swap[1];
+- kvm_t *kd;
++ struct xswdev xsw;
++ size_t mibsize, size;
+ int totswap, n;
+
+- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
+- n = kvm_getswapinfo(kd, swap, 1, 0);
+- if (n < 0 || swap[0].ksw_total == 0) {
+- val.uint32 = 0;
++ val.uint32 = 0;
++ totswap = 0;
++
++ if (use_vm_swap_info) {
++ for (n = 0; ; ++n) {
++ mibswap[mibswap_size] = n;
++ size = sizeof(xsw);
++ if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, NULL) == -1)
++ break;
++ if (xsw.xsw_version != XSWDEV_VERSION)
++ return val;
++ totswap += xsw.xsw_nblks;
++ }
++ } else if(kd != NULL) {
++ n = kvm_getswapinfo(kd, swap, 1, 0);
++ if (n < 0 || swap[0].ksw_total == 0) {
++ val.uint32 = 0;
++ }
++ totswap = swap[0].ksw_total;
+ }
+- totswap = swap[0].ksw_total;
+- totswap *= getpagesize() / 1024;
+- val.uint32 = totswap;
+- kvm_close(kd);
+
++ val.uint32 = totswap * (pagesize / 1024);
+ return val;
+ }
+
+@@ -330,9 +380,8 @@
+ len = sizeof (free_pages);
+ if((sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &len, NULL, 0)
+ == -1) || !len) free_pages = 0;
+- free_pages *= getpagesize() / 1024;
+
+- val.uint32 = free_pages;
++ val.uint32 = free_pages * (pagesize / 1024);
+ return val;
+ }
+
+@@ -373,9 +422,7 @@
+ || !len)
+ cache = 0;
+
+- cache *= getpagesize() / 1024;
+-
+- val.uint32 = cache;
++ val.uint32 = cache * (pagesize / 1024);
+ return val;
+ }
+
+@@ -383,23 +430,35 @@
+ swap_free_func ( void )
+ {
+ g_val_t val;
++
+ struct kvm_swap swap[1];
+- kvm_t *kd;
++ struct xswdev xsw;
++ size_t size;
+ int totswap, usedswap, freeswap, n;
+
+- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
+- n = kvm_getswapinfo(kd, swap, 1, 0);
+- if (n < 0 || swap[0].ksw_total == 0) {
+- val.uint32 = 0;
+- }
+- totswap = swap[0].ksw_total;
+- usedswap = swap[0].ksw_used;
+- kvm_close(kd);
++ val.uint32 = 0;
++ totswap = 0;
++ usedswap = 0;
+
+- freeswap = totswap-usedswap;
+- freeswap *= getpagesize() / 1024;
++ if (use_vm_swap_info) {
++ for (n = 0; ; ++n) {
++ mibswap[mibswap_size] = n;
++ size = sizeof(xsw);
++ if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, NULL) == -1)
++ break;
++ if (xsw.xsw_version != XSWDEV_VERSION)
++ return val;
++ totswap += xsw.xsw_nblks;
++ usedswap += xsw.xsw_used;
++ }
++ } else if(kd != NULL) {
++ n = kvm_getswapinfo(kd, swap, 1, 0);
++ totswap = swap[0].ksw_total;
++ usedswap = swap[0].ksw_used;
++ }
++ freeswap = totswap - usedswap;
+
+- val.uint32 = freeswap;
++ val.uint32 = freeswap * (pagesize / 1024);
+ return val;
+ }
+
diff --git a/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in b/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in
new file mode 100644
index 000000000000..11d8a323fc92
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- lib/Makefile.in.orig Wed May 28 12:59:41 2003
++++ lib/Makefile.in Wed May 28 13:00:03 2003
+@@ -471,7 +471,6 @@
+
+ install-exec-am: install-libLTLIBRARIES
+ @$(NORMAL_INSTALL)
+- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+ install-info: install-info-am
+
diff --git a/sysutils/ganglia-monitor-core/pkg-plist b/sysutils/ganglia-monitor-core/pkg-plist
index 4bec439d4427..903beb055db2 100644
--- a/sysutils/ganglia-monitor-core/pkg-plist
+++ b/sysutils/ganglia-monitor-core/pkg-plist
@@ -1,35 +1,36 @@
+@comment $FreeBSD$
bin/gstat
bin/gmetric
etc/gmond.conf.sample
%%GMETAD%%etc/gmetad.conf.sample
etc/rc.d/gmond.sh.sample
%%GMETAD%%etc/rc.d/gmetad.sh.sample
-include/ganglia.h
-include/ascii.h
-include/asciitab.h
-include/daemon_inetd.h
-include/daemon_init.h
-include/debug_msg.h
-include/error.h
-include/file.h
-include/hash.h
-include/iasciitab.h
-include/latin1tab.h
-include/llist.h
-include/my_inet_ntop.h
-include/nametab.h
-include/net.h
-include/rdwr.h
-include/utf8tab.h
-include/xmldef.h
-include/xmlparse.h
-include/xmlrole.h
-include/xmltok.h
-include/xmltok_impl.h
-include/gexec_funcs.h
-include/fsusage.h
-include/gexec_process.h
-include/gmond_config.h
+include/ganglia/ganglia.h
+include/ganglia/ascii.h
+include/ganglia/asciitab.h
+include/ganglia/daemon_inetd.h
+include/ganglia/daemon_init.h
+include/ganglia/debug_msg.h
+include/ganglia/error.h
+include/ganglia/file.h
+include/ganglia/hash.h
+include/ganglia/iasciitab.h
+include/ganglia/latin1tab.h
+include/ganglia/llist.h
+include/ganglia/my_inet_ntop.h
+include/ganglia/nametab.h
+include/ganglia/net.h
+include/ganglia/rdwr.h
+include/ganglia/utf8tab.h
+include/ganglia/xmldef.h
+include/ganglia/xmlparse.h
+include/ganglia/xmlrole.h
+include/ganglia/xmltok.h
+include/ganglia/xmltok_impl.h
+include/ganglia/gexec_funcs.h
+include/ganglia/fsusage.h
+include/ganglia/gexec_process.h
+include/ganglia/gmond_config.h
lib/libganglia.so.2
lib/libganglia.so
lib/libganglia.la