This commit is contained in:
qgarnier 2021-01-27 14:37:47 +01:00 committed by GitHub
parent 77880ea99e
commit fd565f2f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -110,7 +110,7 @@ sub manage_selection {
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
foreach (('current', 'voltage')) {
$result->{$_} = 0 if (defined($result->{$_}) && $result->{$_} eq '');
$result->{$_} = 0 if (defined($result->{$_}) && ($result->{$_} eq '' || $result->{$_} == -1 || $result->{$_} == -65535));
$result->{$_} *= 0.1;
}
@ -126,7 +126,8 @@ sub manage_selection {
}
$self->{global} = $options{snmp}->map_instance(mapping => $mapping2, results => $snmp_result, instance => 0);
$self->{global}->{frequency} = defined($self->{global}->{frequency}) ? ($self->{global}->{frequency} * 0.1) : 0;
$self->{global}->{frequency} = defined($self->{global}->{frequency}) && $self->{global}->{frequency} != -1 && $self->{global}->{frequency} != -65535
? ($self->{global}->{frequency} * 0.1) : 0;
}
1;