mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
If a pool is named something like "m" or "ra" or any string that matches the types of zpool, the grep will match multiple lines.
Adding a space after the zlabel will allow for more exact matching.
This commit is contained in:
parent
178a3d148e
commit
45e7dea7a1
1 changed files with 2 additions and 2 deletions
|
@ -40,9 +40,9 @@ echo $zlist | tr ' ' '\n' | while read iz; do
|
||||||
*) name=`echo $iz | gawk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
|
*) name=`echo $iz | gawk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
|
||||||
esac
|
esac
|
||||||
echo -n $name'_read.value '
|
echo -n $name'_read.value '
|
||||||
grep '^[ ]*'$zlabel $ztmp|gawk '{print $6}'|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
|
grep '^[ ]*'$zlabel\ $ztmp|gawk '{print $6}'|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
|
||||||
echo -n $name'_write.value '
|
echo -n $name'_write.value '
|
||||||
grep '^[ ]*'$zlabel $ztmp|gawk '{print $7}'|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
|
grep '^[ ]*'$zlabel\ $ztmp|gawk '{print $7}'|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
|
||||||
done
|
done
|
||||||
|
|
||||||
rm $ztmp; touch $ztmp
|
rm $ztmp; touch $ztmp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue