summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2006-06-08 19:16:24 +0000
committerhe <he@pkgsrc.org>2006-06-08 19:16:24 +0000
commitb1c2748f6741a904f37e85bf8e14469877f829dc (patch)
treea24a11a8b6a3defc6f3db7f97601a02de9731a4d /sysutils
parentdc0a5b618a511efe49937ce476bf348ec26ba9f6 (diff)
downloadpkgsrc-b1c2748f6741a904f37e85bf8e14469877f829dc.tar.gz
Import a package for the server end of the Munin monitoring system.
This version has a patch so that it works properly with RRDtool of version 1.2 or newer.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/munin-server/DESCR7
-rw-r--r--sysutils/munin-server/MESSAGE10
-rw-r--r--sysutils/munin-server/Makefile87
-rw-r--r--sysutils/munin-server/PLIST24
-rw-r--r--sysutils/munin-server/distinfo9
-rw-r--r--sysutils/munin-server/patches/patch-aa92
-rw-r--r--sysutils/munin-server/patches/patch-ab13
-rw-r--r--sysutils/munin-server/patches/patch-ad38
-rw-r--r--sysutils/munin-server/patches/patch-ae89
9 files changed, 369 insertions, 0 deletions
diff --git a/sysutils/munin-server/DESCR b/sysutils/munin-server/DESCR
new file mode 100644
index 00000000000..73694b6a6ff
--- /dev/null
+++ b/sysutils/munin-server/DESCR
@@ -0,0 +1,7 @@
+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 has been ease of creating own "plugins" (graphs).
diff --git a/sysutils/munin-server/MESSAGE b/sysutils/munin-server/MESSAGE
new file mode 100644
index 00000000000..caeec38ea1f
--- /dev/null
+++ b/sysutils/munin-server/MESSAGE
@@ -0,0 +1,10 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+You can start the collection of statistics and production of graphs by
+installing a crontab for the ${MUNIN_USER} user of the form
+
+*/5 * * * * ${PREFIX}/bin/munin-cron
+
+You may need to give ${MUNIN_USER} a valid shell to do so.
+===========================================================================
diff --git a/sysutils/munin-server/Makefile b/sysutils/munin-server/Makefile
new file mode 100644
index 00000000000..9f7a39c583c
--- /dev/null
+++ b/sysutils/munin-server/Makefile
@@ -0,0 +1,87 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+#
+
+DISTNAME= ${PKGNAME:S:-server-:_:}
+PKGNAME= munin-server-1.3.1
+CATEGORIES= sysutils
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://munin.sourceforge.net/
+COMMENT= System monitoring tool, server version
+
+DEPENDS+= p5-Net-SSLeay>=0:../../security/p5-Net-SSLeay
+DEPENDS+= rrdtool>=1.2:../../databases/rrdtool
+DEPENDS+= munin-doc>=1.3.1:../../sysutils/munin-doc
+
+USE_TOOLS+= gmake
+USE_PKGINSTALL= YES
+
+PERL5_CONFIGURE=NO
+
+WRKSRC= ${WRKDIR}/${DISTNAME:S:_:-:}
+
+MUNIN_GROUP?= munin
+MUNIN_USER?= munin
+
+PKG_GROUPS= ${MUNIN_GROUP}
+PKG_USERS= ${MUNIN_USER}:${MUNIN_GROUP}::Munin\\ user
+
+STATEDIR= ${VARBASE}/munin/plugin-state
+
+MAKE_DIRS= ${VARBASE}/munin
+MAKE_DIRS+= ${VARBASE}/run/munin
+MAKE_DIRS+= ${VARBASE}/log/munin
+MAKE_DIRS+= ${STATEDIR}
+
+OWN_DIRS= ${VARBASE}/munin
+OWN_DIRS+= ${VARBASE}/run/munin
+OWN_DIRS+= ${VARBASE}/log/munin
+OWN_DIRS+= ${VARBASE}/munin/plugin-state
+
+OWN_DIRS_PERMS+=${VARBASE}/munin ${MUNIN_USER} ${MUNIN_GROUP} 0755
+OWN_DIRS_PERMS+=${VARBASE}/run/munin ${MUNIN_USER} ${MUNIN_GROUP} 0755
+OWN_DIRS_PERMS+=${VARBASE}/log/munin ${MUNIN_USER} ${MUNIN_GROUP} 0755
+OWN_DIRS_PERMS+=${VARBASE}/munin/plugin-state ${MUNIN_USER} ${MUNIN_GROUP} 0775
+
+INSTALL_TARGET= install-main
+
+BUILD_TARGET= build
+
+PERL5_SITELIB= ${PERL5_SUB_INSTALLVENDORLIB:Q}
+
+MAKE_ENV+= PERL5_SITELIB=${PREFIX}/${PERL5_SITELIB}
+MAKE_ENV+= MUNIN_USER=${MUNIN_USER}
+MAKE_ENV+= MUNIN_GROUP=${MUNIN_GROUP}
+MAKE_ENV+= PERL5=${PERL5:Q}
+
+FILES_SUBST+= PERL=${PERL5:Q}
+FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
+FILES_SUBST+= STATEDIR=${STATEDIR}
+
+PLIST_SUBST+= PERL5_SITELIB=${PERL5_SITELIB:Q}
+
+MESSAGE_SUBST+= MUNIN_USER=${MUNIN_USER:Q}
+
+EGDIR= ${PREFIX}/share/examples/munin
+TMPL_EGDIR= ${EGDIR}/templates
+INST_TMPL_DIR= ${PKG_SYSCONFDIR}/munin/templates
+
+CONF_FILES+= ${EGDIR}/munin.conf ${PKG_SYSCONFDIR}/munin/munin.conf
+
+TMPL_FILES= definitions.html logo.png munin-comparison-day.tmpl \
+ munin-comparison-month.tmpl munin-comparison-week.tmpl \
+ munin-comparison-year.tmpl munin-domainview.tmpl \
+ munin-nodeview.tmpl munin-overview.tmpl \
+ munin-serviceview.tmpl style.css
+
+.for f in ${TMPL_FILES}
+CONF_FILES+= ${TMPL_EGDIR}/${f} ${INST_TMPL_DIR}/${f}
+.endfor
+
+post-install:
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/build/server/munin.conf ${EGDIR}
+
+.include "../../mk/bsd.pkg.mk"
+.include "../../lang/perl5/module.mk"
diff --git a/sysutils/munin-server/PLIST b/sysutils/munin-server/PLIST
new file mode 100644
index 00000000000..f84447d842d
--- /dev/null
+++ b/sysutils/munin-server/PLIST
@@ -0,0 +1,24 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+bin/munin-cron
+lib/munin/munin-graph
+lib/munin/munin-html
+lib/munin/munin-limits
+lib/munin/munin-update
+share/examples/munin/munin.conf
+share/examples/munin/templates/definitions.html
+share/examples/munin/templates/logo.png
+share/examples/munin/templates/munin-comparison-day.tmpl
+share/examples/munin/templates/munin-comparison-month.tmpl
+share/examples/munin/templates/munin-comparison-week.tmpl
+share/examples/munin/templates/munin-comparison-year.tmpl
+share/examples/munin/templates/munin-domainview.tmpl
+share/examples/munin/templates/munin-nodeview.tmpl
+share/examples/munin/templates/munin-overview.tmpl
+share/examples/munin/templates/munin-serviceview.tmpl
+share/examples/munin/templates/style.css
+www/munin/data/cgi/munin-cgi-graph
+${PERL5_SITELIB}/Munin.pm
+@comment pkg-specific directories:
+@dirrm share/examples/munin/templates
+@comment shared with munin-node
+@unexec ${RMDIR} %D/lib/munin 2>/dev/null || ${TRUE}
diff --git a/sysutils/munin-server/distinfo b/sysutils/munin-server/distinfo
new file mode 100644
index 00000000000..938d0d5a7b8
--- /dev/null
+++ b/sysutils/munin-server/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+SHA1 (munin_1.3.1.tar.gz) = f7783b645abbb25524c3f1b6e0fe27185f1de3db
+RMD160 (munin_1.3.1.tar.gz) = a6ea4e1839f4c787457e4051d55007b7bcebd1d4
+Size (munin_1.3.1.tar.gz) = 315743 bytes
+SHA1 (patch-aa) = 7582a840614389f5fb4bf672cd4ea1e4b6822dd5
+SHA1 (patch-ab) = bb0f63cdef893d8c224cdd03a4a4125d03f85f80
+SHA1 (patch-ad) = 1ecac375a3c340200e3aa7ecad96a1351ff1da79
+SHA1 (patch-ae) = ac8f4f5b7abf03c057ff293ab82c7176bc51a3f6
diff --git a/sysutils/munin-server/patches/patch-aa b/sysutils/munin-server/patches/patch-aa
new file mode 100644
index 00000000000..5a0a3e11f31
--- /dev/null
+++ b/sysutils/munin-server/patches/patch-aa
@@ -0,0 +1,92 @@
+$NetBSD: patch-aa,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+--- Makefile.config.orig 2005-01-10 11:38:22.000000000 +0100
++++ Makefile.config
+@@ -7,32 +7,39 @@
+ #
+ # the base of the Munin installation.
+ #
+-PREFIX = $(DESTDIR)/opt/munin
++ifdef $(PREFIX)
++UPREFIX=$(PREFIX)
++else
++UPREFIX=/usr/pkg
++endif
+
+ # Where Munin keeps its configurations (server.conf, client.conf, ++)
+-CONFDIR = $(DESTDIR)/etc/opt/munin
++CONFDIR = $(UPREFIX)/etc/munin
++
++# Where NetBSD pkgsrc installs example config files
++EGDIR = $(UPREFIX)/share/examples/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)/share/doc/munin
+
+ # Where to put man pages
+-MANDIR = $(PREFIX)/man
++MANDIR = $(UPREFIX)/man
+
+ # Where to put internal binaries and plugin repository
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = $(UPREFIX)/lib/munin
+
+ # Server only - Output directory
+-HTMLDIR = $(PREFIX)/var/www
++HTMLDIR = $(UPREFIX)/www/munin/data
+ CGIDIR = $(HTMLDIR)/cgi
+
+ # Client only - Where to put RRD files and other intenal data
+-DBDIR = $(DESTDIR)/var/opt/munin
++DBDIR = $(DESTDIR)/var/munin
+
+ # Client only - Where plugins should put their states. Must be writable by
+ # group "munin", and should be preserved between reboots
+@@ -45,14 +52,14 @@ LOGDIR = $(DESTDIR)/var/log/munin
+ # writable by the user "munin".
+ STATEDIR = $(DESTDIR)/var/run/munin
+
+-# The perl interpreter to use
+-PERL = $(shell which perl)
++# The perl interpreter to use (passed in by pkgsrc)
++PERL = ${PERL5}
+
+ # The python interpreter to use (used by some plugins)
+ PYTHON = /usr/bin/env python
+
+ # Server only - Where to install the perl libraries
+-PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d= -f2 | sed "s/[\';]//g")
++PERLLIB = ${PERL5_SITELIB}
+
+ # Client only - Install plugins for this architecture
+ OSTYPE = $(shell uname | tr '[A-Z]' '[a-z]')
+@@ -65,16 +72,15 @@ HOSTNAME = $(shell hostname)
+ VERSION = $(shell cat RELEASE)
+
+ # User to run munin as
+-USER = munin
+-GROUP = munin
++USER = ${MUNIN_USER}
++GROUP = ${MUNIN_GROUP}
+
+ # Default user to run the plugins as
+ PLUGINUSER = nobody
+
+ # 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) nonexistent. Create the user and retry; exit 2"))
++CHECKGROUP = $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
+
+ CHOWN = chown
+ CHMOD = chmod
diff --git a/sysutils/munin-server/patches/patch-ab b/sysutils/munin-server/patches/patch-ab
new file mode 100644
index 00000000000..ec4f5a69630
--- /dev/null
+++ b/sysutils/munin-server/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+--- node/munin-node.conf.in.orig 2004-01-29 18:15:47.000000000 +0100
++++ node/munin-node.conf.in
+@@ -12,7 +12,7 @@ setseid 1
+ # Which port to bind to;
+ host *
+ user root
+-group root
++group wheel
+ setsid yes
+
+ # Regexps for files to ignore
diff --git a/sysutils/munin-server/patches/patch-ad b/sysutils/munin-server/patches/patch-ad
new file mode 100644
index 00000000000..f84d4dd52d1
--- /dev/null
+++ b/sysutils/munin-server/patches/patch-ad
@@ -0,0 +1,38 @@
+$NetBSD: patch-ad,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+--- Makefile.orig 2004-12-22 22:33:47.000000000 +0100
++++ Makefile
+@@ -17,6 +17,7 @@ install: install-main install-node insta
+ install-main: build
+ $(CHECKUSER)
+ mkdir -p $(CONFDIR)/templates
++ mkdir -p $(EGDIR)/templates
+ mkdir -p $(LIBDIR)
+ mkdir -p $(BINDIR)
+ mkdir -p $(PERLLIB)
+@@ -29,13 +30,11 @@ install-main: build
+ $(CHOWN) $(USER) $(LOGDIR) $(STATEDIR) $(RUNDIR) $(HTMLDIR) $(DBDIR)
+
+ for p in build/server/*.tmpl; do \
+- $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
++ $(INSTALL) -m 0644 "$$p" $(EGDIR)/templates/ ; \
+ done
+- $(INSTALL) -m 0644 server/logo.png $(CONFDIR)/templates/
+- $(INSTALL) -m 0644 server/style.css $(CONFDIR)/templates/
+- $(INSTALL) -m 0644 server/definitions.html $(CONFDIR)/templates/
+-
+- test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/server/munin.conf $(CONFDIR)/
++ $(INSTALL) -m 0644 server/logo.png $(EGDIR)/templates/
++ $(INSTALL) -m 0644 server/style.css $(EGDIR)/templates/
++ $(INSTALL) -m 0644 server/definitions.html $(EGDIR)/templates/
+
+ $(INSTALL) -m 0755 build/server/munin-cron $(BINDIR)/
+
+@@ -71,7 +70,6 @@ install-node-non-snmp: build
+
+ $(INSTALL) -m 0755 build/node/munin-node $(SBINDIR)/
+ $(INSTALL) -m 0755 build/node/munin-node-configure $(SBINDIR)/
+- test -f "$(CONFDIR)/munin-node.conf" || $(INSTALL) -m 0644 build/node/munin-node.conf $(CONFDIR)/
+ $(INSTALL) -m 0755 build/node/munin-run $(SBINDIR)/
+
+ install-node-plugins: build
diff --git a/sysutils/munin-server/patches/patch-ae b/sysutils/munin-server/patches/patch-ae
new file mode 100644
index 00000000000..61befa0683c
--- /dev/null
+++ b/sysutils/munin-server/patches/patch-ae
@@ -0,0 +1,89 @@
+$NetBSD: patch-ae,v 1.1.1.1 2006/06/08 19:16:24 he Exp $
+
+--- server/munin-graph.in.orig 2005-01-08 23:34:38.000000000 +0100
++++ server/munin-graph.in
+@@ -490,6 +490,9 @@ sub get_header {
+ push @$result,"--width", &munin_get ($config, "graph_width", "400", $domain, $host, $service);
+ push @$result,"--imgformat", "PNG";
+ push @$result,"--lazy" if ($force_lazy);
++ push @$result,"--font", "LEGEND:" . &munin_get ($config, "legend_fontsize", "7", $domain, $host, $service) . ":";
++ push @$result,"--font", "AXIS:" . &munin_get ($config, "axis_fontsize", "7", $domain, $host, $service) . ":";
++# push @$result,"--font-render-mode", "mono";
+
+ push (@$result, "--units-exponent", "0")
+ if (! &should_scale ($node, $service));
+@@ -848,10 +851,10 @@ sub process_node {
+ elsif ($global_headers == 1)
+ {
+ push (@rrd, "COMMENT:" . (" " x $max_field_len));
+- push (@rrd, "COMMENT: Cur:");
+- push (@rrd, "COMMENT:Min:");
+- push (@rrd, "COMMENT:Avg:");
+- push (@rrd, "COMMENT:Max: \\j");
++ push (@rrd, "COMMENT: Cur\\:");
++ push (@rrd, "COMMENT:Min\\:");
++ push (@rrd, "COMMENT:Avg\\:");
++ push (@rrd, "COMMENT:Max\\: \\j");
+ $global_headers++;
+ }
+
+@@ -924,13 +927,13 @@ sub process_node {
+ }
+ else
+ {
+- push (@rrd, "COMMENT: Cur:") unless $global_headers;
++ push (@rrd, "COMMENT: Cur\\:") unless $global_headers;
+ push (@rrd, "GPRINT:c$rrdname:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, "yes")?"%s":"") . "");
+- push (@rrd, "COMMENT: Min:") unless $global_headers;
++ push (@rrd, "COMMENT: Min\\:") unless $global_headers;
+ push (@rrd, "GPRINT:i$rrdname:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
+- push (@rrd, "COMMENT: Avg:") unless $global_headers;
++ push (@rrd, "COMMENT: Avg\\:") unless $global_headers;
+ push (@rrd, "GPRINT:g$rrdname:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
+- push (@rrd, "COMMENT: Max:") unless $global_headers;
++ push (@rrd, "COMMENT: Max\\:") unless $global_headers;
+ push (@rrd, "GPRINT:a$rrdname:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "\\j");
+ push (@{$total_pos{'min'}}, "i$rrdname");
+ push (@{$total_pos{'avg'}}, "g$rrdname");
+@@ -991,13 +994,13 @@ sub process_node {
+
+ push (@rrd, "CDEF:dpostotal=ipostotal,UN,ipostotal,UNKN,IF");
+ push (@rrd, "LINE1:dpostotal#000000:" . $node->{client}->{$service}->{graph_total} . (" " x ($max_field_len - length ($node->{client}->{$service}->{graph_total}) + 1)));
+- push (@rrd, "COMMENT: Cur:") unless $global_headers;
++ push (@rrd, "COMMENT: Cur\\:") unless $global_headers;
+ push (@rrd, "GPRINT:gpostotal:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
+- push (@rrd, "COMMENT: Min:") unless $global_headers;
++ push (@rrd, "COMMENT: Min\\:") unless $global_headers;
+ push (@rrd, "GPRINT:ipostotal:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
+- push (@rrd, "COMMENT: Avg:") unless $global_headers;
++ push (@rrd, "COMMENT: Avg\\:") unless $global_headers;
+ push (@rrd, "GPRINT:gpostotal:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "");
+- push (@rrd, "COMMENT: Max:") unless $global_headers;
++ push (@rrd, "COMMENT: Max\\:") unless $global_headers;
+ push (@rrd, "GPRINT:apostotal:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "\\j");
+ }
+
+@@ -1010,7 +1013,10 @@ sub process_node {
+ push @complete, @{&get_header ($node, $config, $domain, $name, $service, $time)};
+ push @complete, @rrd;
+
+- push (@complete, "COMMENT:Last update: " . localtime($lastupdate) . "\\r");
++ my($ts);
++ $ts = localtime($lastupdate);
++ $ts =~ s/:/\\:/g;
++ push (@complete, "COMMENT:Last update\\: " . $ts . "\\r");
+
+ if (time - 300 < $lastupdate)
+ {
+@@ -1040,7 +1046,10 @@ sub process_node {
+ push @rrd_sum, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time};
+ }
+ push @rrd_sum, @rrd;
+- push (@rrd_sum, "COMMENT:Last update: " . localtime($lastupdate) . "\\r");
++ my($ts2);
++ $ts2 = localtime($lastupdate);
++ $ts2 =~ s/:/\\:/g;
++ push (@rrd_sum, "COMMENT:Last update\\: " . $ts2 . "\\r");
+
+ my $labelled = 0;
+ my @defined = ();