summaryrefslogtreecommitdiff
path: root/sysutils/munin-node/plugins/zfs_arc_compression
blob: 303d80d00779c69fa10fe9b2c5cfdc4ad5940341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -e
set -u

UNCOMP_ARC=$(sysctl -n kstat.zfs.misc.arcstats.uncompressed_size)
COMP_ARC=$(sysctl -n kstat.zfs.misc.arcstats.compressed_size)

value=$(bc -e scale=2 -e "$UNCOMP_ARC/$COMP_ARC" -e quit)

cat <<EOM
graph_title ZFS ARC compression ratio
graph_vlabel ratio
graph_category ZFS
graph_info This graph shows the ZFS ARC compression (uncompressed vs. compressed) ratio
ratio.label ratio
ratio.value $value
EOM

exit 0