ports/156015: [PATCH] dns/unbound add MUNIN-plugin
Takefu
takefu at airport.fm
Tue Mar 29 01:20:10 UTC 2011
>Number: 156015
>Category: ports
>Synopsis: [PATCH] dns/unbound add MUNIN-plugin
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Mar 29 01:20:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Takefu
>Release: FreeBSD 8.2 i386
>Organization:
FOX Amateur Radio Club
>Environment:
>Description:
- add MUNIN-plugin
make WITH_MUNIN=yes
Port maintainer (sem at FreeBSD.org) is cc'd.
>How-To-Repeat:
>Fix:
--- unbound-munin_plugin.patch begins here ---
diff -ruN /usr/ports/dns/unbound/Makefile dns/unbound/Makefile
--- /usr/ports/dns/unbound/Makefile 2011-03-25 14:36:50.000000000 +0900
+++ dns/unbound/Makefile 2011-03-29 09:45:26.000000000 +0900
@@ -32,7 +32,7 @@
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
SUB_FILES= pkg-install pkg-deinstall
-PLIST_SUB+= PYTHON=${PYTHON}
+PLIST_SUB+= PYTHON=${PYTHON} MUNIN=${MUNIN}
OPTIONS= LIBEVENT "is useful when using many (10000) outgoing ports" off \
THREADS "build with threads support" on \
@@ -58,6 +58,15 @@
CONFIGURE_ARGS+= --disable-gost
.endif
+.if defined(WITH_MUNIN)
+ALL= hits queue memory by_type by_class\
+ by_opcode by_rcode by_flags histogram
+SUB_FILES+= pkg-message
+MUNIN=
+.else
+MUNIN= "@comment "
+.endif
+
.include <bsd.port.pre.mk>
# OpenSSL on 6.x has no sha256 functions
@@ -89,6 +98,20 @@
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.if defined(WITH_MUNIN)
+ @${MKDIR} ${PREFIX}/share/munin/plugins
+ @${MKDIR} ${PREFIX}/etc/munin/plugins
+ @${INSTALL_DATA} ${WRKDIR}/unbound-${PORTVERSION}/contrib/unbound_munin_\
+ ${PREFIX}/share/munin/plugins/
+ @for i in ${ALL}; do\
+ ${LN} -fs ${PREFIX}/share/munin/plugins/unbound_munin_\
+ ${PREFIX}/etc/munin/plugins/unbound_munin_$$i ;\
+ done
+ @${ECHO_MSG}
+ @${ECHO_MSG} "============================================================="
+ @${CAT} ${WRKDIR}/pkg-message
+ @${ECHO_MSG} "============================================================="
+.endif
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}; \
for f in ${PORTDOCS}; do \
diff -ruN /usr/ports/dns/unbound/files/pkg-message.in dns/unbound/files/pkg-message.in
--- /usr/ports/dns/unbound/files/pkg-message.in 1970-01-01 09:00:00.000000000 +0900
+++ dns/unbound/files/pkg-message.in 2011-03-25 14:25:38.000000000 +0900
@@ -0,0 +1,10 @@
+You can set them in your %%PREFIX%%/etc/munin/plugin-conf.d/plugins.conf file
+with:
+
+[unbound*]
+user root
+env.statefile %%PREFIX%%/var/munin/plugin-state/unbound-state
+env.unbound_conf %%PREFIX%%/etc/unbound/unbound.conf
+env.unbound_control %%PREFIX%%/sbin/unbound-control
+env.spoof_warn 1000
+env.spoof_crit 100000
diff -ruN /usr/ports/dns/unbound/pkg-plist dns/unbound/pkg-plist
--- /usr/ports/dns/unbound/pkg-plist 2010-11-10 16:17:53.000000000 +0900
+++ dns/unbound/pkg-plist 2011-03-25 14:24:36.000000000 +0900
@@ -16,5 +16,19 @@
%%PYTHON%%%%PYTHON_SITELIBDIR%%/_unbound.so.2
%%PYTHON%%%%PYTHON_SITELIBDIR%%/unbound.py
%%PYTHON%%%%PYTHON_SITELIBDIR%%/unboundmodule.py
+%%MUNIN%%etc/munin/plugins/unbound_munin_by_class
+%%MUNIN%%etc/munin/plugins/unbound_munin_by_flags
+%%MUNIN%%etc/munin/plugins/unbound_munin_by_opcode
+%%MUNIN%%etc/munin/plugins/unbound_munin_by_rcode
+%%MUNIN%%etc/munin/plugins/unbound_munin_by_type
+%%MUNIN%%etc/munin/plugins/unbound_munin_histogram
+%%MUNIN%%etc/munin/plugins/unbound_munin_hits
+%%MUNIN%%etc/munin/plugins/unbound_munin_memory
+%%MUNIN%%etc/munin/plugins/unbound_munin_queue
+%%MUNIN%%share/munin/plugins/unbound_munin_
+%%MUNIN%%@dirrmtry etc/munin/plugins
+%%MUNIN%%@dirrmtry etc/munin
+%%MUNIN%%@dirrmtry share/munin/plugins
+%%MUNIN%%@dirrmtry share/munin
@dirrmtry etc/unbound
@dirrmtry /var/run/unbound
--- unbound-munin_plugin.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list