Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/emc/emc_vnx_file_
2 2

  
3 3
: <<=cut
4 4

  
5
=head1 NAME 
5
=head1 NAME
6 6

  
7
 emc_vnx_file_stats - Plugin to monitor Basic, NFSv3 and NFSv4 statistics of 
7
 emc_vnx_file_stats - Plugin to monitor Basic, NFSv3 and NFSv4 statistics of
8 8
 EMC VNX 5300 Unified Storage system's Datamovers
9 9

  
10 10
=head1 AUTHOR
......
22 22

  
23 23
=head1 DESCRIPTION
24 24

  
25
 The plugin monitors basic statistics of EMC Unified Storage system Datamovers 
26
 and NFS statistics of EMC VNX5300 Unified Storage system. Probably it can 
25
 The plugin monitors basic statistics of EMC Unified Storage system Datamovers
26
 and NFS statistics of EMC VNX5300 Unified Storage system. Probably it can
27 27
 also be compatible with other Isilon or Celerra systems. It uses SSH to connect
28
 to Control Stations, then remotely executes '/nas/sbin/server_stats' and 
29
 fetches and parses data from it. It supports gathering data both from 
30
 active/active and active/passive Datamover configurations, ignoring offline or 
31
 standby Datamovers. 
28
 to Control Stations, then remotely executes '/nas/sbin/server_stats' and
29
 fetches and parses data from it. It supports gathering data both from
30
 active/active and active/passive Datamover configurations, ignoring offline or
31
 standby Datamovers.
32 32
 If all Datamovers are offline or absent, the plugin returns error.
33 33
 This plugin also automatically chooses Primary Control Station from the list by
34 34
  calling '/nasmcd/sbin/getreason' and '/nasmcd/sbin/t2slot'.
35
 
35

  
36 36
 At the moment data is gathered from the following statistics sources:
37 37
  * nfs.v3.op - Tons of timings about NFSv3 RPC calls
38 38
  * nfs.v4.op - Tons of timings about NFSv4 RPC calls
39 39
  * nfs.client - Here new Client addresses are rescanned and added automatically.
40 40
  * basic-std Statistics Group - Basic Statistics of Datamovers (eg. CPU, Memory
41 41
  etc.)
42
 
42

  
43 43
 It's quite easy to comment out unneeded data to make graphs less overloaded or
44 44
 to add new statistics sources.
45 45

  
......
78 78

  
79 79
=head1 COMPATIBILITY
80 80

  
81
 The plugin has been written for being compatible with EMC VNX5300 Storage 
81
 The plugin has been written for being compatible with EMC VNX5300 Storage
82 82
 system, as this is the only EMC storage which i have.
83 83
 By the way, i am pretty sure it can also work with other VNX1 storages, like
84 84
 VNX5100 and VNX5500.
85
 About VNX2 series, i don't know whether the plugin will be able to work with 
85
 About VNX2 series, i don't know whether the plugin will be able to work with
86 86
 them. Maybe it would need some corrections in command-line backend. The same
87
 situation is with other EMC systems, so i encourage you to try and fix the 
88
 plugin. 
87
 situation is with other EMC systems, so i encourage you to try and fix the
88
 plugin.
89 89

  
90 90
=head1 CONFIGURATION
91 91

  
92
 The plugin uses SSH to connect to Control Stations. It's possible to use 
92
 The plugin uses SSH to connect to Control Stations. It's possible to use
93 93
 'nasadmin' user, but it would be better if you create read-only global user by
94 94
 Unisphere Client. The user should have only Operator role.
95 95
 I created "operator" user but due to the fact that Control Stations already
96
 had one internal "operator" user, the new one was called "operator1". So be 
96
 had one internal "operator" user, the new one was called "operator1". So be
97 97
 careful. After that, copy .bash_profile from /home/nasadmin to a newly created
98 98
 /home/operator1
99
 
99

  
100 100
 On munin-node side choose a user which will be used to connect through SSH.
101
 Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash", 
102
 "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created 
101
 Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash",
102
 "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created
103 103
 user.
104
 
105
 Make a link from /usr/share/munin/plugins/emc_vnx_file_stats to 
106
 /etc/munin/plugins/. If you want to get NFS statistics, name the link as 
104

  
105
 Make a link from /usr/share/munin/plugins/emc_vnx_file_stats to
106
 /etc/munin/plugins/. If you want to get NFS statistics, name the link as
107 107
 "emc_vnx_file_nfs_stats_<NAME>", otherwise to get Basic Datamover statistics
108 108
 you have to name it "emc_vnx_file_basicdm_stats_<NAME>", where <NAME> is any
109
 arbitrary name of your storage system. The plugin will return <NAME> in its 
109
 arbitrary name of your storage system. The plugin will return <NAME> in its
110 110
 answer as "host_name" field.
111 111

  
112 112
 For example, assume your storage system is called "VNX5300".
113
 Make a configuration file at 
113
 Make a configuration file at
114 114
 /etc/munin/plugin-conf.d/emc_vnx_file_stats_VNX5300
115
 
115

  
116 116
 [emc_vnx_file_*]
117
 user munin				
118
 env.username operator1				
119
 env.cs_addr 192.168.1.1 192.168.1.2		
120
 env.nas_servers server_2 server_3		
117
 user munin
118
 env.username operator1
119
 env.cs_addr 192.168.1.1 192.168.1.2
120
 env.nas_servers server_2 server_3
121 121

  
122
 Where: 
122
 Where:
123 123
 user - SSH Client local user
124 124
 env.username - Remote user with Operator role
125 125
 env.cs_addr - Control Stations addresses
......
143 143
username=${username:=""}
144 144
nas_servers=${nas_servers:="server_2 server_3"}
145 145

  
146
# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. 
146
# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station.
147 147
ssh_check_cmd() {
148 148
	ssh -q "$username@$1" "/nasmcd/sbin/getreason | grep -w \"slot_\$(/nasmcd/sbin/t2slot)\" | cut -d- -f1 | awk '{print \$1}' "
149 149

  
......
192 192
fi
193 193

  
194 194
STATSTYPE=$(echo "${0##*/}" | cut -d _ -f 1-5)
195
if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS; 
195
if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS;
196 196
elif [ "$STATSTYPE" = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM;
197 197
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>'" >&2; exit 1; fi
198 198

  
......
213 213
		run_remote nas_server -i "$server" | grep -q 'type *= nas' || continue
214 214
		nas_server_ok=TRUE
215 215
		filtered_server="$(clean_fieldname "$server")"
216
		
216

  
217 217
		if [ "$STATSTYPE" = "BASICDM" ] ; then
218
			cat <<-EOF 
218
			cat <<-EOF
219 219
			multigraph emc_vnx_cpu_percent
220 220
			graph_title EMC VNX 5300 Datamover CPU Util %
221 221
			graph_vlabel %
......
259 259
			${server}_total.label ${server} Total
260 260
			${server}_freebuffer.label ${server} Free Buffer
261 261
			${server}_encumbered.label ${server} Encumbered
262
						
262

  
263 263
			multigraph emc_vnx_filecache
264 264
			graph_title EMC VNX 5300 File Buffer Cache
265 265
			graph_vlabel per second
......
272 272
			${server}_w_hits.label Watermark Hits
273 273
			${server}_hits.label Hits
274 274
			${server}_lookups.label Lookups
275
				
275

  
276 276
			multigraph emc_vnx_fileresolve
277 277
			graph_title EMC VNX 5300 FileResolve
278 278
			graph_vlabel Entries
......
286 286
		if [ "$STATSTYPE" = "NFS" ] ; then
287 287
#nfs.v3.op data
288 288
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -info nfs.v3.op
289
# server_2 : 
290
# 
289
# server_2 :
290
#
291 291
# name            = nfs.v3.op
292 292
# description     = NFS V3 per operation statistics
293 293
# type            = Set
......
296 296
# member_of       = nfs.v3
297 297
			member_elements_by_line=$(run_remote server_stats "$server" -info nfs.v3.op | grep member_elements | sed -ne 's/^.*= //p')
298 298
			IFS=',' read -ra graphs <<< "$member_elements_by_line"
299
			cat <<-EOF 
299
			cat <<-EOF
300 300
			multigraph vnx_emc_v3_calls_s
301 301
			graph_title EMC VNX 5300 NFSv3 Calls per second
302 302
			graph_vlabel Calls
......
309 309
			done
310 310

  
311 311
			cat <<-EOF
312
			
312

  
313 313
			multigraph vnx_emc_v3_usec_call
314 314
			graph_title EMC VNX 5300 NFSv3 uSeconds per call
315 315
			graph_vlabel uSec / call
......
362 362
				echo "${server}_$field.label $server $field"
363 363
			done
364 364
			cat <<-EOF
365
			
365

  
366 366
			multigraph vnx_emc_v4_op_percent
367 367
			graph_title EMC VNX 5300 NFSv4 Op %
368 368
			graph_vlabel %
......
376 376
			done
377 377

  
378 378
#nfs.client data
379
#							 Total    Read     Write   Suspicious   Total    Read     Write      Avg   
379
#							 Total    Read     Write   Suspicious   Total    Read     Write      Avg
380 380
#                                                      Ops/s    Ops/s    Ops/s    Ops diff    KiB/s    KiB/s    KiB/s   uSec/call
381 381
			member_elements_by_line=$(run_remote server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p' | cut -d' ' -f1)
382 382
			#Somewhy readarray adds extra \n in the end of each variable. So, we use read() with a workaround
......
437 437
			done
438 438

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

  
444 444
			multigraph vnx_emc_nfs_std_nfs_ops
......
451 451
			echo "${filtered_server}_wops.label $server Write Ops/s"
452 452
			echo "${filtered_server}_wops.draw STACK"
453 453
			echo "${filtered_server}_tops.label $server Total Ops/s"
454
			
454

  
455 455
			cat <<-EOF
456 456

  
457 457
			multigraph vnx_emc_nfs_std_nfs_b_s
......
465 465
			echo "${filtered_server}_wbs.draw STACK"
466 466
			echo "${filtered_server}_tbs.label $server Total B/s"
467 467
			echo "${filtered_server}_tbs.cdef ${filtered_server}_rbs,${filtered_server}_wbs,+"
468
			
468

  
469 469
			cat <<-EOF
470 470

  
471 471
			multigraph vnx_emc_nfs_std_nfs_avg
......
499 499

  
500 500
	if [ "$STATSTYPE" = "BASICDM" ] ; then
501 501
#basicdm data
502
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -count 1 -terminationsummary no 
503
# server_2   CPU    Network     Network       dVol        dVol   
504
# Timestamp  Util      In         Out         Read       Write   
505
#             %      KiB/s       KiB/s       KiB/s       KiB/s   
502
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -count 1 -terminationsummary no
503
# server_2   CPU    Network     Network       dVol        dVol
504
# Timestamp  Util      In         Out         Read       Write
505
#             %      KiB/s       KiB/s       KiB/s       KiB/s
506 506
# 20:42:26      9       16432        3404        1967       24889
507 507

  
508 508
		member_elements_by_line=$(run_remote server_stats "$server" -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
......
519 519
		echo "${server}_stor_read.value $((graphs[4] * 1024))"
520 520
		echo "${server}_stor_write.value $((graphs[5] * 1024))"
521 521

  
522
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor kernel.memory -count 1 -terminationsummary no 
523
# server_2       Free           Buffer       Buffer   Buffer    Buffer         Buffer       Buffer Cache  Encumbered  FileResolve  FileResolve  FileResolve  Free KiB   Page     Total    Used KiB     Memory  
524
# Timestamp     Buffer        Cache High     Cache    Cache      Cache       Cache Low       Watermark      Memory      Dropped        Max         Used                 Size    Memory                  Util   
525
#                KiB       Watermark Hits/s  Hit %    Hits/s   Lookups/s  Watermark Hits/s     Hits/s        KiB        Entries       Limit       Entries                KiB      KiB                    %     
522
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor kernel.memory -count 1 -terminationsummary no
523
# server_2       Free           Buffer       Buffer   Buffer    Buffer         Buffer       Buffer Cache  Encumbered  FileResolve  FileResolve  FileResolve  Free KiB   Page     Total    Used KiB     Memory
524
# Timestamp     Buffer        Cache High     Cache    Cache      Cache       Cache Low       Watermark      Memory      Dropped        Max         Used                 Size    Memory                  Util
525
#                KiB       Watermark Hits/s  Hit %    Hits/s   Lookups/s  Watermark Hits/s     Hits/s        KiB        Entries       Limit       Entries                KiB      KiB                    %
526 526
# 20:44:14        3522944                 0      96     11562      12010                 0             0     3579268            0            0            0    3525848      8    6291456    2765608          44
527 527

  
528 528
		member_elements_by_line=$(run_remote server_stats "$server" -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
......
530 530

  
531 531
		echo -e "\nmultigraph emc_vnx_memory"
532 532
		#Reserved for math
533
		echo "${server}_total.value $((graphs[14] / 1))"	
533
		echo "${server}_total.value $((graphs[14] / 1))"
534 534
		echo "${server}_used.value $((graphs[15] / 1))"
535 535
		echo "${server}_free.value $((graphs[12] / 1))"
536 536
		echo "${server}_freebuffer.value $((graphs[1] / 1))"
......
553 553
	if [ "$STATSTYPE" = "NFS" ] ; then
554 554
#nfs.v3.op data
555 555
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.v3.op -count 1 -terminationsummary no
556
# server_2       NFS Op          NFS      NFS Op     NFS       NFS Op % 
557
# Timestamp                       Op      Errors      Op                
558
#                              Calls/s     diff   uSec/Call             
556
# server_2       NFS Op          NFS      NFS Op     NFS       NFS Op %
557
# Timestamp                       Op      Errors      Op
558
#                              Calls/s     diff   uSec/Call
559 559
# 22:14:41   v3GetAttr                30       0          23          21
560 560
#            v3Lookup                 40       0       98070          27
561 561
#            v3Access                 50       0          20          34
......
571 571
		while IFS=$'\n' read -ra graphs ; do
572 572
			elements_array+=( $graphs )
573 573
		done <<< "$member_elements_by_line"
574
		
574

  
575 575
		if [ "${#elements_array[@]}" -eq "0" ]; then  LINES=0; fi
576 576

  
577 577
		echo "multigraph vnx_emc_v3_calls_s"
......
593 593

  
594 594
#nfs.v4.op data
595 595
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.v4.op -count 1 -terminationsummary no
596
# server_2       NFS Op          NFS      NFS Op     NFS       NFS Op % 
597
# Timestamp                       Op      Errors      Op                
598
#                              Calls/s     diff   uSec/Call             
596
# server_2       NFS Op          NFS      NFS Op     NFS       NFS Op %
597
# Timestamp                       Op      Errors      Op
598
#                              Calls/s     diff   uSec/Call
599 599
# 22:13:14   v4Compound             2315       0        7913          30
600 600
#            v4Access                246       0           5           3
601 601
#            v4Close                 133       0          11           2
......
643 643
		elements_array=()
644 644

  
645 645
#nfs.client data
646
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no 
647
# server_2                    Client                     NFS      NFS      NFS       NFS        NFS      NFS      NFS       NFS   
648
# Timestamp                                             Total    Read     Write   Suspicious   Total    Read     Write      Avg   
646
# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no
647
# server_2                    Client                     NFS      NFS      NFS       NFS        NFS      NFS      NFS       NFS
648
# Timestamp                                             Total    Read     Write   Suspicious   Total    Read     Write      Avg
649 649
#                                                       Ops/s    Ops/s    Ops/s    Ops diff    KiB/s    KiB/s    KiB/s   uSec/call
650 650
# 20:26:38   id=192.168.1.223                           2550       20     2196          13     4673      159     4514       1964
651 651
#            id=192.168.1.2                              691        4        5           1     1113      425      688       2404
......
687 687

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

  
704 704
		echo -e "\nmultigraph vnx_emc_nfs_std_nfs_b_s"
705 705
		echo "${filtered_server}_rbs.value $((graphs[3] * 1024))"
706 706
		echo "${filtered_server}_wbs.value $((graphs[6] * 1024))"
707 707
		echo "${filtered_server}_tbs.value 0"
708
				
708

  
709 709

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

Formats disponibles : Unified diff