1
package HP::Proliant::Component::PowersupplySubsystem::CLI;
2
our @ISA = qw(HP::Proliant::Component::PowersupplySubsystem);
5
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
11
runtime => $params{runtime},
12
rawdata => $params{rawdata},
14
powerconverters => [],
17
extendedinfo => undef,
28
runtime => $self->{runtime},
29
cpqHeFltTolPowerSupplyChassis => 1,
32
foreach (grep(/^powersupply/, split(/\n/, $self->{rawdata}))) {
34
if (/^Power supply #(\d+)/) {
37
push(@{$self->{powersupplies}},
38
HP::Proliant::Component::PowersupplySubsystem::Powersupply->new(%tmpps));
40
runtime => $self->{runtime},
41
cpqHeFltTolPowerSupplyChassis => 1,
44
$tmpps{cpqHeFltTolPowerSupplyBay} = $1;
46
} elsif (/\s*Present\s+:\s+(\w+)/) {
47
$tmpps{cpqHeFltTolPowerSupplyPresent} = lc $1 eq 'yes' ? 'present' :
48
lc $1 eq 'no' ? 'absent': 'other';
49
} elsif (/\s*Redundant\s*:\s+(\w+)/) {
50
$tmpps{cpqHeFltTolPowerSupplyRedundant} = lc $1 eq 'yes' ? 'redundant' :
51
lc $1 eq 'no' ? 'notRedundant' : 'other';
52
} elsif (/\s*Condition\s*:\s+(\w+)/) {
53
$tmpps{cpqHeFltTolPowerSupplyCondition} = lc $1;
54
} elsif (/\s*Power Supply not present/) {
55
$tmpps{cpqHeFltTolPowerSupplyPresent} = "absent";
56
$tmpps{cpqHeFltTolPowerSupplyCondition} = "other";
57
$tmpps{cpqHeFltTolPowerSupplyRedundant} = "notRedundant";
61
push(@{$self->{powersupplies}},
62
HP::Proliant::Component::PowersupplySubsystem::Powersupply->new(%tmpps));
64
runtime => $self->{runtime},
65
cpqHeFltTolPowerSupplyChassis => 1,
71
push(@{$self->{powersupplies}},
72
HP::Proliant::Component::PowersupplySubsystem::Powersupply->new(%tmpps));
74
runtime => $params{runtime},