Fix #2339
This commit is contained in:
parent
cf8248b333
commit
4637176fbe
|
@ -33,7 +33,7 @@ sub check {
|
||||||
my ($results) = $self->{custom}->get_infos(
|
my ($results) = $self->{custom}->get_infos(
|
||||||
cmd => 'show frus',
|
cmd => 'show frus',
|
||||||
base_type => 'enclosure-fru',
|
base_type => 'enclosure-fru',
|
||||||
key => 'part-number',
|
key => 'fru-location',
|
||||||
properties_name => '^(fru-status|fru-location)$',
|
properties_name => '^(fru-status|fru-location)$',
|
||||||
no_quit => 1,
|
no_quit => 1,
|
||||||
);
|
);
|
||||||
|
@ -45,13 +45,18 @@ sub check {
|
||||||
|
|
||||||
my $state = $results->{$part_number}->{'fru-status'};
|
my $state = $results->{$part_number}->{'fru-status'};
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("fru '%s' status is %s [instance: %s]",
|
$self->{output}->output_add(
|
||||||
$instance, $state, $instance)
|
long_msg => sprintf(
|
||||||
);
|
"fru '%s' status is %s [instance: %s]",
|
||||||
|
$instance, $state, $instance
|
||||||
|
)
|
||||||
|
);
|
||||||
my $exit = $self->get_severity(section => 'fru', value => $state);
|
my $exit = $self->get_severity(section => 'fru', value => $state);
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(
|
||||||
short_msg => sprintf("Fru '%s' status is '%s'", $instance, $state));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Fru '%s' status is '%s'", $instance, $state)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue