mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
[zpool_iostat] autoconf checks zpool executable
This commit is contained in:
parent
67af152b9e
commit
64c30de05f
1 changed files with 10 additions and 4 deletions
|
@ -1,13 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
ZPOOL_BIN=/sbin/zpool
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
echo yes
|
if [ -x "$ZPOOL_BIN" ]; then
|
||||||
exit 0
|
echo yes
|
||||||
|
else
|
||||||
|
echo "no (missing executable '$ZPOOL_BIN')"
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
zlines=$(/sbin/zpool iostat -v | wc -l | sed 's/ //g')
|
zlines=$("$ZPOOL_BIN" iostat -v | wc -l | sed 's/ //g')
|
||||||
ztmp=/var/run/munin/zpool_iostat
|
ztmp=/var/run/munin/zpool_iostat
|
||||||
/sbin/zpool iostat -v 1 1 | tail "-$zlines" > "$ztmp"
|
"$ZPOOL_BIN" iostat -v 1 1 | tail "-$zlines" > "$ztmp"
|
||||||
zlist=$(gawk '/alloc/ {next}; /avail/ {next}; /raid/ {next}; /mirror/ {next}; { if ( $4 >=0 ) print $1}' "$ztmp")
|
zlist=$(gawk '/alloc/ {next}; /avail/ {next}; /raid/ {next}; /mirror/ {next}; { if ( $4 >=0 ) print $1}' "$ztmp")
|
||||||
zname=$(gawk '/alloc/ {next}; /avail/ {next}; /raid/ {next}; /mirror/ {next}; { if ( $4 >=0 ) print $1}' "$ztmp" | gawk '{gsub("[^a-zA-Z0-9_]", "_", $1); print}')
|
zname=$(gawk '/alloc/ {next}; /avail/ {next}; /raid/ {next}; /mirror/ {next}; { if ( $4 >=0 ) print $1}' "$ztmp" | gawk '{gsub("[^a-zA-Z0-9_]", "_", $1); print}')
|
||||||
zorder=$(for o in $zname; do echo "${o}_read "; echo "${o}_write "; done)
|
zorder=$(for o in $zname; do echo "${o}_read "; echo "${o}_write "; done)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue