Last stable version of Munin, node version.

Munin is a system monitoring and graphing tool. Project homepage
is located at http://munin-monitoring.org/
This commit is contained in:
Francois Tigeot 2011-01-25 14:30:37 +00:00 committed by Thomas Klausner
parent a5fa729f26
commit 2ecbdf2bdb
7 changed files with 439 additions and 0 deletions

7
munin-node/DESCR Normal file
View file

@ -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).

12
munin-node/MESSAGE Normal file
View file

@ -0,0 +1,12 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
Plugins can be auto-configured with "munin-node-configure --shell | sh"
You may also want to add an entry such as
${VARBASE}/log/munin/munin-node.log munin:munin 644 7 * 24 Z
to /etc/newsyslog.conf to have the node log rotated.
===========================================================================

119
munin-node/Makefile Normal file
View file

@ -0,0 +1,119 @@
# $NetBSD: Makefile,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
#
DISTNAME= munin-${VER}
PKGNAME= munin-node-${VER}
VER= 1.4.5
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://munin-monitoring.org/
COMMENT= System monitoring tool, client version
LICENSE= gnu-gpl-v2
PKG_DESTDIR_SUPPORT= destdir
DEPENDS+= p5-Net-Server>=0:../../net/p5-Net-Server
#DEPENDS+= munin-doc>=1.3.1:../../sysutils/munin-doc
.include "../../mk/bsd.prefs.mk"
USE_TOOLS+= perl:run tar
USE_TOOLS+= gmake
USE_PKGINSTALL= YES
WRKSRC= ${WRKDIR}/${DISTNAME}
PLIST_VARS+= aix freebsd linux netbsd sunos
.if ${OPSYS} == "AIX"
PLIST.aix= yes
.endif
.if ${OPSYS} == "FreeBSD"
PLIST.freebsd= yes
.endif
.if ${OPSYS} == "Linux"
PLIST.linux= yes
.endif
.if ${OPSYS} == "NetBSD"
PLIST.netbsd= yes
.endif
.if ${OPSYS} == "SunOS"
PLIST.sunos= yes
.endif
PKG_GROUPS_VARS+= MUNIN_GROUP
PKG_USERS_VARS+= MUNIN_USER
USERGROUP_PHASE= pre-install
MUNIN_GROUP?= munin
MUNIN_USER?= munin
PKG_GROUPS= ${MUNIN_GROUP}
PKG_USERS= ${MUNIN_USER}:${MUNIN_GROUP}
PKG_GECOS.${MUNIN_USER}= Munin user
PKG_SYSCONFSUBDIR?= munin
REPLACE_PERL+= node/sbin/munin-node
REPLACE_PERL+= node/node.d/*.in
STATEDIR?= ${VARBASE}/munin/plugin-state
MUNIN_RUN?= ${VARBASE}/run/munin
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-node install-node-plugins
BUILD_TARGET= build
#MAKE_ENV+= PERL5_SITELIB=${PERL5_SITELIB}
MAKE_ENV+= PREFIX=${PREFIX}
MAKE_ENV+= CONFDIR=${PKG_SYSCONFDIR}
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}
FILES_SUBST+= MUNIN_RUN=${MUNIN_RUN:Q}
FILES_SUBST+= MUNIN_USER=${MUNIN_USER:Q}
FILES_SUBST+= MUNIN_GROUP=${MUNIN_GROUP:Q}
MESSAGE_SUBST+= VARBASE=${VARBASE:Q}
BUILD_DEFS+= VARBASE
RCD_SCRIPTS+= munin-node
EGDIR= ${PREFIX}/share/examples/munin
CONF_FILES+= ${EGDIR}/munin-node.conf ${PKG_SYSCONFDIR}/munin-node.conf
INSTALLATION_DIRS+= ${EGDIR}
pre-configure:
cd ${FILESDIR}; ${TAR} cf - . | (cd ${WRKSRC}; ${TAR} xfp -)
post-install:
${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf ${DESTDIR}${EGDIR}
.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"

159
munin-node/PLIST Normal file
View file

@ -0,0 +1,159 @@
@comment $NetBSD: PLIST,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
${PLIST.linux}lib/munin/plugins/acpi
lib/munin/plugins/amavis
lib/munin/plugins/apache_accesses
lib/munin/plugins/apache_processes
lib/munin/plugins/apache_volume
lib/munin/plugins/apc_envunit_
lib/munin/plugins/apc_nis
${PLIST.linux}lib/munin/plugins/apt
${PLIST.linux}lib/munin/plugins/apt_all
lib/munin/plugins/bind9
lib/munin/plugins/bind9_rndc
lib/munin/plugins/courier_
lib/munin/plugins/courier_mta_mailqueue
lib/munin/plugins/courier_mta_mailstats
lib/munin/plugins/courier_mta_mailvolume
${PLIST.linux}lib/munin/plugins/cps_
lib/munin/plugins/cpu
lib/munin/plugins/cupsys_pages
lib/munin/plugins/df
${PLIST.linux}lib/munin/plugins/df_abs
lib/munin/plugins/df_inode
lib/munin/plugins/dhcpd3
${PLIST.linux}lib/munin/plugins/entropy
lib/munin/plugins/exim_mailqueue
lib/munin/plugins/exim_mailqueue_alt
lib/munin/plugins/exim_mailstats
${PLIST.linux}lib/munin/plugins/files_
lib/munin/plugins/foldingathome
lib/munin/plugins/foldingathome_rank
lib/munin/plugins/foldingathome_wu
${PLIST.linux}lib/munin/plugins/forks
${PLIST.netbsd}lib/munin/plugins/forks
${PLIST.sunos}lib/munin/plugins/fs_df
${PLIST.sunos}lib/munin/plugins/fs_inodes
${PLIST.linux}lib/munin/plugins/fw_conntrack
${PLIST.linux}lib/munin/plugins/fw_forwarded_local
${PLIST.linux}lib/munin/plugins/fw_packets
lib/munin/plugins/hddtemp
lib/munin/plugins/hddtemp2
lib/munin/plugins/hddtemp_smartctl
lib/munin/plugins/hddtempd
${PLIST.linux}lib/munin/plugins/i2c
${PLIST.linux}lib/munin/plugins/i2c_fan
lib/munin/plugins/if_
${PLIST.linux}lib/munin/plugins/if_err_
${PLIST.netbsd}lib/munin/plugins/if_errcoll_
${PLIST.freebsd}lib/munin/plugins/if_errcoll_
${PLIST.linux}lib/munin/plugins/interrupts
${PLIST.netbsd}lib/munin/plugins/interrupts
lib/munin/plugins/iostat
${PLIST.linux}lib/munin/plugins/iostat_ios
${PLIST.sunos}lib/munin/plugins/io_busy_
${PLIST.sunos}lib/munin/plugins/io_bytes_
${PLIST.sunos}lib/munin/plugins/io_ops_
${PLIST.netbsd}lib/munin/plugins/iostat_ops
${PLIST.linux}lib/munin/plugins/ip_
lib/munin/plugins/ipac-ng
lib/munin/plugins/ircu
${PLIST.linux}lib/munin/plugins/irqstats
${PLIST.netbsd}lib/munin/plugins/irqstats
lib/munin/plugins/load
lib/munin/plugins/loggrep
lib/munin/plugins/mailman
lib/munin/plugins/mailscanner
lib/munin/plugins/mbmon_
lib/munin/plugins/memory
${PLIST.netbsd}lib/munin/plugins/memory_pools
${PLIST.netbsd}lib/munin/plugins/memory_types
lib/munin/plugins/mhttping
lib/munin/plugins/multips
lib/munin/plugins/munin_update
lib/munin/plugins/mysql_bytes
lib/munin/plugins/mysql_isam_space_
lib/munin/plugins/mysql_queries
lib/munin/plugins/mysql_slowqueries
lib/munin/plugins/mysql_threads
lib/munin/plugins/named
${PLIST.linux}lib/munin/plugins/netopia
lib/munin/plugins/netstat
${PLIST.linux}lib/munin/plugins/nfs_client
${PLIST.netbsd}lib/munin/plugins/nfs_client
${PLIST.linux}lib/munin/plugins/nfsd
${PLIST.netbsd}lib/munin/plugins/nfsd
lib/munin/plugins/ntp_
lib/munin/plugins/ntp_kernel_err
lib/munin/plugins/ntp_kernel_pll_freq
lib/munin/plugins/ntp_kernel_pll_off
lib/munin/plugins/ntp_states
lib/munin/plugins/nut_misc
lib/munin/plugins/nut_volts
${PLIST.freebsd}lib/munin/plugins/open_files
${PLIST.linux}lib/munin/plugins/open_files
${PLIST.netbsd}lib/munin/plugins/open_files
${PLIST.linux}lib/munin/plugins/open_inodes
${PLIST.sunos}lib/munin/plugins/paging_in
${PLIST.sunos}lib/munin/plugins/paging_out
lib/munin/plugins/perdition
lib/munin/plugins/ping_
lib/munin/plugins/plugins.history
lib/munin/plugins/pm3users_
lib/munin/plugins/pop_stats
${PLIST.linux}lib/munin/plugins/port_
lib/munin/plugins/postfix_mailqueue
lib/munin/plugins/postfix_mailstats
lib/munin/plugins/postfix_mailvolume
lib/munin/plugins/processes
lib/munin/plugins/ps_
lib/munin/plugins/psu_
lib/munin/plugins/samba
lib/munin/plugins/sendmail_mailqueue
lib/munin/plugins/sendmail_mailstats
lib/munin/plugins/sendmail_mailtraffic
${PLIST.linux}lib/munin/plugins/sensors_
${PLIST.netbsd}lib/munin/plugins/sensors_
lib/munin/plugins/smart_
lib/munin/plugins/snmp__cpuload
lib/munin/plugins/snmp__df
lib/munin/plugins/snmp__fc_if_
lib/munin/plugins/snmp__fc_if_err_
lib/munin/plugins/snmp__if_
lib/munin/plugins/snmp__if_err_
lib/munin/plugins/snmp__load
lib/munin/plugins/snmp__processes
lib/munin/plugins/snmp__sensors_fsc_bx_fan
lib/munin/plugins/snmp__sensors_fsc_bx_temp
lib/munin/plugins/snmp__sensors_fsc_fan
lib/munin/plugins/snmp__sensors_fsc_temp
lib/munin/plugins/snmp__sensors_mbm_fan
lib/munin/plugins/snmp__sensors_mbm_temp
lib/munin/plugins/snmp__sensors_mbm_volt
lib/munin/plugins/snmp__users
lib/munin/plugins/spamstats
lib/munin/plugins/squid_cache
lib/munin/plugins/squid_icp
lib/munin/plugins/squid_requests
lib/munin/plugins/squid_traffic
lib/munin/plugins/surfboard
${PLIST.aix}lib/munin/plugins/swap
${PLIST.freebsd}lib/munin/plugins/swap
${PLIST.linux}lib/munin/plugins/swap
${PLIST.netbsd}lib/munin/plugins/swap
${PLIST.netbsd}lib/munin/plugins/swap_size
lib/munin/plugins/sybase_space
${PLIST.sunos}lib/munin/plugins/temperature
${PLIST.freebsd}lib/munin/plugins/uptime
${PLIST.linux}lib/munin/plugins/uptime
${PLIST.netbsd}lib/munin/plugins/uptime
${PLIST.sunos}lib/munin/plugins/uptime
${PLIST.linux}lib/munin/plugins/users
${PLIST.linux}lib/munin/plugins/vlan_
${PLIST.linux}lib/munin/plugins/vlan_inetuse_
${PLIST.linux}lib/munin/plugins/vlan_linkuse_
lib/munin/plugins/vmstat
sbin/munin-node
sbin/munin-node-configure
sbin/munin-run
share/examples/munin/munin-node.conf
share/examples/rc.d/munin-node

6
munin-node/distinfo Normal file
View file

@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
SHA1 (munin-1.4.5.tar.gz) = bd1e8ad1fe1cfade1de9c28f3ad69bf35ca495ca
RMD160 (munin-1.4.5.tar.gz) = 883aa4baacfa5be1ec6a83737d5d241c40ad6912
Size (munin-1.4.5.tar.gz) = 1231622 bytes
SHA1 (patch-aa) = bad7c649a79e1a9f4355bf8f8ae77fdd62267750

View file

@ -0,0 +1,61 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: munin-node.sh,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
#
# PROVIDE: munin-node
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start munin-node:
#
# munin_node=YES
#
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="munin_node"
rcvar=$name
command=@PREFIX@/sbin/munin-node
command_interpreter=@PERL@
pidfile="@VARBASE@/run/munin/munin-node.pid"
required_files=@PKG_SYSCONFDIR@/munin-node.conf
stop_cmd="munin_node_stop"
# Net::Server breaks rc.subr's techniques for detecting whether the
# process running at a certain PID is actually the process we wish to
# stop. Just unconditionally send SIGTERM to the PID instead.
#
munin_node_stop()
{
@ECHO@ "Stopping ${name}."
if [ -f ${pidfile} ]; then
pid=`@HEAD@ -1 ${pidfile}`
doit="kill ${pid}"
if ! eval $doit && [ -z "$rc_force" ]; then
return 1
fi
wait_for_pids $pid
fi
@RM@ -f ${pidfile}
}
if [ ! -d @STATEDIR@ ]; then
mkdir @STATEDIR@
chown @MUNIN_USER@:@MUNIN_GROUP@ @STATEDIR@
fi
if [ ! -d @MUNIN_RUN@ ]; then
mkdir @MUNIN_RUN@
chown @MUNIN_USER@:@MUNIN_GROUP@ @MUNIN_RUN@
fi
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
echo -n " ${name}"
exec ${command} ${command_args}
fi

View file

@ -0,0 +1,75 @@
$NetBSD: patch-aa,v 1.1 2011/01/25 14:30:37 ftigeot Exp $
--- Makefile.config.orig 2009-11-06 14:35:44.000000000 +0000
+++ Makefile.config
@@ -17,29 +17,29 @@
#
# the base of the Munin installation.
#
-PREFIX = $(DESTDIR)/opt/munin
+UPREFIX = $(DESTDIR)$(PREFIX)
# Where Munin keeps its configurations (server.conf, client.conf, ++)
-CONFDIR = $(DESTDIR)/etc/opt/munin
+CONFDIR ?= $(UPREFIX)/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)/share/doc/munin
# Where to put man pages
-MANDIR = $(PREFIX)/man
+MANDIR = $(UPREFIX)/${PKGMANDIR}
# Where to put internal binaries and plugin repository
-LIBDIR = $(PREFIX)/lib
+LIBDIR = $(UPREFIX)/lib/munin
# Server only - Output directory
-HTMLDIR = $(PREFIX)/www/docs
-CGIDIR = $(PREFIX)/www/cgi
+HTMLDIR = $(UPREFIX)/www/munin/data
+CGIDIR = $(UPREFIX)/www/cgi-bin
# Server only - spool directory for data gathered from nodes by
# munin-gather - experimental. Place on ramdisk to make munin
@@ -52,7 +52,7 @@ SSPOOLDIR = $(PREFIX)/spool
# SSPOOLDIR := /tmp/muninspool
# 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
@@ -66,7 +66,7 @@ LOGDIR = $(PREFIX)/log/munin
STATEDIR = $(DESTDIR)/var/run/munin
# The perl interpreter to use
-PERL := $(shell which perl)
+PERL := ${PERL5}
# The python interpreter to use (used by some plugins)
PYTHON := /usr/bin/env python
@@ -126,9 +126,10 @@ PLUGINUSER := nobody
# Which command to use to check if the USER and GROUP to run Munin as, exists.
# These will work on most modern OSes:
#
-GETENT := $(shell which getent || which true 2>/dev/null)
-CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
-CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. 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"))
+
+
# For OSX, comment out the previous two lines and comment in these
#