mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Plugin zfs-filesystem-graph: fix autoconf and remove "suggest"
This commit is contained in:
parent
be192b5226
commit
e68a0308fe
1 changed files with 7 additions and 5 deletions
|
@ -20,18 +20,20 @@
|
||||||
# ** WARNING **
|
# ** WARNING **
|
||||||
# For now this plugin does not allow "_" in the name of a zpool or filesystems
|
# For now this plugin does not allow "_" in the name of a zpool or filesystems
|
||||||
#
|
#
|
||||||
|
# #%# capabilities=autoconf
|
||||||
|
#
|
||||||
|
|
||||||
myname=$(basename "$0" | sed 's/^zfs_fs_//g' | sed -e 's/_/\//g')
|
myname=$(basename "$0" | sed 's/^zfs_fs_//g' | sed -e 's/_/\//g')
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
# Makes little sense to autoconf if you can't suggest
|
if which zfs >/dev/null; then
|
||||||
echo no
|
echo yes
|
||||||
|
else
|
||||||
|
echo "no (missing executable 'zfs')"
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "suggest" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -r -a values <<<"$(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota "$myname" \
|
read -r -a values <<<"$(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota "$myname" \
|
||||||
| awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}')"
|
| awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}')"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue