-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
executable file
·1288 lines (997 loc) · 49.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
NAME
IBM::StorageSystem - Perl API to IBM StorageSystem CLI
VERSION
Version 0.01
SYNOPSIS
IBM::StorageSystem is a Perl module that provides a simple API to the
IBM StorageSystem CLI.
use IBM::StorageSystem;
# Create a IBM::StorageSystem object
my $ibm = IBM::StorageSystem->new(
user => 'admin',
host => 'my-StorageSystem',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
# Get a list of our enclosures as IBM::StorageSystem::Enclosure objects
my @enclosures = $ibm->get_enclosures;
# Print the status of each enclosure
map {
printf( "Enclosure %s status: %10s\n",
$_->id,
$_->status
)
} @enclosures;
# Get the status of each PSU in each enclosure as
# IBM::StorageSystem::Enclosure::PSU objects
map {
printf( "\tPSU %s status: %s", $_->id, $_->status )
} map {
print "--- Enclosure $_->id ---\n"; $ $_->get_psus
} @enclosures;
# Prints something like:
# --- Enclosure 1 ---
# PSU 1 status: online
# PSU 2 status: online
# --- Enclosure 2 ---
# PSU 1 status: online
# PSU 2 status: online
# ...
# Get a list of canisters in the first enclosure as
# IBM::StorageSystem::Enclosure::Canister objects
my @canisters = $enclosures[0]->get_canisters;
# Get the temperature of just the first canister in the second enclosure
print "Temperature: ", $ibm->enclosure(2)->canister(1)->temperature, "\n";
# Prints - Temperature: 39
...
METHODS
new
my $ibm = IBM::StorageSystem->new(
user => 'admin',
host => 'my-StorageSystem',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
Constructor - creates a new IBM::StorageSystem object. This method
accepts three mandatory parameters and one optional parameter, the three
mandatory parameters are:
user
The username of the user with which to connect to the device.
host
The hostname or IP address of the device to which we are connecting.
key_path
Either a relative or fully qualified path to the private ssh key
valid for the user name and device to which we are connecting. Please
note that the executing user must have read permission to this key.
The optional parameter is:
stats_threshold
The period in seconds for which retrieved system statistics will be
considered fresh, after which they will be re-retrieved. If not set,
the default value of this parameter is zero meaning that the
statistics are not refreshed unless done explicitly via the refresh
method of an <IBM:StorageSystem::Statistic> object.
auth_service_cert_set
Specifies if the authentication service certificate has been set.
auth_service_configured
True if the auth_service_type is configured and either one of the
following is true:
* The auth_service_type is LDAP-only (if at least one LDAP server is
configured)
* The auth_service_type is TIP-only:
* The name, password, and URL are established
* An SSL certificate is created (if an HTTPS URL is available)
auth_service_enabled
True if auth_service_type is configured.
auth_service_pwd_set
Specifies if the authentication password has been set.
auth_service_type
Returns the authentication services type, either; Tivoli Integrated
Portal (TIP) or Native Lightweight Directory Access Protocol (LDAP)
auth_service_url
Returns the authentication services URL.
auth_service_user_name
Returns the user name used for authentication services.
bandwidth
Returns the bandwidth available on the intersystem link for background
copy, in megabytes per second (MBps).
cluster_isns_IP_address
Returns the cluster ISNS IP address.
cluster_locale
Returns the cluster configured locale.
cluster_ntp_IP_address
Returns the cluster NTP service address.
code_level
Returns the cluster code level.
console_IP
Returns the cluster console IP address.
email_contact
Returns the clusters email contact information - this value is usually
the system name.
email_contact2
Returns the clusters extended email contact information.
email_contact2_alternate
Returns the clusters extended alternate email contact information.
email_contact2_primary
Returns the clusters extended primary email contact information.
email_contact_alternate
Returns the clusters email contact alternate information.
email_contact_location
Returns the clusters email contact location.
email_contact_primary
Returns the clusters email contact phone number.
email_reply
Returns the clusters email reply email.
email_state
Returns the clusters email operational state.
gm_inter_cluster_delay_simulation
Returns the cluster gm inter cluster delay simulation.
gm_intra_cluster_delay_simulation
Returns the cluster gm intra cluster delay simulation.
gm_link_tolerance
Returns the cluster gm link delay tolerance in seconds.
gm_max_host_delay
Returns the cluster gm maximum host delay value.
has_nas_key
Specifies if the cluster has a NAS key configured.
id
Returns the cluster ID.
id_alias
Returns the cluster ID alias.
inventory_mail_interval
Returns the cluster inventory mail interval period in days.
iscsi_auth_method
Returns the cluster iSCSI authentication method.
iscsi_chap_secret
Returns the iSCSI CHAP secret.
layer
Returns the cluster layer type; either replication or storage (default).
Replication means the system can create partnerships with Storwize
StorageSystem Unified. Storage means the system can present storage to
Storwize StorageSystem Unified.
location
Returns the cluster location type, either local or remote.
name
Returns the cluster name.
partnership
Returns the cluster partnership type, either one of; fully_configured,
partially_configured_local, partially_configured_local_stopped,
not_present, fully_configured_stopped, fully_configured_remote_stopped,
fully_configured_local_excluded, fully_configured_remote_excluded or
fully_configured_exceeded
rc_buffer_size
Returns the cluster resource buffer size assigned for Metro Mirror or
Global Mirrored Copy Services.
relationship_bandwidth_limit
Returns the cluster relationship bandwidth limit in megabytes per second
(MBps).
space_allocated_to_vdisks
Returns the space allocated to VDisks - this may be in a variable
notation format.
space_in_mdisk_grps
Returns the space allocated to MDisk groups - this may be in a variable
notation format.
statistics_frequency
Returns the statistics collection frequency interval.
statistics_status
Returns the statistics collection status.
tier
Returns an array containing the supported tier types for the cluster.
Note that this method returns an array of the available tier types and
that the ordering of these types is preserved from the CLI output. The
ordering of these types can be used to retrieve the tier capacity of
each tier type with the tier_capacity command.
tier_capacity
Returns the total tier capacity for each tier type in the cluster.
Note that this method returns an array of tier capacity values, the
index of which corresponds with the array indexes of tier types as
returned by the tier method.
For example, to print each tier type and the corresponding tier capacity
for this cluster:
for ( my $i = 0; $i < scalar @{ $ibm->tier } ; $i++ ) {
print "Tier: " . $ibm->tier->[$i] .
" - Capacity: " . $ibm->tier_capacity->[$i] . "\n"
}
Returns
tier_free_capacity
Returns the free tier capacity for each tier type in the cluster.
Note that like the tier and tier_capacity methods, this method also
returns an array of tier free capacity values, the order of which
corresponds with the arrays returned by the aforementioned methods.
time_zone
Returns the cluster time zone.
total_allocated_extent_capacity
Returns the clusters total allocated capacity - this may be in a
variable notation format.
total_free_space
Returns the clusters total free space - this may be in a variable
notation format.
total_mdisk_capacity
Returns the clusters total MDisk capacity - this may be in a variable
notation format.
total_overallocation
Returns the cluster total overallocation limit.
total_used_capacity
Returns the clusters total used capacity - this may be in a variable
notation format.
total_vdisk_capacity
Returns the clusters total VDisk capacity - this may be in a variable
notation format.
total_vdiskcopy_capacity
Returns the clusters total VDisk copy capacity - this may be in a
variable notation format.
compression_cpu_pc
Returns an IBM::StorageSystem::Statistic object for allocated CPU
capacity utilised for compression.
cpu_pc
Returns an IBM::StorageSystem::Statistic object for allocated CPU
capacity utilised for the system.
drive_r_io
Returns an IBM::StorageSystem::Statistic object the average amount of
I/O operations transferred per second for read operations to drives
during the sample period.
drive_r_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for read operations to drives during
the sample period.
drive_r_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to read
requests to drives over the sample period.
drive_w_io
Returns an IBM::StorageSystem::Statistic object the average amount of
I/O operations transferred per second for write operations to drives
during the sample period.
drive_w_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for write operations to drives
during the sample period.
drive_w_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to write
requests to drives over the sample period.
fc_io
Returns an IBM::StorageSystem::Statistic object for the total
input/output (I/O) operations transferred per seconds for Fibre Channel
traffic on the system. This value includes host I/O and any bandwidth
that is used for communication within the system.
fc_mb
Returns an IBM::StorageSystem::Statistic object for the total number of
megabytes transferred per second for Fibre Channel traffic on the
system. This value includes host I/O and any bandwidth that is used for
communication within the system.
iscsi_io
Returns an IBM::StorageSystem::Statistic object for the total I/O
operations transferred per second for iSCSI traffic on the system.
iscsi_mb
Returns an IBM::StorageSystem::Statistic object for the total number of
megabytes transferred per second for iSCSI traffic on the system.
mdisk_r_io
Returns an IBM::StorageSystem::Statistic object for the average amount
of I/O operations transferred per second for read operations to MDisks
during the sample period.
mdisk_r_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for read operations to MDisks during
the sample period.
mdisk_r_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to read
requests to MDisks over the sample period.
mdisk_w_io
Returns an IBM::StorageSystem::Statistic object for the average amount
of I/O operations transferred per second for write operations to MDisks
during the sample period.
mdisk_w_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for write operations to MDisks
during the sample period.
mdisk_w_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to write
requests to MDisks over the sample period.
sas_io
Returns an IBM::StorageSystem::Statistic object for the total I/O
operations transferred per second for SAS traffic on the system. This
value includes host I/O and bandwidth that is used for background RAID
activity.
sas_mb
Returns an IBM::StorageSystem::Statistic object for the total number of
megabytes transferred per second for iSCSI traffic on the system.
total_cache_pc
Returns an IBM::StorageSystem::Statistic object for the total percentage
for both the write and read cache usage for the node.
vdisk_r_io
Returns an IBM::StorageSystem::Statistic object for the average amount
of I/O operations transferred per second for read operations to volumes
during the sample period.
vdisk_r_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for read operations to MDisks during
the sample period.
vdisk_r_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to read
requests to MDisks over the sample period.
vdisk_w_io
Returns an IBM::StorageSystem::Statistic object for the average amount
of I/O operations transferred per second for read operations to drives
during the sample period.
vdisk_w_mb
Returns an IBM::StorageSystem::Statistic object for the average number
of megabytes transferred per second for read operations to drives during
the sample period
vdisk_w_ms
Returns an IBM::StorageSystem::Statistic object for the average amount
of time in milliseconds that the system takes to respond to read
requests to MDisks over the sample period.
write_cache_pc
Returns an IBM::StorageSystem::Statistic object for the percentage of
the write cache usage for the node.
refresh_system_stats
This method refreshes all system statistics with updated values from the
system. This method may be handy if instantiate an IBM::StorageSystem
object within a long running or non-exiting process and wish to either
periodically retrieve updated system statistics.
Note that you can call refresh on individual system statistics which may
have a slight performance increase over this method.
stats_threshold
This method allows you specify the statistics threshold freshness
interval in seconds. This interval is used to determine if the values
returned by a statistics method are fresh or whether they should be
refreshed from the target system.
By default this value is zero, meaning that the statistics are never
refreshed unless explicitly done so by calling the refresh method of the
statistic object. This may result in a performance increase in
situations where statistic methods are frequently used, and may also
result in more consistent reporting of the target system state as the
statistic values will more closely represent a single point in time
overview of the system rather than a series of consecutive snapshots.
In situation where you may want to gather a set of statistical values
for the target system over a finite period, you could set the threshold
value low, and reset it afterwards. e.g.
# Print the current FC IOPS value every two seconds for a minute
$ibm->stats_threshold = 1;
for ( 1 .. 30 ) {
print $ibm->fc_io_current;
sleep 2
}
# Disable automatic refreshing
$ibm->stats_threshold = 0;
cluster_throughput ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing IBM::StorageSystem::Statistics::ClusterThroughput
performance data on bytes read and written across all nodes and all GPFS
filesystems in the cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_client_throughput ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterClientThroughput performance data
on client throughput across all nodes in the target cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_create_delete_latency ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterCreateDeleteLatency performance
data on cluster file creation and deletion latency across all nodes in
the target cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_create_delete_operations ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterCreateDeleteOperations
performance data on cluster file creation and deletion operations across
all nodes in the target cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_open_close_latency ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterOpenCloseLatency performance data
on cluster file open and close latency across all nodes in the target
cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_open_close_operations ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterCreateDeleteOperations
performance data on cluster file open and close operations across all
nodes in the target cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_read_write_latency ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterReadWriteLatency performance data
on cluster file read and write latency across all nodes in the target
cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
cluster_read_write_operations ( $interval )
Returns either a single, or list, of IBM::StorageSystem::StatisticsSet
objects containing
IBM::StorageSystem::Statistics::ClusterReadWriteOperations performance
data on cluster file read and write operations across all nodes in the
target cluster.
The method accepts a single optional parameter; the time period for
which to return the data. The allowed values for this parameter are one
of; minute, hour, day, week, month, quarter and year. If omitted, this
parameter will default to minute.
array( $id )
# Print the capacity and RAID level of array 1 in GB
my $array = $ibm->array( 1 );
print "Array 1 capacity: "
. int ( $array->capacity / ( 1024 ** 3 ) )
. " (" . $array->raid_level . ")\n"
# e.g. Array 1 capacity: 5824G (raid10)
Returns an IBM::StorageSystem::Array object representing the array
specified by the numerical id parameter.
Note that this is a caching method and that a previously retrieved
IBM::StorageSystem::Array object will be returned if one has been cached
from previous invocations.
get_array( $id )
Returns the array specified by the value of the numerical ID argument as
an IBM::StorageSystem::Array object.
Note that this method is non-caching and the array information will
always be retrieved from the StorageSystem system even if a cached
object exists.
get_arrays
# Print the array status of all arrays in our system
map {
print "Array ", $_->mdisk_id, " status ", $_->status, "\n"
} $ibm->get_arrays;
Returns an array of IBM::StorageSystem::Array objects representing all
arrays in the target system.
disk ( $id )
# Get the disk named "system_vol_00" as an IBM::StorageSystem::Disk
# object
my $disk = $ibm->disk(system_vol_00);
# Print the disk status
print $disk->status;
# Alternately
print $ibm->disk(system_vol_00)->status;
Returns a IBM::StorageSystem::Disk object representing the disk
specified by the value of the id parameter, which should be a valid disk
name in the target system.
get_disk( $id )
This is a functionally equivalent non-caching implementation of the disk
method.
get_disks
# Print a listing of all disks in the target system including their
# name, the assigned pool and status
printf( "%-20s%-20s%-20s\n", "Name", "Pool", "Status" );
printf( "%-20s%-20s%-20s\n", "-----", "------", "-------" );
foreach my $disk ( $ibm->get_disks ) {
printf( "%-20s%-20s%-20s\n",
$disk->name,
$disk->pool,
$disk->status )
}
# Prints something like:
#
# Name Pool Status
# ----- ------ -------
# silver_vol_00 silver ready
# silver_vol_01 silver ready
# silver_vol_02 silver ready
# ... etc.
Returns an array of IBM::StorageSystem::Disk objects representing all
disks in the target system.
drive ( $id )
# Get drive ID 2 as an IBM::StorageSystem::Drive object
my $drive = $ibm->drive( 2 );
# Print the drive capacity in bytes
print $drive->capacity;
# Alternately;
print $ibm->drive( 2 )->capacity;
# Print the drive vendor and product IDs
print "Vendor ID: ", $drive->vendor_id,
" - Product ID: ", $drive->product_id, "\n";
Returns the drive specified by the value of the integer argument as a
IBM::StorageSystem::Drive object.
note that this method implements caching and that a cached object will
be retrieved if present.
If you require a non-cached object, then use the get_drive method
instead.
get_drive( $id )
Returns the drive specified by the value of the integer argument. This
method is non-caching and always retrieves information directly from the
target system even if a cached object is present.
get_drives( $id )
# Print the SAS port status and drive status for all drives in a
# nicely formatted list
printf( "%-20s%-20s%-20s%-20s\n",
'Drive',
'SAS Port 1 Status',
'SAS Port 2 Status',
'Status'
);
printf( "%-20s%-20s%-20s%-20s\n",
'-'x18,
'-'x18,
'-'x18,
'-'x18
);
map {
printf( "%-20s%-20s%-20s%-20s\n",
$_->id,
$_->port_1_status,
$_->port_2_status,
$_->status )
} $ibm->get_drives;
# e.g.
# Drive SAS Port 1 Status SAS Port 2 Status Status
# ------------------ ------------------ ------------------ ------------------
# 0 online online online
# 1 online online online
# 2 online online online
# 3 online online online
# ...
Returns all drives as an array of IBM::StorageSystem::Drive objects.
enclosure( $id )
# Print the status of a specific enclosure
print "Enclosure two status is "
. $ibm->enclosure(2)->status . "\n";
# Get all PSUs in an enclosure as
# IBM::StorageSystem::Enclosure::PSU objects.
my @psus = $ibm->enclosure(1)->psus;
Returns the enclosure specified by the numerical identifier of the id
parameter as an IBM::StorageSystem::Enclosure object.
Note that this is a caching method and that a cached object will be
returned if one is present. If you require a non-cached result, then
please use the get_enclosure method.
get_enclosure( $id )
This method is a functionally equivalent non-caching implementation of
the enclosure method.
get_enclosures
# Print the status of each enclosure in our system.
foreach my $enclosure ( $ibm->get_enclosures ) {
print "Enclosure ", $enclosure->id,
" status: ", $enclosure->status, "\n"
}
Returns an array of IBM::StorageSystem::Enclosure objects representing
all enclosures present in the target system.
get_exports
# Print a listing of all configured exports containing the export
# name, the export path, the export protocol and the export status.
printf( "%-20s%-40s%-10s%-10s\n",
'Name',
'Path',
'Protocol',
'Active'
);
foreach my $export ( $ibm->get_exports ) {
print '-'x100,"\n";
printf( "%-20s%-40s%-10s%-10s\n",
$export->name,
$export->path,
$export->protocol,
$export->active
)
}
# Prints something like:
#
#Name Path Protocol Active
# ----------------------------------------------------------------------------------------------------
# homes_root /ibm/fs1/homes NFS true
# ----------------------------------------------------------------------------------------------------
# shares_root /ibm/fs1/shares NFS true
# ----------------------------------------------------------------------------------------------------
# test /ibm/fs1/test CIFS true
# ----------------------------------------------------------------------------------------------------
# ... etc.
Returns all configured exports on the target system as an array of
IBM::StorageSystem::Export objects.
get_fabrics
# Print a list of our fabrics (sorted by fabric ID) including the
# fabric ID, node ID, port ID, local WWPN, remote WWPN and fabric
# status.
printf( "%-5s%-8s%-8s%-20s%-20s%-10s\n",
'ID',
'Node',
'Port',
'Local WWPN',
'Remote WWPN',
'Status'
);
print '-'x80,"\n";
for my $fabric ( map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [$_, $_->id] } $ibm->get_fabrics
) {
printf( "%-5s%-8s%-8s%-20s%-20s%-10s\n",
$fabric->id,
$fabric->node_name,
$fabric->local_port,
$fabric->local_wwpn,
$fabric->remote_wwpn,
$fabric->state
)
}
# Prints something like:
#
# ID Node Port Local WWPN Remote WWPN Status
# --------------------------------------------------------------------------------
# 1 node1 1 5005076802159D73 21000024FF43DE7B active
# 1 node1 2 5005076802259D73 21000024FF35B8FC active
# 2 node2 1 5005076802159D74 21000024FF43DE7A active
# 2 node2 2 5005076802259D74 21000024FF35B8FD active
Returns all configured fabrics on the target system as an array of
IBM::StorageSystem::Fabric objects.
filesystem( $filesystem_name )
# Print the block size of file system 'fs1'
print $ibm->filesystem(fs1)->block_size;
# Get the file system 'fs2' as a IBM::StorageSystem::FileSystem object
my $fs = $ibm->filesystem(fs2);
# Print the mount point of this file system
print "fs2 mount point: " . $fs->mount_point . "\n";
# Call a function if inode usage on file system 'fs2' exceeds 90% of
# maximum allocation.
monitoring_alert( 'Inode allocation > 90% on '.$filesystem->device_name )
if ( ( ( $fs->inodes / $fs->max_inodes ) * 100 ) > 90 );
Returns the file system specified by the value of the named parameter as
a IBM::StorageSystem::FileSystem object.
Note that this is a caching method and a cached object will be retrieved
if one exists, If you require a non-cached object, then please use the
get_filesystem method.
get_filesystem( $filesystem_name )
This is a non-caching functionally equivalent implementation of the
filesystem method. Use this method if you require the file system
information to be retrieved directly from the target system rather than
cache.
get_filesystems
# Do the same for all file systems
map {
monitoring_alert( 'Inode allocation > 90% on '.$_->device_name )
if ( ( ( $fs->inodes / $fs->max_inodes ) * 100 ) > 90 )
} $ibm->get_filesystems;
Returns an array of IBM::StorageSystem::FileSystem objects representing
all configured file systems on the target system.
get_healths
# Simple one-liner to print the sensor status and value for any error
# conditions.
map {
print join ' -> ', ( $_->sensor, $_->value."\n" )
} grep {
$_->status =~ /ERROR/
} $ibm->get_healths;
# e.g.
# CLUSTER -> Alert found in component cluster
# MDISK -> Alert found in component mdisk
# NODE -> Alert found in component node
Returns an array of IBM::StorageSystem::Health objects representative of
all health sensors on the target system.
Note that this method is only implemented on StorageSystem Unified
systems and not StorageSystem SONAS systems.
host( $hostname )
# Print the host status of the attached host 'sauron'
print "Status: " . $ibm->host(sauron)->status . "\n";
Returns the host specified by the value of the named host parameter as
an IBM::StorageSystem::Host object.
Note that this is a caching method and a cached object will be returned
if one exists. If you require a non-cached object, then please use the
get_host method.
get_host( $hostname )
This is a functionally equivalent non-caching implementation of the host
method.
get_hosts
# Print a list of all configured hosts sorted by hostname, their
# WWPNs, port state and login status.
foreach $host ( map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [ $_, $_->name ] } $ibm->get_hosts
) {
my $c = 0;
foreach $wwpn ( @{ $host->WWPN } ) {
print ( $c ? "\t" : ('-'x100)."\n".$host->name );
print "\t\t\t$wwpn\t" . @{ $host->state }[$c] . "\t\t" .
( @{$host->node_logged_in_count }[$c] ? '' : 'not ' )
. "logged in\n";
$c++
}
}
# Prints something similar to:
# ----------------------------------------------------------------------------------------------------
# host-3 2101001B32A3D94C active logged in
# 2100001B3283D94C active logged in
# ----------------------------------------------------------------------------------------------------
# host-4 2100001B320786E7 active logged in
# 2101001B322786E7 active logged in
# ----------------------------------------------------------------------------------------------------
# storage-2 210100E08BB40A08 offline not logged in
# 210000E08B940A08 offline not logged in
# ... etc.
Returns an array of IBM::StorageSystem::Host objects representing all
host attached to the target system.
iogroup( $id )
# Get I/O group 0
my $io_group = $ibm->get_iogroup(0);
# Print the I/O group maintenance state
print $io_group->maintenance_state;
# Alternately:
print $ibm->iogroup(0)->maintenance_state;
Returns the I/O group identified by the value of the numerical ID
parameter as an IBM::StorageSystem::IOGroup object.
Note that this method implements caching and a cached object will be
returned should one be present. If you require a non-cached object then
please use the get_iogroup method.
get_iogroup( $id )
This is a functionally equivalent non-caching implementation of the
iogroup method.
get_iogroups
# Print a formatted listing of all I/O groups by ID and name, along
# with their VDisk count, host count, node count and maintenance state.
map { printf( "%-8s%-20s%-20s%-20s%-20s%-20s\n",
$_->id,
$_->name,
$_->vdisk_count,
$_->host_count,
$_->node_count,
$_->maintenance )
} $ibm->get_iogroups;
# Prints something like:
#
# ID Name VDisk Count Host Count Node Count Maintenance
# 0 io_grp0 2 3 2 no
# 1 io_grp1 0 3 0 no
# 2 io_grp2 0 3 0 no
# 3 io_grp3 0 3 0 no
# ... etc.
Returns an array of IBM::StorageSystem::IOGroup objects representing all
configured I/O groups on the target system.
interface ( $id )
# Get interface ethX0 on management node mgmt001st001 as an
# IBM::StorageSystem::Interface object
# Print the interface status
print $interface->up_or_down;
# Print the interface status
print $interface->speed;
# Alternately;
print $ibm->interface('mgmt001st001:ethX0')->speed;
Returns the interface identified by the value of the id parameter as an
IBM::StorageSystem::Interface object.
The value of the id parameter must be a valid node and interface name
separated by a colon.
Note that this method implements caching and a cached object will be
returned should one be present. If you require a non-cached object then
please use the get_iogroup method.
get_interface( $id )
This is a functionally equivalent non-caching implementation of the
interface method.
get_interfaces
# Print a list of all interfaces, their status, speed and role
foreach my $interface ( $ibm->get_interfaces ) {
print "Interface: " . $interface->interface . "\n";
print "\tStatus: " . $interface->up_or_down . "\n";