Index: head/sysutils/ganglia-monitor-core/Makefile =================================================================== --- head/sysutils/ganglia-monitor-core/Makefile (revision 82450) +++ head/sysutils/ganglia-monitor-core/Makefile (revision 82451) @@ -1,91 +1,92 @@ # Ports collection makefile for: ganglia-monitor-core # Date created: Wed Jan 23, 2003 # Whom: Brooks Davis # # $FreeBSD$ # 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 .if defined (WITHOUT_GMETAD) PKGNAMESUFFIX= -nogmetad .endif MAINTAINER= brooks@FreeBSD.org COMMENT= "Ganglia cluster monitor, monitoring daemon" .if !defined (WITHOUT_GMETAD) LIB_DEPENDS= rrd.0:${PORTSDIR}/net/rrdtool .endif 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 USE_LIBTOOL= yes INSTALLS_SHLIB= yes .if defined (WITHOUT_GMETAD) PLIST_SUB+= GMETAD="@comment " .else PLIST_SUB+= GMETAD= .endif USE_REINPLACE= yes MAN1= gmetric.1 gmond.1 gstat.1 .if !defined (WITHOUT_GMETAD) MAN1+= gmetad.1 .endif CONF_DIR= ${PREFIX}/etc RC_DIR= ${PREFIX}/etc/rc.d FIX_CONF_FILES= ${WRKSRC}/lib/ganglia/gmond_config.h \ ${WRKSRC}/mans/gmetad.1 \ ${WRKSRC}/mans/gmond.1 \ ${WRKSRC}/gmetad/cmdline.c \ ${WRKSRC}/gmetad/cmdline.h \ ${WRKSRC}/gmond/cmdline.c \ ${WRKSRC}/gmond/cmdline.h FIX_DB_FILES= ${WRKSRC}/gmetad/gmetad.c \ ${WRKSRC}/gmetad/gmetad.conf post-patch: ${REINPLACE_CMD} -e "s|/etc/\(gm[a-z]*d.conf\)|${CONF_DIR}/\1|g" \ ${FIX_CONF_FILES} ${REINPLACE_CMD} -e "s|/var/lib/ganglia|/var/db/ganglia|g" \ ${FIX_DB_FILES} # Post-install # post-install: install-man install-sample-files install-startup-files ${SH} pkg-install ${PKGNAME} POST-INSTALL install-man: ${INSTALL_MAN} ${WRKSRC}/mans/gmetric.1 ${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/mans/gmond.1 ${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/mans/gstat.1 ${MANPREFIX}/man/man1 .if !defined (WITHOUT_GMETAD) ${INSTALL_MAN} ${WRKSRC}/mans/gmetad.1 ${MANPREFIX}/man/man1 .endif install-sample-files: ${INSTALL_DATA} ${WRKSRC}/gmond/gmond.conf \ ${CONF_DIR}/gmond.conf.sample .if !defined (WITHOUT_GMETAD) ${INSTALL_DATA} ${WRKSRC}/gmetad/gmetad.conf \ ${CONF_DIR}/gmetad.conf.sample .endif install-startup-files: ${INSTALL_SCRIPT} ${FILESDIR}/gmond.sh.sample ${RC_DIR} .if !defined (WITHOUT_GMETAD) ${INSTALL_SCRIPT} ${FILESDIR}/gmetad.sh.sample ${RC_DIR} .endif .include Property changes on: head/sysutils/ganglia-monitor-core/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property Index: head/sysutils/ganglia-monitor-core/distinfo =================================================================== --- head/sysutils/ganglia-monitor-core/distinfo (revision 82450) +++ head/sysutils/ganglia-monitor-core/distinfo (revision 82451) @@ -1 +1 @@ -MD5 (ganglia-monitor-core-2.5.2.tar.gz) = a1a01a24156eb6d375b0dd47490aa9b5 +MD5 (ganglia-monitor-core-2.5.3.tar.gz) = c6bd5f5d21b3b84286d474f7e57f5101 Property changes on: head/sysutils/ganglia-monitor-core/distinfo ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property Index: head/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c =================================================================== --- head/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c (nonexistent) +++ head/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c (revision 82451) @@ -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"); Property changes on: head/sysutils/ganglia-monitor-core/files/patch-gmond_gmond.c ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c =================================================================== --- head/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c (nonexistent) +++ head/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c (revision 82451) @@ -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 + #include + #include ++#if __FreeBSD_version < 500101 + #include ++#else ++#include ++#endif ++#include ++#include + #include + #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; + } + Property changes on: head/sysutils/ganglia-monitor-core/files/patch-gmond_machines_freebsd.c ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in =================================================================== --- head/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in (nonexistent) +++ head/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in (revision 82451) @@ -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 + Property changes on: head/sysutils/ganglia-monitor-core/files/patch-lib_Makefile.in ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/sysutils/ganglia-monitor-core/pkg-plist =================================================================== --- head/sysutils/ganglia-monitor-core/pkg-plist (revision 82450) +++ head/sysutils/ganglia-monitor-core/pkg-plist (revision 82451) @@ -1,40 +1,41 @@ +@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 lib/libganglia.a %%GMETAD%%sbin/gmetad sbin/gmond @dirrm include/ganglia @unexec rmdir /var/db/ganglia/rrds /var/db/ganglia 2>/dev/null || true Property changes on: head/sysutils/ganglia-monitor-core/pkg-plist ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property