mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
Merge pull request #367 from avances123/master
freedisk plugin to show abs used values to disk, increasing line instead of free usage. (decreasing)
This commit is contained in:
commit
97fab71b9e
1 changed files with 35 additions and 0 deletions
35
plugins/disk/useddisk
Executable file
35
plugins/disk/useddisk
Executable file
|
@ -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`"
|
Loading…
Add table
Add a link
Reference in a new issue