view release on metacpan or search on metacpan
lib/IBM/StorageSystem.pm view on Meta::CPAN
=head1 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::Enclsoure::PSU objects
map { printf( "\tPSU %s status: %s", $_->id, $_->status ) }
lib/IBM/StorageSystem.pm view on Meta::CPAN
# Prints - Temperature: 39
...
=head1 METHODS
=head3 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:
=over 3
=item user
The username of the user with which to connect to the device.
lib/IBM/StorageSystem.pm view on Meta::CPAN
This is a functionally equivalent non-caching implementation of the B<replication> method.
=head3 get_replications
use Date::Calc qw(date_to_Time Today_and_Now);
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";
# Generate an alert for any replication errors in the last six hours
foreach my $task ( $ibm->get_replications ) {
if ( $task->status eq 'ERROR' and ( Date_to_Time( Today_and_Now )
- ( Date_to_Time( split /-| |\./, $task->time ) ) ) < 21_600 ) {
alert( "Replication failure for filesystem " . $task->filesystem .
" - log ID: " . $task->log_id . )
lib/IBM/StorageSystem/Array.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Array is a utility class for operations with a IBM StorageSystem array.
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";
# Get array 2 as an IBM::StorageSystem::Array object
my $array = $ibm->array( 2 );
# Print the array capacity
print $array->capacity;
# Print the array RAID level
print $array->raid_level;
lib/IBM/StorageSystem/Disk.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Disk is a utility class for operations with IBM StorageSystem disks.
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";
# Get disk ID system_vol_00 as an IBM::StorageSystem::Disk object.
my $disk = $ibm->disk( 'system_vol_01' );
# Print the file system to which the disk is assigned
print $disk->file_system;
# Prints "fs1"
lib/IBM/StorageSystem/Drive.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Drive is a utility class for operations with a IBM StorageSystem drive.
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";
# Get drive ID 2 as an IBM::StorageSystem::Drive object - note that drive ID 2
# is not necessarily the physical disk in slot ID 2 - see notes below.
my $drive = $ibm->drive( 2 );
# Print the drive capacity in bytes
print $drive->capacity;
# Print the drive vendor and product IDs
lib/IBM/StorageSystem/Enclosure.pm view on Meta::CPAN
Version 0.01
=head1 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";
lib/IBM/StorageSystem/Enclosure/Battery.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Enclosure::Battery is a utility class for operations with a IBM Storwize
enclosure battery.
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";
# Get a list of the batteries in enclosure two
my @batteries = $ibm->enclosure(2)->get_batterys;
# Print the percent charged status of each battery
for my $battery ( @batteries ) {
print "Battery " $battery->battery_id . " percent charged: "
. $_->percent_charged . "%\n"
}
lib/IBM/StorageSystem/Enclosure/Canister.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Enclosure::Canister is a utility class for operations with a IBM Storwize enclosure Canister.
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 WWNN of the first canister in the first enclosure.
print $ibm->enclosure(1)->canister(1)->WWNN;
# Print the temperatures of all canisters in this enclosure.
map { print "Canister ", $_->canister_id, " temperature: ", $_->temperature } $enclosure->get_canisters;
=head3 FRU_identity
lib/IBM/StorageSystem/Enclosure/PSU.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Enclosure::PSU is a utility class for operations with a IBM Storwize enclosure PSU.
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 the second PSU in the fifth enclosure.
print $ibm->enclosure(5)->psu(2)->status;
# Print the status of all PSUs in all enclosures in our system
map { print "\t- PSU ", $_->PSU_id, " status: ", $_->status, "\n" }
map { print "--- Enclosure ", $_->id, "\n"; $_->get_psus } $ibm->get_enclosures;
# Should yield something similar to:
lib/IBM/StorageSystem/Enclosure/Slot.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Enclosure::Slot is a utility class for operations with a IBM Storwize enclosure slot.
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 corresponding slot and drive IDs for all populated slots
# in all enclosures in this system.
foreach my $enclosure ( $ibm->get_enclosures ) {
foreach my $slot ( $ibm->enclosure($enclosure)->get_slots ) {
print "Slot ", $slot->slot_id, " -> Drive ", $slot->drive_id, "\n"
if ( $slot->drive_present eq 'yes' )
}
lib/IBM/StorageSystem/Export.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Export - Class for operations with a IBM StorageSystem logical export entity
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 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 )
lib/IBM/StorageSystem/Fabric.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Fabric is a utility class for operations with a IBM StorageSystem fabric entity.
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 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,
lib/IBM/StorageSystem/FileSystem.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::V7000::FileSystem - Class for operations with a IBM V7000 file system entities
use IBM::V7000;
my $ibm = IBM::V7000->new( user => 'admin',
host => 'my-v7000',
key_path => '/path/to/my/.ssh/private_key'
) or die "Couldn't create object! $!\n";
# Print the block size of file system 'fs1'
print $ibm->fs(fs1)->block_size;
# Get the file system 'fs2' as a IBM::V7000::FileSystem object
my $fs = $ibm->fs(fs2);
# Print the mount point of this file system
print "fs2 mount point: " . $fs2->mount_point . "\n";
lib/IBM/StorageSystem/FileSystem/FileSet.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::FileSystem::FileSet - Utility class for operations with a IBM storage system filesystem filesets
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";
=head3 alloc_inodes
Returns the number of allocated inodes for the fileset.
B<Note> that the number of allocated inodes is returned in a human-readable format with a variable units -
e.g. the value may be returned as 10K or 10M, where K and M refer to the unit.
=head3 comment
lib/IBM/StorageSystem/Health.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Health - Class for operations with a IBM StorageSystem logical health stati
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";
# 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
lib/IBM/StorageSystem/Host.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Host is a utility class for operations with a IBM StorageSystem attached hosts.
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 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 } ) {
lib/IBM/StorageSystem/IOGroup.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::IOGroup is a utility class for operations with IBM StorageSystem I/O Groups.
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";
# 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;
lib/IBM/StorageSystem/Interface.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Interface - Class for operations with a IBM StorageSystem network interfaces
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";
# Get interface ethX0 on management node mgmt001st001 as an IBM::StorageSystem::Interface object
my $interface = $ibm->interface('mgmt001st001:ethX0');
# Print the interface status
print $interface->up_or_down;
# Print the interface status
print $interface->speed;
lib/IBM/StorageSystem/Mount.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Mount - Class for operations with IBM StorageSystem mount
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 mount status of file system fs1
print "Mount status: " . $ibm->mount(fs1) . "\n";
# Print only those file system that aren't mounted
map { print $_->file_system . " is not mounted.\n" }
grep { $_->mount_status ne 'mounted' }
$ibm->get_mounts;
lib/IBM/StorageSystem/Node.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Node is a utility class for operations with a IBM StorageSystem node.
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";
# Get node mgmt001st001 as an IBM::StorageSystem::Node object
my $node = $ibm->node( mgmt001st001 );
# Print the node description
print "Description: " . $node->description . "\n";
# Prints something like: "Description: active management node"
# Or alternately;
lib/IBM/StorageSystem/Pool.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Pool is a class for operations with a IBM StorageSystem pool objects.
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 a
=head1 METHODS
=head3 name
Returns the name of the pool.
lib/IBM/StorageSystem/Quota.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Quota - Class for operations with IBM StorageSystem quota objects
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";
=head1 METHODS
=head3 HL_inode
Returns the quota inode hard limit.
lib/IBM/StorageSystem/Replication.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Replication - Class for operations with IBM StorageSystem asynchronous replications
use IBM::StorageSystem;
use Date::Calc qw(date_to_Time Today_and_Now);
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";
# Generate an alert for any replication errors in the last six hours
foreach my $task ( $ibm->get_replications ) {
if ( $repl->status eq 'ERROR' and ( Date_to_Time( Today_and_Now )
- ( Date_to_Time( split /-| |\./, $repl->time ) ) ) > 21_600 ) {
alert( "Replication failure for filesystem " . $repl->filesystem .
" - log ID: " . $repl->log_id . )
lib/IBM/StorageSystem/Service.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Service - Class for operations with a IBM StorageSystem service entities
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 enabled status of the NFS service
print $ibm->service(NFS)->enabled;
# Print the configured and enabled status of all services
printf( "%-20s%-20s%-20s\n", 'Service', 'Configured', 'Active' );
map { printf( "%-20s%-20s%-20s\n", $_->name, $_->configured, $_->active ) } $ibm->get_services;
lib/IBM/StorageSystem/Snapshot.pm view on Meta::CPAN
=head1 SYNOPSIS
IBM::StorageSystem::Snapshot is a class for operations with a IBM StorageSystem snapshot objects.
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 a list of all snapshots tabularly ordered by file system and fileset,
# including the age of each snapshot in days.
use Date::Calc qw(Today Delta_Days);
my ( $y, $m, $d ) = Today;
foreach my $filesystem ( $ibm->get_filesystems ) {
lib/IBM/StorageSystem/Statistic.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Statistic - Class for operations with IBM StorageSystem system statistics
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 current system FC IOPS
print $ibm->fc_io->current;
# Print the peak system FC IOPS
print $ibm->fc_io->peak;
# Refresh the FC IOPS statistics and print the new current value
$ibm->fc_io->refresh;
lib/IBM/StorageSystem/Task.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::Task - Class for operations with IBM StorageSystem tasks
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 the SNAPSHOTS task
my $snapshots = $ibm->task(SNAPSHOTS);
print "Status: " . $snapshots->status . "\n";
# Alternately
print "Status: " . $ibm->task(SNAPSHOTS)->status . "\n";
# Print the array status of all arrays in our system
lib/IBM/StorageSystem/VDisk.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::VDisk - Class for operations with IBM StorageSystem VDisks
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";
# Get the VDisk ID 3 and print the VDisk UUID
my $vdisk = $ibm->vdisk(3);
print $vdisk->vdisk_UUID;
# Alternately:
print $ibm->vdisk(3)->vdisk_UUID;
# Print the name, ID, capacity in GB and MDisk group name of all VDisks in a
lib/IBM/StorageSystem/VDisk/Copy.pm view on Meta::CPAN
Version 0.01
=head1 SYNOPSIS
IBM::StorageSystem::VDisk::Copy - Class for operations with IBM StorageSystem VDisk Copies
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 copy 0 of VDisk 0
print "Status: " . $ibm->vdisk(0)->copy(0)->status . "\n";
# Print each VDisk by name and each of the VDisk copies status
foreach my $vdisk ( $ibm->get_vdisks ) {
print "VDisk : " . $vdisk->name . "\n";
foreach my $copy ( $vdisk->get_copys ) {