NAME
IBM::StorageSystem::Enclosure - Class for operations with a IBM Storwize enclosure
VERSION
Version 0.01
SYNOPSIS
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
METHODS
new
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.
psu( $id )
# 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.
get_psu( $id )
my $psu = $enclosure->get_psu(2);
Returns the PSU as specified by the value of the id parameter as a IBM::StorageSystem::Enclosure::PSU object.
get_psus
my @psus = $enclosure->get_psus;
Returns an all PSUs in the specified enclosure as an array of IBM::StorageSystem::Enclosure::PSU objects.
battery( $id )
# 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.
Note that this method implements object caching when possible - please refer to the Caching section in the IBM::StorageSystem documentation for further detail.
get_battery( $id )
# 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_batterys
# 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.
slot( $id )
# 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.
Note that this method implements object caching when possible - please refer to the Caching section in the IBM::StorageSystem documentation for further detail.
get_slot( $id )
Returns a BM::StorageSystem::Enclosure::Slot object for the slot specified by the id parameter.
get_slots
# 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.
canister( $id )
# 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.
Note that this method implements object caching when possible - please refer to the Caching section in the IBM::StorageSystem documentation for further detail.
get_canister( $id )
Returns the canister for this enclosure as specified by the id parameter as an IBM::StorageSystem::Enclosure::Canister object.
get_canisters
my @canisters = $enclosure->get_canisters;
Returns a list of all present canisters in this enclosure as IBM::StorageSystem::Enclosure::Canister objects.
FRU_identity
Returns the Field Replacable Unit (FRU) identity of the enclosure.
FRU_part_number
Returns the Field Replacable Unit part number of the enclosure.
IO_group_id
Returns the IO group ID for this enclosure.
IO_group_name
Returns the IO group name for this enclosure.
drive_slots
Returns the number of drive slots present in this enclosure.
error_sequence_number
Returns the error sequence number (if any) of the most recently logged error condition.
fault_LED
Returns the fault LED state.
firmware_level_1
Returns the firmware level 1 code.
firmware_level_2
Returns the firmware level 2 code.
id
Returns the enclosure ID.
identify_LED
Returns the identity LED state.
machine_part_number
Returns the machine part number of the enclosure (if present).
managed
Returns the managed status of the enclosure.
online_PSUs
Returns the number of online PSUs present in this enclosure.
online_canisters
Returns the number of online canisters present in this enclosure.
product_MTM
Returns the product Manufacturing Type Model code for this enclosure.
serial_number
Returns the serial number of this enclosure.
status
Returns the system status of this enclosure.
total_PSUs
Returns the total number of PSUs present in this enclosure.
total_canisters
Returns the total number of canisters present in this enclosure.
type
Returns the enclosure operational type.