From baf8f4c9cc4566f2f43362a0874d2ddb4a6c4602 Mon Sep 17 00:00:00 2001 From: lifeofguenter Date: Tue, 2 Nov 2010 00:02:02 +0100 Subject: [PATCH] Initial version --- plugins/other/freedisk | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 plugins/other/freedisk diff --git a/plugins/other/freedisk b/plugins/other/freedisk new file mode 100755 index 00000000..325beb8e --- /dev/null +++ b/plugins/other/freedisk @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Wildcard-plugin to monitor free disk. +# +# ln -s /usr/share/munin/plugins/freedisk_ /etc/munin/plugins/freedisk_hda1 +# +# ...will monitor /dev/hda1. +# +# $Log$ +# Revision 0.1 2010/11/01 guenter@grodotzki.ph +# init + +# parse wildcard config +DISK=`basename $0 | sed 's/^freedisk_//g'` + +# output config +if [ "$1" = "config" ]; then + echo "graph_title Free Disk on /dev/$DISK" + echo "graph_args --base 1024" + echo "graph_vlabel Free Disk in Bytes" + echo "graph_category disk" + echo "freedisk.label free Bytes" + echo "freedisk.draw LINE3" + echo "freedisk.cdef freedisk,1024,*" + echo "totaldisk.label total Bytes" + echo "totaldisk.draw AREA" + echo "totaldisk.cdef totaldisk,1024,*" + exit 0 +fi + +# get data +OUTPUT=`df -P | grep "$DISK"` + +echo "freedisk.value `echo $OUTPUT | cut -d ' ' -f 4`" +echo "totaldisk.value `echo $OUTPUT | cut -d ' ' -f 2`"