1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

decrease numbers of fork

This commit is contained in:
Yoann Moulin 2010-12-30 09:33:43 +01:00 committed by Steve Schnepp
parent 2a2a73a6f2
commit 4d80dc5a8d

View file

@ -3,6 +3,7 @@
# Plugin to monitor a ZFS Filesystem # Plugin to monitor a ZFS Filesystem
# #
# Wildcard-plugin to monitor a zfs filesystems. # Wildcard-plugin to monitor a zfs filesystems.
#
# To monitor a filesystem, link zfs_fs_<zpool>_<filesystem> to this file. E.g. # To monitor a filesystem, link zfs_fs_<zpool>_<filesystem> to this file. E.g.
# #
# ln -s /usr/share/munin/node/plugins-auto/zfs_fs_ /etc/munin/node.d/zfs_fs_tank_foo # ln -s /usr/share/munin/node/plugins-auto/zfs_fs_ /etc/munin/node.d/zfs_fs_tank_foo
@ -15,12 +16,10 @@
# #
# config (required) # config (required)
# autoconf (optional - used by munin-config) # autoconf (optional - used by munin-config)
#
# ** WARNING **
# For now this plugin does not allow "_" in the name of a zpool or filesystems
# #
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=auto
#%# 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'`
@ -38,49 +37,51 @@ values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefrese
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo "graph_title zfs $myname" echo <<EOF "graph_title zfs $myname
echo 'graph_order usedbydataset usedbychildren usedbysnapshots usedbyrefreservation available total quota' graph_order usedbydataset usedbychildren usedbysnapshots usedbyrefreservation available total quota
echo "graph_args --base 1024 -r -l 0 --vertical-label Bytes --upper-limit ${values[6]}" graph_args --base 1024 -r -l 0 --vertical-label Bytes --upper-limit ${values[6]}
echo 'graph_info This graph shows how is used a zfs filesystems.' graph_info This graph shows how is used a zfs filesystems.
echo 'graph_category Zfs' graph_category Zfs
echo 'graph_period second' graph_period second
echo 'usedbydataset.label UsedByDataset' usedbydataset.label UsedByDataset
echo 'usedbydataset.draw AREA' usedbydataset.draw AREA
echo 'usedbydataset.info Used space by Dataset' usedbydataset.info Used space by Dataset
echo 'usedbydataset.colour FF0000' usedbydataset.colour FF0000
echo 'usedbychildren.label UsedByChildren' usedbychildren.label UsedByChildren
echo 'usedbychildren.draw STACK' usedbychildren.draw STACK
echo 'usedbychildren.info Used space by children' usedbychildren.info Used space by children
echo 'usedbychildren.colour FFCC33' usedbychildren.colour FFCC33
echo 'usedbysnapshots.label UsedBySnapshots' usedbysnapshots.label UsedBySnapshots
echo 'usedbysnapshots.draw STACK' usedbysnapshots.draw STACK
echo 'usedbysnapshots.info Used space by snapshot' usedbysnapshots.info Used space by snapshot
echo 'usedbysnapshots.colour 0000FF' usedbysnapshots.colour 0000FF
echo 'usedbyrefreservation.label Usedbyrefreservation' usedbyrefreservation.label Usedbyrefreservation
echo 'usedbyrefreservation.draw STACK' usedbyrefreservation.draw STACK
echo 'usedbyrefreservation.info Used space by Ref Reservation' usedbyrefreservation.info Used space by Ref Reservation
echo 'usedbyrefreservation.colour 33CCFF' usedbyrefreservation.colour 33CCFF
echo 'available.label Available' available.label Available
echo 'available.draw STACK' available.draw STACK
echo 'available.info Free space' available.info Free space
echo 'available.colour 00FF00' available.colour 00FF00
echo 'total.label Total' total.label Total
echo 'total.draw LINE1' total.draw LINE1
echo 'total.info Total' total.info Total
echo 'total.colour 000000' total.colour 000000
echo 'quota.label Quota' quota.label Quota
echo 'quota.draw LINE1' quota.draw LINE1
echo 'quota.info Quota' quota.info Quota
echo 'quota.colour 555555' quota.colour 555555"
EOF
exit 0 exit 0
fi fi
echo "usedbydataset.value ${values[0]}" echo <<EOF "usedbydataset.value ${values[0]}
echo "usedbysnapshots.value ${values[2]}" usedbysnapshots.value ${values[2]}
echo "usedbychildren.value ${values[1]}" usedbychildren.value ${values[1]}
echo "usedbyrefreservation.value ${values[3]}" usedbyrefreservation.value ${values[3]}
echo "available.value ${values[4]}" available.value ${values[4]}
echo "total.value ${values[6]}" total.value ${values[6]}
echo "quota.value ${values[5]}" quota.value ${values[5]}"
EOF
exit 0 exit 0