From 49e295a72275f3a8eaf8baf528ef3bb399b227d6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 28 Feb 2019 10:48:20 +0100 Subject: [PATCH] fix printer errror status --- centreon-plugins/snmp_standard/mode/printererror.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/printererror.pm b/centreon-plugins/snmp_standard/mode/printererror.pm index cb1717cf1..10f060be4 100644 --- a/centreon-plugins/snmp_standard/mode/printererror.pm +++ b/centreon-plugins/snmp_standard/mode/printererror.pm @@ -124,11 +124,6 @@ sub manage_selection { my $value = unpack('S', $result->{$_}); $self->{printer}->{$instance} = { display => $instance, errors => {} }; - if ($result->{$_} == 0) { - $self->{printer}->{$instance}->{errors}->{0} = { status => 'ok' }; - next; - } - my $i = 0; foreach my $key (keys %errors_printer) { if (($value & (1 << $key))) { @@ -136,6 +131,11 @@ sub manage_selection { $i++; } } + + if ($i == 0) { + $self->{printer}->{$instance}->{errors}->{0} = { status => 'ok' }; + next; + } } }