From b57ca697337e8b5dac51eca54fab45d47b29fcf3 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Fri, 17 Nov 2017 16:13:22 +0100 Subject: [PATCH] Fix #802 --- .../server/ibm/mgmt_cards/imm/snmp/mode/components/global.pm | 1 + .../server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/global.pm b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/global.pm index f8a88065b..46e607410 100644 --- a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/global.pm +++ b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/global.pm @@ -52,6 +52,7 @@ sub check { return if (!defined($self->{results}->{$mapping->{systemHealthStat}->{oid}}) || scalar(keys %{$self->{results}->{$mapping->{systemHealthStat}->{oid}}}) <= 0); my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{systemHealthStat}->{oid}}, instance => '0'); + $self->{components}->{global}->{total}++; $self->{output}->output_add(long_msg => sprintf("system health status is '%s'", $result->{systemHealthStat})); diff --git a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm index fabd3303d..4c3fe85c8 100644 --- a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm +++ b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm @@ -62,8 +62,8 @@ sub check { if (defined($result->{voltReading})) { my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'voltage', instance => $instance, value => $result->{voltReading}); if ($checked == 0) { - my $warn_th = $result->{voltNonCritLimitLow} . ':' . $result->{voltNonCritLimitHigh}; - my $crit_th = $result->{voltCritLimitLow} . ':' . $result->{voltCritLimitHigh}; + my $warn_th = $result->{voltNonCritLimitLow} . ':' . ($result->{voltNonCritLimitHigh} > 0 ? $result->{voltNonCritLimitHigh} : ''); + my $crit_th = $result->{voltCritLimitLow} . ':' . ($result->{voltCritLimitHigh} > 0 ? $result->{voltCritLimitHigh} : ''); $self->{perfdata}->threshold_validate(label => 'warning-voltage-instance-' . $instance, value => $warn_th); $self->{perfdata}->threshold_validate(label => 'critical-voltage-instance-' . $instance, value => $crit_th); $exit = $self->{perfdata}->threshold_check(