mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Fix method to create device maps
because sometimes iostat may hang in process substitution and for readability
This commit is contained in:
parent
13cb4192d9
commit
544b2cfb4a
1 changed files with 5 additions and 4 deletions
|
@ -105,10 +105,11 @@ functions='ops bytes busy queue latency'
|
||||||
# name_sd1=c0t0d0
|
# name_sd1=c0t0d0
|
||||||
# name_ssd2=c0tAB_1234d0 (shorten long target)
|
# name_ssd2=c0tAB_1234d0 (shorten long target)
|
||||||
# ...
|
# ...
|
||||||
declare $( paste -d= \
|
instance_names=$( iostat -x | sed -e '1,2d' | awk '{print $1}' | \
|
||||||
<( iostat -x | awk '{print $1}' | sed -e '1,2d' -e 's/^/name_/' ) \
|
sed -e 's/^/name_/' )
|
||||||
<( iostat -xn | awk '{print $NF}' | sed -e '1,2d' -e 's/^\(c[0-9]*\)\(t.\{2\}\).*\(.\{4\}\)\(d[0-9]*\)$/\1\2_\3\4/' ) \
|
logical_device_names=$( iostat -xn | sed -e '1,2d' | awk '{print $NF}' | \
|
||||||
)
|
sed -e 's/^\(c[0-9]*\)\(t.\{2\}\).*\(.\{4\}\)\(d[0-9]*\)$/\1\2_\3\4/' )
|
||||||
|
declare $( paste -d= <( echo "$instance_names" ) <( echo "$logical_device_names" ) )
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue