Révision f6dbe9bd
add usage of clean_fieldname
Used the correct munin way by soursing "$MUNIN_LIBDIR/plugins/plugin.sh" and use clean_fieldname.
For the title I removed the replacement of / by __ and on the multigraph value I added the usage of clean_fieldname to make it backwards compatible.
| plugins/zfs/zfs_list | ||
|---|---|---|
| 16 | 16 |
# |
| 17 | 17 |
#%# family=auto |
| 18 | 18 |
|
| 19 |
. "$MUNIN_LIBDIR/plugins/plugin.sh" |
|
| 20 |
|
|
| 19 | 21 |
need_multigraph() |
| 20 | 22 |
|
| 21 | 23 |
if [ "$1" = "autoconf" ]; then |
| ... | ... | |
| 31 | 33 |
if [ "$1" = "config" ]; then |
| 32 | 34 |
for i in `zfs list -Hp | awk '{print $1}'`; do
|
| 33 | 35 |
values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota $i | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}') )
|
| 34 |
fsname=`echo $i | sed 's/\//__/g' | sed 's/-/_/g'`
|
|
| 36 |
fsname=$(clean_fieldname "$i")
|
|
| 35 | 37 |
|
| 36 | 38 |
echo <<EOF "multigraph zfs_list_$fsname |
| 37 | 39 |
graph_title $fsname usage |
| ... | ... | |
| 75 | 77 |
|
| 76 | 78 |
for i in `zfs list -Hp | awk '{print $1}'`; do
|
| 77 | 79 |
values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota $i | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}') )
|
| 78 |
fsname=`echo $i | sed 's/\//__/g' | sed 's/-/_/g'`
|
|
| 80 |
fsname=$(clean_fieldname $(echo "$i" | sed 's/\//__/g'))
|
|
| 79 | 81 |
|
| 80 | 82 |
echo <<EOF "multigraph zfs_list_$fsname |
| 81 | 83 |
usedbydataset.value ${values[0]}
|
Formats disponibles : Unified diff