aboutsummaryrefslogtreecommitdiff
path: root/sysutils/munin-node/plugins/zfs_compress
blob: 02f918f875d5b628e5a6ec6362bbd02579c31984 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#
# $FreeBSD$

set -e
set -u

cat <<'EOM'
graph_title ZFS dataset compression ratio 
graph_vlabel ratio 
graph_category ZFS
graph_info This graph shows the ZFS dataset compression ratio
EOM

listing=$(zfs get -t filesystem -H compressratio)

while read -r label _ ratio _; do
	clean_label=$(echo "${label}" | sed -e 's|/|__|g')
	echo "${clean_label}.label ${label}"
	echo "${clean_label}.value ${ratio%x}"
done <<eot
${listing}
eot

exit 0