%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /backups/router/usr/local/share/munin/plugins/
Upload File :
Create Path :
Current File : //backups/router/usr/local/share/munin/plugins/zpool_chksum

#!/bin/sh

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

Zerion Mini Shell 1.0