NAME
IBM::StorageSystem::Host - Class for operations with a IBM StorageSystem attached hosts
VERSION
Version 0.01
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 } ) {
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.
METHODS
WWPN
Returns an array of the WWPNs configured for this host - the order of the WWPNs in the array preserves the order in which the WWPNs were returned from the CLI. For example, if two WWPNs would be returned from the CLI command of lshost <host_id>, then the order in which the WWPNs will be preserved in the array so that the first WWPN to be returned is the first array item and the second to be returned is the second array item.
See the NOTES section for further detail.
id
Returns the numerical identifier of the host.
iogrp_count
Returns the IO group count for the host.
mask
Returns the LUN masking for the host.
name
Returns the name of the host - this is the name with which the host was configured with in the CLI or GUI.
node_logged_in_count
Returns an array of integers representing the node logged in count for the corresponding WWPN. The array order is preserved from the output of the CLI and the array index match the values returned from the WWPN and state methods.
port_count
Returns configured host port count.
state
Returns an array or host port states - the array order is preserved as returned by the CLI and the array indexes match the values returned from the WWPN and node_logged_in_count methods.
status
Returns the host overal status, either one of online, offline or degraded.
type
Returns the host type.
NOTES
Note that the CLI output of an lshost <host_id> command in the StorageSystem CLI environment can return multiple identical output lines for the values of 'state', 'node_logged_in_count' and 'WWPN' fields. These output lines are positionally representational meaning that the first output lines refer to the first port, the second set of lines refer to the second port, and so on.
Because this output is returned using positional output formatting only and not explicit field numbering it is necessary to preserve the order implied by positional output formatting to retain the relationship between port specific information.
To do so, the methods WWPN, node_logged_in_count and state all return ordered arrays that preserve the positional output from the CLI so that the indexes for all of the aforementioned methods refer to a common port. That is:
# Given $i, then the port identified by WWPN
@{ $host->wwpn[$i] }
# Will have the port state
@{ $host->state[$i] }
# And the node_logged_in_count of
@{ $host->node_logged_in_count[$i] }
AUTHOR
Luke Poskitt, <ltp at cpan.org>
BUGS
Please report any bugs or feature requests to bug-ibm-v7000-host at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IBM-StorageSystem-Host. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc IBM::StorageSystem::Host
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=IBM-StorageSystem-Host
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2012 Luke Poskitt.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.