Projet

Général

Profil

Révision fe330bab

IDfe330bab0320634e652e5b8299dec7e17dc744bb
Parent 782b70e5
Enfant f66edd28

Ajouté par Diver il y a presque 9 ans

Added EMC VNX 5300 Std NFS; fixed some indentation

Voir les différences:

plugins/emc/emc_vnx_file_
71 71
	EMC VNX 5300 NFS Client Ops/s
72 72
	EMC VNX 5300 NFS Client B/s
73 73
	EMC VNX 5300 NFS Client Avg uSec/call
74
	EMC VNX 5300 Std NFS Ops/s
75
	EMC VNX 5300 Std NFS B/s
76
	EMC VNX 5300 Std NFS Average Size Bytes
77
	EMC VNX 5300 Std NFS Active Threads
74 78

  
75 79
=head1 COMPATIBILITY
76 80

  
......
135 139
. "$MUNIN_LIBDIR/plugins/plugin.sh"
136 140

  
137 141
nas_server_ok=""
138
: ${cs_addr:=""}
139
: ${username:=""}
140
: ${nas_servers:="server_2 server_3"}
142
cs_addr=${cs_addr:=""}
143
username=${username:=""}
144
nas_servers=${nas_servers:="server_2 server_3"}
141 145

  
142 146
# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. 
143 147
ssh_check_cmd() {
......
202 206
echo "host_name ${TARGET}"
203 207

  
204 208
if [ "$1" = "config" ] ; then
209
# TODO: active/active
205 210
	for server in $nas_servers; do
206 211
		run_remote nas_server -i "$server" | grep -q 'type *= nas' || continue
207 212
		nas_server_ok=TRUE
213
		filtered_server="$(clean_fieldname "$server")"
208 214
		
209 215
		if [ "$STATSTYPE" = "BASICDM" ] ; then
210 216
			cat <<-EOF 
......
427 433
				field="$(clean_fieldname "_$graph")"
428 434
				echo "${server}${field}.label $server $graph Avg uSec/call"
429 435
			done
436

  
437
#nfs-std
438
# Timestamp     NFS         Read      Read    Read Size     Write      Write   Write Size    Active  
439
#              Ops/s       Ops/s      KiB/s     Bytes       Ops/s      KiB/s     Bytes      Threads  
440
			cat <<-EOF
441

  
442
			multigraph vnx_emc_nfs_std_nfs_ops
443
			graph_title EMC VNX 5300 Std NFS Ops/s
444
			graph_vlabel Ops/s
445
			graph_category nfs
446
			EOF
447
			echo "graph_order ${filtered_server}_rops ${filtered_server}_wops ${filtered_server}_tops"
448
			echo "${filtered_server}_rops.label $server Read Ops/s"
449
			echo "${filtered_server}_wops.label $server Write Ops/s"
450
			echo "${filtered_server}_wops.draw STACK"
451
			echo "${filtered_server}_tops.label $server Total Ops/s"
452
			
453
			cat <<-EOF
454

  
455
			multigraph vnx_emc_nfs_std_nfs_b_s
456
			graph_title EMC VNX 5300 Std NFS B/s
457
			graph_vlabel B/s
458
			graph_category nfs
459
			EOF
460
			echo "graph_order ${filtered_server}_rbs ${filtered_server}_wbs ${filtered_server}_tbs"
461
			echo "${filtered_server}_rbs.label $server Read B/s"
462
			echo "${filtered_server}_wbs.label $server Write B/s"
463
			echo "${filtered_server}_wbs.draw STACK"
464
			echo "${filtered_server}_tbs.label $server Total B/s"
465
			echo "${filtered_server}_tbs.cdef ${filtered_server}_rbs,${filtered_server}_wbs,+"
466
			
467
			cat <<-EOF
468

  
469
			multigraph vnx_emc_nfs_std_nfs_avg
470
			graph_title EMC VNX 5300 Std NFS Average Size Bytes
471
			graph_vlabel Bytes
472
			graph_category nfs
473
			EOF
474
			echo "${filtered_server}_avg_readsize.label $server Average Read Size Bytes"
475
			echo "${filtered_server}_avg_writesize.label $server Average Write Size Bytes"
476

  
477
			cat <<-EOF
478

  
479
			multigraph vnx_emc_nfs_std_nfs_threads
480
			graph_title EMC VNX 5300 Std NFS Active Threads
481
			graph_vlabel Threads
482
			graph_category nfs
483
			EOF
484
			echo "${filtered_server}_threads.label $server Active Threads"
430 485
		fi
431 486
	done
432 487
	if [ -z "$nas_server_ok" ]; then
......
438 493
for server in $nas_servers; do
439 494
	run_remote nas_server -i $server | grep -q 'type *= nas' || continue
440 495
	nas_server_ok=TRUE
496
	filtered_server="$(clean_fieldname "$server")"
497

  
441 498
	if [ "$STATSTYPE" = "BASICDM" ] ; then
442 499
#basicdm data
443 500
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -count 1 -terminationsummary no 
......
446 503
#             %      KiB/s       KiB/s       KiB/s       KiB/s   
447 504
# 20:42:26      9       16432        3404        1967       24889
448 505

  
449
	member_elements_by_line=$(run_remote server_stats "$server" -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
450
	IFS=$' ' read -ra graphs <<< "$member_elements_by_line"
506
		member_elements_by_line=$(run_remote server_stats "$server" -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
507
		IFS=$' ' read -ra graphs <<< "$member_elements_by_line"
451 508

  
452
	echo "multigraph emc_vnx_cpu_percent"
453
	echo "${server}_cpuutil.value ${graphs[1]}"
509
		echo "multigraph emc_vnx_cpu_percent"
510
		echo "${server}_cpuutil.value ${graphs[1]}"
454 511

  
455
	echo -e "\nmultigraph emc_vnx_network_b"
456
	echo "${server}_net_in.value $((${graphs[2]} * 1024))"
457
	echo "${server}_net_out.value $((${graphs[3]} * 1024))"
512
		echo -e "\nmultigraph emc_vnx_network_b"
513
		echo "${server}_net_in.value $((${graphs[2]} * 1024))"
514
		echo "${server}_net_out.value $((${graphs[3]} * 1024))"
458 515

  
459
	echo -e "\nmultigraph emc_vnx_storage_b"
460
	echo "${server}_stor_read.value $((${graphs[4]} * 1024))"
461
	echo "${server}_stor_write.value $((${graphs[5]} * 1024))"
516
		echo -e "\nmultigraph emc_vnx_storage_b"
517
		echo "${server}_stor_read.value $((${graphs[4]} * 1024))"
518
		echo "${server}_stor_write.value $((${graphs[5]} * 1024))"
462 519

  
463 520
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor kernel.memory -count 1 -terminationsummary no 
464 521
# server_2       Free           Buffer       Buffer   Buffer    Buffer         Buffer       Buffer Cache  Encumbered  FileResolve  FileResolve  FileResolve  Free KiB   Page     Total    Used KiB     Memory  
......
466 523
#                KiB       Watermark Hits/s  Hit %    Hits/s   Lookups/s  Watermark Hits/s     Hits/s        KiB        Entries       Limit       Entries                KiB      KiB                    %     
467 524
# 20:44:14        3522944                 0      96     11562      12010                 0             0     3579268            0            0            0    3525848      8    6291456    2765608          44
468 525

  
469
	member_elements_by_line=$(run_remote server_stats "$server" -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
470
	IFS=$' ' read -ra graphs <<< "$member_elements_by_line"
526
		member_elements_by_line=$(run_remote server_stats "$server" -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
527
		IFS=$' ' read -ra graphs <<< "$member_elements_by_line"
471 528

  
472
	echo -e "\nmultigraph emc_vnx_memory"
473
	#Reserved for math
474
	echo "${server}_total.value $((${graphs[14]} / 1))"	
475
	echo "${server}_used.value $((${graphs[15]} / 1))"
476
	echo "${server}_free.value $((${graphs[12]} / 1))"
477
	echo "${server}_freebuffer.value $((${graphs[1]} / 1))"
478
	echo "${server}_encumbered.value $((${graphs[8]} / 1))"
529
		echo -e "\nmultigraph emc_vnx_memory"
530
		#Reserved for math
531
		echo "${server}_total.value $((${graphs[14]} / 1))"	
532
		echo "${server}_used.value $((${graphs[15]} / 1))"
533
		echo "${server}_free.value $((${graphs[12]} / 1))"
534
		echo "${server}_freebuffer.value $((${graphs[1]} / 1))"
535
		echo "${server}_encumbered.value $((${graphs[8]} / 1))"
479 536

  
480
	echo -e "\nmultigraph emc_vnx_filecache"
481
	echo "${server}_highw_hits.value ${graphs[2]}"
482
	echo "${server}_loww_hits.value ${graphs[6]}"
483
	echo "${server}_w_hits.value ${graphs[7]}"
484
	echo "${server}_hits.value ${graphs[4]}"
485
	echo "${server}_lookups.value ${graphs[5]}"
537
		echo -e "\nmultigraph emc_vnx_filecache"
538
		echo "${server}_highw_hits.value ${graphs[2]}"
539
		echo "${server}_loww_hits.value ${graphs[6]}"
540
		echo "${server}_w_hits.value ${graphs[7]}"
541
		echo "${server}_hits.value ${graphs[4]}"
542
		echo "${server}_lookups.value ${graphs[5]}"
486 543

  
487
	echo -e "\nmultigraph emc_vnx_fileresolve"
488
	echo "${server}_dropped.value ${graphs[9]}"
489
	echo "${server}_max.value ${graphs[10]}"
490
	echo "${server}_used.value ${graphs[11]}"
544
		echo -e "\nmultigraph emc_vnx_fileresolve"
545
		echo "${server}_dropped.value ${graphs[9]}"
546
		echo "${server}_max.value ${graphs[10]}"
547
		echo "${server}_used.value ${graphs[11]}"
491 548

  
492 549

  
493 550
	fi
......
506 563
#            v3Mkdir                  13       0         953           9
507 564
#            v3Link                    6       0        1064           4
508 565

  
509
	member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs.v3.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v3/v3/p')
510
	NUMCOL=5
511
	LINES=$(wc -l <<< "$member_elements_by_line")
512
	while IFS=$'\n' read -ra graphs ; do
513
		elements_array+=( $graphs )
514
	done <<< "$member_elements_by_line"
515
	
516
	if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
517

  
518
	echo "multigraph vnx_emc_v3_calls_s"
519
	for ((i=0; i<$((LINES)); i++ )); do
520
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+1]}"
521
	done
566
		member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs.v3.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v3/v3/p')
567
		NUMCOL=5
568
		LINES=$(wc -l <<< "$member_elements_by_line")
569
		while IFS=$'\n' read -ra graphs ; do
570
			elements_array+=( $graphs )
571
		done <<< "$member_elements_by_line"
572
		
573
		if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
522 574

  
523
	echo -e "\nmultigraph vnx_emc_v3_usec_call"
524
	for ((i=0; i<$((LINES)); i++ )); do
525
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+3]}"
526
	done
575
		echo "multigraph vnx_emc_v3_calls_s"
576
		for ((i=0; i<$((LINES)); i++ )); do
577
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+1]}"
578
		done
527 579

  
528
	echo -e "\nmultigraph vnx_emc_v3_op_percent"
529
	for ((i=0; i<$((LINES)); i++ )); do
530
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+4]}"
531
	done
580
		echo -e "\nmultigraph vnx_emc_v3_usec_call"
581
		for ((i=0; i<$((LINES)); i++ )); do
582
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+3]}"
583
		done
584

  
585
		echo -e "\nmultigraph vnx_emc_v3_op_percent"
586
		for ((i=0; i<$((LINES)); i++ )); do
587
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+4]}"
588
		done
532 589

  
533
	elements_array=()
590
		elements_array=()
534 591

  
535 592
#nfs.v4.op data
536 593
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.v4.op -count 1 -terminationsummary no
......
557 614
#            v4SetAttr                 9       0         889           0
558 615
#            v4Write                 525       0       16508           7
559 616

  
560
	member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs.v4.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v4/v4/p')
561
	NUMCOL=5
562
	LINES=$(wc -l <<< "$member_elements_by_line")
563
	while IFS=$'\n' read -ra graphs ; do
564
		elements_array+=( $graphs )
565
	done <<< "$member_elements_by_line"
617
		member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs.v4.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v4/v4/p')
618
		NUMCOL=5
619
		LINES=$(wc -l <<< "$member_elements_by_line")
