1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

zpool_capacity: Added fragmentation % graph

Added fragmentation % graph
This commit is contained in:
rantal 2019-07-24 18:27:18 +03:00 committed by Lars Kruse
parent db7b2f28ab
commit 4864783fca

View file

@ -8,6 +8,7 @@
These functions are implemented:
capacity : to monitor zpool capacity %
fragmentation : to monitor zpool fragmantation %
allocated : to monitor zpool allocated bytes
dedup : to monitor zpool dedup and compress ratio
@ -34,6 +35,8 @@
K.Cima https://github.com/shakemid
Fragmentation graph by https://github.com/rantal
=head1 LICENSE
GPLv2
@ -54,7 +57,7 @@ set -o nounset
# Global variables
plugin_name=zpool_capacity
functions='capacity allocated dedup'
functions='capacity fragmentation allocated dedup'
zpool_cmd=/sbin/zpool
zfs_cmd=/sbin/zfs
@ -92,6 +95,20 @@ preconfig() {
${p} GAUGE LINE2 ${p}"
done
;;
fragmentation)
global_attr="
graph_title ZFS storage pool - Fragmentation
graph_category fs
graph_args --base 1000 --lower-limit 0 --upper-limit 100
graph_vlabel % fragmentation
graph_info ZFS storage pool - Fragmentation
"
for p in $pool_list
do
data_attr="${data_attr}
${p} GAUGE LINE2 ${p}"
done
;;
allocated)
global_attr="
graph_title ZFS storage pool - Allocated bytes
@ -168,6 +185,9 @@ get_stats() {
capacity)
"$zpool_cmd" list -H -o name,capacity | sed 's/%$//'
;;
fragmentation)
"$zpool_cmd" list -H -o name,fragmentation | sed 's/%$//'
;;
allocated)
( "$zpool_cmd" list -H -o name,allocated \
| awk '{ print $1"_allocated", $2 }'