diff -urN node.d.midnightbsd.orig/cpu.in node.d.midnightbsd/cpu.in
--- node/node.d.midnightbsd.orig/cpu.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/cpu.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,156 @@
+#!/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$
+# Revision 1.8.2.3  2005/02/03 13:28:50  lupe
+# correct field.info
+#
+# Revision 1.8.2.2  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.10  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.9  2005/01/25 08:48:28  lupe
+# Correct multi-CPU bugs
+#
+# Revision 1.8.2.1  2005/01/25 09:22:52  lupe
+# Correct multi-CPU bugs
+#
+# Revision 1.8  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.7  2004/11/28 09:43:54  lupe
+# 6-CURRENT support
+#
+# Revision 1.6  2004/11/21 00:16:56  jimmyo
+# Changed a lot of plugins so they use DERIVE instead of COUNTER.
+#
+# Revision 1.5  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.4  2004/05/09 19:18:35  jimmyo
+# Added support for scaleto100-parameter (patch from Lupe Christoph).
+#
+# Revision 1.3  2004/02/18 16:39:36  jimmyo
+# Turned off scaling of values for cpu-graphs (no more nano-percentages).
+#
+# Revision 1.2  2004/02/01 18:59:54  lupe
+# FreeBSD 5 compatibility.
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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
+
+	OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
+	if [ "$OSV" = "4" ]; then
+		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f16 -d' '`
+	elif [ "$OSV" -ge "5" ]; then
+		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f13 -d' '`
+	fi
+	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'
+	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 '{ print "user.value " $2 "\nnice.value " $3 "\nsystem.value " $4 "\ninterrupt.value " $5 "\nidle.value " $6 }'
+
diff -urN node.d.midnightbsd.orig/df.in node.d.midnightbsd/df.in
--- node/node.d.midnightbsd.orig/df.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/df.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,95 @@
+#!/bin/sh
+#
+# Script to monitor disk usage.
+#
+# Parameters understood:
+#
+# 	config   (required)
+# 	autoconf (optional - used by munin-config)
+#
+# $Log$
+# Revision 1.4.2.4  2005/01/28 16:24:23  lupe
+# Minor corrections
+#
+# Revision 1.4.2.3  2005/01/28 14:52:23  lupe
+# Delete a merge marker
+#
+# Revision 1.4.2.2  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.2.2.1  2005/01/25 10:32:40  lupe
+# Add support for FreeBSD 4.x ramdisks
+#
+# Revision 1.2.2.1  2005/01/25 10:32:40  lupe
+# Add support for FreeBSD 4.x ramdisks
+#
+# Revision 1.2.2.1  2005/01/25 10:32:40  lupe
+# Add support for FreeBSD 4.x ramdisks
+#
+# Revision 1.2  2004/02/01 19:00:29  lupe
+# Ignore devfs,fdescfs,linprocfs in addition to procfs,nfs.
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# Magic markers (optional - used by munin-config and installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+MAXLABEL=20
+
+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 noprocfs,devfs,fdescfs,linprocfs,nfs | 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 noprocfs,devfs,fdescfs,linprocfs,nfs | 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 -urN node.d.midnightbsd.orig/df_inode.in node.d.midnightbsd/df_inode.in
--- node/node.d.midnightbsd.orig/df_inode.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/df_inode.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# Plugin to monitor inode-usage.
+#
+# Parameters understood:
+#
+# 	config   (required)
+# 	autoconf (optional - used by munin-config)
+#
+# $Log$
+# Revision 1.4.2.4  2005/02/03 13:28:50  lupe
+# correct field.info
+#
+# Revision 1.4.2.3  2005/01/28 16:24:22  lupe
+# Minor corrections
+#
+# Revision 1.4.2.2  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.3  2004/05/18 22:04:30  jimmyo
+# Use "sed 1d" instead of "tail +2" in df plugins (patch by Olivier Delhomme).
+#
+# Revision 1.2.2.1  2005/01/25 10:32:40  lupe
+# Add support for FreeBSD 4.x ramdisks
+#
+# Revision 1.2  2004/02/01 19:00:29  lupe
+# Ignore devfs,fdescfs,linprocfs in addition to procfs,nfs.
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# Magic markers (optional - used by munin-config and installation
+# scripts):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+MAXLABEL=20
+
+print_values() {
+	mfs=0
+	/bin/df -P -i -t noprocfs,devfs,fdescfs,linprocfs,nfs | 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
+	else
+		echo yes
+	fi
+	exit 0
+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 noprocfs,devfs,fdescfs,linprocfs,nfs | 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 \" -> \" \$1
+			print name \".warning 92\"
+			print name \".critical 98\"
+		}"
+	exit 0
+fi
+
+print_values
diff -urN node.d.midnightbsd.orig/if_.in node.d.midnightbsd/if_.in
--- node/node.d.midnightbsd.orig/if_.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/if_.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,102 @@
+#!/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$
+# Revision 1.4.2.3  2005/02/17 10:57:54  lupe
+# Added warning note in if_ output.
+#
+# Revision 1.4.2.2  2005/01/28 16:24:22  lupe
+# Minor corrections
+#
+# Revision 1.4.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.3  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 22:12:50  jimmyo
+# Changed deprecated plugin options
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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 '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/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. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is usuitable for most production environments."
+	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#[0-9]*>/ {
+	if (NF == 10) { 
+		print "rbytes.value", $6;
+		print "obytes.value", $9;
+	} else {
+		print "rbytes.value", $7;
+		print "obytes.value", $10;
+	}
+}'
diff -urN node.d.midnightbsd.orig/if_.in.orig node.d.midnightbsd/if_.in.orig
--- node/node.d.midnightbsd.orig/if_.in.orig	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/if_.in.orig	Fri May  9 22:19:35 2008
@@ -0,0 +1,102 @@
+#!/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$
+# Revision 1.4.2.3  2005/02/17 10:57:54  lupe
+# Added warning note in if_ output.
+#
+# Revision 1.4.2.2  2005/01/28 16:24:22  lupe
+# Minor corrections
+#
+# Revision 1.4.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.3  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 22:12:50  jimmyo
+# Changed deprecated plugin options
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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#[0-9]*>/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. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is usuitable for most production environments."
+	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#[0-9]*>/ {
+	if (NF == 10) { 
+		print "rbytes.value", $6;
+		print "obytes.value", $9;
+	} else {
+		print "rbytes.value", $7;
+		print "obytes.value", $10;
+	}
+}'
diff -urN node.d.midnightbsd.orig/if_errcoll_.in node.d.midnightbsd/if_errcoll_.in
--- node/node.d.midnightbsd.orig/if_errcoll_.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/if_errcoll_.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,94 @@
+#!/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$
+# Revision 1.4.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.5  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.3  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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 '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/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 -b -I $INTERFACE | awk '
+/<Link#[0-9]*>/ {
+	if (NF == 10) {
+		print "ierrors.value", $5;
+		print "oerrors.value", $8;
+		print "collisions.value", $10;
+	} else {
+		print "ierrors.value", $6;
+		print "oerrors.value", $9;
+		print "collisions.value", $11;
+	}
+}'
diff -urN node.d.midnightbsd.orig/if_errcoll_.in.orig node.d.midnightbsd/if_errcoll_.in.orig
--- node/node.d.midnightbsd.orig/if_errcoll_.in.orig	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/if_errcoll_.in.orig	Fri May  9 22:19:34 2008
@@ -0,0 +1,94 @@
+#!/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$
+# Revision 1.4.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.5  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.3  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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#[0-9]*>/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 -b -I $INTERFACE | awk '
+/<Link#[0-9]*>/ {
+	if (NF == 10) {
+		print "ierrors.value", $5;
+		print "oerrors.value", $8;
+		print "collisions.value", $10;
+	} else {
+		print "ierrors.value", $6;
+		print "oerrors.value", $9;
+		print "collisions.value", $11;
+	}
+}'
diff -urN node.d.midnightbsd.orig/load.in node.d.midnightbsd/load.in
--- node/node.d.midnightbsd.orig/load.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/load.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,127 @@
+#!/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$
+# Revision 1.3.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.3  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.2  2004/01/15 16:58:10  jimmyo
+# FreeBSD-plugin load bugfix from Robert Lindgren (SF#865928).
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+#%# 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
+
+# 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'
+	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 -urN node.d.midnightbsd.orig/memory.in node.d.midnightbsd/memory.in
--- node/node.d.midnightbsd.orig/memory.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/memory.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,95 @@
+#!/bin/sh
+#
+# Plugin to monitor memory usage.
+#
+# Parameters:
+#
+# 	config   (required)
+# 	autoconf (optional - only used by munin-config)
+#
+# $Log$
+# Revision 1.2.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.3  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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 vm.stats.vm.v_page_size > /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 vm.stats.vm.v_page_size`
+    MEMSIZE=`/sbin/sysctl -n vm.stats.vm.v_page_count`
+    MEMMAX=`echo 'scale=2;' $PAGESIZE*$MEMSIZE | bc -q `
+
+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 buffers cached 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, usually for kernel purposes, but also sometimes for special use in processes'
+	echo 'wired.draw STACK'
+	echo 'buffers.label buffers'
+	echo 'buffers.info pages used for filesystem buffers'
+	echo 'buffers.draw STACK'
+	echo 'cached.label cache'
+	echo 'cached.info pages that have percolated from inactive to a status where they maintain their data, but can often be immediately reused'
+	echo 'cached.draw STACK'
+	echo 'free.label free'
+	echo 'free.info pages without data content'
+	echo 'free.draw STACK'
+	exit 0
+fi
+
+ACTIVE_COUNT=`/sbin/sysctl -n vm.stats.vm.v_active_count`
+INACTIVE_COUNT=`/sbin/sysctl -n vm.stats.vm.v_inactive_count`
+FREE_COUNT=`/sbin/sysctl -n vm.stats.vm.v_free_count`
+CACHE_COUNT=`/sbin/sysctl -n vm.stats.vm.v_cache_count`
+BUFFERS_COUNT=`/sbin/sysctl -n vfs.bufspace`
+WIRED_COUNT=`/sbin/sysctl -n vm.stats.vm.v_wire_count`
+echo 'print "active.value ";' $ACTIVE_COUNT*$PAGESIZE | bc -q
+echo 'print "inactive.value ";' $INACTIVE_COUNT*$PAGESIZE | bc -q
+echo 'print "cached.value ";' $CACHE_COUNT*$PAGESIZE | bc -q
+echo 'print "free.value ";' $FREE_COUNT*$PAGESIZE | bc -q
+echo 'print "wired.value ";' $WIRED_COUNT*$PAGESIZE | bc -q
+echo buffers.value $BUFFERS_COUNT
diff -urN node.d.midnightbsd.orig/netstat.in node.d.midnightbsd/netstat.in
--- node/node.d.midnightbsd.orig/netstat.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/netstat.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# Plugin to monitor network connections.
+#
+# Parameters:
+#
+# 	config   (required)
+# 	autoconf (optional - only used by munin-config)
+#
+# $Log$
+# Revision 1.5.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.6  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.5  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.4  2004/12/09 22:12:55  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.3  2004/11/21 00:16:56  jimmyo
+# Changed a lot of plugins so they use DERIVE instead of COUNTER.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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 -urN node.d.midnightbsd.orig/open_files.in node.d.midnightbsd/open_files.in
--- node/node.d.midnightbsd.orig/open_files.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/open_files.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,74 @@
+#!/bin/sh
+# 
+# Plugin to monitor the number of open files in the system.
+#
+# Parameters:
+# 	
+# 	config   (required)
+# 	autoconf (optional - used by munin-config)
+#
+# $Log$
+# Revision 1.2.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.3  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# Magic markers (Used by munin-config and some installation scripts.
+# Optional):
+#
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+    if [ -x /sbin/sysctl ]; then
+        /sbin/sysctl kern.openfiles > /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 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.'
+	/sbin/sysctl -n kern.maxfiles | awk  '{printf "used.warning %d\nused.critical %d\n",$1*0.92,$1*0.98}'
+	exit 0
+fi
+
+#awk '{print "used.value " $1-$2 "\nmax.value " $3}' < /proc/sys/fs/file-nr
+echo -n 'max.value '
+/sbin/sysctl -n kern.maxfiles
+echo -n 'used.value '
+/sbin/sysctl -n kern.openfiles
diff -urN node.d.midnightbsd.orig/processes.in node.d.midnightbsd/processes.in
--- node/node.d.midnightbsd.orig/processes.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/processes.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of processes on the machine. Much linke
+# doing a "ps | wc -l".
+#
+# Parameters:
+#
+# 	config   (required)
+# 	autoconf (optional - used by munin-config)
+#
+# $Log$
+# Revision 1.2.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.3  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# 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 -urN node.d.midnightbsd.orig/swap.in node.d.midnightbsd/swap.in
--- node/node.d.midnightbsd.orig/swap.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/swap.in	Fri May  9 22:19:34 2008
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# Plugin to monitor swap IO in number of blocks per second.
+#
+# Parameters:
+#
+# 	config   (required)
+# 	autoconf (optional - used by munin-config)
+#
+# $Log$
+# Revision 1.5.2.2  2005/01/28 16:24:22  lupe
+# Minor corrections
+#
+# Revision 1.5.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.5  2004/12/10 10:47:49  jimmyo
+# Change name from ${scale} to ${graph_period}, to be more consistent.
+#
+# Revision 1.4  2004/12/09 22:12:56  jimmyo
+# Added "graph_period" option, to make "graph_sums" usable.
+#
+# Revision 1.3  2004/11/21 00:16:56  jimmyo
+# Changed a lot of plugins so they use DERIVE instead of COUNTER.
+#
+# Revision 1.2  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.4  2003/11/07 22:12:50  jimmyo
+# Changed deprecated plugin options
+#
+# Revision 1.3  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# Magic markers (used by munin-config and some installation scripts (i.e.
+# optional)):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+if [ "$1" = "autoconf" ]; then
+    if [ -x /sbin/sysctl ]; then
+        /sbin/sysctl vm.stats.vm.v_swappgsin > /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
+
+#awk '/swap/ { print "swap_in.value " $2 "\nswap_out.value " $3 }' < /proc/stat 
+echo -n 'swap_in.value '
+/sbin/sysctl -n vm.stats.vm.v_swappgsin
+echo -n 'swap_out.value '
+/sbin/sysctl -n vm.stats.vm.v_swappgsout
diff -urN node.d.midnightbsd.orig/vmstat.in node.d.midnightbsd/vmstat.in
--- node/node.d.midnightbsd.orig/vmstat.in	Wed Dec 31 19:00:00 1969
+++ node/node.d.midnightbsd/vmstat.in	Fri May  9 22:19:35 2008
@@ -0,0 +1,108 @@
+#!/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$
+# Revision 1.4.2.1  2005/01/28 14:51:22  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.5  2005/01/28 14:47:31  lupe
+# Add graph_info and some filed.info
+#
+# Revision 1.4  2004/11/28 09:43:54  lupe
+# 6-CURRENT support
+#
+# Revision 1.3  2004/05/20 19:02:36  jimmyo
+# Set categories on a bunch of plugins
+#
+# Revision 1.2  2004/02/01 18:59:54  lupe
+# FreeBSD 5 compatibility.
+#
+# Revision 1.1  2004/01/02 18:50:00  jimmyo
+# Renamed occurrances of lrrd -> munin
+#
+# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
+# Import of LRRD CVS tree after renaming to Munin
+#
+# Revision 1.2  2003/11/07 17:43:16  jimmyo
+# Cleanups and log entries
+#
+#
+#
+# Magick markers (optional):
+#%# family=auto
+#%# capabilities=autoconf
+
+
+
+OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
+
+if [ "$1" = "autoconf" ]; then
+	if [ "$OSV" -ge "5" ]; then
+		/sbin/sysctl -n vm.vmtotal 2>/dev/null >/dev/null
+		RESULT=$?
+		NAME=/sbin/sysctl
+	else
+		/usr/bin/vmstat 1 1 2>/dev/null >/dev/null
+		RESULT=$?
+		NAME=/usr/bin/vmstat
+	fi
+	if [ $RESULT -eq 0 ]; then
+		echo yes
+		exit 0
+	else
+		if [ $RESULT -eq 127 ]; then
+			echo "no (could not run \"$NAME\")"
+			exit 1
+		else
+			echo no
+			exit 1
+		fi
+	fi
+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.'
+	if [ "$OSV" -ge "5" ]; then
+		echo 'running.label running'
+		echo 'running.info processes on CPU or waiting for CPU'
+		echo 'running.type GAUGE'
+		echo 'diskwait.label diskwait'
+		echo 'diskwait.info processes waiting for disk activity'
+		echo 'diskwait.type GAUGE'
+		echo 'pagewait.label pagewait'
+		echo 'pagewait.info processes waiting for page-in'
+		echo 'pagewait.type GAUGE'
+		echo 'sleep.label sleep'
+		echo 'sleep.info processes waiting for some event'
+		echo 'sleep.type GAUGE'
+	else
+		echo 'wait.label wait'
+		echo 'wait.type GAUGE'
+		echo 'sleep.label sleep'
+		echo 'sleep.type GAUGE'
+	fi
+	exit 0
+fi
+
+if [ "$OSV" -ge "5" ]; then
+	/sbin/sysctl -n vm.vmtotal | awk '
+/^Processes:/ {
+	print "running.value", $3;
+	print "diskwait.value", $6;
+	print "pagewait.value", $9;
+	print "sleep.value", $11+0;
+}'
+else
+	vmstat 1 2| awk 'END { print "wait.value " $1 "\nsleep.value " $2 }' 
+fi
