fix(emc/unisphere): hardware mode - uninitialized value sp component (#3184)

This commit is contained in:
qgarnier 2021-10-11 15:53:25 +02:00 committed by GitHub
parent c1f7024885
commit d7dd65e3aa
2 changed files with 5 additions and 4 deletions

View File

@ -44,11 +44,12 @@ sub check {
next if ($self->check_filter(section => 'sp', instance => $instance));
$self->{components}->{sp}->{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(
"storage processor '%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("Storage processor '%s' status is '%s'", $result->{content}->{name}, $health)
short_msg => sprintf("Storage processor '%s' status is '%s'", $name, $health)
);
}
}

View File

@ -49,7 +49,7 @@ sub check {
$self->{output}->output_add(
long_msg => sprintf(
"ssd '%s' status is '%s' [instance = %s]",
$name, $health, $instance,
$name, $health, $instance
)
);