+ fix plugin apc

This commit is contained in:
garnier-quentin 2016-01-15 16:40:45 +01:00
parent 11aec9d6e7
commit f5a81c4ef2
1 changed files with 9 additions and 5 deletions

View File

@ -208,15 +208,19 @@ sub manage_selection {
$self->{global} = {};
$self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_upsBasicBattery },
{ oid => $oid_upsAdvBattery },
],
nothing_quit => 1);
{ oid => $oid_upsAdvBattery },
],
nothing_quit => 1);
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0');
my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0');
$self->{global}->{$name} = $result->{$name} foreach my $name (keys %{$mapping});
$self->{global}->{$name} = $result2->{$name} foreach my $name (keys %{$mapping2});
foreach my $name (keys %{$mapping}) {
$self->{global}->{$name} = $result->{$name};
}
foreach my $name (keys %{$mapping2}) {
$self->{global}->{$name} = $result2->{$name};
}
}
1;