IBM::StorageSystem::Enclosure - Class for operations with a IBM Storwize enclosure
Version 0.01
IBM::StorageSystem is a utility class for operation with an IBM Storwize enclosure.
use IBM::StorageSystem; my $ibm = IBM::StorageSystem->new( user => 'admin', host => 'my-v7000', key_path => '/path/to/my/.ssh/private_key' ) or die "Couldn't create object! $!\n"; # Print the status of each enclosure in our system. foreach my $enclosure ( $ibm->get_enclosures ) { print "Enclosure ", $enclosure->id, " status: ", $enclosure->status, "\n" } # Print the status of a specific enclosure print "Enclosure two status is " . $ibm->enclosure(2)->status . "\n"; # Get all PSUs in an enclosure as L<IBM::StorageSystem::Enclosure::PSU> objects. my @psus = $ibm->enclosure(1)->psus; # Plus much more
Constructor method - note that under normal circumstances you shouldn't need to explicitly call this method - rather a IBM::StorageSystem::Enclosure object is created for you via calls to methods in other classes like get_enclosure in IBM::StorageSystem.
# Get the first PSU of the first enclosure and print the redundancy status my $enclosure = $ibm->enclosure(1); my $psu = $enclosure->psu(1); print $psu->redundant; # Alternately print $ibm->enclosure(1)->psu(1)->redundant;
Returns the PSU as specified by the value of the id parameter as a IBM::StorageSystem::Enclosure::PSU object.
Note that this method implements object caching when possible - please refer to the Caching section in the IBM::StorageSystem documentation for further detail.
my $psu = $enclosure->get_psu(2);
my @psus = $enclosure->get_psus;
Returns an all PSUs in the specified enclosure as an array of IBM::StorageSystem::Enclosure::PSU objects.
# Print the percentage charged status of the first battery in the second enclosure print $ibm->enclosure(2)->battery(1)->percent_charged;
Returns the enclosure battery as specified by the value of the given id parameter as a IBM::StorageSystem::Enclosure::Battery object.
# Get the first battery of the first enclosure. my $battery = $ibm->enclosure(1)->get_battery(1);
Returns the enclosure battery as specified by the value of the id parameter as a IBM::StorageSystem::Enclosure::Battery object.
# Get all batteries for an enclosure object. my @batterys = $enclosure->get_batterys;
Returns a list of IBM::StorageSystem::Enclosure::Battery objects for the specified enclosure.
# Check the SAS port and LED fault states of slot 1. my $slot = $ibm->enclosure(1)->slot(1); if ( ( $slot->port_1_status ne 'online' or $slot->port_2_status ne 'online' ) or $slot->fault_LED ne 'off' ) { jump_up_and_down() }
Returns a IBM::StorageSystem::Enclosure::Slot object for the slot specified by the id parameter.
Returns a BM::StorageSystem::Enclosure::Slot object for the slot specified by the id parameter.
# Print the drive ID for each slot. map { print "Slot ", $_->slot_id, " drive ID: ", $_->drive_id, "\n" } $enclosure->get_slots;
Returns a list of IBM::StorageSystem::Enclosure::Slot objects for the specified enclosure.
# Get the first canister of this enclosure my $canister = $enclosure->canister(1); # Check and alert the canister temperature SMS_NOC( "Enclosure ${ $enclosure->id } canister ${ canister->id } ". "temperature ${ $canister->temperature }C" ) if ($canister->temperature > 45);
Returns the canister for this enclosure as specified by the id parameter as an IBM::StorageSystem::Enclosure::Canister object.
my @canisters = $enclosure->get_canisters;
Returns a list of all present canisters in this enclosure as IBM::StorageSystem::Enclosure::Canister objects.
Returns the Field Replacable Unit (FRU) identity of the enclosure.
Returns the Field Replacable Unit part number of the enclosure.
Returns the IO group ID for this enclosure.
Returns the IO group name for this enclosure.
Returns the number of drive slots present in this enclosure.
Returns the error sequence number (if any) of the most recently logged error condition.
Returns the fault LED state.
Returns the firmware level 1 code.
Returns the firmware level 2 code.
Returns the enclosure ID.
Returns the identity LED state.
Returns the machine part number of the enclosure (if present).
Returns the managed status of the enclosure.
Returns the number of online PSUs present in this enclosure.
Returns the number of online canisters present in this enclosure.
Returns the product Manufacturing Type Model code for this enclosure.
Returns the serial number of this enclosure.
Returns the system status of this enclosure.
Returns the total number of PSUs present in this enclosure.
Returns the total number of canisters present in this enclosure.
Returns the enclosure operational type.
To install IBM::StorageSystem, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IBM::StorageSystem
CPAN shell
perl -MCPAN -e shell install IBM::StorageSystem
For more information on module installation, please visit the detailed CPAN module installation guide.