#!/bin/sh # # $FreeBSD: head/sysutils/munin-node/plugins/zpool_chksum 419615 2016-08-04 14:26:56Z mat $ 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 <