Forum Discussion
mariogolf_57851
Nimbostratus
Dec 22, 2010----------------------------------------------------------------------------
sub get_fan_metrics
----------------------------------------------------------------------------
sub get_fan_metrics()
{
$soapResponse = $SystemInfo->get_fan_metrics();
$PlatformFans = $soapResponse->result;
$TimeStamp=$PlatformFans->{'time_stamp'};
$FanMetric=$PlatformFans->{'fans'};
@AoA=$FanMetric;
for $i ( 0 .. $AoA ) {
for $j ( 0 .. ${$AoA[$i]} ) {
$FanIndex = $AoA[$i][$j][0];
for my $Index (sort keys %{$FanIndex}) {
print $Index . " " . $FanIndex->{"$Index"} . "\n";
}
$FanState = $AoA[$i][$j][1];
for my $State (sort keys %{$FanState}) {
print $State . " " . $FanState->{"$State"} . "\n";
}
$FanSpeed = $AoA[$i][$j][2];
for my $Speed (sort keys %{$FanSpeed}) {
print $Speed . " " . $FanSpeed->{"$Speed"} . "\n";
}
}
}
print "The statistics were gathered: [";
print $TimeStamp->{'year'};
print $TimeStamp->{'month'};
print $TimeStamp->{'day'};
print $TimeStamp->{'hour'};
print $TimeStamp->{'minute'};
print $TimeStamp->{'second'};
print "]\n";
}