Fix #794
This commit is contained in:
parent
e9a884c041
commit
277b71c2a0
|
@ -72,21 +72,14 @@ sub run {
|
|||
my $oid_hrPrinterDetectedErrorState = '.1.3.6.1.2.1.25.3.5.1.2';
|
||||
my $result = $self->{snmp}->get_table(oid => $oid_hrPrinterDetectedErrorState, nothing_quit => 1);
|
||||
|
||||
use Data::Dumper;
|
||||
print Data::Dumper::Dumper($result);
|
||||
foreach (keys %$result) {
|
||||
my ($value1, $value2) = unpack('C', $result->{$_});
|
||||
# 16 bits value
|
||||
my $value = unpack('S', $result->{$_});
|
||||
|
||||
foreach my $key (keys %errors_printer) {
|
||||
my ($byte_check, $pos);
|
||||
if ($key >= 8) {
|
||||
next if (!defined($value2));
|
||||
$byte_check = $value2;
|
||||
$pos = $key - 8;
|
||||
} else {
|
||||
$byte_check = $value1;
|
||||
$pos = $key
|
||||
}
|
||||
|
||||
if (($byte_check & (1 << $pos)) &&
|
||||
foreach my $key (keys %errors_printer) {
|
||||
if (($value & (1 << $key)) &&
|
||||
(!$self->{output}->is_status(value => ${$errors_printer{$key}}[1], compare => 'ok', litteral => 1))) {
|
||||
$self->{output}->output_add(severity => ${$errors_printer{$key}}[1],
|
||||
short_msg => sprintf(${$errors_printer{$key}}[0]));
|
||||
|
|
Loading…
Reference in New Issue