From 4d48b5724f2f016441087e5a50203ed1ddb5d247 Mon Sep 17 00:00:00 2001 From: kuriyama Date: Sun, 10 Aug 2008 14:48:06 +0000 Subject: o Make dir /var/agentx for AgnetX sockets [1]. o Include zfs mount points for disk reports. Reported by: bms [1] --- net-mgmt/net-snmp-devel/Makefile | 2 ++ net-mgmt/net-snmp-devel/files/patch-disk.c | 31 ++++++++++++++++++++++++++++++ net-mgmt/net-snmp-devel/pkg-plist | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 net-mgmt/net-snmp-devel/files/patch-disk.c (limited to 'net-mgmt/net-snmp-devel') diff --git a/net-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile index 08770cbc8302..bc2a07d5cf33 100644 --- a/net-mgmt/net-snmp-devel/Makefile +++ b/net-mgmt/net-snmp-devel/Makefile @@ -7,6 +7,7 @@ PORTNAME= snmp PORTVERSION= 5.4.1.2 +PORTREVISION= 1 CATEGORIES= net-mgmt ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= net-snmp @@ -265,6 +266,7 @@ post-build: .endif post-install: strip-files install-config-files install-doc-files display-message + ${MKDIR} /var/agentx strip-files: @cd ${PREFIX}/bin; ${STRIP_CMD} ${BIN_FILES} diff --git a/net-mgmt/net-snmp-devel/files/patch-disk.c b/net-mgmt/net-snmp-devel/files/patch-disk.c new file mode 100644 index 000000000000..d58269d1e08d --- /dev/null +++ b/net-mgmt/net-snmp-devel/files/patch-disk.c @@ -0,0 +1,31 @@ +--- agent/mibgroup/ucd-snmp/disk.c.orig 2008-07-05 22:11:22.366362753 +0900 ++++ agent/mibgroup/ucd-snmp/disk.c 2008-07-06 00:32:19.611196878 +0900 +@@ -73,6 +73,9 @@ + #if HAVE_SYS_VFS_H + #include + #endif ++#if defined(__FreeBSD__) && __FreeBSD_version >= 700055 ++#include ++#endif + #if defined(HAVE_STATFS) + #if HAVE_SYS_MOUNT_H + #include +@@ -491,6 +494,18 @@ + dummy = 1; + } + endfsent(); /* close /etc/fstab */ ++#if defined(__FreeBSD__) && __FreeBSD_version >= 700055 ++ { ++ struct statfs *mntbuf; ++ size_t i, mntsize; ++ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); ++ for (i = 0; i < mntsize; i++) { ++ if (strncmp(mntbuf[i].f_fstypename, "zfs", 3) == 0) { ++ add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, minpercent, 0); ++ } ++ } ++ } ++#endif + if(dummy != 0) { + /* + * dummy clause for else below diff --git a/net-mgmt/net-snmp-devel/pkg-plist b/net-mgmt/net-snmp-devel/pkg-plist index 5e4c2c135409..6d9ec599c68c 100644 --- a/net-mgmt/net-snmp-devel/pkg-plist +++ b/net-mgmt/net-snmp-devel/pkg-plist @@ -436,9 +436,11 @@ sbin/snmptrapd %%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/agent %%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP %%WITH_PERL%%@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/Bundle +@exec mkdir /var/agentx @dirrm include/net-snmp/system @dirrm include/net-snmp/machine @dirrm include/net-snmp/library @dirrm include/net-snmp/agent @dirrm include/net-snmp @dirrmtry etc/snmp +@unexec rmdir /var/agentx 2>/dev/null || true -- cgit