From e5bcd283dd5238851518beb8ab56032e326af210 Mon Sep 17 00:00:00 2001 From: Fabio Rueda Date: Fri, 23 Aug 2013 14:03:40 +0200 Subject: [PATCH] reverted freedisk plugin to show abs used values to disk, would be better to see line growing until the upper limit to the area (total size) --- plugins/disk/useddisk | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 plugins/disk/useddisk diff --git a/plugins/disk/useddisk b/plugins/disk/useddisk new file mode 100755 index 00000000..f1641243 --- /dev/null +++ b/plugins/disk/useddisk @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Wildcard-plugin to monitor used disk. +# +# ln -s /usr/share/munin/plugins/useddisk_ /etc/munin/plugins/useddisk_hda1 +# +# ...will monitor /dev/hda1. +# +# $Log$ +# Revision 0.1 2013/08/23 avances123@gmail.com +# init + +# parse wildcard config +DISK=`basename $0 | sed 's/^useddisk_//g'` + +# output config +if [ "$1" = "config" ]; then + echo "graph_title Used Disk on /dev/$DISK" + echo "graph_args --base 1024" + echo "graph_vlabel Used Disk in Bytes" + echo "graph_category disk" + echo "useddisk.label used Bytes" + echo "useddisk.draw LINE3" + echo "useddisk.cdef useddisk,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 "useddisk.value `echo $OUTPUT | cut -d ' ' -f 3`" +echo "totaldisk.value `echo $OUTPUT | cut -d ' ' -f 2`"