@@ -1,5 +1,20 @@
Revision history for Cisco-UCS
+0.33 Fri May 17 2013 <ltp@cpan.org>
+ - Added Cisco::UCS::Blade::PowerBudget
+ - Added Cisco::UCS::Chassis::Stats
+ - Updated Cisco::UCS::Blade to add new method for retreiving power budget stats.
+ - Updated Cisco::UCS::Chassis to add new method for retreiving environmental stats..
+
+0.32 Wed May 15 2013 <ltp@cpan.org>
+ - Added Cisco::UCS::Blade::CPU
+ - Added Cisco::UCS::Common::PowerStats
+ - Added Cisco::UCS::Common::EnvironmentalStats
+ - Updated Cisco::UCS::Blade - new methods for retrieving CPU and power stats.
+
+0.31 Wed May 1 2013 <ltp@cpan.org>
+ - Added let method to Cisco::UCS::Blade
+
0.30 Fri 4 2012 <ltp@cpan.org>
-Fixed bug in _get_child_objects in UCS.pm that prevented correct handling
of single child entities.
@@ -7,7 +7,10 @@ lib/Cisco/UCS/Interconnect.pm
lib/Cisco/UCS/MgmtEntity.pm
lib/Cisco/UCS/FEX.pm
lib/Cisco/UCS/Chassis.pm
+lib/Cisco/UCS/Chassis/Stats.pm
lib/Cisco/UCS/Blade.pm
+lib/Cisco/UCS/Blade/CPU.pm
+lib/Cisco/UCS/Blade/PowerBudget.pm
lib/Cisco/UCS/ServiceProfile.pm
lib/Cisco/UCS/Fault.pm
lib/Cisco/UCS/Common/FanModule.pm
@@ -15,8 +18,11 @@ lib/Cisco/UCS/Common/Fan.pm
lib/Cisco/UCS/Common/PSU.pm
lib/Cisco/UCS/Common/SwitchCard.pm
lib/Cisco/UCS/Common/EthernetPort.pm
+lib/Cisco/UCS/Common/EnvironmentalStats.pm
+lib/Cisco/UCS/Common/PowerStats.pm
t/00-load.t
t/manifest.t
t/pod-coverage.t
t/pod.t
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
@@ -0,0 +1,43 @@
+{
+ "abstract" : "A Perl interface to the Cisco UCS XML API",
+ "author" : [
+ "Luke Poskitt <ltp@cpan.org>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.112621",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Cisco-UCS",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "LWP" : 0,
+ "Test::More" : 0,
+ "XML::Simple" : 0
+ }
+ }
+ },
+ "release_status" : "stable",
+ "version" : "0.33"
+}
@@ -1,24 +1,24 @@
---- #YAML:1.0
-name: Cisco-UCS
-version: 0.30
-abstract: A Perl interface to the Cisco UCS XML API
+---
+abstract: 'A Perl interface to the Cisco UCS XML API'
author:
- - Luke Poskitt <ltp@cpan.org>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
+ - 'Luke Poskitt <ltp@cpan.org>'
build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- LWP: 0
- Test::More: 0
- XML::Simple: 0
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.56
+ ExtUtils::MakeMaker: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.112621'
+license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Cisco-UCS
+no_index:
+ directory:
+ - t
+ - inc
+requires:
+ LWP: 0
+ Test::More: 0
+ XML::Simple: 0
+version: 0.33
@@ -0,0 +1,266 @@
+package Cisco::UCS::Blade::CPU;
+
+use strict;
+use warnings;
+
+use Cisco::UCS::Common::EnvironmentalStats;
+use Scalar::Util qw(weaken);
+
+our $VERSION = '0.01';
+our %V_MAP = (
+ arch => 'arch',
+ cores => 'cores',
+ coresEnabled => 'cores_enabled',
+ dn => 'dn',
+ id => 'id',
+ model => 'model',
+ operability => 'operability',
+ operQualifierReason => 'operational_reason',
+ operState => 'operational_state',
+ perf => 'perf',
+ power => 'power',
+ presence => 'presence',
+ revision => 'revision',
+ serial => 'serial',
+ socketDesignation => 'socket',
+ speed => 'speed',
+ stepping => 'stepping',
+ thermal => 'thermal',
+ threads => 'threads',
+ vendor => 'vendor',
+ visibility => 'visibility',
+ voltage => 'voltage',
+);
+
+{ no strict 'refs';
+
+ while ( my ($attribute, $pseudo) = each %V_MAP ) {
+ *{ __PACKAGE__ .'::'. $pseudo } = sub {
+ my $self = shift;
+ return $self->{$attribute}
+ }
+ }
+}
+
+sub new {
+ my ( $class, $ucs, $args ) = @_;
+
+ my $self = bless {}, $class;
+ weaken( $self->{ucs} = $ucs );
+
+ foreach my $var ( keys %$args ) {
+ $self->{ $var } = $args->{ $var };
+ }
+
+ return $self
+}
+
+sub env_stats {
+ my $self = shift;
+ return Cisco::UCS::Common::EnvironmentalStats->new(
+ $self->{ucs}->resolve_dn( dn => "$self->{dn}/env-stats" )->{outConfig}->{processorEnvStats} )
+}
+
+1;
+
+=head1 NAME
+
+Cisco::UCS::Blade::CPU - Class for operations with a Cisco UCS Blade CPUs.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in all chassis along with a cacti-style listing of the
+ # blades current, minimum and maximum power consumption values.
+
+ map {
+ print "Chassis: " . $_->id ."\n";
+ map { print "\tCommon::PowerStats: ". $_->id ." - Power consumed -"
+ . " Current:". $_->power_stats->consumed_power
+ . " Max:". $_->power_stats->consumed_power_max
+ . " Min:". $_->power_stats->consumed_power_min ."\n"
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # Prints something like:
+ #
+ # Chassis: 1
+ # Blade: 1 - Power consumed - Current:115.656647 Max:120.913757 Min:110.399513
+ # Blade: 2 - Power consumed - Current:131.427994 Max:139.313675 Min:126.170883
+ # Blade: 3 - Power consumed - Current:131.427994 Max:157.713593 Min:126.170883
+ # Blade: 4 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 5 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 6 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 7 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 8 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Chassis: 2
+ # Blade: 1 - Power consumed - Current:131.427994 Max:136.685120 Min:128.799438
+ # Blade: 2 - Power consumed - Current:126.170883 Max:131.427994 Min:123.542320
+ # Blade: 3 - Power consumed - Current:134.056564 Max:155.085037 Min:131.427994
+ # ...etc.
+
+=head1 DECRIPTION
+
+Cisco::UCS::Blade::CPU is a class providing operations with a Cisco UCS Blade CPU.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Blade::CPU object
+is created automatically by method calls on a L<Cisco::UCS::Blade> object.
+
+=cut
+
+=head1 METHODS
+
+=head3 arch
+
+Returns the CPU architecture.
+
+=head3 cores
+
+Returns the number of CPU cores.
+
+=head3 cores_enabled
+
+Returns the number of CPU cores enabled.
+
+=head3 env_stats
+
+Returns the environmental status and statistics of the CPU as a
+L<Cisco::UCS::Common::EnvironmentalStats> object.
+
+=head3 dn
+
+Returns the distinguished name of the CPU in the UCS information management heirarchy.
+
+=head3 id
+
+Returns the integer ID of the CPU.
+
+=head3 model
+
+Returns the CPU model.
+
+=head3 operability
+
+Returns the CPU operability state.
+
+=head3 operational_reason
+
+Returns the CPU operational reason.
+
+=head3 operational_state
+
+Returns the CPU operational state.
+
+=head3 perf
+
+Returns the CPU performance state.
+
+=head3 power
+
+Returns the CPU power state.
+
+=head3 presence
+
+Returns the CPU presence state.
+
+=head3 revision
+
+Returns the CPU revision level.
+
+=head3 serial
+
+Returns the CPU serial number.
+
+=head3 socket
+
+Returns the CPU socket.
+
+=head3 speed
+
+Returns the CPU speed.
+
+=head3 stepping
+
+Returns the CPU stepping.
+
+=head3 thermal
+
+Returns the CPU thermal state.
+
+=head3 threads
+
+Returns number of the CPU threads.
+
+=head3 vendor
+
+Returns the CPU vendor string.
+
+=head3 visibility
+
+Returns the CPUs visibility.
+
+=head3 voltage
+
+Returns the CPUs voltage.
+
+=head1 AUTHOR
+
+Luke Poskitt, C<< <ltp at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-cisco-ucs-blade-cpu at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Cisco-UCS-Blade-CPU>. I will
+be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Cisco::UCS::Blade::CPU
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Cisco-UCS-Blade-CPU>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Cisco-UCS-Blade-CPU>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Cisco-UCS-Blade-CPU>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Cisco-UCS-Blade-CPU/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013 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.
+
+
+=cut
@@ -0,0 +1,259 @@
+package Cisco::UCS::Blade::PowerBudget;
+
+use strict;
+use warnings;
+
+use Cisco::UCS::Blade::PowerBudget;
+use Scalar::Util qw(weaken);
+
+our $VERSION = '0.01';
+our %V_MAP = (
+ adminCommitted => 'admin_commited',
+ adminPeak => 'admin_peak',
+ capAction => 'cap_action',
+ catalogPower => 'catalog_power',
+ currentPower => 'current_power',
+ dynRealloc => 'dyn_reallocation',
+ groupName => 'group_name',
+ idlePower => 'idle_power',
+ maxPower => 'max_power',
+ minPower => 'min_power',
+ operCommitted => 'oper_commited',
+ operMin => 'oper_min',
+ operPeak => 'oper_peak',
+ operState => 'oper_state',
+ prio => 'priority',
+ psuCapacity => 'psu_capacity',
+ psuState => 'psu_state',
+ scaledWt => 'scaled_wt',
+ style => 'style',
+ updateTime => 'update_time',
+ weight => 'weight',
+);
+
+{ no strict 'refs';
+
+ while ( my ($attribute, $pseudo) = each %V_MAP ) {
+ *{ __PACKAGE__ .'::'. $pseudo } = sub {
+ my $self = shift;
+ return $self->{$attribute}
+ }
+ }
+}
+
+sub new {
+ my ( $class, $args ) = @_;
+
+ my $self = bless {}, $class;
+
+ foreach my $var ( keys %$args ) {
+ $self->{ $var } = $args->{ $var };
+ }
+
+ return $self
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Cisco::UCS::Blade::PowerBudget - Class for operations with a Cisco UCS blade power budgets.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in all chassis along with the chassis current output power
+ # and each blades current input power both in watts and as a percentage of
+ # the chassis input power level.
+
+ map {
+ my $c_power = $_->stats->output_power;
+ printf( "Chassis: %d - Output power: %.3f\n", $_->id, $c_power );
+ map {
+ printf( "\tBlade: %d - Input power: %.3f (%.2f%%)\n",
+ $_->id, $_->power_budget->current_power,
+ ( $c_power == 0 ? '-' : ( $_->power_budget->current_power / $c_power * 100 ) ) )
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # E.g.
+ #
+ # Chassis: 1 - Output power: 704.000
+ # Blade: 1 - Input power: 119.000 (16.90%)
+ # Blade: 2 - Input power: 134.000 (19.03%)
+ # Blade: 3 - Input power: 135.000 (19.18%)
+ # Blade: 4 - Input power: 0.000 (0.00%)
+ # Blade: 5 - Input power: 0.000 (0.00%)
+ # Blade: 6 - Input power: 0.000 (0.00%)
+ # Blade: 7 - Input power: 0.000 (0.00%)
+ # Blade: 8 - Input power: 136.000 (19.32%)
+ # Chassis: 2 - Output power: 1188.000
+ # Blade: 1 - Input power: 127.000 (10.69%)
+ # Blade: 2 - Input power: 0.000 (0.00%)
+ # Blade: 3 - Input power: 120.000 (10.10%)
+ # Blade: 4 - Input power: 0.000 (0.00%)
+ # Blade: 5 - Input power: 127.000 (10.69%)
+ # Blade: 6 - Input power: 121.000 (10.19%)
+ # Blade: 7 - Input power: 172.000 (14.48%)
+ # Blade: 8 - Input power: 136.000 (11.45%)
+ # etc.
+
+=head1 DECRIPTION
+
+Cisco::UCS::Blade::PowerBudget is a class providing operations with a Cisco UCS blade power budget.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Blade::PowerBudget object
+is created automatically by method calls on a L<Cisco::UCS::Blade> object.
+
+=cut
+
+=head1 METHODS
+
+=head3 admin_commited
+
+Returns the administrative commited power level of the blade.
+
+=head3 admin_peak
+
+Returns the administrative peak power level of the blade.
+
+=head3 cap_action
+
+Returns the power cap action of the blade.
+
+=head3 catalog_power
+
+Returns the catalog power level of the blade.
+
+=head3 current_power
+
+Returns the current power level of the blade.
+
+=head3 dyn_reallocation
+
+Returns the power dynamic reallocation policy of the blade.
+
+=head3 group_name
+
+Returns the power group name of the blade.
+
+=head3 idle_power
+
+Returns the idle power level of the blade.
+
+=head3 max_power
+
+Returns the maximum power level of the blade.
+
+=head3 min_power
+
+Returns the minimum power level of the blade.
+
+=head3 oper_commited
+
+Returns the operator committed power level of the blade.
+
+=head3 oper_min
+
+Returns the operator committed minimum power level of the blade.
+
+=head3 oper_peak
+
+Returns the operator committed peak power level of the blade.
+
+=head3 oper_state
+
+Returns the operational power state of the blade.
+
+=head3 priority
+
+Returns the administrative power priority of the blade.
+
+=head3 psu_capacity
+
+Returns the PSU capacity.
+
+=head3 psu_state
+
+Returns the PSU state.
+
+=head3 scaled_wt
+
+Returns the scaled weighted threshold of the blade power budget.
+
+=head3 style
+
+Returns the power budget management style of the blade.
+
+=head3 update_time
+
+Returns a timestamp at which time the last time power budget statistics
+and information were last updated.
+
+=head3 weight
+
+Returns the power budget weight for the blade.
+
+=head1 AUTHOR
+
+Luke Poskitt, C<< <ltp at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-cisco-ucs-blade-powerbudget at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Cisco-UCS-Blade-PowerBudget>. I will
+be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Cisco::UCS::Blade::PowerBudget
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Cisco-UCS-Blade-PowerBudget>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Cisco-UCS-Blade-PowerBudget>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Cisco-UCS-Blade-PowerBudget>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Cisco-UCS-Blade-PowerBudget/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013 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.
+
+
+=cut
@@ -5,8 +5,11 @@ use strict;
use Carp qw(croak);
use Scalar::Util qw(weaken);
+use Cisco::UCS::Blade::CPU;
+use Cisco::UCS::Blade::PowerBudget;
+use Cisco::UCS::Common::PowerStats;
-our $VERSION = '0.1';
+our $VERSION = '0.4';
our @ATTRIBUTES = qw(association availability discovery dn model name operability presence revision serial uuid vendor);
@@ -38,29 +41,6 @@ our %ATTRIBUTES = (
uuid_original => 'originalUuid'
);
-=head1 NAME
-
-Cisco::UCS::Blade - Class for operations with a Cisco UCS blade.
-
-=cut
-
-=head1 SYNOPSIS
-
- foreach my $blade ($ucs->chassis(1)->get_blades) {
- printf ("%1d\t: %-20s\n", $blade->id, $blade->serial)
- }
-
- print $chassis(2)->blade(3)->memory_available;
-
-=head1 DECRIPTION
-
-Cisco::UCS::Blade is a class providing operations with a Cisco UCS Blade.
-
-Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Blade object
-is created automatically by method calls to a L<Cisco::UCS::Chassis> object.
-
-=cut
-
sub new {
my ($class, %args) = @_;
my $self = {};
@@ -92,6 +72,131 @@ sub new {
}
}
+sub led {
+ my ( $self, $state ) = @_;
+ $state = lc $state;
+ $state eq 'on' || $state eq 'off' or return;
+ my $req = <<XML;
+ <configConfMos cookie="$self->{ucs}->{cookie}" inHierarchical="false">
+ <inConfigs>
+ <pair key="sys/chassis-$self->{chassisId}/blade-$self->{slotId}/locator-led">
+ <equipmentLocatorLed adminState="$state" dn="sys/chassis-$self->{chassisId}/blade-$self->{slotId}/locator-led" id="1" name="" ></equipmentLocatorLed>
+ </pair>
+ </inConfigs>
+ </configConfMos>
+XML
+ my $xml = $self->{ucs}->_ucsm_request( $req );
+
+ if ( defined $xml->{'errorCode'} ) {
+ my $self->{error} = (defined $xml->{'errorDescr'} ? $xml->{'errorDescr'} : "Unspecified error");
+ print "got error: $self->{error}\n";
+ return
+ }
+
+ return 1
+}
+
+sub power_stats {
+ my $self = shift;
+ return Cisco::UCS::Common::PowerStats->new(
+ $self->{ucs}->resolve_dn( dn => "$self->{dn}/board/power-stats" )->{outConfig}->{computeMbPowerStats} )
+}
+
+sub power_budget {
+ my $self = shift;
+ return Cisco::UCS::Blade::PowerBudget->new(
+ $self->{ucs}->resolve_dn( dn => "$self->{dn}/budget" )->{outConfig}->{powerBudget} )
+}
+
+sub cpu {
+ my ( $self, $id ) = @_;
+ return ( defined $self->{cpu}->{$id} ? $self->{cpu}->{$id} : $self->get_cpus( $id ) )
+}
+
+sub get_cpu {
+ my ( $self, $id ) = @_;
+ return ( $id ? $self->get_cpus( $id ) : undef )
+}
+
+sub get_cpus {
+ my ( $self, $id ) = @_;
+ my $cpus = $self->{ucs}->resolve_children( dn => "$self->{dn}/board" )->{outConfigs}->{processorUnit};
+ my @cpus;
+
+ while ( my ( $cid, $cpu ) = each %$cpus ) {
+ $cpu->{id} = $cid;
+ $cpu = Cisco::UCS::Blade::CPU->new( $self->{ucs}, $cpu );
+ push @cpus, $cpu;
+ $self->{cpu}->{$cid} = $cpu;
+ return $cpu if ( defined $id and $cid == $id )
+ }
+
+ return @cpus;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Cisco::UCS::Blade - Class for operations with a Cisco UCS blade.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in chassis 1 along with their serial number
+
+ foreach my $blade ($ucs->chassis(1)->get_blades) {
+ printf ("%1d\t: %-20s\n", $blade->id, $blade->serial)
+ }
+
+ # Print the memory installed and available in blade 2/3
+
+ print $chassis(2)->blade(3)->memory_available;
+
+ # Print all blades in all chassis along with a cacti-style listing of the
+ # blades current, minimum and maximum power consumption values.
+
+ map {
+ print "Chassis: " . $_->id ."\n";
+ map { print "\tBlade: ". $_->id ." - Power consumed -"
+ . " Current:". $_->power_stats->consumed_power
+ . " Max:". $_->power_stats->consumed_power_max
+ . " Min:". $_->power_stats->consumed_power_min ."\n"
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # Prints something like:
+ #
+ # Chassis: 1
+ # Blade: 1 - Power consumed - Current:115.656647 Max:120.913757 Min:110.399513
+ # Blade: 2 - Power consumed - Current:131.427994 Max:139.313675 Min:126.170883
+ # Blade: 3 - Power consumed - Current:131.427994 Max:157.713593 Min:126.170883
+ # Blade: 4 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 5 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 6 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 7 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 8 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Chassis: 2
+ # Blade: 1 - Power consumed - Current:131.427994 Max:136.685120 Min:128.799438
+ # Blade: 2 - Power consumed - Current:126.170883 Max:131.427994 Min:123.542320
+ # Blade: 3 - Power consumed - Current:134.056564 Max:155.085037 Min:131.427994
+ # ...etc.
+
+=head1 DECRIPTION
+
+Cisco::UCS::Blade is a class providing operations with a Cisco UCS Blade.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Blade object
+is created automatically by method calls to a L<Cisco::UCS::Chassis> object.
+
+=cut
+
=head1 METHODS
=head3 admin_state
@@ -130,6 +235,23 @@ Returns the chassis ID of the chassis in which the specified blade is located.
returns the checkpoint status of the specified blade.
+=head3 cpu ( $id )
+
+Returns the specified CPU in the socket designated by the value of the $id parameter as
+a L<Cisco::UCS::Blade::CPU> object.
+
+B<Note> that this is a caching method and will return a previously retrieved and cached
+object if one is available. See the method description for B<get_cpu> below for non-caching
+behaviour.
+
+=head3 get_cpu ( $id )
+
+This is a functionally equivalent non-caching implementation of the B<cpu> method.
+
+=head3 get_cpus ( $id )
+
+Returns all CPUs in the target blade as an array of L<Cisco::UCS::Blade::CPU> objects.
+
=head3 description
Returns the value of the user description field for the specified blade.
@@ -146,6 +268,10 @@ Returns the dn (distinguished name) of the specified blade in the UCS management
Returns the id of the specified blade in the chassis - this is equivalent to the slot ID number (e.g. 1 .. 8).
+=head3 led ( $state )
+
+Sets the locator led of the blade to the desired state; either on or off;
+
=head3 managing_instance
Returns the managing instance for the specified blade (either A or B).
@@ -180,7 +306,7 @@ Returns the number of CPU cores in the specified blade.
=head3 num_cpus
-Returns the number of CPUs in teh specified blade.
+Returns the number of CPUs in the specified blade.
=head3 num_eth_ifs
@@ -210,6 +336,16 @@ Returns the operational status of the specified blade.
Returns the presence status of the specified blade.
+=head3 power_budget
+
+Returns a L<Cisco::UCS::Blade::PowerBudget> object representing the power budget
+values for the specified blade.
+
+=head3 power_stats
+
+Returns a L<Cisco::UCS::Common::PowerStats> object representing the power usage
+statistics of the specified blade.
+
=head3 revision
Returns the revision level of the specified blade.
@@ -303,5 +439,3 @@ See http://dev.perl.org/licenses/ for more information.
=cut
-
-1;
@@ -0,0 +1,209 @@
+package Cisco::UCS::Chassis::Stats;
+
+use strict;
+use warnings;
+
+use Scalar::Util qw(weaken);
+
+our $VERSION = '0.01';
+
+our %V_MAP = (
+ inputPower => 'input_power',
+ inputPowerAvg => 'input_power_avg',
+ inputPowerMax => 'input_power_max',
+ inputPowerMin => 'input_power_min',
+ outputPower => 'output_power',
+ outputPowerAvg => 'output_power_avg',
+ outputPowerMax => 'output_power_max',
+ outputPowerMin => 'output_power_min',
+ thresholded => 'thresholded',
+ suspect => 'suspect',
+ timeCollected => 'time_collected',
+);
+
+{ no strict 'refs';
+
+ while ( my ($attribute, $pseudo) = each %V_MAP ) {
+ *{ __PACKAGE__ .'::'. $pseudo } = sub {
+ my $self = shift;
+ return $self->{$attribute}
+ }
+ }
+}
+
+sub new {
+ my ( $class, $args ) = @_;
+
+ my $self = bless {}, $class;
+
+ foreach my $var ( keys %$args ) {
+ $self->{ $var } = $args->{ $var };
+ }
+
+ return $self
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Cisco::UCS::Chassis::Stats - Class for operations with Cisco UCS chassis power statistics.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in all chassis along with the chassis current output power
+ # and each blades current input power both in watts and as a percentage of
+ # the chassis input power level.
+
+ map {
+ my $c_power = $_->stats->output_power;
+ printf( "Chassis: %d - Output power: %.3f\n", $_->id, $c_power );
+ map {
+ printf( "\tBlade: %d - Input power: %.3f (%.2f%%)\n",
+ $_->id, $_->power_budget->current_power,
+ ( $c_power == 0 ? '-' : ( $_->power_budget->current_power / $c_power * 100 ) ) )
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # E.g.
+ #
+ # Chassis: 1 - Output power: 704.000
+ # Blade: 1 - Input power: 119.000 (16.90%)
+ # Blade: 2 - Input power: 134.000 (19.03%)
+ # Blade: 3 - Input power: 135.000 (19.18%)
+ # Blade: 4 - Input power: 0.000 (0.00%)
+ # Blade: 5 - Input power: 0.000 (0.00%)
+ # Blade: 6 - Input power: 0.000 (0.00%)
+ # Blade: 7 - Input power: 0.000 (0.00%)
+ # Blade: 8 - Input power: 136.000 (19.32%)
+ # Chassis: 2 - Output power: 1188.000
+ # Blade: 1 - Input power: 127.000 (10.69%)
+ # Blade: 2 - Input power: 0.000 (0.00%)
+ # Blade: 3 - Input power: 120.000 (10.10%)
+ # Blade: 4 - Input power: 0.000 (0.00%)
+ # Blade: 5 - Input power: 127.000 (10.69%)
+ # Blade: 6 - Input power: 121.000 (10.19%)
+ # Blade: 7 - Input power: 172.000 (14.48%)
+ # Blade: 8 - Input power: 136.000 (11.45%)
+ # etc.
+
+
+=head1 DECRIPTION
+
+Cisco::UCS::Chassis::Stats is a class providing operations with a Cisco UCS chassis power statistics.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Chassis::Stats
+object is created automatically by method calls on a L<Cisco::UCS::Chassis> object.
+
+=cut
+
+=head1 METHODS
+
+=head3 input_power
+
+Returns the current input power for the chassis.
+
+=head3 input_power_avg
+
+Returns the average input power value for the chassis.
+
+=head3 input_power_min
+
+Returns the minimum power input value for the chassis.
+
+=head3 input_power_max
+
+Returns the maximum power input value for the chassis.
+
+=head3 output_power
+
+Returns the current output power value for the chassis.
+
+=head3 output_power_avg
+
+Returns the average output power value for the chassis.
+
+=head3 output_power_min
+
+Returns the minimum output power value for the chassis.
+
+=head3 output_power_max
+
+Returns the maximum output power value for the blade.
+
+=head3 thresholded
+
+Returns the input power thresholded state for the blade.
+
+=head3 suspect
+
+Returns the input power suspect state for the blade.
+
+=head3 time_collected
+
+Returns the timestamp at which time the power statsitics were collected.
+
+=head1 AUTHOR
+
+Luke Poskitt, C<< <ltp at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-cisco-ucs-chassis-stats at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Cisco-UCS-Chassis-Stats>. I will
+be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Cisco::UCS::Chassis::Stats
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Cisco-UCS-Chassis-Stats>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Cisco-UCS-Chassis-Stats>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Cisco-UCS-Chassis-Stats>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Cisco-UCS-Chassis-Stats/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013 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.
+
+
+=cut
@@ -3,6 +3,7 @@ package Cisco::UCS::Chassis;
use warnings;
use strict;
+use Cisco::UCS::Chassis::Stats;
use Cisco::UCS::FEX;
use Cisco::UCS::Common::FanModule;
use Cisco::UCS::Common::Fan;
@@ -14,7 +15,7 @@ use vars qw($VERSION @ISA);
@ISA = qw(Cisco::UCS);
-$VERSION = '0.1';
+$VERSION = '0.2';
our @ATTRIBUTES = qw(dn error id model operability power presence serial thermal vendor);
@@ -265,6 +266,21 @@ sub get_psus {
return $self->_get_child_objects(id => $id, type => 'equipmentPsu', class => 'Cisco::UCS::Common::PSU', attr => 'psu');
}
+=head3 stats
+
+ print "Output power: ". $ucs->chassis(1)->stats->output_power ." W\n";
+
+Return a L<Cisco::UCS::Chassis::Stats> object containing the current power statistics
+for the specified chassis.
+
+=cut
+
+sub stats {
+ my $self = shift;
+ return Cisco::UCS::Chassis::Stats->new(
+ $self->{ucs}->resolve_dn( dn => "$self->{dn}/stats" )->{outConfig}->{equipmentChassisStats} )
+}
+
=head3 admin_state
Returns the administrative state of the chassis.
@@ -0,0 +1,212 @@
+package Cisco::UCS::Common::EnvironmentalStats;
+
+use strict;
+use warnings;
+
+use Scalar::Util qw(weaken);
+
+our $VERSION = '0.01';
+
+our %V_MAP = (
+ inputCurrent => 'input_current',
+ inputCurrentAvg => 'input_current_avg',
+ inputCurrentMin => 'input_current_min',
+ inputCurrentMax => 'input_current_max',
+ #intervals => 'intervals',
+ temperature => 'temperature',
+ temperatureAvg => 'temperature_avg',
+ temperatureMin => 'temperature_min',
+ temperatureMax => 'temperature_max',
+ thresholded => 'thresholded',
+ suspect => 'suspect',
+ timeCollected => 'time_collected',
+ #update => 'update'
+);
+
+{ no strict 'refs';
+
+ while ( my ($attribute, $pseudo) = each %V_MAP ) {
+ *{ __PACKAGE__ .'::'. $pseudo } = sub {
+ my $self = shift;
+ return $self->{$attribute}
+ }
+ }
+}
+
+sub new {
+ my ( $class, $args ) = @_;
+
+ my $self = bless {}, $class;
+
+ foreach my $var ( keys %$args ) {
+ $self->{ $var } = $args->{ $var };
+ }
+
+ return $self
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Cisco::UCS::Common::EnvironmentalStats - Class for operations with Cisco UCS environmental stati.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in all chassis along with a cacti-style listing of the
+ # blades current, maximum and average CPU temperature values.
+
+ map {
+ print "Chassis: " . $_->id ."\n";
+ map {
+ print "\tBlade: ". $_->id;
+ map {
+ print "\n\t\tCPU: ". $_->id
+ . "\n\t\t\tCurrent:". $_->env_stats->temperature
+ . "\n\t\t\tMax:". $_->env_stats->temperature_max
+ . "\n\t\t\tAvg:". $_->env_stats->temperature_avg ."\n"
+
+ }
+ sort { $a->id <=> $b->id } $_->get_cpus
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # Prints something like:
+ #
+ # Chassis: 1
+ # Blade: 1
+ # CPU: 1
+ # Current:32.500000
+ # Max:33.000000
+ # Avg:32.375000
+ #
+ # CPU: 2
+ # Current:37.000000
+ # Max:37.000000
+ # Avg:32.500000
+ # Blade: 2
+ # CPU: 1
+ # Current:45.500000
+ # Max:46.000000
+ # Avg:45.666668
+ # ...etc.
+
+=head1 DECRIPTION
+
+Cisco::UCS::Common::EnvironmentalStats is a class providing operations with Cisco UCS environmental stati.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Common::EnvironmentalStats
+object is created automatically by method calls on a L<Cisco::UCS::Blade> object.
+
+=cut
+
+=head1 METHODS
+
+=head3 input_current
+
+Returns the current input current value for the target object.
+
+=head3 input_current_avg
+
+Returns the current average input current value for the target object.
+
+=head3 input_current_min
+
+Returns the current minimum input current value for the target object.
+
+=head3 input_current_max
+
+Returns the current maximum input current value for the target object.
+
+=head3 temperature
+
+Returns the current temperature value for the target object.
+
+=head3 temperature_avg
+
+Returns the average temperature value for the target object.
+
+=head3 temperature_max
+
+Returns the maximum temperature value for the target object.
+
+=head3 temperature_min
+
+Returns the minimum temperature value for the target object.
+
+=head3 thresholded
+
+Flag to indicate if the environmental status is in a thresholded state.
+
+=head3 suspect
+
+Flag to indicate if the environmental status is in a suspect state.
+
+=head3 time_collected
+
+Returns the timestamp at which time the status information were collected.
+
+=head1 AUTHOR
+
+Luke Poskitt, C<< <ltp at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-cisco-ucs-common-environmentalstats at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Cisco-UCS-Common-EnvironmentalStats>. I will
+be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Cisco::UCS::Common::EnvironmentalStats
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Cisco-UCS-Common-EnvironmentalStats>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Cisco-UCS-Common-EnvironmentalStats>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Cisco-UCS-Common-EnvironmentalStats>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Cisco-UCS-Common-EnvironmentalStats/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013 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.
+
+
+=cut
@@ -0,0 +1,221 @@
+package Cisco::UCS::Common::PowerStats;
+
+use strict;
+use warnings;
+
+use Scalar::Util qw(weaken);
+
+our $VERSION = '0.01';
+
+our %V_MAP = (
+ consumedPower => 'consumed_power',
+ consumedPowerAvg=> 'consumed_power_avg',
+ consumedPowerMin=> 'consumed_power_min',
+ consumedPowerMax=> 'consumed_power_max',
+ inputCurrent => 'input_current',
+ inputCurrentAvg => 'input_current_avg',
+ inputCurrentMin => 'input_current_min',
+ inputCurrentMax => 'input_current_max',
+ inputVoltage => 'input_voltage',
+ inputVoltageAvg => 'input_voltage_avg',
+ inputVoltageMin => 'input_voltage_min',
+ inputVoltageMax => 'input_voltage_max',
+ thresholded => 'thresholded',
+ suspect => 'suspect',
+ timeCollected => 'time_collected'
+);
+
+{ no strict 'refs';
+
+ while ( my ($attribute, $pseudo) = each %V_MAP ) {
+ *{ __PACKAGE__ .'::'. $pseudo } = sub {
+ my $self = shift;
+ return $self->{$attribute}
+ }
+ }
+}
+
+sub new {
+ my ( $class, $args ) = @_;
+
+ my $self = bless {}, $class;
+
+ foreach my $var ( keys %$args ) {
+ $self->{ $var } = $args->{ $var };
+ }
+
+ return $self
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Cisco::UCS::Common::PowerStats - Class for operations with Cisco UCS power usage statistics.
+
+=cut
+
+=head1 SYNOPSIS
+
+ # Print all blades in all chassis along with a cacti-style listing of the
+ # blades current, minimum and maximum power consumption values.
+
+ map {
+ print "Chassis: " . $_->id ."\n";
+ map { print "\tBlade: ". $_->id ." - Power consumed -"
+ . " Current:". $_->power_stats->consumed_power
+ . " Max:". $_->power_stats->consumed_power_max
+ . " Min:". $_->power_stats->consumed_power_min ."\n"
+ }
+ sort { $a->id <=> $b->id } $_->get_blades
+ }
+ sort {
+ $a->id <=> $b->id
+ } $ucs->get_chassiss;
+
+ # Prints something like:
+ #
+ # Chassis: 1
+ # Blade: 1 - Power consumed - Current:115.656647 Max:120.913757 Min:110.399513
+ # Blade: 2 - Power consumed - Current:131.427994 Max:139.313675 Min:126.170883
+ # Blade: 3 - Power consumed - Current:131.427994 Max:157.713593 Min:126.170883
+ # Blade: 4 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 5 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 6 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 7 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Blade: 8 - Power consumed - Current:0.000000 Max:0.000000 Min:0.000000
+ # Chassis: 2
+ # Blade: 1 - Power consumed - Current:131.427994 Max:136.685120 Min:128.799438
+ # Blade: 2 - Power consumed - Current:126.170883 Max:131.427994 Min:123.542320
+ # Blade: 3 - Power consumed - Current:134.056564 Max:155.085037 Min:131.427994
+ # ...etc.
+
+=head1 DECRIPTION
+
+Cisco::UCS::Common::PowerStats is a class providing operations with a Cisco UCS power usage statistics.
+
+Note that you are not supposed to call the constructor yourself, rather a Cisco::UCS::Common::PowerStats object
+is created automatically by method calls on a L<Cisco::UCS::Blade> object.
+
+=cut
+
+=head1 METHODS
+
+=head3 consumed_power
+
+Returns the current power consumed value for the blade.
+
+=head3 consumed_power_avg
+
+Returns the current average power consumed value for the blade.
+
+=head3 consumed_power_min
+
+Returns the current minimum power consumed value for the blade.
+
+=head3 consumed_power_max
+
+Returns the current maximum power consumed value for the blade.
+
+=head3 input_current
+
+Returns the current input current value for the blade.
+
+=head3 input_current_avg
+
+Returns the current average input current value for the blade.
+
+=head3 input_current_min
+
+Returns the current minimum input current value for the blade.
+
+=head3 input_current_max
+
+Returns the current maximum input current value for the blade.
+
+=head3 input_voltage
+
+Returns the current input voltage value for the blade.
+
+=head3 input_voltage_avg
+
+Returns the current average input voltage value for the blade.
+
+=head3 input_voltage_min
+
+Returns the current minimum input voltage value for the blade.
+
+=head3 input_voltage_max
+
+Returns the current maximum input voltage value for the blade.
+
+=head3 thresholded
+
+Returns the input power thresholded state for the blade.
+
+=head3 suspect
+
+Returns the input power suspect state for the blade.
+
+=head3 time_collected
+
+Returns the timestamp at which time the power statsitics were collected.
+
+=head1 AUTHOR
+
+Luke Poskitt, C<< <ltp at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-cisco-ucs-common-powerstats at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Cisco-UCS-Common-PowerStats>. I will
+be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Cisco::UCS::Common::PowerStats
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Cisco-UCS-Common-PowerStats>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Cisco-UCS-Common-PowerStats>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Cisco-UCS-Common-PowerStats>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Cisco-UCS-Common-PowerStats/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013 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.
+
+
+=cut
@@ -16,7 +16,7 @@ use Carp qw(croak carp cluck);
use vars qw($VERSION);
-our $VERSION = '0.30';
+our $VERSION = '0.33';
our @ATTRIBUTES = qw(dn cluster cookie);
@@ -28,41 +28,41 @@ Cisco::UCS - A Perl interface to the Cisco UCS XML API
=head1 SYNOPSIS
-use Cisco::UCS;
+ use Cisco::UCS;
-my $ucs = Cisco::UCS->new (
- cluster => $cluster,
- username => $username,
- passwd => $password
- );
+ my $ucs = Cisco::UCS->new (
+ cluster => $cluster,
+ username => $username,
+ passwd => $password
+ );
-$ucs->login();
+ $ucs->login();
-@errors = $ucs->get_errors(severity=>"critical",ack="no");
+ @errors = $ucs->get_errors(severity=>"critical",ack="no");
-foreach my $error_id (@errors) {
- my %this_error = $ucs->get_error_id($error_id);
- print "Error ID: $error_id. Severity: $this_error{severity}. Description: $this_error{descr}\n";
-}
+ foreach my $error_id (@errors) {
+ my %this_error = $ucs->get_error_id($error_id);
+ print "Error ID: $error_id. Severity: $this_error{severity}. Description: $this_error{descr}\n";
+ }
-print "Interconnect A serial : " . $ucs->interconnect(A)->serial . "\n";
+ print "Interconnect A serial : " . $ucs->interconnect(A)->serial . "\n";
-# prints "Interconnect A serial : BFG9000"
+ # prints "Interconnect A serial : BFG9000"
-foreach my $chassis ($ucs->chassis) {
- print "Chassis " . $chassis->id . " serial : " . $chassis->serial . "\n"
-}
+ foreach my $chassis ($ucs->chassis) {
+ print "Chassis " . $chassis->id . " serial : " . $chassis->serial . "\n"
+ }
-# prints:
-# "Chassis 1 serial : ABC1234"
-# "Chassis 2 serial : ABC1235"
-# etc.
+ # prints:
+ # "Chassis 1 serial : ABC1234"
+ # "Chassis 2 serial : ABC1235"
+ # etc.
-print "Interconnect A Ethernet 1/1 TX bytes: " . $ucs->interconnect(A)->card(1)->eth_port(1)->tx_total_bytes . "\n";
+ print "Interconnect A Ethernet 1/1 TX bytes: " . $ucs->interconnect(A)->card(1)->eth_port(1)->tx_total_bytes . "\n";
-# prints "Interconnect A Ethernet 1/1 TX bytes: 83462486"
+ # prints "Interconnect A Ethernet 1/1 TX bytes: 83462486"
-$ucs->logout();
+ $ucs->logout();
=head1 DESCRIPTION
@@ -16,16 +16,22 @@ plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
#pod_coverage_ok( "Cisco::UCS", "Cisco::UCS POD coverage OK" );
+pod_coverage_ok( 'Cisco::UCS' );
+pod_coverage_ok( 'Cisco::UCS::Blade', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Blade::CPU', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Blade::PowerBudget', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Chassis', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Chassis::Stats', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::Fault', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::FEX', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::Interconnect', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::MgmtEntity', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::ServiceProfile', { also_private => [ 'new' ] } );
-pod_coverage_ok( 'Cisco::UCS::Blade', { also_private => [ 'new' ] } );
-pod_coverage_ok( 'Cisco::UCS::Chassis', { also_private => [ 'new' ] } );
-pod_coverage_ok( 'Cisco::UCS::FEX', { also_private => [ 'new' ] } );
-pod_coverage_ok( 'Cisco::UCS::Common::PSU', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Common::EthernetPort', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Common::EnvironmentalStats', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::Common::Fan', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::Common::FanModule', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Common::PowerStats', { also_private => [ 'new' ] } );
+pod_coverage_ok( 'Cisco::UCS::Common::PSU', { also_private => [ 'new' ] } );
pod_coverage_ok( 'Cisco::UCS::Common::SwitchCard', { also_private => [ 'new' ] } );
-pod_coverage_ok( 'Cisco::UCS::Common::EthernetPort', { also_private => [ 'new' ] } );
done_testing();