summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/munin-node/Makefile4
-rw-r--r--sysutils/munin-node/PLIST3
-rwxr-xr-xsysutils/munin-node/files/node/node.d.netbsd/swap_size.in53
3 files changed, 57 insertions, 3 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
index 28dc6ed1447..a65cfe38ee2 100644
--- a/sysutils/munin-node/Makefile
+++ b/sysutils/munin-node/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.18 2010/10/27 18:23:13 shattered Exp $
+# $NetBSD: Makefile,v 1.19 2010/11/26 19:16:02 shattered Exp $
#
DISTNAME= munin_${VER}
VER= 1.3.2
PKGNAME= munin-node-${VER}
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/}
diff --git a/sysutils/munin-node/PLIST b/sysutils/munin-node/PLIST
index e320d04ea22..5c1c60fb63c 100644
--- a/sysutils/munin-node/PLIST
+++ b/sysutils/munin-node/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.8 2010/07/16 22:04:11 abs Exp $
+@comment $NetBSD: PLIST,v 1.9 2010/11/26 19:16:02 shattered Exp $
lib/munin/plugins/acpi
lib/munin/plugins/amavis
lib/munin/plugins/apache_accesses
@@ -112,6 +112,7 @@ lib/munin/plugins/squid_requests
lib/munin/plugins/squid_traffic
lib/munin/plugins/surfboard
${PLIST.not-sunos}lib/munin/plugins/swap
+${PLIST.not-sunos}lib/munin/plugins/swap_size
lib/munin/plugins/sybase_space
${PLIST.sunos}lib/munin/plugins/temperature
${PLIST.not-sunos}lib/munin/plugins/uptime
diff --git a/sysutils/munin-node/files/node/node.d.netbsd/swap_size.in b/sysutils/munin-node/files/node/node.d.netbsd/swap_size.in
new file mode 100755
index 00000000000..d52a5d49adb
--- /dev/null
+++ b/sysutils/munin-node/files/node/node.d.netbsd/swap_size.in
@@ -0,0 +1,53 @@
+#! /bin/sh
+#
+# Plugin to monitor swap usage.
+#
+# Parameters:
+#
+# config (required)
+# autoconf (optional - only used by munin-config)
+#
+# 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`
+
+if [ "$1" = "config" ]; then
+ echo 'graph_args --base 1024 -l 0 --vertical-label Bytes'
+ echo 'graph_title Swap usage'
+ echo 'graph_category system'
+ echo 'graph_info This graph shows how the machine uses its swap.'
+
+ echo 'graph_order size used'
+
+ echo 'size.label swap size'
+ echo 'size.draw AREA'
+
+ echo 'used.label swap used'
+ echo 'used.draw AREA'
+
+ exit 0
+fi
+
+vmstat -s | awk -v bpp=$PAGESIZE '
+/swap pages in use$/ { print "used.value " $1 * bpp; }
+/swap pages$/ { print "size.value " $1 * bpp; }
+'