mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
[zpool_iostat] enable 'exit_on_error' and 'exit_on_unset' via 'set -eu'
This commit is contained in:
parent
3e86f2b80a
commit
77b9a515a5
1 changed files with 9 additions and 2 deletions
|
@ -1,11 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# -*- sh -*-
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
|
||||||
|
# shellcheck source=/usr/share/munin/plugins/plugin.sh
|
||||||
. "$MUNIN_LIBDIR/plugins/plugin.sh"
|
. "$MUNIN_LIBDIR/plugins/plugin.sh"
|
||||||
|
|
||||||
|
|
||||||
ZPOOL_BIN=/sbin/zpool
|
ZPOOL_BIN=/sbin/zpool
|
||||||
|
ACTION="${1:-}"
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$ACTION" = "autoconf" ]; then
|
||||||
if [ -x "$ZPOOL_BIN" ]; then
|
if [ -x "$ZPOOL_BIN" ]; then
|
||||||
echo yes
|
echo yes
|
||||||
else
|
else
|
||||||
|
@ -27,7 +34,7 @@ get_pool_iostat() {
|
||||||
| gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
|
| 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_title zpool iostat'
|
||||||
echo 'graph_args --base 1000 -l 0'
|
echo 'graph_args --base 1000 -l 0'
|
||||||
echo 'graph_vlabel write - read KBytes/s'
|
echo 'graph_vlabel write - read KBytes/s'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue