freebsd-ports/sysutils/munin-node/plugins/zpool_chksum
Mathieu Arnold b224fa620b Fix swap accounting if there are multiple devices [1]
Add a few zfs related plugins [2]

PR:		210494 [1]
Submitted by:	bcr [2]
Reported by:	Fabian Keil [1]
Sponsored by:	Absolight
2016-08-04 14:26:56 +00:00

34 lines
784 B
Bash

#!/bin/sh
#
# $FreeBSD$
set -e
set -u
cat <<'EOM'
graph_title ZFS dataset error counters
graph_vlabel amount of errors
graph_category ZFS
graph_info This graph shows the ZFS dataset error counters for reads, writes, and checksums
EOM
status=$(zpool status|awk 'BEGIN {p=0} /spares$/ || /^$/ {p=0} p==1 {print} /NAME.*STATE.*READ/ {p=1}')
while read -r label _ r w c; do
echo "R${label}.label READ ${label} "
echo "R${label}.value ${r}"
echo "R${label}.warning 1"
echo "R${label}.critical 2"
echo "W${label}.label WRITE ${label} "
echo "W${label}.value ${w}"
echo "W${label}.warning 1"
echo "W${label}.critical 2"
echo "C${label}.label CHKSUM ${label}"
echo "C${label}.value ${c}"
echo "C${label}.warning 1"
echo "C${label}.critical 2"
done <<eot
${status}
eot
exit 0