pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/munin-node Add plugin to monitor swap usage.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6b8062762ba0
branches:  trunk
changeset: 582709:6b8062762ba0
user:      shattered <shattered%pkgsrc.org@localhost>
date:      Fri Nov 26 19:16:02 2010 +0000

description:
Add plugin to monitor swap usage.

diffstat:

 sysutils/munin-node/Makefile                              |   4 +-
 sysutils/munin-node/PLIST                                 |   3 +-
 sysutils/munin-node/files/node/node.d.netbsd/swap_size.in |  53 +++++++++++++++
 3 files changed, 57 insertions(+), 3 deletions(-)

diffs (90 lines):

diff -r d9f9a92cdae8 -r 6b8062762ba0 sysutils/munin-node/Makefile
--- a/sysutils/munin-node/Makefile      Fri Nov 26 18:00:17 2010 +0000
+++ b/sysutils/munin-node/Makefile      Fri Nov 26 19:16:02 2010 +0000
@@ -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 -r d9f9a92cdae8 -r 6b8062762ba0 sysutils/munin-node/PLIST
--- a/sysutils/munin-node/PLIST Fri Nov 26 18:00:17 2010 +0000
+++ b/sysutils/munin-node/PLIST Fri Nov 26 19:16:02 2010 +0000
@@ -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_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 -r d9f9a92cdae8 -r 6b8062762ba0 sysutils/munin-node/files/node/node.d.netbsd/swap_size.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/munin-node/files/node/node.d.netbsd/swap_size.in Fri Nov 26 19:16:02 2010 +0000
@@ -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; }
+'



Home | Main Index | Thread Index | Old Index