IBM-StorageSystem
view release on metacpan or search on metacpan
lib/IBM/StorageSystem/Node.pm view on Meta::CPAN
my @values = split /,/, $stat;
( my $m = 'IBM::StorageSystem::Statistic::Node::Disk' . ucfirst $m ) =~ s/s$//;
my $s = $m->new;
my $c = 0;
foreach my $col ( @cols ) {
$s->$col( $values[$c++] );
}
$stats->__push( $s )
}
return $stats
}
}
}
sub new {
my( $class, $ibm, %args ) = @_;
my $self = bless {}, $class;
weaken( $self->{__ibm} = $ibm );
defined $args{Hostname} or croak 'Constructor failed: mandatory Hostname argument not supplied';
# Modify the passed arg attribute names for nicer formatting - lower cased except for acronyms
foreach my $attr ( keys %args ) {
my $mattr = lc $attr;
foreach my $s ( qw(ctdb gpfs ip os) ) {
my $u = uc $s;
$mattr =~ s/(^|_)($s)/$1$u/g
}
$self->{$mattr} = $args{$attr}
}
return $self;
}
1;
__END__
=head1 NAME
IBM::StorageSystem::Node - Class for operations with a IBM StorageSystem node
=head1 VERSION
Version 0.01
=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;
print "Description: " . $ibm->node( mgmt001st001 )->description . "\n";
# Print the GPFS status of all nodes
foreach my $node ( $ibm->get_nodes ) {
print "GPFS status: " . $node->GPFS_status . "\n"
}
# Print the node product version
print $node->product_version;
# Print the node connection status
print $node->connection_status;
=head1 METHODS
=head3 CTDB_status
Returns the Clustered Trivial Database Status (CTDB) status of the specified node.
=head3 connection_status
Returns the connection status of the specified node.
=head3 CTDB_IP_address
Returns the CTDB IP address of the specified node.
=head3 cpu( $timeperiod )
Returns a L<IBM::StorageSystem::Statistic::Node::CPU> object containing CPU statistics
and performance data for the specified node for the specified time period.
Valid values for the timeperiod parameter are one of minute, hour, day, week, month, quarter
and year - if the timeperiod parameter is not specified it will default to minute.
=head3 daemon_IP_address
Returns the daemon IP address of the specified node.
=head3 daemon_version
Returns the daemon version number.
=head3 description
Returns the node description.
=head3 disk_reads( $time_period )
( run in 0.872 second using v1.01-cache-2.11-cpan-39bf76dae61 )