2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #731 from acranox/fix_iostat_pool_names

If a pool is named something like "m" or "ra" or any string that matc…
This commit is contained in:
sumpfralle 2016-10-21 00:46:27 +02:00 committed by GitHub
commit 7fea585bc5

View File

@ -40,9 +40,9 @@ echo $zlist | tr ' ' '\n' | while read iz; do
*) name=`echo $iz | gawk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
esac
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}'
gawk '{ if ($1 == "'"$zlabel"'") print $6; }' "$ztmp"|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
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}'
gawk '{ if ($1 == "'"$zlabel"'") print $7; }' "$ztmp"|gawk '/M/ {print strtonum($1)*1000}; /K/ {print strtonum($1)}; /[0-9]$/ {print int($1)/1000}'
done
rm $ztmp; touch $ztmp