root / plugins / disk / freedisk @ 6ffd5019
Historique | Voir | Annoter | Télécharger (898 octets)
| 1 | baf8f4c9 | lifeofguenter | #!/bin/bash |
|---|---|---|---|
| 2 | # |
||
| 3 | # Wildcard-plugin to monitor free disk. |
||
| 4 | # |
||
| 5 | # ln -s /usr/share/munin/plugins/freedisk_ /etc/munin/plugins/freedisk_hda1 |
||
| 6 | # |
||
| 7 | # ...will monitor /dev/hda1. |
||
| 8 | # |
||
| 9 | # $Log$ |
||
| 10 | # Revision 0.1 2010/11/01 guenter@grodotzki.ph |
||
| 11 | # init |
||
| 12 | |||
| 13 | # parse wildcard config |
||
| 14 | DISK=`basename $0 | sed 's/^freedisk_//g'` |
||
| 15 | |||
| 16 | # output config |
||
| 17 | if [ "$1" = "config" ]; then |
||
| 18 | echo "graph_title Free Disk on /dev/$DISK" |
||
| 19 | echo "graph_args --base 1024" |
||
| 20 | echo "graph_vlabel Free Disk in Bytes" |
||
| 21 | echo "graph_category disk" |
||
| 22 | echo "freedisk.label free Bytes" |
||
| 23 | echo "freedisk.draw LINE3" |
||
| 24 | echo "freedisk.cdef freedisk,1024,*" |
||
| 25 | echo "totaldisk.label total Bytes" |
||
| 26 | echo "totaldisk.draw AREA" |
||
| 27 | echo "totaldisk.cdef totaldisk,1024,*" |
||
| 28 | exit 0 |
||
| 29 | fi |
||
| 30 | |||
| 31 | # get data |
||
| 32 | OUTPUT=`df -P | grep "$DISK"` |
||
| 33 | |||
| 34 | echo "freedisk.value `echo $OUTPUT | cut -d ' ' -f 4`" |
||
| 35 | echo "totaldisk.value `echo $OUTPUT | cut -d ' ' -f 2`" |
