summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhe <he>2006-06-04 20:53:56 +0000
committerhe <he>2006-06-04 20:53:56 +0000
commit2da2e13a53f2105d518f4fb405e63d24757b515b (patch)
treee56692e95f6d1f17355080390a79736c4d4ee8ac
parent9099b62bbc6bd098dc451f916bcecf89789ad4ed (diff)
downloadpkgsrc-2da2e13a53f2105d518f4fb405e63d24757b515b.tar.gz
Import the client version of the Munin system monitoring/graphing
tool -- project homepage is at http://munin.sourceforge.net/ This package has added support for NetBSD, via a number of new plugin scripts where specific steps needs to be taken to collect information. I also modified the ntp_ plugin script to make it possible to not plot the NTP poll delay, leaving just jitter and offset, which IMO produces a more telling graph.
-rw-r--r--sysutils/munin-node/DESCR7
-rw-r--r--sysutils/munin-node/MESSAGE6
-rw-r--r--sysutils/munin-node/Makefile84
-rw-r--r--sysutils/munin-node/PLIST136
-rw-r--r--sysutils/munin-node/distinfo9
-rw-r--r--sysutils/munin-node/files/munin-node.sh36
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/cpu.in133
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/df.in76
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/df_inode.in91
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/forks.in75
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/if_.in80
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/if_errcoll_.in76
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/interrupts.in93
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/iostat.in117
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/iostat_ops.in117
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/irqstats.in84
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/load.in122
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/memory.in89
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/memory_pools.in143
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/memory_types.in88
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/netstat.in94
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/nfs_client.in82
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/nfsd.in82
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/open_files.in78
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/processes.in52
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/sensors_.in166
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/swap.in74
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/uptime.in63
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/vmstat.in102
-rw-r--r--sysutils/munin-node/files/node/node.d/ntp_kernel_err.in43
-rw-r--r--sysutils/munin-node/files/node/node.d/ntp_kernel_pll_freq.in50
-rw-r--r--sysutils/munin-node/files/node/node.d/ntp_kernel_pll_off.in43
-rw-r--r--sysutils/munin-node/patches/patch-aa89
-rw-r--r--sysutils/munin-node/patches/patch-ab13
-rw-r--r--sysutils/munin-node/patches/patch-ac40
-rw-r--r--sysutils/munin-node/patches/patch-ad21
36 files changed, 2754 insertions, 0 deletions
diff --git a/sysutils/munin-node/DESCR b/sysutils/munin-node/DESCR
new file mode 100644
index 00000000000..73694b6a6ff
--- /dev/null
+++ b/sysutils/munin-node/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-node/MESSAGE b/sysutils/munin-node/MESSAGE
new file mode 100644
index 00000000000..8cab8ad9907
--- /dev/null
+++ b/sysutils/munin-node/MESSAGE
@@ -0,0 +1,6 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+Plugins can be auto-configured with "munin-node-configure --shell | sh"
+
+===========================================================================
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
new file mode 100644
index 00000000000..772a8d1af53
--- /dev/null
+++ b/sysutils/munin-node/Makefile
@@ -0,0 +1,84 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/06/04 20:53:56 he Exp $
+#
+
+DISTNAME= ${PKGNAME:S:-node-:_:}
+PKGNAME= munin-node-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, client version
+
+DEPENDS+= p5-Net-Server>=0:../../net/p5-Net-Server
+DEPENDS+= p5-Net-SSLeay>=0:../../security/p5-Net-SSLeay
+BUILD_DEPENDS+= htmldoc>=0:../../www/htmldoc
+BUILD_DEPENDS+= html2text>=0:../../textproc/html2text
+
+USE_TOOLS+= perl
+USE_TOOLS+= gmake
+USE_PKGINSTALL= YES
+
+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-doc install-man
+INSTALL_TARGET+=install-node install-node-plugins
+
+BUILD_TARGET= build build-doc build-man
+
+#MAKE_ENV+= PERL=${PERL5:Q}
+#MAKE_ENV+= PERL5_SITELIB=${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}
+
+RCD_SCRIPTS+= munin-node
+
+EGDIR= ${PREFIX}/share/examples/munin
+
+CONF_FILES+= ${EGDIR}/munin-node.conf ${PKG_SYSCONFDIR}/munin/munin-node.conf
+
+
+pre-configure:
+ cd ${FILESDIR}; ${TAR} cf - . | (cd ${WRKSRC}; ${TAR} xfp -)
+
+post-install:
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/build/node/munin-node.conf ${EGDIR}
+
+#pre-install:
+# sed -e "s!@PKG_SYSCONFDIR@!${PKG_SYSCONFDIR}!; \
+# s!@PERL@!${PERL5}!; \
+# s!@PREFIX@!${PREFIX}!;" \
+# <${WRKSRC}/munin-node.sh \
+# > ${WRKSRC}/rc.d/munin-node
+
+.include "../../mk/bsd.pkg.mk"
+.include "../../lang/python/application.mk"
diff --git a/sysutils/munin-node/PLIST b/sysutils/munin-node/PLIST
new file mode 100644
index 00000000000..d729bdcee65
--- /dev/null
+++ b/sysutils/munin-node/PLIST
@@ -0,0 +1,136 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+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
+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
+lib/munin/plugins/cpu
+lib/munin/plugins/cupsys_pages
+lib/munin/plugins/df
+lib/munin/plugins/df_inode
+lib/munin/plugins/dhcpd3
+lib/munin/plugins/exim_mailqueue
+lib/munin/plugins/exim_mailqueue_alt
+lib/munin/plugins/exim_mailstats
+lib/munin/plugins/foldingathome
+lib/munin/plugins/foldingathome_rank
+lib/munin/plugins/foldingathome_wu
+lib/munin/plugins/forks
+lib/munin/plugins/hddtemp
+lib/munin/plugins/hddtemp2
+lib/munin/plugins/hddtemp_smartctl
+lib/munin/plugins/hddtempd
+lib/munin/plugins/if_
+lib/munin/plugins/if_errcoll_
+lib/munin/plugins/interrupts
+lib/munin/plugins/iostat
+lib/munin/plugins/iostat_ops
+lib/munin/plugins/ipac-ng
+lib/munin/plugins/ircu
+lib/munin/plugins/irqstats
+lib/munin/plugins/load
+lib/munin/plugins/loggrep
+lib/munin/plugins/mailman
+lib/munin/plugins/mailscanner
+lib/munin/plugins/memory
+lib/munin/plugins/memory_pools
+lib/munin/plugins/memory_types
+lib/munin/plugins/mhttping
+lib/munin/plugins/multips
+lib/munin/plugins/munin_graph
+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
+lib/munin/plugins/netstat
+lib/munin/plugins/nfs_client
+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
+lib/munin/plugins/open_files
+lib/munin/plugins/perdition
+lib/munin/plugins/ping_
+lib/munin/plugins/plugins.history
+lib/munin/plugins/pm3users_
+lib/munin/plugins/pop_stats
+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
+lib/munin/plugins/sensors_
+lib/munin/plugins/smart_
+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
+lib/munin/plugins/swap
+lib/munin/plugins/sybase_space
+lib/munin/plugins/uptime
+lib/munin/plugins/vmstat
+man/man5/munin-node.conf.5
+man/man5/munin.conf.5
+man/man8/munin-cron.8
+man/man8/munin-graph.8
+man/man8/munin-html.8
+man/man8/munin-limits.8
+man/man8/munin-node.8
+man/man8/munin-run.8
+man/man8/munin-update.8
+sbin/munin-node
+sbin/munin-node-configure
+sbin/munin-node-configure-snmp
+sbin/munin-run
+share/doc/munin/COPYING
+share/doc/munin/README.api
+share/doc/munin/README.plugins
+share/doc/munin/munin-doc.html
+share/doc/munin/munin-doc.pdf
+share/doc/munin/munin-doc.txt
+share/doc/munin/munin-faq.html
+share/doc/munin/munin-faq.pdf
+share/doc/munin/munin-faq.txt
+share/examples/munin/munin-node.conf
+share/examples/rc.d/munin-node
+@comment pkg-specific directories:
+@dirrm share/doc/munin
+@dirrm lib/munin/plugins
+@dirrm lib/munin
diff --git a/sysutils/munin-node/distinfo b/sysutils/munin-node/distinfo
new file mode 100644
index 00000000000..5e4838c30e2
--- /dev/null
+++ b/sysutils/munin-node/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/06/04 20:53:57 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) = f4c75a11a5fa026d968a2685f55061c74f51e537
+SHA1 (patch-ab) = bb0f63cdef893d8c224cdd03a4a4125d03f85f80
+SHA1 (patch-ac) = 9ef503b4d20f65e990c332c7789188a6fbad618e
+SHA1 (patch-ad) = 8accd3875324035f2c95903fc37cee4b4a55948a
diff --git a/sysutils/munin-node/files/munin-node.sh b/sysutils/munin-node/files/munin-node.sh
new file mode 100644
index 00000000000..a95e7334da4
--- /dev/null
+++ b/sysutils/munin-node/files/munin-node.sh
@@ -0,0 +1,36 @@
+#! /bin/sh
+#
+# $NetBSD: munin-node.sh,v 1.1.1.1 2006/06/04 20:53:57 he 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@
+required_files=@PKG_SYSCONFDIR@/munin/munin-node.conf
+
+if [ ! -d @STATEDIR@ ]; then
+ mkdir @STATEDIR@
+ chown munin:munin /var/run/munin
+fi
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ echo -n " ${name}"
+ exec ${command} ${command_args}
+fi
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/cpu.in b/sysutils/munin-node/files/node/node.d.netbsd/cpu.in
new file mode 100755
index 00000000000..2a47984cc84
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/cpu.in
@@ -0,0 +1,133 @@
+#!/bin/sh
+#
+# Plugin to monitor CPU usage.
+#
+# Usage: Place in /etc/munin/node.d/ (or link it there using ln -s)
+#
+# Parameters understood:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: cpu.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers - optional - used by installation scripts and
+# munin-config:
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /sbin/sysctl ]; then
+ /sbin/sysctl kern.cp_time > /dev/null
+ if [ $? = "0" ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f15 -d' '`
+ PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
+ NCPU=`/sbin/sysctl -n hw.ncpu`
+ if [ "$scaleto100" = yes ]; then
+ CDEF="${STATUNITS},/,100,*,$NCPU,/"
+ PERCENT=100
+ else
+ CDEF="${STATUNITS},/,100,*"
+ PERCENT=$(($NCPU*100))
+ fi
+# SYSWARNING=$PERCENT*30/100
+# SYSCRITICAL=$PERCENT*50/100
+# INTWARNING=$PERCENT*80/100
+# USRWARNING=$PERCENT*80/100
+
+ echo 'graph_title CPU usage (' $NCPU ' CPUs)'
+ echo 'graph_order system interrupt user nice idle'
+ echo "graph_args --base 1000 -r --lower-limit 0 --upper-limit $PERCENT "
+ echo 'graph_vlabel %'
+ echo 'graph_scale no'
+ echo 'graph_info This graph shows how CPU time is spent.'
+ echo 'graph_category system'
+ echo 'graph_period second'
+
+ echo 'system.label system'
+ echo 'system.draw AREA'
+ echo 'system.max 5000'
+ echo 'system.type DERIVE'
+ echo 'system.min 0'
+# echo "system.warning $SYSWARNING"
+# echo "system.critical $SYSCRITICAL"
+ echo 'system.info CPU time spent by the kernel in system activities'
+ echo "system.cdef system,$CDEF"
+
+ echo 'interrupt.label interrupt'
+ echo 'interrupt.draw STACK'
+ echo 'interrupt.max 5000'
+# echo "interrupt.warning $INTWARNING"
+ echo 'interrupt.type DERIVE'
+ echo 'interrupt.min 0'
+ echo 'interrupt.info CPU time spent by the kernel processing interrupts'
+ echo "interrupt.cdef interrupt,$CDEF"
+
+ echo 'user.label user'
+ echo 'user.draw STACK'
+ echo 'user.max 5000'
+# echo "user.warning $USRWARNING"
+ echo 'user.type DERIVE'
+ echo 'user.info CPU time spent by normal programs and daemons'
+ echo 'user.min 0'
+ echo "user.cdef user,$CDEF"
+
+ echo 'nice.label nice'
+ echo 'nice.draw STACK'
+ echo 'nice.max 5000'
+ echo 'nice.type DERIVE'
+ echo 'nice.info CPU time spent by nice(1)d programs'
+ echo 'nice.min 0'
+ echo "nice.cdef nice,$CDEF"
+
+ echo 'idle.label idle'
+ echo 'idle.draw STACK'
+ echo 'idle.max 5000'
+ echo 'idle.type DERIVE'
+ echo 'idle.info Idle CPU time'
+ echo 'idle.min 0'
+ echo "idle.cdef idle,$CDEF"
+
+ exit 0
+fi
+
+/sbin/sysctl kern.cp_time | awk '{
+ gsub(",", "");
+ split($0, a);
+ print "system.value " a[10];
+ print "interrupt.value " a[13];
+ print "user.value " a[4];
+ print "nice.value " a[7];
+ print "idle.value " a[16];
+}'
+
+
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/df.in b/sysutils/munin-node/files/node/node.d.netbsd/df.in
new file mode 100755
index 00000000000..e345f1c4c00
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/df.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Script to monitor disk usage.
+#
+# Parameters understood:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: df.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers (optional - used by munin-config and installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+MAXLABEL=20
+
+TYPES=noprocfs,devfs,fdescfs,ptyfs,kernfs,nfs
+
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Filesystem usage (in %)'
+ echo 'graph_args --upper-limit 100 -l 0'
+ echo 'graph_vlabel %'
+ echo 'graph_category disk'
+ echo 'graph_info This graph shows disk usage on the machine.'
+ mfs=0
+ /bin/df -P -t $TYPES | tail +2 | grep -v "//" | while read i; do
+ case $i in
+ mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
+ *) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
+ esac
+ echo -n "$name.label "
+ echo $i | awk "{
+ dir=\$6;
+ if (length(dir) <= $MAXLABEL)
+ print dir
+ else
+ printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
+ print \"$name.info \" \$6 \" -> \" \$1;
+ }"
+ echo "$name.warning 92"
+ echo "$name.critical 98"
+ done
+ exit 0
+fi
+
+mfs=0
+/bin/df -P -t $TYPES | tail +2 | grep -v "//" | while read i; do
+ case $i in
+ mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
+ *) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
+ esac
+ echo -n "$name.value "
+ echo $i | awk '{ print $5 }' | cut -f1 -d%
+done
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/df_inode.in b/sysutils/munin-node/files/node/node.d.netbsd/df_inode.in
new file mode 100755
index 00000000000..d7e79245270
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/df_inode.in
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# Plugin to monitor inode-usage.
+#
+# Parameters understood:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: df_inode.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - used by munin-config and installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+MAXLABEL=20
+
+TYPES=noprocfs,devfs,fdescfs,ptyfs,kernfs,nfs
+
+print_values() {
+ mfs=0
+ /bin/df -P -i -t $TYPES | tail +2 | grep -v "//" | \
+ while read i; do
+ case $i in
+ mfs:*) name=mfs$mfs; mfs=`expr $mfs + 1`;;
+ *) name=`echo $i | awk '{
+ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'`
+ ;;
+ esac
+ echo -n "$name.value "
+ echo $i | awk '{ print $8 }' | cut -f1 -d%
+ done
+}
+
+if [ "$1" = "autoconf" ]; then
+ if [ "`print_values`" = "" ] ; then
+ echo no
+ exit 1
+ else
+ echo yes
+ exit 0
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Inode usage (in %)'
+ echo 'graph_args --upper-limit 100 -l 0'
+ echo 'graph_vlabel %'
+ echo 'graph_category disk'
+ echo 'graph_info This graph shows the inode usage for the partitions of types that use inodes.'
+ /bin/df -P -i -t $TYPES | tail +2 | grep -v "//" | awk "
+ BEGIN {
+ mfs = 0
+ }
+ {
+ name = \$1
+ dir = \$9
+ if (\$1 ~ /^mfs:/) {
+ name = \"mfs\" mfs
+ mfs = mfs + 1
+ } else {
+ gsub(/[^a-zA-Z0-9_]/, \"_\", name)
+ }
+ if (length(dir) <= $MAXLABEL)
+ print name \".label \" dir
+ else
+ printf (\"%s.label ...%s\n\", name, substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
+ print name \".info \" dir \" -> \" name
+ print name \".warning 92\"
+ print name \".critical 98\"
+ }"
+ exit 0
+fi
+
+print_values
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/forks.in b/sysutils/munin-node/files/node/node.d.netbsd/forks.in
new file mode 100755
index 00000000000..a86ee79f536
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/forks.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of forks per second on the machine.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: forks.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magick markers (optional - used by munin-config and som installation
+# scripts):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ echo yes
+ exit 0
+ else
+ echo "no (no /usr/bin/vmstat executable)"
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Fork rate'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_vlabel forks / ${graph_period}'
+ echo 'graph_category processes'
+ echo 'graph_info This graph shows the number of forks (new processes started) per second.'
+
+ echo 'forks.label forks'
+ echo 'forks.type DERIVE'
+ echo 'forks.min 0'
+ echo 'forks.max 100000'
+ echo 'forks.info The number of forks per second.'
+
+ echo 'forkblk.label forks blocked parent'
+ echo 'forkblk.type DERIVE'
+ echo 'forkblk.min 0'
+ echo 'forkblk.max 100000'
+ echo 'forkblk.info The number of forks which blocked the parent process.'
+
+ echo 'forksh.label shared addrs w. parent'
+ echo 'forksh.type DERIVE'
+ echo 'forksh.min 0'
+ echo 'forksh.max 100000'
+ echo 'forksh.info The number of forks which shared address space with the parent process.'
+
+ exit 0
+fi
+
+vmstat -s | awk '
+/forks total$/ { print "forks.value " $1; }
+/forks blocked parent$/ { print "forkblk.value " $1; }
+/forks shared address space with parent$/ { print "forksh.value " $1; }
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/if_.in b/sysutils/munin-node/files/node/node.d.netbsd/if_.in
new file mode 100755
index 00000000000..3a7fbcc4919
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/if_.in
@@ -0,0 +1,80 @@
+#!/bin/sh
+#
+# Wildcard-plugin to monitor network interfaces. To monitor an
+# interface, link if_<interface> to this file. E.g.
+#
+# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
+#
+# ...will monitor eth0.
+#
+# Any device found in /usr/bin/netstat can be monitored.
+#
+# $Log: if_.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers (optional - used by munin-config and some installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf suggest
+
+
+INTERFACE=`basename $0 | sed 's/^if_//g'`
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/netstat ]; then
+ echo yes
+ exit 0
+ else
+ echo "no (/usr/bin/netstat not found)"
+ exit 1
+ fi
+fi
+
+if [ "$1" = "suggest" ]; then
+ if [ -x /usr/bin/netstat ]; then
+ netstat -i -b | sed -n -e '/^faith/d' -e '/^lo0/d' -e '/<Link.*>/s/\** .*//p'
+ exit 0
+ else
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo "graph_order rbytes obytes"
+ echo "graph_title $INTERFACE traffic"
+ echo 'graph_args --base 1000'
+ echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
+ echo 'graph_category network'
+ echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes."
+
+ echo 'rbytes.label received'
+ echo 'rbytes.type COUNTER'
+ echo 'rbytes.graph no'
+ echo 'rbytes.cdef rbytes,8,*'
+
+ echo 'obytes.label bps'
+ echo 'obytes.type COUNTER'
+ echo 'obytes.negative rbytes'
+ echo 'obytes.cdef obytes,8,*'
+ echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface."
+ exit 0
+fi;
+
+/usr/bin/netstat -i -b -I $INTERFACE | awk '
+/<Link.*>/ {
+ print "rbytes.value ", $5;
+ print "obytes.value ", $6;
+}'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/if_errcoll_.in b/sysutils/munin-node/files/node/node.d.netbsd/if_errcoll_.in
new file mode 100755
index 00000000000..2c073b71af6
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/if_errcoll_.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Wildcard-plugin to monitor network interfaces. To monitor an
+# interface, link if_<interface> to this file. E.g.
+#
+# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
+#
+# ...will monitor eth0.
+#
+# Any device found in /usr/bin/netstat can be monitored.
+#
+# $Log: if_errcoll_.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - used by munin-config and some installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf suggest
+
+
+INTERFACE=`basename $0 | sed 's/^if_errcoll_//g'`
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/netstat ]; then
+ echo yes
+ exit 0
+ else
+ echo "no (/usr/bin/netstat not found)"
+ exit 1
+ fi
+fi
+
+if [ "$1" = "suggest" ]; then
+ if [ -x /usr/bin/netstat ]; then
+ netstat -i -b | sed -n -e '/^faith/d' -e '/^lo0/d' -e '/<Link.*>/s/\** .*//p'
+ exit 0
+ else
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+ echo "graph_order ierrors oerrors collisions"
+ echo "graph_title $INTERFACE Errors & Collisions"
+ echo 'graph_args --base 1000'
+ echo 'graph_vlabel events / ${graph_period}'
+ echo 'graph_category network'
+ echo "graph_info This graph shows the amount of errors and collisions on the $INTERFACE network interface."
+ echo 'ierrors.label Input Errors'
+ echo 'ierrors.type COUNTER'
+ echo 'oerrors.label Output Errors'
+ echo 'oerrors.type COUNTER'
+ echo 'collisions.label Collisions'
+ echo 'collisions.type COUNTER'
+ exit 0
+fi;
+
+/usr/bin/netstat -i -I $INTERFACE | awk '
+/<Link.*>/ {
+ print "ierrors.value", $6;
+ print "oerrors.value", $8;
+ print "collisions.value", $9;
+}'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/interrupts.in b/sysutils/munin-node/files/node/node.d.netbsd/interrupts.in
new file mode 100755
index 00000000000..9b0d315f9b2
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/interrupts.in
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of interrupts and context switches on a system.
+#
+# Idea and base from Ragnar Wisløff.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# $Log: interrupts.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+if [ "$1" = "config" ]; then
+ # The title of the graph
+ echo 'graph_title Interrupts & context switches'
+
+ # Arguments to "rrdtool graph". In this case, tell it that the
+ # lower limit of the graph is '0', and that 1k=1000 (not 1024)
+ echo 'graph_args --base 1000 -l 0'
+ # The Y-axis label
+ echo 'graph_vlabel interrupts & ctx switches / ${graph_period}'
+ # Graph category
+ echo 'graph_category system'
+ # Graph information
+ echo 'graph_info This graph shows the number of interrupts and context switches on the system. These are typically high on a busy system.'
+
+ echo 'devint.info Device interrupts come from hardware (exceptions, NMI, IRQ)'
+ echo 'softint.info Software interrupts are typically deferred processing from hardware interrupts'
+
+ echo 'ctx.info A context switch occurs when a multitasking operatings system suspends the currently running process, and starts executing another.'
+
+ # The fields. "label" is used in the legend. "label" is the only
+ # required subfield.
+ echo 'devint.label device interrupts'
+ echo 'softint.label software interrupts'
+ echo 'ctx.label context switches'
+
+ # Specify type
+ echo 'devint.type DERIVE'
+ echo 'softint.type DERIVE'
+ echo 'ctx.type DERIVE'
+
+ # Set max (should always be done with counters) Note: this is max
+ # per second.
+ echo 'devint.max 100000'
+ echo 'softint.max 100000'
+ echo 'ctx.max 100000'
+
+ echo 'devint.min 0'
+ echo 'softint.min 0'
+ echo 'ctx.min 0'
+
+ # Last, if run with the "config"-parameter, quit here (don't
+ # display any data)
+ exit 0
+fi
+
+# The real work
+
+vmstat -s | awk '
+/device interrupts$/ { print "devint.value " $1; }
+/context switches$/ { print "ctx.value " $1; }
+/software interrupts$/ { print "softint.value " $1; }
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/iostat.in b/sysutils/munin-node/files/node/node.d.netbsd/iostat.in
new file mode 100755
index 00000000000..77e95fe8dc3
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/iostat.in
@@ -0,0 +1,117 @@
+#!/bin/sh
+#
+# Plugin for watching io-bound traffic (in bytes) on disks.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: iostat.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magick markers (optional - used by munin-config and som installation
+# scripts):
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/sbin/iostat ]; then
+ echo yes
+ exit 0
+ else
+ echo "no (no /usr/sbin/iostat executable)"
+ exit 1
+ fi
+fi
+
+nf=`/usr/sbin/iostat -I -x | tail -1 | awk '{ print NF }'`
+if [ $nf -eq 5 ]; then
+ oldformat=true
+else
+ oldformat=false
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title IOstat by bytes'
+ echo 'graph_args --base 1024 -l 0 '
+
+ if ! $oldformat; then
+ echo 'graph_vlabel MB per ${graph_period} read (-) / written (+)'
+ else
+ echo 'graph_vlabel MB per ${graph_period} read+written'
+ fi
+
+ echo 'graph_category disk'
+ echo 'graph_info This graph shows the I/O to and from block devices'
+
+ drives=`/usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+// { print $1; }'`
+
+ echo -n 'graph_order'
+ for d in $drives; do
+ if $oldformat; then
+ echo -n ' '${d}'_io'
+ else
+ echo -n ' '${d}'_read '${d}'_write'
+ fi
+ done
+ echo
+
+ if $oldformat; then
+ for d in $drives; do
+ echo "${d}_io.label ${d}"
+ echo "${d}_io.info I/O on device ${d}"
+ echo "${d}_io.type DERIVE"
+ echo "${d}_io.max 2000"
+ echo "${d}_io.min 0"
+ done
+ else
+ for d in $drives; do
+ echo "${d}_read.label ${d}"
+ echo "${d}_read.type DERIVE"
+ echo "${d}_read.max 2000"
+ echo "${d}_read.min 0"
+ echo "${d}_read.graph no"
+
+ echo "${d}_write.label ${d}"
+ echo "${d}_write.info I/O on device ${d}"
+ echo "${d}_write.type DERIVE"
+ echo "${d}_write.max 2000"
+ echo "${d}_write.min 0"
+ echo "${d}_write.negative ${d}_read"
+ done
+ fi
+ exit 0
+fi
+
+if $oldformat; then
+ /usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+{
+ print $1 "_io.value " int($5);
+}
+'
+else
+ /usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+{
+ print $1 "_read.value " int($5);
+ print $1 "_write.value " int($9);
+}
+'
+fi
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/iostat_ops.in b/sysutils/munin-node/files/node/node.d.netbsd/iostat_ops.in
new file mode 100755
index 00000000000..7e234b3ab56
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/iostat_ops.in
@@ -0,0 +1,117 @@
+#!/bin/sh
+#
+# Plugin for watching io-bound traffic (in transfers) on disks.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: iostat_ops.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magick markers (optional - used by munin-config and som installation
+# scripts):
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/sbin/iostat ]; then
+ echo yes
+ exit 0
+ else
+ echo "no (no /usr/sbin/iostat executable)"
+ exit 1
+ fi
+fi
+
+nf=`/usr/sbin/iostat -I -x | tail -1 | awk '{ print NF }'`
+if [ $nf -eq 5 ]; then
+ oldformat=true
+else
+ oldformat=false
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title IOstat by transfers'
+ echo 'graph_args --base 1000 -l 0 '
+
+ if ! $oldformat; then
+ echo 'graph_vlabel Xfers per ${graph_period} read (-) / written (+)'
+ else
+ echo 'graph_vlabel Xfers per ${graph_period} read+written'
+ fi
+
+ echo 'graph_category disk'
+ echo 'graph_info This graph shows the I/O to and from block devices'
+
+ drives=`/usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+// { print $1; }'`
+
+ echo -n 'graph_order'
+ for d in $drives; do
+ if $oldformat; then
+ echo -n ' ' ${d}'_io'
+ else
+ echo -n ' ' ${d}'_read ' ${d}'_write '
+ fi
+ done
+ echo
+
+ if $oldformat; then
+ for d in $drives; do
+ echo "${d}_io.label ${d}"
+ echo "${d}_io.info I/O on device ${d}"
+ echo "${d}_io.type DERIVE"
+ echo "${d}_io.max 20000"
+ echo "${d}_io.min 0"
+ done
+ else
+ for d in $drives; do
+ echo "${d}_read.label ${d}"
+ echo "${d}_read.type DERIVE"
+ echo "${d}_read.max 20000"
+ echo "${d}_read.min 0"
+ echo "${d}_read.graph no"
+
+ echo "${d}_write.label ${d}"
+ echo "${d}_write.info I/O on device ${d}"
+ echo "${d}_write.type DERIVE"
+ echo "${d}_write.max 20000"
+ echo "${d}_write.min 0"
+ echo "${d}_write.negative ${d}_read"
+ done
+ fi
+ exit 0
+fi
+
+if $oldformat; then
+ /usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+{
+ print $1 "_io.value " $3;
+}
+'
+else
+ /usr/sbin/iostat -I -x | awk '
+/^device/ { next; }
+{
+ print $1 "_read.value " $3;
+ print $1 "_write.value " $7;
+}
+'
+fi
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/irqstats.in b/sysutils/munin-node/files/node/node.d.netbsd/irqstats.in
new file mode 100755
index 00000000000..4643a6407ce
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/irqstats.in
@@ -0,0 +1,84 @@
+#! /bin/sh
+#
+# Plugin to monitor the individual interrupt sources.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# $Log: irqstats.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+intr_sources () {
+ /usr/bin/vmstat -i | awk '
+/^interrupt/ { next; }
+/^Total/ { next; }
+{
+ s=substr($0, 1, 24);
+ gsub(" *$", "", s);
+ gsub(" ", "_", s);
+ print s;
+}
+'
+}
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Individual interrupts'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel interrupts / ${graph_period}'
+ echo 'graph_category system'
+ echo -n 'graph_order '
+ for i in `intr_sources`; do
+ echo -n ' intr_'${i}
+ done
+ echo
+
+ for i in `intr_sources`; do
+# echo 'intr_'${i}'.draw LINE'
+ echo 'intr_'${i}'.label' `echo $i | sed -e 's/_/ /g'`
+ echo 'intr_'${i}'.info Interrupt' `echo $i | sed -e 's/_/ /g'`
+ echo 'intr_'${i}'.type DERIVE'
+ echo 'intr_'${i}'.min 0'
+ done
+ exit 0
+fi
+
+/usr/bin/vmstat -i | awk '
+/^interrupt/ { next; }
+/^Total/ { next; }
+/[0-9]/{
+ s=substr($0, 1, 24);
+ gsub(" *$", "", s);
+ gsub(" ", "_", s);
+ print "intr_" s ".value " $(NF-1);
+}
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/load.in b/sysutils/munin-node/files/node/node.d.netbsd/load.in
new file mode 100755
index 00000000000..d5c070e23f8
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/load.in
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+# Plugin to monitor the load average on a system.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+# $Log: load.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+# If run with the "autoconf"-parameter, give our opinion on wether we
+# should be run on this system or not. This is optinal, and only used by
+# munin-config. In the case of this plugin, we should most probably
+# always be included.
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /sbin/sysctl ]; then
+ /sbin/sysctl vm.loadavg > /dev/null
+ if [ $? = "0" ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+NCPU=`/sbin/sysctl -n hw.ncpu`
+# If we fail for some reason, default to 1 cpu
+if [ $? != 0 ]; then NCPU=1; fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+if [ "$1" = "config" ]; then
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # The title of the graph
+ echo 'graph_title Load average'
+ # Arguments to "rrdtool graph". In this case, tell it that the
+ # lower limit of the graph is '0', and that 1k=1000 (not 1024)
+ echo 'graph_args --base 1000 -l 0'
+ # The Y-axis label
+ echo 'graph_vlabel load'
+ # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
+ # 420 milliload)
+ echo 'graph_noscale true'
+ # The category of the plugin. Defaults to "other".
+ echo 'graph_category system'
+ # The fields. "label" is used in the legend. "label" is the only
+ # required subfield.
+ echo 'load.label load'
+ # These two are optional. They are only used if you have
+ # configured your munin to tell a Nagios-server about any
+ # problems
+ echo 'load.warning ' $((10 * $NCPU))
+ echo 'load.critical 120'
+ # This one is purely to add an explanation to the web page. The first
+ # one is for the graph itself, while the second one is for the field
+ # "load".
+ echo 'graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").'
+ echo 'load.info Average load for the five minutes.'
+
+ # Last, if run with the "config"-parameter, quit here (don't
+ # display any data)
+ exit 0
+fi
+
+# If not run with any parameters at all (or only unknown ones), do the
+# real work - i.e. display the data. Almost always this will be
+# "value" subfield for every data field.
+
+echo -n "load.value "
+/sbin/sysctl vm.loadavg | cut -f3 -d' '
+
+# How could this plugin have been written in its simplest form?
+# Something like this:
+#
+# ---------------------
+# #!/bin/sh
+
+#
+# if [ "$1" = "config" ]; then
+
+# echo "graph_title Load average"
+# echo 'graph_args --base 1000 -l 0'
+# echo 'graph_vlabel load'
+# echo "load.label load"
+# exit 0
+# fi
+# echo -n "load.value "
+# cut -f1 -d' ' < /proc/loadavg
+# ---------------------
+#
+# Except for the Nagios-warnings (which most people don't have any need
+# for) and things used by installation scripts and munin-config (which
+# you don't need if you don't plan on submitting your plugin to the
+# pacakge), the two versions will work identically.
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/memory.in b/sysutils/munin-node/files/node/node.d.netbsd/memory.in
new file mode 100755
index 00000000000..7ac1b5ff86a
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/memory.in
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# Plugin to monitor memory usage.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - only used by munin-config)
+#
+# $Log: memory.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /sbin/sysctl ]; then
+ /sbin/sysctl hw.pagesize > /dev/null
+ if [ $? = "0" ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+PAGESIZE=`/sbin/sysctl -n hw.pagesize`
+MEMSIZE=`vmstat -s | awk '/pages managed/ { print $1 }'`
+MEMMAX=`echo 2k $PAGESIZE $MEMSIZE '*p' | dc`
+
+if [ "$1" = "config" ]; then
+ echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX
+ echo 'graph_title Memory usage'
+ echo 'graph_category system'
+ echo 'graph_info This graph shows what the machine uses its memory for.'
+
+ echo 'graph_order active inactive wired kernel free'
+
+ echo 'active.label active'
+ echo 'active.info pages recently statistically used'
+ echo 'active.draw AREA'
+
+ echo 'inactive.label inactive'
+ echo 'inactive.info pages recently statistically unused'
+ echo 'inactive.draw STACK'
+
+ echo 'wired.label wired'
+ echo 'wired.info pages that are fixed into memory'
+ echo 'wired.draw STACK'
+
+ echo 'kernel.label kernel'
+ echo 'kernel.info pages used by the kernel'
+ echo 'kernel.draw STACK'
+
+ echo 'free.label free'
+ echo 'free.info pages without data content'
+ echo 'free.draw STACK'
+
+ exit 0
+fi
+
+vmstat -s | awk -v bpp=$PAGESIZE '
+/pages managed$/ { managed = $1; }
+/pages free$/ { free = $1; print "free.value " $1 * bpp; }
+/pages active$/ { active = $1; print "active.value " $1 * bpp; }
+/pages inactive$/ { inactive = $1; print "inactive.value " $1 * bpp; }
+/pages wired$/ { wired = $1; print "wired.value " $1 * bpp; }
+END { kernel = managed - wired - inactive - active - free;
+ print "kernel.value " kernel * bpp; }'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/memory_pools.in b/sysutils/munin-node/files/node/node.d.netbsd/memory_pools.in
new file mode 100755
index 00000000000..e93202547d0
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/memory_pools.in
@@ -0,0 +1,143 @@
+#! /bin/sh
+#
+# Plugin to monitor NetBSD kernel memory pool usage.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - only used by munin-config)
+#
+# $Log: memory_pools.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+PAGESIZE=`/sbin/sysctl -n hw.pagesize`
+
+KMEM=`vmstat -s | awk -v bpp=$PAGESIZE '
+/pages managed$/ { managed = $1; }
+/pages free$/ { free = $1; }
+/pages active$/ { active = $1; }
+/pages inactive$/ { inactive = $1;}
+/pages wired$/ { wired = $1; }
+END { kernel = managed - wired - inactive - active - free;
+ print kernel * bpp; }'`
+
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_args --base 1024 -l 0 --vertical-label Bytes'
+ echo 'graph_title Kernel Pool Memory usage'
+ echo 'graph_category system'
+ echo 'graph_info This graph shows the kernel memory pool usage'
+ echo 'graph_order vnode ncache ffsino mbufs rest bufpl bufs'
+
+ echo 'vnode.label vnodes'
+ echo 'vnode.info vnode cache'
+ echo 'vnode.draw AREA'
+
+ echo 'ncache.label ncache'
+ echo 'ncache.info namei cache'
+ echo 'ncache.draw STACK'
+
+ echo 'ffsino.label ffs-i'
+ echo 'ffsino.info FFS inode cache'
+ echo 'ffsino.draw STACK'
+
+ echo 'mbufs.label mbufs'
+ echo 'mbufs.info network buffers (mbufs + mbuf clusters)'
+ echo 'mbufs.draw STACK'
+
+ echo 'rest.label rest'
+ echo 'rest.info sum of other memory pools'
+ echo 'rest.draw STACK'
+
+ echo 'bufpl.label bufpl'
+ echo 'bufpl.info buffer pool'
+ echo 'bufpl.draw STACK'
+
+ echo 'bufs.label bufs'
+ echo 'bufs.info buffer pools, for file metadata'
+ echo 'bufs.draw STACK'
+
+ exit 0
+fi
+
+vmstat -m -W > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ vmstat -m -W 2>/dev/null | awk '
+/^Memory resource pool statistics/ { inpool=1; next; }
+/^In use/ { inpool=0; next; }
+/^Name/ { next; }
+/^vnodepl/ && inpool { vnode = $10 * $11; next; }
+/^ncachepl/ && inpool { ncache = $10 * $11; next; }
+/^ffsinopl/ && inpool { ffsino = $10 * $11; next; }
+/^dino1pl/ && inpool { dinopl = $10 * $11; next; }
+/^buf.*k / && inpool { bufk += $10 * $11; next; }
+/^bufpl/ && inpool { bufpl = $10 * $11; next; }
+/^mbpl/ && inpool { mbufs += $10 * $11; next; }
+/^mclpl/ && inpool { mbufs += $10 * $11; next; }
+$16 != "0x200" && $16 != "0x600" && inpool { rest += $10 * $11; }
+END {
+ print "bufs.value " bufk;
+ print "bufpl.value " bufpl;
+ print "vnode.value " vnode;
+ print "ncache.value " ncache;
+ print "ffsino.value " ffsino;
+ print "mbufs.value " mbufs;
+ print "rest.value " rest;
+}'
+else
+ # Need to guess size of pool pages, may not be correct
+ # for small-memory machines (< 16MB)
+ vmstat -m 2>/dev/null | awk -v bpp=$PAGESIZE '
+/^Memory resource pool statistics/ { inpool=1; next; }
+/^In use/ { inpool=0; next; }
+/^Name/ { next; }
+/^vnodepl/ && inpool { vnode = $8 * bpp; next; }
+/^ncachepl/ && inpool { ncache = $8 * bpp; next; }
+/^ffsinopl/ && inpool { ffsino = $8 * bpp; next; }
+/^dino1pl/ && inpool { dinopl = $8 * bpp; next; }
+/^buf.*k / && inpool { bufk += $8 * 65536; next; }
+/^bufpl/ && inpool { bufpl = $8 * bpp; next; }
+/^mbpl/ && inpool { mbufs += $8 * bpp; next; }
+/^mclpl/ && inpool { mbufs += $8 * bpp; next; }
+/^kvakernel/ { next; }
+/^kvakmem/ { next; }
+inpool { rest += $8 * bpp; }
+END {
+ print "bufs.value " bufk;
+ print "bufpl.value " bufpl;
+ print "vnode.value " vnode;
+ print "ncache.value " ncache;
+ print "ffsino.value " ffsino;
+ print "mbufs.value " mbufs;
+ print "rest.value " rest;
+}'
+fi
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/memory_types.in b/sysutils/munin-node/files/node/node.d.netbsd/memory_types.in
new file mode 100755
index 00000000000..e55effaa54d
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/memory_types.in
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# Plugin to monitor memory usage by type.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - only used by munin-config)
+#
+# $Log: memory_types.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /sbin/sysctl ]; then
+ if /sbin/sysctl hw.pagesize > /dev/null 2>&1; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+PAGESIZE=`/sbin/sysctl -n hw.pagesize`
+MEMSIZE=`vmstat -s | awk '/pages managed/ { print $1 }'`
+MEMMAX=`echo 2k $PAGESIZE $MEMSIZE '*p' | dc`
+
+if [ "$1" = "config" ]; then
+ echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX
+ echo 'graph_title Memory usage by category'
+ echo 'graph_category system'
+ echo 'graph_info This graph shows how the machine uses its memory.'
+
+ echo 'graph_order exec anon file kernel free'
+
+ echo 'exec.label exec'
+ echo 'exec.info memory for cached executables'
+ echo 'exec.draw AREA'
+
+ echo 'anon.label anon'
+ echo 'anon.info anonymous memory'
+ echo 'anon.draw STACK'
+
+ echo 'file.label file'
+ echo 'file.info memory for cached non-executable files'
+ echo 'file.draw STACK'
+
+ echo 'kernel.label kernel'
+ echo 'kernel.info memory used by the kernel'
+ echo 'kernel.draw STACK'
+
+ echo 'free.label free'
+ echo 'free.info free memory'
+ echo 'free.draw STACK'
+
+ exit 0
+fi
+
+vmstat -s | awk -v bpp=$PAGESIZE '
+/pages managed$/ { managed = $1; }
+/pages free$/ { free = $1; print "free.value " $1 * bpp; }
+/anonymous pages$/{ anon = $1; print "anon.value " $1 * bpp; }
+/cached file pages$/{ file = $1; print "file.value " $1 * bpp; }
+/cached executable pages$/{ exec = $1; print "exec.value " $1 * bpp; }
+END { kernel = managed - anon - file - exec - free;
+ print "kernel.value " kernel * bpp; }'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/netstat.in b/sysutils/munin-node/files/node/node.d.netbsd/netstat.in
new file mode 100755
index 00000000000..1151e331636
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/netstat.in
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# Plugin to monitor network connections.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - only used by munin-config)
+#
+# $Log: netstat.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (optional - used by munin-config and some installation
+# scripts):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if ( netstat -s 2>/dev/null >/dev/null ); then
+ echo yes
+ exit 0
+ else
+ if [ $? -eq 127 ]
+ then
+ echo "no (netstat program not found)"
+ exit 1
+ else
+ echo no
+ exit 1
+ fi
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Netstat'
+ echo 'graph_args -l 0 --base 1000'
+ echo 'graph_vlabel active connections per ${graph_period}'
+ echo 'graph_category network'
+ echo 'graph_period second'
+ echo 'graph_info This graph shows the TCP activity of all the network interfaces combined.'
+
+ echo 'active.label active'
+ echo 'active.type DERIVE'
+ echo 'active.min 0'
+ echo 'active.max 50000'
+ echo 'active.info The number of active TCP openings per second.'
+
+ echo 'passive.label passive'
+ echo 'passive.type DERIVE'
+ echo 'passive.min 0'
+ echo 'passive.max 50000'
+ echo 'passive.info The number of passive TCP openings per second.'
+
+ echo 'failed.label failed'
+ echo 'failed.type DERIVE'
+ echo 'failed.min 0'
+ echo 'failed.max 50000'
+ echo 'failed.info The number of failed TCP connection attempts per second.'
+
+ echo 'resets.label resets'
+ echo 'resets.type DERIVE'
+ echo 'resets.min 0'
+ echo 'resets.max 50000'
+ echo 'resets.info The number of TCP connection resets.'
+
+ echo 'established.label established'
+ echo 'established.type DERIVE'
+ echo 'established.min 0'
+ echo 'established.max 50000'
+ echo 'established.info The number of currently open connections.'
+ exit 0
+fi
+
+netstat -s | awk '
+/connection requests/ { print "active.value " $1 }
+/connection accepts/ { print "passive.value " $1 }
+/bad connection/ { print "failed.value " $1 }
+/reset/ { print "resets.value " $1 }
+/connections established/ { print "established.value " $1 }'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/nfs_client.in b/sysutils/munin-node/files/node/node.d.netbsd/nfs_client.in
new file mode 100755
index 00000000000..38bb762b7c0
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/nfs_client.in
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Plugin to monitor NFS client traffic
+#
+# $Log: nfs_client.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+getnames () {
+ /usr/bin/nfsstat -c | awk '
+/RPC Counts/ { coll = 1; next; }
+/RPC Info/ { exit 0; }
+/[a-z]/ && coll {
+ for (n = 1; n <= NF; n++) {
+ print $n
+ }
+}
+'
+}
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/nfsstat ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title NFS Client'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_total total'
+ echo 'graph_category NFS'
+ for a in `getnames` ; do
+ echo "$a.label $a"
+ echo "$a.type DERIVE"
+ echo "$a.min 0"
+ done
+ exit 0
+fi
+
+/usr/bin/nfsstat -c | awk '
+/RPC Counts/ { coll=1; next; }
+/RPC Info/ { exit 0; }
+/[a-z]/ && coll {
+ for (n in names) {
+ names[n] = ""
+ }
+ for (n = 1; n <= NF; n++) {
+ names[n] = $n
+ }
+}
+/[0-9]/ && coll {
+ for (n = 1; n <= NF/2; n++) {
+ name = names[n]
+ values[name] = $((n - 1) * 2 + 1)
+ }
+}
+END {
+ for (v in values) {
+ print v ".value " values[v];
+ }
+}
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/nfsd.in b/sysutils/munin-node/files/node/node.d.netbsd/nfsd.in
new file mode 100755
index 00000000000..0e54d9ad96c
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/nfsd.in
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Plugin to monitor NFS server traffic
+#
+# $Log: nfsd.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+getnames () {
+ /usr/bin/nfsstat -s | awk '
+/RPC Counts/ { coll = 1; next; }
+/Server Errors/ { exit 0; }
+/[a-z]/ && coll {
+ for (n = 1; n <= NF; n++) {
+ print $n
+ }
+}
+'
+}
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/nfsstat ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title NFS Server'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel requests / ${graph_period}'
+ echo 'graph_total total'
+ echo 'graph_category NFS'
+ for a in `getnames` ; do
+ echo "$a.label $a"
+ echo "$a.type DERIVE"
+ echo "$a.min 0"
+ done
+ exit 0
+fi
+
+/usr/bin/nfsstat -s | awk '
+/RPC Counts/ { coll=1; next; }
+/Server Errors/ { exit 0; }
+/[a-z]/ && coll {
+ for (n in names) {
+ names[n] = ""
+ }
+ for (n = 1; n <= NF; n++) {
+ names[n] = $n
+ }
+}
+/[0-9]/ && coll {
+ for (n = 1; n <= NF/2; n++) {
+ name = names[n]
+ values[name] = $((n - 1) * 2 + 1)
+ }
+}
+END {
+ for (v in values) {
+ print v ".value " values[v];
+ }
+}
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/open_files.in b/sysutils/munin-node/files/node/node.d.netbsd/open_files.in
new file mode 100755
index 00000000000..5ed473ba126
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/open_files.in
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of open files in the system.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: open_files.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (Used by munin-config and some installation scripts.
+# Optional):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/sbin/pstat ]; then
+ /usr/sbin/pstat -T | grep files > /dev/null
+ if [ $? = "0" ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+eval `/usr/sbin/pstat -T | awk '/files/ {
+ split($1, a, "/");
+ print "filemax=" a[2];
+ print "openfiles=" a[1];
+}'`
+
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title File table usage'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel number of open files'
+ echo 'graph_category system'
+ echo 'graph_info This graph monitors the Linux open files table.'
+
+ echo 'used.label open files'
+ echo 'used.info The number of currently open files.'
+
+ echo 'max.label max open files'
+ echo 'max.info The maximum supported number of open files.'
+
+ awk -v filemax=$filemax '{
+ printf "used.warning %d\n", $filemax * 0.92;
+ printf "used.critical %d\n", $filemax * 0.98;
+}'
+ exit 0
+fi
+
+echo 'max.value ' $filemax
+echo 'used.value ' $openfiles
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/processes.in b/sysutils/munin-node/files/node/node.d.netbsd/processes.in
new file mode 100755
index 00000000000..fc899ad5a6c
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/processes.in
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of processes on the machine. Much like
+# doing a "ps | wc -l".
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: processes.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magick markers (optional - used by munin-config and som installation
+# scripts):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Number of Processes'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_vlabel number of processes'
+ echo 'graph_category processes'
+ echo 'graph_info This graph shows the number of processes in the system.'
+ echo 'processes.label processes'
+ echo 'processes.info The current number of processes.'
+ echo 'processes.draw LINE2'
+ exit 0
+fi
+
+echo -n "processes.value "
+ps ax | wc -l
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/sensors_.in b/sysutils/munin-node/files/node/node.d.netbsd/sensors_.in
new file mode 100755
index 00000000000..5f8d8723ab8
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/sensors_.in
@@ -0,0 +1,166 @@
+#!/bin/sh
+#
+# Plugin to monitor various environment sensors provided by envstat(8)
+# on NetBSD
+#
+# Requirements:
+# - envsys(4) driver configured and supported hardware present
+# - envstat(8) program present
+#
+# Parameters supported:
+#
+# config
+# autoconf
+# suggest
+#
+# $Log: sensors_.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#%# family=auto
+#%# capabilities="autoconf suggest"
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/sbin/envstat ]; then
+ if /usr/sbin/envstat -r >/dev/null 2>&1; then
+ echo yes
+ exit 0
+ else
+ echo no '(no sensors available via envstat(8))'
+ exit 1
+ fi
+ else
+ echo no '(/usr/sbin/envstat not executable)'
+ exit 1
+ fi
+fi
+
+
+if [ "$1" = "suggest" ]; then
+ /usr/sbin/envstat -r | awk '
+/degC$/ { temp=1; }
+/RPM$/ { fans=1; }
+/V$/ { volt=1; }
+END {
+ if (temp) {
+ print "temp";
+ }
+ if (fans) {
+ print "fans";
+ }
+ if (volt) {
+ print "volt";
+ }
+}'
+ exit 0
+fi
+
+
+if [ "$1" = "config" ]; then
+ case $0 in
+ sensors_temp)
+ echo 'graph_title Fans'
+ echo 'graph_vtitle RPM'
+ echo 'graph_args --base 1000 -l 0'
+ /usr/sbin/envstat -r | awk '
+BEGIN { p=0 }
+/degC$/ {
+ gsub(":", "", $1);
+ print "temp." $1 ".label " $1;
+ p=1;
+}
+END {
+ if (!p) {
+ exit 1;
+ }
+}'
+ if [ $? != 0 ]; then
+ echo 'No temperature sensors found' >&2
+ exit 1
+ fi
+ ;;
+ sensors_fans)
+ echo 'graph_title Temperatures'
+ echo 'graph_vtitle deg Celcius'
+ echo 'graph_args --base 1000 -l 0'
+ /usr/sbin/envstat -r | awk '
+BEGIN { p=0 }
+/RPM$/ {
+ gsub(":", "", $1);
+ print "fans." $1 ".label " $1;
+ p=1;
+}
+END {
+ if (!p) {
+ exit 1;
+ }
+}'
+ if [ $? != 0 ]; then
+ echo 'No fan sensors found' >&2
+ exit 1
+ fi
+ ;;
+ sensors_volt)
+ echo 'graph_title Voltages'
+ echo 'graph_vtitle Volt'
+ echo 'graph_args --base 1000 --logarithmic'
+ /usr/sbin/envstat -r | awk '
+BEGIN { p=0 }
+/V$/ {
+ gsub(":", "", $1);
+ print "volt." $1 ".label " $1;
+ p=1;
+}
+END {
+ if (!p) {
+ exit 1;
+ }
+}'
+ if [ $? != 0 ]; then
+ echo 'No voltage sensors found' >&2
+ exit 1
+ fi
+ ;;
+ esac
+ echo 'graph_category sensors'
+
+ exit 0
+fi
+
+
+case $0 in
+ sensors_temp)
+ /usr/sbin/envstat -r | awk '
+/degC$/ {
+ gsub(":", "", $1);
+ print "temp." $1 ".value " $2;
+}
+'
+ ;;
+ sensors_fans)
+ /usr/sbin/envstat -r | awk '
+/RPM$/ {
+ gsub(":", "", $1);
+ print "fans." $1 ".value " $2;
+}
+'
+ ;;
+ sensors_volt)
+/usr/sbin/envstat -r | awk '
+/V$/ {
+ gsub(":", "", $1);
+ print "volt." $1 ".value " $2;
+}
+'
+ ;;
+esac
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/swap.in b/sysutils/munin-node/files/node/node.d.netbsd/swap.in
new file mode 100755
index 00000000000..4c7bb4aff40
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/swap.in
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Plugin to monitor swap IO in number of blocks per second.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: swap.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magic markers (used by munin-config and some installation scripts (i.e.
+# optional)):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ /usr/bin/vmstat -s | grep 'swap ins' > /dev/null
+ if [ $? = "0" ]; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+
+ echo 'graph_title Swap in/out'
+ echo 'graph_args -l 0 --base 1000'
+ echo 'graph_vlabel pages per ${graph_period} in (-) / out (+)'
+ echo 'graph_category system'
+ echo 'graph_info This graph shows the swap activity of the system.'
+
+ echo 'swap_in.label swap'
+ echo 'swap_in.type DERIVE'
+ echo 'swap_in.min 0'
+ echo 'swap_in.max 100000'
+ echo 'swap_in.graph no'
+
+ echo 'swap_out.label swap'
+ echo 'swap_out.type DERIVE'
+ echo 'swap_out.min 0'
+ echo 'swap_out.max 100000'
+ echo 'swap_out.negative swap_in'
+ exit 0
+fi
+
+vmstat -s | awk '
+/swap ins$/ { print "swap_in.value " $1; }
+/swap outs$/ { print "swap_out.value " $1; }
+'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/uptime.in b/sysutils/munin-node/files/node/node.d.netbsd/uptime.in
new file mode 100755
index 00000000000..a93905c577f
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/uptime.in
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# Plugin to measure uptime. Especially the average and max values on the
+# bigger graphs (yearly) can be interesting.
+#
+# $Log: uptime.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+# Magic markers - optional - used by installation scripts and
+# munin-config:
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /sbin/sysctl ]; then
+ if /sbin/sysctl kern.boottime >/dev/null 2>&1; then
+ if [ -x /bin/date ]; then
+ echo yes
+ exit 0
+ else
+ echo no '(no /bin/date)'
+ exit 1
+ fi
+ else
+ echo no '(sysctl kern.boottime failed)' 2>&1
+ exit 1
+ fi
+ else
+ echo no '(no /sbin/sysctl)'
+ exit 1
+ fi
+fi
+
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title Uptime'
+ echo 'graph_args --base 1000 -l 0 '
+ echo 'graph_vlabel uptime in days'
+ echo 'uptime.label uptime'
+ echo 'uptime.draw AREA'
+ exit 0
+fi
+
+
+boottime=`/sbin/sysctl -n kern.boottime`
+now=`/bin/date +%s`
+
+awk -v boottime=$boottime -v now=$now </dev/null '
+END {
+ printf "uptime.value %.2f\n", (now - boottime) / 86400;
+}'
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/vmstat.in b/sysutils/munin-node/files/node/node.d.netbsd/vmstat.in
new file mode 100755
index 00000000000..d9a74d10283
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/vmstat.in
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of procs in io-sleep and other wait
+# states. Uses `vmstat`.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - used by munin-config)
+#
+# $Log: vmstat.in,v $
+# Revision 1.1.1.1 2006/06/04 20:53:57 he
+# Import the client version of the Munin system monitoring/graphing
+# tool -- project homepage is at http://munin.sourceforge.net/
+#
+# This package has added support for NetBSD, via a number of new plugin
+# scripts where specific steps needs to be taken to collect information.
+#
+# I also modified the ntp_ plugin script to make it possible to not
+# plot the NTP poll delay, leaving just jitter and offset, which IMO
+# produces a more telling graph.
+#
+#
+#
+#
+# Magick markers (optional):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+ if [ -x /usr/bin/vmstat ]; then
+ if /usr/bin/vmstat 1 1 2>/dev/null >/dev/null; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+/usr/bin/vmstat -t -c 1 >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+ new=true
+else
+ new=false
+fi
+
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title VMstat'
+ echo 'graph_args --base 1000 -l 0'
+ echo 'graph_vlabel process states'
+ echo 'graph_category processes'
+ echo 'graph_info This graph shows number of processes in each state.'
+
+ echo 'running.label running'
+ echo 'running.info processes on CPU or waiting for CPU'
+ echo 'running.type GAUGE'
+
+ echo 'sleep.label sleep'
+ echo 'sleep.info processes waiting for some event'
+ echo 'sleep.type GAUGE'
+
+ if $new; then
+ echo 'diskwait.label diskwait'
+ echo 'diskwait.info processes waiting for disk i/o activity'
+ echo 'diskwait.type GAUGE'
+
+ echo 'pagewait.label pagewait'
+ echo 'pagewait.info processes waiting for page-in'
+ echo 'pagewait.type GAUGE'
+
+ else
+ echo 'iowait.label wait'
+ echo 'iowait.info processes blocked for resources (i/o, paging, etc.)'
+ echo 'iowait.type GAUGE'
+
+ fi
+ exit 0
+fi
+
+if $new; then
+ /usr/bin/vmstat -t -c 1 | tail -1 | awk '// {
+ print "running.value " $1;
+ print "diskwait.value " $2;
+ print "pagewait.value " $3;
+ print "sleep.value " $4;
+ print "swapped.value " $5;
+}'
+else
+ /usr/bin/vmstat -c 1 | tail -1 | awk '// {
+ print "running.value " $1;
+ print "iowait.value " $2;
+ print "sleep.value " $3;
+}'
+fi
diff --git a/sysutils/munin-node/files/node/node.d/ntp_kernel_err.in b/sysutils/munin-node/files/node/node.d/ntp_kernel_err.in
new file mode 100644
index 00000000000..0a28bfa615e
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d/ntp_kernel_err.in
@@ -0,0 +1,43 @@
+#! /bin/sh
+#
+# $Id: ntp_kernel_err.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+#
+# Plugin to monitor the estimated error for the kernel NTP
+# status.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=manual
+#%# capabilities=autoconf
+
+# If run with the "autoconf"-parameter, give our opinion on wether we
+# should be run on this system or not. This is optinal, and only used by
+# munin-config. In the case of this plugin, we should most probably
+# always be included.
+
+if [ "$1" = "autoconf" ]; then
+ if ntpdc -c help >/dev/null 2>&1; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title NTP kernel PLL estimated error (secs)'
+# echo 'graph_args --logarithmic'
+ echo 'graph_vlabel est. err (secs)'
+ echo 'graph_category other'
+ echo 'graph_info The kernels estimated error for the phase-locked loop used by NTP'
+ echo 'ntp_err.label est-error'
+ echo 'ntp_err.info Estimated error for the kernel PLL'
+ exit 0
+fi
+
+echo -n 'ntp_err.value '
+ntpdc -c kern | awk '/^estimated error:/ { print $3 }'
diff --git a/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_freq.in b/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_freq.in
new file mode 100644
index 00000000000..c2f5f1b7099
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_freq.in
@@ -0,0 +1,50 @@
+#! /bin/sh
+#
+# $Id: ntp_kernel_pll_freq.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+#
+# Plugin to monitor the kernel's PLL frequency for the NTP
+# status.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=manual
+#%# capabilities=autoconf
+
+# If run with the "autoconf"-parameter, give our opinion on wether we
+# should be run on this system or not. This is optinal, and only used by
+# munin-config. In the case of this plugin, we should most probably
+# always be included.
+
+if [ "$1" = "autoconf" ]; then
+ if ntpdc -c help >/dev/null 2>&1; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ -f @@CONFDIR@@/ntp-freq-comp ]; then
+ fcomp=`cat @@CONFDIR@@/ntp-freq-comp`
+else
+ fcomp=0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title NTP kernel PLL frequency (ppm +' ${fcomp}')'
+# echo 'graph-args --logarithmic'
+ echo 'graph_args --alt-autoscale'
+ echo 'graph_vlabel PLL frequency (ppm +' ${fcomp}')'
+ echo 'graph_category other'
+ echo 'graph_info The frequency for the kernel phase-locked loop used by NTP'
+ echo 'ntp_pll_freq.label pll-freq'
+ echo 'ntp_pll_freq.info Phase-locked loop frequency in parts per million'
+ exit 0
+fi
+
+echo -n 'ntp_pll_freq.value '
+ntpdc -c kern | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
diff --git a/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_off.in b/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_off.in
new file mode 100644
index 00000000000..da48e782f3f
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d/ntp_kernel_pll_off.in
@@ -0,0 +1,43 @@
+#! /bin/sh
+#
+# $Id: ntp_kernel_pll_off.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+#
+# Plugin to monitor the kernel's PLL offset for the NTP
+# status.
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# Magic markers (optional - only used by munin-config and some
+# installation scripts):
+#
+#%# family=manual
+#%# capabilities=autoconf
+
+# If run with the "autoconf"-parameter, give our opinion on wether we
+# should be run on this system or not. This is optinal, and only used by
+# munin-config. In the case of this plugin, we should most probably
+# always be included.
+
+if [ "$1" = "autoconf" ]; then
+ if ntpdc -c help >/dev/null 2>&1; then
+ echo yes
+ exit 0
+ else
+ echo no
+ exit 1
+ fi
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title NTP kernel PLL offset (secs)'
+# echo 'graph-args --logarithmic'
+ echo 'graph_vlabel PLL offset (secs)'
+ echo 'graph_category other'
+ echo 'graph_info The kernel offset for the phase-locked loop used by NTP'
+ echo 'ntp_pll_off.label pll-offset'
+ echo 'ntp_pll_off.info Phase-locked loop offset in seconds'
+ exit 0
+fi
+
+echo -n 'ntp_pll_off.value '
+ntpdc -c kern | awk '/^pll offset:/ { print $3 }'
diff --git a/sysutils/munin-node/patches/patch-aa b/sysutils/munin-node/patches/patch-aa
new file mode 100644
index 00000000000..ad4384ef6fa
--- /dev/null
+++ b/sysutils/munin-node/patches/patch-aa
@@ -0,0 +1,89 @@
+$NetBSD: patch-aa,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+--- Makefile.config.orig 2005-01-10 11:38:22.000000000 +0100
++++ Makefile.config
+@@ -7,32 +7,36 @@
+ #
+ # 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
+
+ # 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 +49,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 +69,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-node/patches/patch-ab b/sysutils/munin-node/patches/patch-ab
new file mode 100644
index 00000000000..beba75aae2a
--- /dev/null
+++ b/sysutils/munin-node/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 2006/06/04 20:53:57 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-node/patches/patch-ac b/sysutils/munin-node/patches/patch-ac
new file mode 100644
index 00000000000..459819e3cda
--- /dev/null
+++ b/sysutils/munin-node/patches/patch-ac
@@ -0,0 +1,40 @@
+$NetBSD: patch-ac,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+--- node/node.d/ntp_.in.orig 2004-11-21 21:19:09.000000000 +0100
++++ node/node.d/ntp_.in
+@@ -76,6 +76,8 @@ $0 =~ /ntp_(.+)*$/;
+ my $name = $1;
+ exit 2 unless defined $name;
+
++my $do_delay = ! defined($ENV{'NTP_NODELAY'});
++
+ if ($ARGV[0] and $ARGV[0] eq "config") {
+ my @lines = `ntpq -c "hostnames no" -c peers`;
+ my $host;
+@@ -91,8 +93,10 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
+ print "graph_title NTP statistics for peer $host\n";
+ }
+ print "graph_args --base 1000 --vertical-label msec --lower-limit 0\n";
+- print "delay.label Delay\n";
+- print "delay.draw LINE2\n";
++ if ($do_delay) {
++ print "delay.label Delay\n";
++ print "delay.draw LINE2\n";
++ }
+ print "offset.label Offset\n";
+ print "offset.draw LINE2\n";
+ print "jitter.label Jitter\n";
+@@ -110,8 +114,12 @@ foreach (@lines) {
+ $host =~ s/[\.-]/_/g;
+ next unless $host eq $name;
+ my @F = split;
+- print <<"EOT";
++if ($do_delay) {
++ print <<"EOT"
+ delay.value $F[7]
++EOT
++}
++ print <<"EOT";
+ offset.value $F[8]
+ jitter.value $F[9]
+ EOT
diff --git a/sysutils/munin-node/patches/patch-ad b/sysutils/munin-node/patches/patch-ad
new file mode 100644
index 00000000000..a732adcb7ec
--- /dev/null
+++ b/sysutils/munin-node/patches/patch-ad
@@ -0,0 +1,21 @@
+$NetBSD: patch-ad,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+
+--- Makefile.orig 2004-12-22 22:33:47.000000000 +0100
++++ Makefile
+@@ -35,8 +35,6 @@ install-main: build
+ $(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 0755 build/server/munin-cron $(BINDIR)/
+
+ $(INSTALL) -m 0755 build/server/munin-update $(LIBDIR)/
+@@ -71,7 +69,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