Révision c7a7f086
Add size module
| plugins/solaris/io_disk | ||
|---|---|---|
| 12 | 12 |
busy : similar to iostat %b, %w (%w usually indicates 0 in Sol10,11) |
| 13 | 13 |
queue : similar to iostat actv, wait |
| 14 | 14 |
latency : similar to iostat asvc_t, wsvc_t |
| 15 |
size : average io size |
|
| 15 | 16 |
|
| 16 | 17 |
This plugin is improved from Solaris io_busy_, io_ops_, io_bytes_ plugins. |
| 17 | 18 |
Any device found in /usr/bin/kstat can be monitored. |
| ... | ... | |
| 52 | 53 |
It may be good to link like ln -s /path/to/io_disk io_nfs if necessary. |
| 53 | 54 |
|
| 54 | 55 |
env.module_regex - kstat module. See man kstat -m option. |
| 55 |
example: env.module_regex /^(s?sd|vdc|zvblk|dad|md|nfs|tape)$/
|
|
| 56 |
example: env.module_regex /^(s?sd|vdc|zvblk|dad|md|nfs|st)$/
|
|
| 56 | 57 |
default: /^(s?sd|vdc|zvblk|dad|md)$/ |
| 57 | 58 |
|
| 58 | 59 |
env.title_type - Device type shown in graph title. |
| ... | ... | |
| 92 | 93 |
|
| 93 | 94 |
# Set environment variables |
| 94 | 95 |
plugin_name=io |
| 95 |
functions='ops bytes busy queue latency' |
|
| 96 |
functions='ops bytes busy queue latency size'
|
|
| 96 | 97 |
: "${class:=disk}"
|
| 97 | 98 |
: "${module:=sd}"
|
| 98 | 99 |
: "${module_regex:=/^(s?sd|vdc|zvblk|dad|md)\$/}"
|
| ... | ... | |
| 120 | 121 |
case "$func" in |
| 121 | 122 |
ops) |
| 122 | 123 |
conf_title='I/O Operations' |
| 123 |
conf_in=reads |
|
| 124 |
conf_out=writes |
|
| 125 |
conf_cdef= |
|
| 126 | 124 |
conf_gargs='--base 1000' |
| 127 | 125 |
conf_vlabel='Ops per second write (-) / read (+)' |
| 126 |
conf_in=reads |
|
| 127 |
conf_out=writes |
|
| 128 |
conf_in_cdef= |
|
| 129 |
conf_out_cdef= |
|
| 128 | 130 |
;; |
| 129 | 131 |
bytes) |
| 130 | 132 |
conf_title='I/O Throughput' |
| 131 |
conf_in=nread |
|
| 132 |
conf_out=nwritten |
|
| 133 |
conf_cdef= |
|
| 134 | 133 |
conf_gargs='--base 1024' |
| 135 | 134 |
conf_vlabel='Bytes per second write (-) / read (+)' |
| 135 |
conf_in=nread |
|
| 136 |
conf_out=nwritten |
|
| 137 |
conf_in_cdef= |
|
| 138 |
conf_out_cdef= |
|
| 136 | 139 |
;; |
| 137 | 140 |
busy) |
| 138 | 141 |
conf_title='Busy & Wait' |
| 139 |
conf_in=rtime |
|
| 140 |
conf_out=wtime |
|
| 141 |
conf_cdef=',100,*' |
|
| 142 | 142 |
conf_gargs='--base 1000 --lower-limit 0 --upper-limit 100' |
| 143 | 143 |
conf_vlabel='% wait (-) / busy (+)' |
| 144 |
conf_in=rtime |
|
| 145 |
conf_out=wtime |
|
| 146 |
conf_in_cdef=',100,*' |
|
| 147 |
conf_out_cdef=',100,*' |
|
| 144 | 148 |
;; |
| 145 | 149 |
queue) |
| 146 | 150 |
conf_title='Queue Length' |
| 147 |
conf_in=rlentime |
|
| 148 |
conf_out=wlentime |
|
| 149 |
conf_cdef= |
|
| 150 | 151 |
conf_gargs='--base 1000' |
| 151 | 152 |
conf_vlabel='Queue length wait (-) / actv (+)' |
| 153 |
conf_in=rlentime |
|
| 154 |
conf_out=wlentime |
|
| 155 |
conf_in_cdef= |
|
| 156 |
conf_out_cdef= |
|
| 152 | 157 |
;; |
| 153 | 158 |
latency) |
| 154 | 159 |
conf_title='Latency' |
| 155 |
conf_in=rlentime |
|
| 156 |
conf_out=wlentime |
|
| 157 |
conf_cdef= |
|
| 158 | 160 |
conf_gargs='--base 1000' |
| 159 | 161 |
conf_vlabel='Seconds wsvc_t (-) / asvc_t (+)' |
| 162 |
conf_in=rlentime |
|
| 163 |
conf_out=wlentime |
|
| 164 |
conf_in_cdef= |
|
| 165 |
conf_out_cdef= |
|
| 166 |
;; |
|
| 167 |
size) |
|
| 168 |
conf_title='I/O Size' |
|
| 169 |
conf_gargs='--base 1024' |
|
| 170 |
conf_vlabel='Average size write (-) / read (+)' |
|
| 171 |
conf_in=nread |
|
| 172 |
conf_out=nwritten |
|
| 173 |
conf_in_cdef= |
|
| 174 |
conf_out_cdef= |
|
| 160 | 175 |
;; |
| 161 | 176 |
*) |
| 162 | 177 |
echo "Unknown function: $func" |
| ... | ... | |
| 205 | 220 |
ref="name_$dev" |
| 206 | 221 |
devname=${!ref:-} # ${!varname} means indirect evaluation (similar to eval)
|
| 207 | 222 |
|
| 208 |
# reads and writes are necessary to calculate latency |
|
| 209 |
if [ "$func" = 'latency' ]; then |
|
| 223 |
# reads and writes are necessary to calculate latency, size |
|
| 224 |
case "$func" in |
|
| 225 |
latency|size) |
|
| 210 | 226 |
for stat in reads writes |
| 211 | 227 |
do |
| 212 | 228 |
echo "${dev}_$stat.label dummy"
|
| ... | ... | |
| 214 | 230 |
echo "${dev}_$stat.type DERIVE"
|
| 215 | 231 |
echo "${dev}_$stat.min 0"
|
| 216 | 232 |
done |
| 217 |
# rlentime / ( reads + writes ) |
|
| 218 |
conf_cdef=,${dev}_reads,${dev}_writes,+,/
|
|
| 219 |
fi |
|
| 233 |
;; |
|
| 234 |
esac |
|
| 220 | 235 |
|
| 236 |
# Set cdef for latency, size |
|
| 237 |
case "$func" in |
|
| 238 |
latency) |
|
| 239 |
# rlentime / ( reads + writes ) |
|
| 240 |
conf_in_cdef=,${dev}_reads,${dev}_writes,+,/
|
|
| 241 |
conf_out_cdef=,${dev}_reads,${dev}_writes,+,/
|
|
| 242 |
;; |
|
| 243 |
size) |
|
| 244 |
conf_in_cdef=,${dev}_reads,/
|
|
| 245 |
conf_out_cdef=,${dev}_writes,/
|
|
| 246 |
;; |
|
| 247 |
esac |
|
| 248 |
|
|
| 249 |
# Print data attributes |
|
| 221 | 250 |
echo "${dev}_${conf_out}.label dummy"
|
| 222 | 251 |
echo "${dev}_${conf_out}.graph no"
|
| 223 | 252 |
echo "${dev}_${conf_out}.type DERIVE"
|
| 224 | 253 |
echo "${dev}_${conf_out}.min 0"
|
| 254 |
if [ -n "${conf_out_cdef:-}" ]; then
|
|
| 255 |
echo "${dev}_${conf_out}.cdef ${dev}_${conf_out}${conf_out_cdef}"
|
|
| 256 |
fi |
|
| 225 | 257 |
|
| 226 | 258 |
echo "${dev}_${conf_in}.label ${devname:-${dev}}"
|
| 227 | 259 |
echo "${dev}_${conf_in}.negative ${dev}_${conf_out}"
|
| 228 | 260 |
echo "${dev}_${conf_in}.type DERIVE"
|
| 229 | 261 |
echo "${dev}_${conf_in}.min 0"
|
| 230 |
|
|
| 231 |
if [ -n "$conf_cdef" ]; then |
|
| 232 |
echo "${dev}_${conf_out}.cdef ${dev}_${conf_out}${conf_cdef}"
|
|
| 233 |
echo "${dev}_${conf_in}.cdef ${dev}_${conf_in}${conf_cdef}"
|
|
| 262 |
if [ -n "${conf_in_cdef:-}" ]; then
|
|
| 263 |
echo "${dev}_${conf_in}.cdef ${dev}_${conf_in}${conf_in_cdef}"
|
|
| 234 | 264 |
fi |
| 235 | 265 |
done |
| 236 | 266 |
|
| ... | ... | |
| 243 | 273 |
func=$1 |
| 244 | 274 |
preconfig "$func" |
| 245 | 275 |
|
| 246 |
if [ "$func" = 'latency' ]; then |
|
| 276 |
case "$func" in |
|
| 277 |
latency|size) |
|
| 247 | 278 |
stat_regex="/^($conf_in|$conf_out|reads|writes)\$/" |
| 248 |
else |
|
| 279 |
;; |
|
| 280 |
*) |
|
| 249 | 281 |
stat_regex="/^($conf_in|$conf_out)\$/" |
| 250 |
fi |
|
| 282 |
;; |
|
| 283 |
esac |
|
| 251 | 284 |
|
| 252 | 285 |
echo "multigraph ${plugin_name}_${func}_${module}"
|
| 253 | 286 |
|
Formats disponibles : Unified diff