+ Protect to avoid errors on checking h3c hardware on wrong hardware

This commit is contained in:
garnier-quentin 2015-11-06 11:31:05 +01:00
parent b498c8ee5e
commit 2cdd7ae294
4 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,7 @@ sub check {
foreach my $instance (sort $self->get_instance_class(class => { $options{component_class} => 1 })) {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance);
next if (!defined($result->{EntityExtErrorStatus}));
next if ($self->check_exclude(section => $options{component}, instance => $instance));
if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) {
$self->absent_problem(section => $options{component}, instance => $instance);

View File

@ -45,6 +45,7 @@ sub check {
foreach my $instance (sort $self->get_instance_class(class => { 7 => 1 })) {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance);
next if (!defined($result->{EntityExtErrorStatus}));
next if ($self->check_exclude(section => 'fan', instance => $instance));
if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) {
$self->absent_problem(section => 'fan', instance => $instance);

View File

@ -45,6 +45,7 @@ sub check {
foreach my $instance (sort $self->get_instance_class(class => { 6 => 1 }) ) {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance);
next if (!defined($result->{EntityExtErrorStatus}));
next if ($self->check_exclude(section => 'psu', instance => $instance));
if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) {
$self->absent_problem(section => 'psu', instance => $instance);

View File

@ -58,6 +58,7 @@ sub check {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance);
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $results, instance => $instance);
next if (!defined($result->{EntityExtErrorStatus}));
next if ($self->check_exclude(section => 'sensor', instance => $instance));
if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) {
$self->absent_problem(section => 'sensor', instance => $instance);