From f7ebb59e7fdbe427b902787275fe8a60f52b3103 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 22 Feb 2016 12:47:15 +0100 Subject: [PATCH] + Fix #342 --- .../ibm/bladecenter/snmp/mode/components/blade.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm b/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm index c48e4007b..add7e90c6 100644 --- a/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm +++ b/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm @@ -82,20 +82,23 @@ sub check { next; } $self->{components}->{blade}->{total}++; + $result->{bladeName} = defined($result->{bladeName}) ? $result->{bladeName} : '-'; if ($result->{bladePowerState} =~ /off/) { - $self->{output}->output_add(long_msg => sprintf("Blade '%s' power state is %s", - $result->{bladeId}, $result->{bladePowerState})); + $self->{output}->output_add(long_msg => sprintf("Blade '%s/%s' power state is %s", + $result->{bladeName}, $result->{bladeId}, $result->{bladePowerState}, + )); next; } - $self->{output}->output_add(long_msg => sprintf("Blade '%s' state is %s [power state: %s]", - $result->{bladeId}, $result->{bladeHealthState}, $result->{bladePowerState})); + $self->{output}->output_add(long_msg => sprintf("Blade '%s/%s' state is %s [power state: %s]", + $result->{bladeName}, $result->{bladeId}, $result->{bladeHealthState}, $result->{bladePowerState}, + )); my $exit = $self->get_severity(section => 'blade', value => $result->{bladeHealthState}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Blade '%s' state is %s", - $result->{bladeId}, $result->{bladeHealthState})); + short_msg => sprintf("Blade '%s/%s' state is %s", + $result->{bladeName}, $result->{bladeId}, $result->{bladeHealthState})); } } }