aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2004-03-02 15:54:05 +0000
committerMathieu Arnold <mat@FreeBSD.org>2004-03-02 15:54:05 +0000
commit9623c63f0ceb22bcaac7eedaacf76751ecc5c9ec (patch)
tree1133db3e951192306eec5389e71b876a82b46538 /sysutils
parent4e96c16014996a5ecdb5bddca7805028b08cb425 (diff)
downloadports-9623c63f0ceb22bcaac7eedaacf76751ecc5c9ec.tar.gz
ports-9623c63f0ceb22bcaac7eedaacf76751ecc5c9ec.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/munin-node/Makefile58
-rw-r--r--sysutils/munin-node/distinfo2
-rw-r--r--sysutils/munin-node/files/munin-node.sh26
-rw-r--r--sysutils/munin-node/files/patch-Makefile.config72
-rw-r--r--sysutils/munin-node/files/patch-munin-node.conf.in11
-rw-r--r--sysutils/munin-node/files/pkg-message12
-rw-r--r--sysutils/munin-node/pkg-deinstall61
-rw-r--r--sysutils/munin-node/pkg-descr13
-rw-r--r--sysutils/munin-node/pkg-install88
-rw-r--r--sysutils/munin-node/pkg-plist60
11 files changed, 404 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 599389c73cf1..9f86b108f087 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -219,6 +219,7 @@
SUBDIR += mtxorbd
SUBDIR += multitail
SUBDIR += munin-main
+ SUBDIR += munin-node
SUBDIR += muse
SUBDIR += nagios-statd
SUBDIR += nautilus-cd-burner
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
new file mode 100644
index 000000000000..a300189e83d3
--- /dev/null
+++ b/sysutils/munin-node/Makefile
@@ -0,0 +1,58 @@
+# New ports collection makefile for: munin-node
+# Date created: 25 Januar 2004
+# Whom: Lupe Christoph <lupe@lupe-christoph.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= munin
+PORTVERSION= 1.0.0.p3
+CATEGORIES= sysutils perl5
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= munin
+PKGNAMESUFFIX= -node
+DISTNAME= munin_1.0.0pre3
+
+MAINTAINER= lupe@lupe-christoph.de
+COMMENT= Node-specific part of Munin
+
+BUILD_DEPENDS= ${RUN_DEPENDS}
+RUN_DEPENDS= ${SITE_PERL}/Net/Server/Fork.pm:${PORTSDIR}/net/p5-Net-Server
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} < 500800
+RUN_DEPENDS+= ${SITE_PERL}/Net/Domain.pm:${PORTSDIR}/net/p5-Net
+.endif
+
+USE_GMAKE= yes
+PATCH_STRIP= -p1
+WRKSRC= ${WRKDIR}/munin-1.0.0pre3
+PKGMESSAGE= ${WRKDIR}/pkg-message
+ALL_TARGET= DATADIR=${DATADIR} build build-man
+INSTALL_TARGET= DATADIR=${DATADIR} install-node install-node-plugins
+
+MAN5= munin-node.conf.5
+MAN8= munin-node-configure.8 munin-node.8 munin-run.8
+
+pre-install:
+ @${SED} 's@%%PREFIX%%@${LOCALBASE}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
+ @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
+
+post-install:
+ @${SED} 's@%PREFIX%@${LOCALBASE}@g' ${FILESDIR}/munin-node.sh > ${PREFIX}/etc/rc.d/munin-node.sh
+ @${CHMOD} +x ${PREFIX}/etc/rc.d/munin-node.sh
+ @if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
+ ${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
+ fi
+ @${CAT} ${PKGMESSAGE}
+ @${INSTALL_MAN} -d ${PREFIX}/man/man5
+ @${INSTALL_MAN} -d ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.conf.5 ${PREFIX}/man/man5
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node-configure.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-run.8 ${PREFIX}/man/man8
+ @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL
+ @${ECHO} ${DISTNAME} | ${SED} -e 's/munin_//' > ${PREFIX}/etc/munin/VERSION.node
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/munin-node/distinfo b/sysutils/munin-node/distinfo
new file mode 100644
index 000000000000..33d0172cbc07
--- /dev/null
+++ b/sysutils/munin-node/distinfo
@@ -0,0 +1,2 @@
+MD5 (munin_1.0.0pre3.tar.gz) = f1aea51a61304b824dd61d7ad7808f6d
+SIZE (munin_1.0.0pre3.tar.gz) = 120572
diff --git a/sysutils/munin-node/files/munin-node.sh b/sysutils/munin-node/files/munin-node.sh
new file mode 100644
index 000000000000..a0b47d4e1f58
--- /dev/null
+++ b/sysutils/munin-node/files/munin-node.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PROGRAM=%PREFIX%/sbin/munin-node
+CONFIG=%PREFIX%/etc/munin/munin-node.conf
+
+case "$1" in
+ start)
+ if [ -x $PROGRAM -a -f $CONFIG -a -d $PLUGINS ]; then
+ $PROGRAM --config $CONFIG && echo -n ' munin-node'
+ fi
+ ;;
+
+ stop)
+ if [ -f $CONFIG ]; then
+ PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG`
+ if [ -f $PIDFILE ]; then
+ /bin/kill `cat $PIDFILE` && echo -n ' munin-node'
+ fi
+ fi
+ ;;
+
+ *)
+ echo "Usage: `basename $0` { start | stop }"
+ exit 64
+ ;;
+esac
diff --git a/sysutils/munin-node/files/patch-Makefile.config b/sysutils/munin-node/files/patch-Makefile.config
new file mode 100644
index 000000000000..7e1b893d6f0f
--- /dev/null
+++ b/sysutils/munin-node/files/patch-Makefile.config
@@ -0,0 +1,72 @@
+--- munin-1.0.0pre3.orig/Makefile.config Sun Feb 1 22:05:52 2004
++++ munin-1.0.0pre3/Makefile.config Sat Feb 7 12:48:23 2004
+@@ -7,42 +7,46 @@
+ #
+ # the base of the Munin installation.
+ #
+-PREFIX = $(DESTDIR)/opt/munin
++ifdef PREFIX
++UPREFIX=$(PREFIX)
++else
++UPREFIX=/usr
++endif
+
+ # Where Munin keeps its configurations (server.conf, client.conf, ++)
+-CONFDIR = $(DESTDIR)/etc/opt/munin
++CONFDIR = $(PREFIX)/etc/munin
+
+ # Server only - where to put munin-cron
+-BINDIR = $(PREFIX)/bin
++BINDIR = $(UPREFIX)/bin
+
+ # Client only - where to put munin-node, munin-node-configure, and munin-run
+-SBINDIR = $(PREFIX)/sbin
++SBINDIR = $(UPREFIX)/sbin
+
+ # Where to put text and html documentation
+-DOCDIR = $(PREFIX)/doc
++DOCDIR = $(UPREFIX)/doc
+
+ # Where to put man pages
+-MANDIR = $(PREFIX)/man
++MANDIR = $(UPREFIX)/man
+
+ # Where to put internal binaries and plugin repository
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = ${DATADIR}
+
+ # Server only - Output directory
+-HTMLDIR = $(PREFIX)/var/www
++HTMLDIR = $(PREFIX)/www/data/munin
+
+ # Client only - Where to put RRD files and other intenal data
+-DBDIR = $(DESTDIR)/var/opt/munin
++DBDIR = $(PREFIX)/var/munin
+
+ # Client only - Where plugins should put their states. Must be writable by
+ # group "munin", and should be preserved between reboots
+ PLUGSTATE = $(DBDIR)/plugin-state
+
+ # Where Munin should place its logs.
+-LOGDIR = $(DESTDIR)/var/log/munin
++LOGDIR = /var/log
+
+ # Location of PID files and other statefiles. On the server, must be
+ # writable by the user "munin".
+-STATEDIR = $(DESTDIR)/var/run/munin
++STATEDIR = /var/run/munin
+
+ # The perl interpreter to use
+ PERL = $(shell which perl)
+@@ -65,9 +69,8 @@
+ GROUP = munin
+
+ # Which command to use to check if the USER and GROUP to run Munin as, exists.
+-GETENT = $(shell which getent || which true 2>/dev/null)
+-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
++CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
++CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+
+ CHOWN = chown
+ CHMOD = chmod
diff --git a/sysutils/munin-node/files/patch-munin-node.conf.in b/sysutils/munin-node/files/patch-munin-node.conf.in
new file mode 100644
index 000000000000..535618ec792d
--- /dev/null
+++ b/sysutils/munin-node/files/patch-munin-node.conf.in
@@ -0,0 +1,11 @@
+--- munin-1.0.0pre1.orig/node/munin-node.conf.in Thu Jan 15 15:28:57 2004
++++ munin-1.0.0pre1/node/munin-node.conf.in Sun Jan 25 14:26:15 2004
+@@ -12,7 +12,7 @@
+ # Which port to bind to;
+ host *
+ user root
+-group root
++group wheel
+ setsid yes
+
+ # Regexps for files to ignore
diff --git a/sysutils/munin-node/files/pkg-message b/sysutils/munin-node/files/pkg-message
new file mode 100644
index 000000000000..206a44057599
--- /dev/null
+++ b/sysutils/munin-node/files/pkg-message
@@ -0,0 +1,12 @@
+
+********************************************************************
+Unless this file already existed, a sample configuration file
+has been placed in %%PREFIX%%/etc/munin/munin-node.conf.
+
+Please edit it according to your needs.
+
+The Munin client will be started at system boot automatically.
+You can start it manually with:
+ %%PREFIX%%/etc/rc.d/munin-node.sh start
+********************************************************************
+
diff --git a/sysutils/munin-node/pkg-deinstall b/sysutils/munin-node/pkg-deinstall
new file mode 100644
index 000000000000..217b827f561c
--- /dev/null
+++ b/sysutils/munin-node/pkg-deinstall
@@ -0,0 +1,61 @@
+#! /bin/sh
+#
+# $Log: pkg-deinstall,v $
+# Revision 1.2 2004/02/06 18:49:58 lupe
+# Fixes for pkg_add compatibility.
+#
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+stop_process() {
+ if [ -x ${PKG_PREFIX}/etc/rc.d/munin-node.sh ]; then
+ ${PKG_PREFIX}/etc/rc.d/munin-node.sh stop
+ fi
+}
+
+delete_group() {
+ local g
+
+ g=$1
+ if yesno "Do you want me to remove group \"${g}\"" y; then
+ pw groupdel -n ${g}
+ echo "Done."
+ fi
+}
+
+case $2 in
+ DEINSTALL)
+ stop_process
+ ;;
+ POST-DEINSTALL)
+ delete_group munin
+ ;;
+esac
diff --git a/sysutils/munin-node/pkg-descr b/sysutils/munin-node/pkg-descr
new file mode 100644
index 000000000000..b70648adb02d
--- /dev/null
+++ b/sysutils/munin-node/pkg-descr
@@ -0,0 +1,13 @@
+Munin network-wide graphing framework (node)
+
+Munin is a tool for graphing all sorts of information about one or more
+servers and displaying it in a web interface. It uses the execellent
+RRDTool (written by Tobi Oetiker) and is written in Perl. Munin has a
+master/node architecture. The master connects to all the nodes at regular
+intervals, and asks them for data. It then stores the data in RRD-files,
+and (if needed) updates the graphs. One of the main goals have been ease
+of creating own "plugins" (graphs).
+
+This is the node part. It is used on all machines Munin shall watch.
+
+WWW: http://www.linpro.no/projects/munin/
diff --git a/sysutils/munin-node/pkg-install b/sysutils/munin-node/pkg-install
new file mode 100644
index 000000000000..09c169bf6b14
--- /dev/null
+++ b/sysutils/munin-node/pkg-install
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# $Log: pkg-install,v $
+# Revision 1.2 2004/02/06 18:49:58 lupe
+# Fixes for pkg_add compatibility.
+#
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+make_group() {
+ local g
+
+ g=$1
+
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "You already have a group \"${g}\", so I will use it."
+ else
+ echo "You need a group \"${g}\"."
+ if which -s pw && yesno "Would you like me to create it" y; then
+ pw groupadd ${g} || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ if ! grep -q "^${u}:" /etc/passwd; then
+ echo "While you're at it, please create a user \"${u}\" too,"
+ echo "with a default group of \"${g}\"."
+ fi
+ exit 1
+ fi
+ fi
+}
+
+init_plugins() {
+ if [ -f ${PKG_PREFIX}/etc/munin/VERSION.node ]; then
+ prevver=$(cat ${PKG_PREFIX}/etc/munin/VERSION.node)
+ fi
+
+ mkdir -p ${PKG_PREFIX}/etc/munin/plugins ${PKG_PREFIX}/var/munin/plugin-state
+
+ if [ -n "$prevver" ]; then
+ echo -n "Initializing new plugins.."
+ ${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x
+ else
+ echo -n "Initializing plugins.."
+ ${PKG_PREFIX}/sbin/munin-node-configure --shell | sh -x
+ fi
+ echo "done."
+}
+
+
+########################################################################
+
+case $2 in
+ PRE-INSTALL)
+ make_group munin
+ ;;
+ POST-INSTALL)
+ init_plugins
+ ;;
+esac
diff --git a/sysutils/munin-node/pkg-plist b/sysutils/munin-node/pkg-plist
new file mode 100644
index 000000000000..93a9e0bbdf37
--- /dev/null
+++ b/sysutils/munin-node/pkg-plist
@@ -0,0 +1,60 @@
+etc/munin/VERSION.node
+etc/munin/munin-node.conf
+etc/munin/plugin-conf.d/plugins.conf
+etc/rc.d/munin-node.sh
+sbin/munin-node
+sbin/munin-node-configure
+sbin/munin-run
+share/munin/plugins/apache_accesses
+share/munin/plugins/apache_processes
+share/munin/plugins/apache_volume
+share/munin/plugins/bind9
+share/munin/plugins/cpu
+share/munin/plugins/df
+share/munin/plugins/df_inode
+share/munin/plugins/exim_mailqueue
+share/munin/plugins/exim_mailstats
+share/munin/plugins/hddtemp
+share/munin/plugins/if_
+share/munin/plugins/if_errcoll_
+share/munin/plugins/ircu
+share/munin/plugins/load
+share/munin/plugins/mailman
+share/munin/plugins/memory
+share/munin/plugins/multips
+share/munin/plugins/munin_graph
+share/munin/plugins/munin_update
+share/munin/plugins/mysql_bytes
+share/munin/plugins/mysql_isam_space_
+share/munin/plugins/mysql_queries
+share/munin/plugins/mysql_slowqueries
+share/munin/plugins/mysql_threads
+share/munin/plugins/named
+share/munin/plugins/netstat
+share/munin/plugins/open_files
+share/munin/plugins/plugins.history
+share/munin/plugins/pop_stats
+share/munin/plugins/postfix_mailqueue
+share/munin/plugins/postfix_mailstats
+share/munin/plugins/postfix_mailvolume
+share/munin/plugins/processes
+share/munin/plugins/ps_
+share/munin/plugins/psu_
+share/munin/plugins/samba
+share/munin/plugins/snmp__if_
+share/munin/plugins/spamstats
+share/munin/plugins/squid_cache
+share/munin/plugins/squid_icp
+share/munin/plugins/squid_requests
+share/munin/plugins/squid_traffic
+share/munin/plugins/surfboard
+share/munin/plugins/swap
+share/munin/plugins/sybase_space
+share/munin/plugins/vmstat
+@unexec rmdir %D/var/munin/plugin-state 2>/dev/null || true
+@unexec rmdir %D/var/munin 2>/dev/null || true
+@dirrm share/munin/plugins
+@unexec rmdir %D/share/munin 2>/dev/null || true
+@unexec rm -rf %D/etc/munin/plugins 2>/dev/null || true
+@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
+@unexec rmdir %D/etc/munin 2>/dev/null || true