Cisco-UCS

 view release on metacpan or  search on metacpan

lib/Cisco/UCS/Common/EnvironmentalStats.pm  view on Meta::CPAN

package Cisco::UCS::Common::EnvironmentalStats;

use strict;
use warnings;

use Scalar::Util qw(weaken);

our $VERSION = '0.51';

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__

=pod

=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 { 



( run in 1.938 second using v1.01-cache-2.11-cpan-98e64b0badf )