620
		while IFS=$'\n' read -ra graphs ; do
621
			elements_array+=( $graphs )
622
		done <<< "$member_elements_by_line"
566 623

  
567
	if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
624
		if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
568 625

  
569
	echo -e "\nmultigraph vnx_emc_v4_calls_s"
570
	for ((i=0; i<$((LINES)); i++ )); do
571
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+1]}"
572
	done
626
		echo -e "\nmultigraph vnx_emc_v4_calls_s"
627
		for ((i=0; i<$((LINES)); i++ )); do
628
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+1]}"
629
		done
573 630

  
574
	echo -e "\nmultigraph vnx_emc_v4_usec_call"
575
	for ((i=0; i<$((LINES)); i++ )); do
576
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+3]}"
577
	done
631
		echo -e "\nmultigraph vnx_emc_v4_usec_call"
632
		for ((i=0; i<$((LINES)); i++ )); do
633
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+3]}"
634
		done
578 635

  
579
	echo -e "\nmultigraph vnx_emc_v4_op_percent"
580
	for ((i=0; i<$((LINES)); i++ )); do
581
		echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+4]}"
582
	done
636
		echo -e "\nmultigraph vnx_emc_v4_op_percent"
637
		for ((i=0; i<$((LINES)); i++ )); do
638
			echo "${server}_${elements_array[i*$NUMCOL]}".value "${elements_array[i*$NUMCOL+4]}"
639
		done
583 640

  
584
	elements_array=()
641
		elements_array=()
585 642

  
586 643
#nfs.client data
587 644
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no 
......
595 652
#            id=192.168.1.235                             21        1        0           0        0        0        0     155839
596 653
#            id=192.168.1.224                              5        0        5           0       20        0       20     704620
597 654

  
598
	echo -e "\nmultigraph vnx_emc_nfs_client_ops_s"
599
 	member_elements_by_line=$(run_remote server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p')
600
	NUMCOL=9
601
	LINES=$(wc -l <<< "$member_elements_by_line")
602
	while IFS=$'\n' read -ra graphs; do
603
		elements_array+=($graphs)
604
	done  <<< "$member_elements_by_line"
605

  
606
	#Not drawing elements in case of empty set
607
	if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
608

  
609
	for (( i=0; i<$((LINES)); i++ )); do
610
		client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
611
		echo "${server}${client}_r".value "${elements_array[$i*$NUMCOL+2]}"
612
		echo "${server}${client}_w".value "${elements_array[$i*$NUMCOL+3]}"
613
		echo "${server}${client}_t".value "${elements_array[$i*$NUMCOL+1]}"
614
		echo "${server}${client}_s".value "${elements_array[$i*$NUMCOL+4]}"
615
	done
616
	echo -e "\nmultigraph vnx_emc_nfs_client_b_s"
617
	for (( i=0; i<$((LINES)); i++ )); do
618
		client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
619
		echo "${server}${client}_r".value "$((${elements_array[$i*$NUMCOL+6]} * 1024))"
620
		echo "${server}${client}_w".value "$((${elements_array[$i*$NUMCOL+7]} * 1024))"
621
		echo "${server}${client}_t".value "$((${elements_array[$i*$NUMCOL+5]} * 1024))"
622
	done
623
	echo -e "\nmultigraph vnx_emc_nfs_client_avg_usec"
624
	for (( i=0; i<$((LINES)); i++ )); do
625
		client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
626
		echo "${server}${client}".value "${elements_array[$i*$NUMCOL+8]}"
627
	done
655
		member_elements_by_line=$(run_remote server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p')
656
		echo -e "\nmultigraph vnx_emc_nfs_client_ops_s"
657
		NUMCOL=9
658
		LINES=$(wc -l <<< "$member_elements_by_line")
659
		while IFS=$'\n' read -ra graphs; do
660
			elements_array+=($graphs)
661
		done  <<< "$member_elements_by_line"
662

  
663
		#Not drawing elements in case of empty set
664
		if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
665

  
666
		for (( i=0; i<$((LINES)); i++ )); do
667
			client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
668
			echo "${server}${client}_r".value "${elements_array[$i*$NUMCOL+2]}"
669
			echo "${server}${client}_w".value "${elements_array[$i*$NUMCOL+3]}"
670
			echo "${server}${client}_t".value "${elements_array[$i*$NUMCOL+1]}"
671
			echo "${server}${client}_s".value "${elements_array[$i*$NUMCOL+4]}"
672
		done
673
		echo -e "\nmultigraph vnx_emc_nfs_client_b_s"
674
		for (( i=0; i<$((LINES)); i++ )); do
675
			client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
676
			echo "${server}${client}_r".value "$((${elements_array[$i*$NUMCOL+6]} * 1024))"
677
			echo "${server}${client}_w".value "$((${elements_array[$i*$NUMCOL+7]} * 1024))"
678
			echo "${server}${client}_t".value "$((${elements_array[$i*$NUMCOL+5]} * 1024))"
679
		done
680
		echo -e "\nmultigraph vnx_emc_nfs_client_avg_usec"
681
		for (( i=0; i<$((LINES)); i++ )); do
682
			client="$(clean_fieldname "_${elements_array[i*$NUMCOL]}")"
683
			echo "${server}${client}".value "${elements_array[$i*$NUMCOL+8]}"
684
		done
685

  
686
#nfs-std
687
# bash-3.2$  server_stats server_2 -monitor nfs-std
688
# server_2     Total        NFS        NFS     NFS Avg       NFS        NFS     NFS Avg       NFS    
689
# Timestamp     NFS         Read      Read    Read Size     Write      Write   Write Size    Active  
690
#              Ops/s       Ops/s      KiB/s     Bytes       Ops/s      KiB/s     Bytes      Threads  
691
# 18:14:52          688         105     6396       62652           1      137      174763           3
692
		member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs-std -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
693
		IFS=$' ' read -ra graphs <<< "$member_elements_by_line"
694
#		echo "$member_elements_by_line"
695
#		echo "${graphs[@]}"
696

  
697
		echo -e "\nmultigraph vnx_emc_nfs_std_nfs_ops"
698
		echo "${filtered_server}_rops.value ${graphs[2]}"
699
		echo "${filtered_server}_wops.value ${graphs[5]}"
700
		echo "${filtered_server}_tops.value ${graphs[1]}"
701
				
702
		echo -e "\nmultigraph vnx_emc_nfs_std_nfs_b_s"
703
		echo "${filtered_server}_rbs.value $((${graphs[3]} * 1024))"
704
		echo "${filtered_server}_wbs.value $((${graphs[6]} * 1024))"
705
		echo "${filtered_server}_tbs.value 0"
706
				
707

  
708
		echo -e "\nmultigraph vnx_emc_nfs_std_nfs_avg"
709
		echo "${filtered_server}_avg_readsize.value ${graphs[4]}"
710
		echo "${filtered_server}_avg_writesize.value ${graphs[7]}"
711

  
712

  
713
		echo -e "\nmultigraph vnx_emc_nfs_std_nfs_threads"
714
		echo "${filtered_server}_threads.value ${graphs[8]}"
628 715
	fi
629 716
done
630 717
if [ -z "$nas_server_ok" ]; then

Formats disponibles : Unified diff