diff --git a/plugins/zfs/zfs_list b/plugins/zfs/zfs_list new file mode 100755 index 00000000..e8c7ed38 --- /dev/null +++ b/plugins/zfs/zfs_list @@ -0,0 +1,91 @@ +#!/bin/bash +# +# Plugin to monitor ZFS Filesystems +# Author: Adam Michel (elfurbe@furbism.com) +# Description: +# This is an extension of the zfs_fs plugin +# modified as a multigraph to graph all zfs +# filesystems it can find +# +# Tested on Ubuntu-14.04 +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# +#%# family=auto + +need_multigraph() + +if [ "$1" = "autoconf" ]; then + # Makes little sense to autoconf if you can't suggest + echo no + exit 0 +fi + +if [ "$1" = "suggest" ]; then + exit 0 +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'` + + echo <