Révision 544b2cfb
Fix method to create device maps
because sometimes iostat may hang in process substitution and for readability
| plugins/solaris/io_disk | ||
|---|---|---|
| 105 | 105 |
# name_sd1=c0t0d0 |
| 106 | 106 |
# name_ssd2=c0tAB_1234d0 (shorten long target) |
| 107 | 107 |
# ... |
| 108 |
declare $( paste -d= \ |
|
| 109 |
<( iostat -x | awk '{print $1}' | sed -e '1,2d' -e 's/^/name_/' ) \
|
|
| 110 |
<( iostat -xn | awk '{print $NF}' | sed -e '1,2d' -e 's/^\(c[0-9]*\)\(t.\{2\}\).*\(.\{4\}\)\(d[0-9]*\)$/\1\2_\3\4/' ) \
|
|
| 111 |
) |
|
| 108 |
instance_names=$( iostat -x | sed -e '1,2d' | awk '{print $1}' | \
|
|
| 109 |
sed -e 's/^/name_/' ) |
|
| 110 |
logical_device_names=$( iostat -xn | sed -e '1,2d' | awk '{print $NF}' | \
|
|
| 111 |
sed -e 's/^\(c[0-9]*\)\(t.\{2\}\).*\(.\{4\}\)\(d[0-9]*\)$/\1\2_\3\4/' )
|
|
| 112 |
declare $( paste -d= <( echo "$instance_names" ) <( echo "$logical_device_names" ) ) |
|
| 112 | 113 |
|
| 113 | 114 |
# Functions |
| 114 | 115 |
|
Formats disponibles : Unified diff