refacto pdu apc (tested)
This commit is contained in:
parent
a1b2821360
commit
ab5da12dfb
|
@ -92,7 +92,7 @@ sub check {
|
|||
$self->{output}->output_add(severity => $exit2,
|
||||
short_msg => sprintf("Humidity '%s' value is %s %%", $result->{rPDU2SensorTempHumidityStatusName}, $value));
|
||||
}
|
||||
$self->{output}->perfdata_add(label => $result->{rPDU2SensorTempHumidityStatusName}, unit => '%',
|
||||
$self->{output}->perfdata_add(label => 'hum_' . $result->{rPDU2SensorTempHumidityStatusName}, unit => '%',
|
||||
value => $value,
|
||||
warning => $warn,
|
||||
critical => $crit,
|
||||
|
|
|
@ -49,7 +49,7 @@ sub check {
|
|||
$self->{components}->{psu} = {name => 'psus', total => 0, skip => 0};
|
||||
return if ($self->check_filter(section => 'psu'));
|
||||
|
||||
if (!defined($self->{results}->{$oid_rPDUPowerSupplyDevice}));
|
||||
return if (!defined($self->{results}->{$oid_rPDUPowerSupplyDevice}));
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rPDUPowerSupplyDevice}, instance => '0');
|
||||
for (my $i = 1; $i <= 2; $i++) {
|
||||
next if (!defined($result->{'rPDUPowerSupply' . $i . 'Status'}));
|
||||
|
|
|
@ -92,7 +92,7 @@ sub check {
|
|||
$self->{output}->output_add(severity => $exit2,
|
||||
short_msg => sprintf("Temperature '%s' value is %s C", $result->{rPDU2SensorTempHumidityStatusName}, $value));
|
||||
}
|
||||
$self->{output}->perfdata_add(label => $result->{rPDU2SensorTempHumidityStatusName}, unit => 'C',
|
||||
$self->{output}->perfdata_add(label => 'temp_' . $result->{rPDU2SensorTempHumidityStatusName}, unit => 'C',
|
||||
value => $value,
|
||||
warning => $warn,
|
||||
critical => $crit);
|
||||
|
|
|
@ -163,7 +163,7 @@ sub run {
|
|||
$result->{rPDUOutletStatusOutletBank}, $result->{rPDUOutletStatusOutletPhase}));
|
||||
}
|
||||
|
||||
if (defined($result->{rPDUOutletStatusLoad}) && $result->{rPDUOutletStatusLoad} =~ /[0-9]/) {
|
||||
if (defined($result->{rPDUOutletStatusLoad}) && $result->{rPDUOutletStatusLoad} =~ /[0-9]/ && $result->{rPDUOutletStatusLoad} != 0) {
|
||||
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'load', instance => $instance, value => $result->{rPDUOutletStatusLoad});
|
||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit2,
|
||||
|
@ -171,8 +171,9 @@ sub run {
|
|||
$result->{rPDUOutletStatusOutletName}, $result->{rPDUOutletStatusLoad},
|
||||
$result->{rPDUOutletStatusOutletBank}, $result->{rPDUOutletStatusOutletPhase}));
|
||||
}
|
||||
$self->{output}->perfdata_add(label => 'load_' . $result->{rPDUOutletStatusOutletName} . '_bank_' . $result->{rPDUOutletStatusOutletBank} . '_' . $result->{rPDUOutletStatusOutletPhase}, unit => 'A',
|
||||
value => $result->{rPDULoadStatusLoad},
|
||||
$self->{output}->perfdata_add(label => 'load_' . $result->{rPDUOutletStatusOutletName} . '_bank_' . $result->{rPDUOutletStatusOutletBank} . '_' . $result->{rPDUOutletStatusOutletPhase} . '_' . $instance,
|
||||
unit => 'A',
|
||||
value => $result->{rPDUOutletStatusLoad},
|
||||
warning => $warn,
|
||||
critical => $crit,
|
||||
min => 0);
|
||||
|
|
Loading…
Reference in New Issue