summaryrefslogtreecommitdiff
path: root/sysutils/munin-node/plugins/zpool_dedup
blob: 932b60628f5cfbefe25898bcef08daf5e0dbc6b7 (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
#!/bin/sh
#
# $FreeBSD$

set -e
set -u

cat <<'EOM'
graph_title ZFS deduplication ratio
graph_vlabel ratio
graph_category ZFS
graph_info This graph shows the ZFS pool deduplication ratio
EOM

listing=$(zpool get -H dedup)

while read -r label _ ratio _; do
	echo "${label}.label ${label}"
	echo "${label}.value ${ratio%x}"
done <<eot
${listing}
eot

exit 0