1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

[zpool_iostat] enable 'exit_on_error' and 'exit_on_unset' via 'set -eu'

This commit is contained in:
Lars Kruse 2016-12-04 15:56:32 +01:00
parent 3e86f2b80a
commit 77b9a515a5

View file

@ -1,11 +1,18 @@
#!/bin/sh
# -*- sh -*-
set -eu
# shellcheck source=/usr/share/munin/plugins/plugin.sh
. "$MUNIN_LIBDIR/plugins/plugin.sh"
ZPOOL_BIN=/sbin/zpool
ACTION="${1:-}"
if [ "$1" = "autoconf" ]; then
if [ "$ACTION" = "autoconf" ]; then
if [ -x "$ZPOOL_BIN" ]; then
echo yes
else
@ -27,7 +34,7 @@ get_pool_iostat() {
| gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
}
if [ "$1" = "config" ]; then
if [ "$ACTION" = "config" ]; then
echo 'graph_title zpool iostat'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel write - read KBytes/s'