From 544b2cfb4a721c5a472d78f042b23eec7a20d684 Mon Sep 17 00:00:00 2001 From: "K.Cima" Date: Wed, 29 Mar 2017 12:09:21 +0900 Subject: [PATCH] Fix method to create device maps because sometimes iostat may hang in process substitution and for readability --- plugins/solaris/io_disk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/solaris/io_disk b/plugins/solaris/io_disk index f50d58b0..8ea87e0d 100755 --- a/plugins/solaris/io_disk +++ b/plugins/solaris/io_disk @@ -105,10 +105,11 @@ functions='ops bytes busy queue latency' # name_sd1=c0t0d0 # name_ssd2=c0tAB_1234d0 (shorten long target) # ... -declare $( paste -d= \ - <( iostat -x | awk '{print $1}' | sed -e '1,2d' -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/' ) \ - ) +instance_names=$( iostat -x | sed -e '1,2d' | awk '{print $1}' | \ + sed -e 's/^/name_/' ) +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