From c1f70248859b79b6124a96014faef789c6b76edb Mon Sep 17 00:00:00 2001 From: qgarnier Date: Mon, 11 Oct 2021 15:49:17 +0200 Subject: [PATCH] fix(emc/unisphere): hardware mode - uninitialized value (#3183) --- .../storage/emc/unisphere/restapi/mode/components/ssd.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/emc/unisphere/restapi/mode/components/ssd.pm b/centreon-plugins/storage/emc/unisphere/restapi/mode/components/ssd.pm index 6d196feb0..d70d79edf 100644 --- a/centreon-plugins/storage/emc/unisphere/restapi/mode/components/ssd.pm +++ b/centreon-plugins/storage/emc/unisphere/restapi/mode/components/ssd.pm @@ -44,11 +44,12 @@ sub check { next if ($self->check_filter(section => 'ssd', instance => $instance)); $self->{components}->{ssd}->{total}++; + my $name = defined($result->{content}->{name}) ? $result->{content}->{name} : $result->{content}->{id}; my $health = $health_status->{ $result->{content}->{health}->{value} }; $self->{output}->output_add( long_msg => sprintf( "ssd '%s' status is '%s' [instance = %s]", - $result->{content}->{name}, $health, $instance, + $name, $health, $instance, ) ); @@ -56,7 +57,7 @@ sub check { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add( severity => $exit, - short_msg => sprintf("ssd '%s' status is '%s'", $result->{content}->{name}, $health) + short_msg => sprintf("ssd '%s' status is '%s'", $name, $health) ); } }