From 945a892b62a9a302b8fb3e3e936251b0071f8ca4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 20 Dec 2018 14:37:17 +0100 Subject: [PATCH] + Fix bug apc ats (#1127) --- hardware/ats/apc/snmp/mode/components/entity.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hardware/ats/apc/snmp/mode/components/entity.pm b/hardware/ats/apc/snmp/mode/components/entity.pm index 731d14451..1a36a1fc7 100644 --- a/hardware/ats/apc/snmp/mode/components/entity.pm +++ b/hardware/ats/apc/snmp/mode/components/entity.pm @@ -68,8 +68,9 @@ sub check { $self->{components}->{entity}->{total}++; $self->{output}->output_add(long_msg => sprintf("entity '%s' status is '%s' [instance = %s]", - $mapping->{$_}->{label}, $result->{$_}, $mapping->{$_}->{label})); + $mapping->{$_}->{label}, defined($result->{$_}) ? $result->{$_} : 'n/a', $mapping->{$_}->{label})); + next if (!defined($result->{$_})); my $exit = $self->get_severity(section => 'entity', instance => $mapping->{$_}->{label}, value => $result->{$_}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit,