Skip to content

Commit

Permalink
Merge pull request #21 from matsimon/additional-PSU-msg
Browse files Browse the repository at this point in the history
ProLiant: Show detailed power supply status/condition if not ok
  • Loading branch information
lausser authored Jan 3, 2024
2 parents 51a68ba + 4670d56 commit 7028f43
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
13 changes: 10 additions & 3 deletions plugins-scripts/HP/Proliant/Component/PowersupplySubsystem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ sub new {
cpqHeFltTolPowerSupplyBay => $params{cpqHeFltTolPowerSupplyBay},
cpqHeFltTolPowerSupplyPresent => $params{cpqHeFltTolPowerSupplyPresent},
cpqHeFltTolPowerSupplyCondition => $params{cpqHeFltTolPowerSupplyCondition},
cpqHeFltTolPowerSupplyStatus => $params{cpqHeFltTolPowerSupplyStatus},
cpqHeFltTolPowerSupplyErrorCondition => $params{cpqHeFltTolPowerSupplyErrorCondition},
cpqHeFltTolPowerSupplyRedundant => $params{cpqHeFltTolPowerSupplyRedundant},
cpqHeFltTolPowerSupplyCapacityUsed => $params{cpqHeFltTolPowerSupplyCapacityUsed} || 0,
cpqHeFltTolPowerSupplyCapacityMaximum => $params{cpqHeFltTolPowerSupplyCapacityMaximum} || 0,
Expand All @@ -86,9 +88,11 @@ sub check {
$self->add_info(sprintf "powersupply %d is missing",
$self->{cpqHeFltTolPowerSupplyBay});
} else {
$self->add_info(sprintf "powersupply %d needs attention (%s)",
$self->add_info(sprintf "powersupply %d needs attention (overall: %s, status: %s, error cond.: %s)",
$self->{cpqHeFltTolPowerSupplyBay},
$self->{cpqHeFltTolPowerSupplyCondition});
$self->{cpqHeFltTolPowerSupplyCondition},
$self->{cpqHeFltTolPowerSupplyStatus},
$self->{cpqHeFltTolPowerSupplyErrorCondition});
}
$self->add_message(CRITICAL, $self->{info});
} else {
Expand All @@ -98,7 +102,9 @@ sub check {
}
$self->add_extendedinfo(sprintf "ps_%s=%s",
$self->{cpqHeFltTolPowerSupplyBay},
$self->{cpqHeFltTolPowerSupplyCondition});
$self->{cpqHeFltTolPowerSupplyCondition},
$self->{cpqHeFltTolPowerSupplyStatus},
$self->{cpqHeFltTolPowerSupplyErrorCondition});
if ($self->{cpqHeFltTolPowerSupplyCapacityUsed} &&
$self->{cpqHeFltTolPowerSupplyCapacityMaximum}) {
if ($self->{runtime}->{options}->{perfdata}) {
Expand Down Expand Up @@ -133,6 +139,7 @@ sub dump {
printf "[PS_%s]\n", $self->{cpqHeFltTolPowerSupplyBay};
foreach (qw(cpqHeFltTolPowerSupplyBay cpqHeFltTolPowerSupplyChassis
cpqHeFltTolPowerSupplyPresent cpqHeFltTolPowerSupplyCondition
cpqHeFltTolPowerSupplyStatus cpqHeFltTolPowerSupplyErrorCondition
cpqHeFltTolPowerSupplyRedundant cpqHeFltTolPowerSupplyCapacityUsed
cpqHeFltTolPowerSupplyCapacityMaximum)) {
printf "%s: %s\n", $_, $self->{$_};
Expand Down
38 changes: 38 additions & 0 deletions plugins-scripts/HP/Proliant/Component/PowersupplySubsystem/SNMP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sub init {
cpqHeFltTolPowerSupplyBay => "1.3.6.1.4.1.232.6.2.9.3.1.2",
cpqHeFltTolPowerSupplyPresent => "1.3.6.1.4.1.232.6.2.9.3.1.3",
cpqHeFltTolPowerSupplyCondition => "1.3.6.1.4.1.232.6.2.9.3.1.4",
cpqHeFltTolPowerSupplyStatus => "1.3.6.1.4.1.232.6.2.9.3.1.5",
cpqHeFltTolPowerSupplyErrorCondition => "1.3.6.1.4.1.232.6.2.9.3.1.18",
cpqHeFltTolPowerSupplyRedundant => "1.3.6.1.4.1.232.6.2.9.3.1.9",
cpqHeFltTolPowerSupplyPresentValue => {
1 => "other",
Expand All @@ -44,6 +46,42 @@ sub init {
3 => "degraded",
4 => "failed",
},
cpqHeFltTolPowerSupplyStatusValue => {
1 => "noError",
2 => "generalFailure",
3 => "bistFailure",
4 => "fanFailure",
5 => "tempFailure",
6 => "interlockOpen",
7 => "epromFailed",
8 => "vrefFailed",
9 => "dacFailed",
10 => "ramTestFailed",
11 => "voltageChannelFailed",
12 => "orringdiodeFailed",
13 => "brownOut",
14 => "giveupOnStartup",
15 => "nvramInvalid",
16 => "calibrationTableInvalid",
17 => "noPowerInput",
},
cpqHeFltTolPowerSupplyErrorConditionValue => {
1 => "noError",
2 => "generalFailure",
3 => "overvoltage",
4 => "overcurrent",
5 => "overtemperature",
6 => "powerinputloss",
7 => "fanfailure",
8 => "vinhighwarning",
9 => "vinlowwarning",
10 => "vouthighwarning",
11 => "voutlowwarning",
12 => "inlettemphighwarning",
13 => "iinternaltemphighwarning",
14 => "vauxhighwarning",
15 => "vauxlowwarning",
},
cpqHeFltTolPowerSupplyCapacityUsed => '1.3.6.1.4.1.232.6.2.9.3.1.7',
cpqHeFltTolPowerSupplyCapacityMaximum => '1.3.6.1.4.1.232.6.2.9.3.1.8',
cpqHeFltTolPowerSupplyRedundantValue => {
Expand Down

0 comments on commit 7028f43

Please sign in to comment.