Skip to content
Permalink
Browse files

Add support for dash in zfs_list

#969 zfs/zfs_list: Add support for dash in zfs_list
  • Loading branch information...
Sephtex committed Feb 3, 2019
1 parent bc8bb4d commit 0429e63be5670f57b053411c37e4c8d92258c92b
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugins/zfs/zfs_list
@@ -31,7 +31,7 @@ fi
if [ "$1" = "config" ]; then
for i in `zfs list -Hp | awk '{print $1}'`; do
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;}') )
fsname=`echo $i | sed 's/\//__/g'`
fsname=`echo $i | sed 's/\//__/g' | sed 's/-/_/g'`

echo <<EOF "multigraph zfs_list_$fsname
graph_title $fsname usage
@@ -75,7 +75,7 @@ fi

for i in `zfs list -Hp | awk '{print $1}'`; do
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;}') )
fsname=`echo $i | sed 's/\//__/g'`
fsname=`echo $i | sed 's/\//__/g' | sed 's/-/_/g'`

echo <<EOF "multigraph zfs_list_$fsname
usedbydataset.value ${values[0]}

0 comments on commit 0429e63

Please sign in to comment.
You can’t perform that action at this time.