Projet

Général

Profil

Révision 210ebae0

ID210ebae0a02e70e10640015fc10e9c245bbf5d96
Parent 9c2aabf4
Enfant 25c2f2c3

Ajouté par Diver il y a presque 9 ans

Shellcheck

Voir les différences:

plugins/emc/emc_vnx_block_lun_perfdata
180 180
		${LUN}_write.min 0
181 181
		${LUN}_write.draw STACK
182 182
		EOF
183
	done <<< $LUNLIST
183
	done <<< "$LUNLIST"
184 184

  
185 185
	cat <<-EOF
186 186

  
......
202 202
		${LUN}_writereq.type COUNTER
203 203
		${LUN}_writereq.min 0
204 204
		EOF
205
	done <<< $LUNLIST
205
	done <<< "$LUNLIST"
206 206

  
207 207
	cat <<-EOF
208 208

  
......
215 215
	echo -n "graph_order "
216 216
	while read -r LUN ; do
217 217
                echo -n "${LUN}_busyticks ${LUN}_idleticks ${LUN}_bta=${LUN}_busyticks_spa ${LUN}_idleticks_spa ${LUN}_btb=${LUN}_busyticks_spb ${LUN}_idleticks_spb "
218
	done <<< $LUNLIST
218
	done <<< "$LUNLIST"
219 219
	echo ""
220 220
	while read -r LUN ; do
221 221
		cat <<-EOF
......
242 242
		${LUN}_load_spa.cdef 100,${LUN}_bta,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/,*
243 243
		${LUN}_load_spb.cdef 100,${LUN}_btb,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/,*
244 244
		EOF
245
	done <<< $LUNLIST
245
	done <<< "$LUNLIST"
246 246

  
247 247
	cat <<-EOF
248 248
	
......
257 257
		${LUN}_outstandsum.label $LUN
258 258
		${LUN}_outstandsum.type COUNTER
259 259
	EOF
260
	done <<< $LUNLIST
260
	done <<< "$LUNLIST"
261 261

  
262 262
	cat <<-EOF
263 263
	
......
272 272
		${LUN}_nonzeroreq.label $LUN
273 273
		${LUN}_nonzeroreq.type COUNTER
274 274
		EOF
275
	done <<< $LUNLIST
275
	done <<< "$LUNLIST"
276 276

  
277 277
	cat <<-EOF
278 278

  
......
286 286
		${LUN}_implic_tr.label ${LUN} Implicit Trespasses
287 287
		${LUN}_explic_tr.label ${LUN} Explicit Trespasses
288 288
		EOF
289
	done <<< $LUNLIST
289
	done <<< "$LUNLIST"
290 290

  
291 291
	cat <<-EOF
292 292

  
......
331 331
		${LUN}_ql_l_b.label ${LUN} Queue Length SPB
332 332
		${LUN}_ql_l_b.cdef ${LUN}_outstandsum,${LUN}_nonzeroreq,2,/,-,${LUN}_readreq,${LUN}_writereq,+,/,${LUN}_busyticks_spb,*,${LUN}_busyticks_spb,${LUN}_idleticks_spb,+,/
333 333
		EOF
334
	done <<< $LUNLIST
334
	done <<< "$LUNLIST"
335 335
exit 0
336 336
fi
337 337

  
......
352 352
		s/Implicit Trespasses\:\ */${LUN}_implic_tr.value /p;
353 353
		s/Explicit Trespasses\:\ */${LUN}_explic_tr.value /p;
354 354
		' ;"
355
done <<< $LUNLIST
355
done <<< "$LUNLIST"
356 356
ANSWER="$($BIGSSHCMD)"
357 357
echo "multigraph emc_vnx_block_blocks"
358 358
echo "$ANSWER" | grep "read\.\|write\."
......
363 363
while read -r LUN ; do
364 364
	echo "${LUN}_load_spa.value 0"
365 365
	echo "${LUN}_load_spb.value 0"
366
done <<< $LUNLIST
366
done <<< "$LUNLIST"
367 367
echo "$ANSWER" | grep "busyticks_spa\.\|idleticks_spa\."
368 368
echo "$ANSWER" | grep "busyticks_spb\.\|idleticks_spb\."
369 369

  
......
387 387
while read -r LUN ; do
388 388
	echo "${LUN}_ql_l_a.value 0 "
389 389
	echo "${LUN}_ql_l_b.value 0 "
