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

@ -7,9 +7,10 @@
zpool_capacity - Munin plugin to monitor ZFS capacity zpool_capacity - Munin plugin to monitor ZFS capacity
These functions are implemented: These functions are implemented:
capacity : to monitor zpool capacity % capacity : to monitor zpool capacity %
allocated : to monitor zpool allocated bytes fragmentation : to monitor zpool fragmantation %
dedup : to monitor zpool dedup and compress ratio allocated : to monitor zpool allocated bytes
dedup : to monitor zpool dedup and compress ratio
Tested with Solaris 10 and 11, OpenIndiana Hipster, FreeBSD 11, CentOS 7 Tested with Solaris 10 and 11, OpenIndiana Hipster, FreeBSD 11, CentOS 7
@ -34,6 +35,8 @@
K.Cima https://github.com/shakemid K.Cima https://github.com/shakemid
Fragmentation graph by https://github.com/rantal
=head1 LICENSE =head1 LICENSE
GPLv2 GPLv2
@ -54,7 +57,7 @@ set -o nounset
# Global variables # Global variables
plugin_name=zpool_capacity plugin_name=zpool_capacity
functions='capacity allocated dedup' functions='capacity fragmentation allocated dedup'
zpool_cmd=/sbin/zpool zpool_cmd=/sbin/zpool
zfs_cmd=/sbin/zfs zfs_cmd=/sbin/zfs
@ -92,6 +95,20 @@ preconfig() {
${p} GAUGE LINE2 ${p}" ${p} GAUGE LINE2 ${p}"
done 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) allocated)
global_attr=" global_attr="
graph_title ZFS storage pool - Allocated bytes graph_title ZFS storage pool - Allocated bytes
@ -168,6 +185,9 @@ get_stats() {
capacity) capacity)
"$zpool_cmd" list -H -o name,capacity | sed 's/%$//' "$zpool_cmd" list -H -o name,capacity | sed 's/%$//'
;; ;;
fragmentation)
"$zpool_cmd" list -H -o name,fragmentation | sed 's/%$//'
;;
allocated) allocated)
( "$zpool_cmd" list -H -o name,allocated \ ( "$zpool_cmd" list -H -o name,allocated \
| awk '{ print $1"_allocated", $2 }' | awk '{ print $1"_allocated", $2 }'