390
done <<< $LUNLIST
390
done <<< "$LUNLIST"
391 391
exit 0
plugins/emc/emc_vnx_file_
129 129
fi
130 130

  
131 131
STATSTYPE=$(echo "${0##*/}" | cut -d _ -f 1-5)
132
if [ $STATSTYPE = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS; 
133
elif [ $STATSTYPE = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM;
132
if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS; 
133
elif [ "$STATSTYPE" = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM;
134 134
else echo "Do not know what to do. Name the plugin as 'emc_vnx_file_nfs_stats_<HOSTNAME>' or 'emc_vnx_file_basicdm_stats_<HOSTNAME>'"; exit 1; fi
135 135
# echo $STATSTYPE
136 136

  
......
233 233
		if [ $STATSTYPE = "NFS" ] ; then
234 234
#nfs.v3.op data
235 235
			member_elements=$($SSH server_stats $server -info nfs.v3.op | grep member_elements | sed -ne 's/^.*= //p')
236
			IFS=',' read -ra graphs <<< $member_elements
236
			IFS=',' read -ra graphs <<< "$member_elements"
237 237
			cat <<-EOF 
238 238
			multigraph vnx_emc_v3_calls_s
239 239
			graph_title EMC VNX 5300 NFSv3 Calls per second
......
274 274
			graphs=()
275 275
#nfs.v4.op data
276 276
			member_elements=$($SSH server_stats $server -info nfs.v4.op | grep member_elements | sed -ne 's/^.*= //p')
277
			IFS=',' read -ra graphs <<< $member_elements
277
			IFS=',' read -ra graphs <<< "$member_elements"
278 278
			cat <<-EOF
279 279
			multigraph vnx_emc_v4_calls_s
280 280
			graph_title EMC VNX 5300 NFSv4 Calls per second
......
317 317
#							 Total    Read     Write   Suspicious   Total    Read     Write      Avg   
318 318
#                                                      Ops/s    Ops/s    Ops/s    Ops diff    KiB/s    KiB/s    KiB/s   uSec/call
319 319
			member_elements=$($SSH server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p' | cut -d' ' -f1)
320
			readarray graphs2 <<< $member_elements
320
			readarray graphs2 <<< "$member_elements"
321 321
			cat <<-EOF
322 322

  
323 323
			multigraph vnx_emc_nfs_client_ops_s
......
391 391
	if [ $STATSTYPE = "BASICDM" ] ; then
392 392
member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
393 393
#       NUMCOL=5
394
        IFS=$' ' read -ra graphs <<< $member_elements
394
        IFS=$' ' read -ra graphs <<< "$member_elements"
395 395

  
396 396
        echo "multigraph emc_vnx_cpu_percent"
397 397
        echo "${server}_cpuutil.value ${graphs[1]}"
......
405 405
        echo "${server}_stor_write.value ${graphs[5]}"
406 406

  
407 407
        member_elements=$($SSH server_stats $server -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
408
        IFS=$' ' read -ra graphs <<< $member_elements
408
        IFS=$' ' read -ra graphs <<< "$member_elements"
409 409

  
410 410
        echo -e "\nmultigraph emc_vnx_memory"
411 411
        echo "${server}_total.value ${graphs[14]}"
......
432 432
#nfs.v3.op data
433 433
	member_elements=$($SSH server_stats $server -monitor nfs.v3.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v3/v3/p')
434 434
	NUMCOL=5
435
	LINES=$(wc -l <<< $member_elements)
435
	LINES=$(wc -l <<< "$member_elements")
436 436
	while IFS=$'\n' read -ra graphs ; do
437 437
		element+=( $graphs )
438
	done <<< $member_elements
438
	done <<< "$member_elements"
439 439

  
440 440
	echo "multigraph vnx_emc_v3_calls_s"
441 441
	for ((i=0; i<$((LINES)); i++ )); do
......
457 457
#nfs.v4.op data
458 458
	member_elements=$($SSH server_stats $server -monitor nfs.v4.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v4/v4/p')
459 459
	NUMCOL=5
460
	LINES=$(wc -l <<< $member_elements)
460
	LINES=$(wc -l <<< "$member_elements")
461 461
	while IFS=$'\n' read -ra graphs ; do
462 462
		element+=( $graphs )
463
	done <<< $member_elements
463
	done <<< "$member_elements"
464 464

  
465 465
	echo -e "\nmultigraph vnx_emc_v4_calls_s"
466 466
	for ((i=0; i<$((LINES)); i++ )); do
......
483 483
	echo -e "\nmultigraph vnx_emc_nfs_client_ops_s"
484 484
        member_elements=$($SSH server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p')
485 485
	NUMCOL=9
486
        LINES=$(wc -l <<< $member_elements)
486
        LINES=$(wc -l <<< "$member_elements")
487 487
	while IFS=$'\n' read -ra graphs; do
488 488
		element+=($graphs)
489
	done  <<< $member_elements
489
	done  <<< "$member_elements"
490 490
	for (( i=0; i<$((LINES)); i++ )); do
491 491
		client=$( echo ${element[i*$NUMCOL]} | sed -ne 's/\./_/pg')
492 492
               echo "${server}_${client}_r".value "${element[$i*$NUMCOL+2]}"

Formats disponibles : Unified diff