Refs #5389: Fix Output

This commit is contained in:
Florian Asche 2014-03-27 00:34:13 +01:00
parent 0775b0707c
commit ffef495ced
2 changed files with 10 additions and 6 deletions

View File

@ -110,7 +110,7 @@ sub run {
my $drive_display = '';
my $drive_display_append = '';
foreach my $name (sort(keys %{$self->{result}})) {
$drive_display .= $drive_display_append . 'name = ' . $name . ' [state = ' . $self->{result}->{$name}->{temperature} . $self->{result}->{$name}->{unit} . ']';
$drive_display .= $drive_display_append . 'name = ' . $name . ' [temperature = ' . $self->{result}->{$name}->{temperature} . $self->{result}->{$name}->{unit} . ']';
$drive_display_append = ', ';
}
@ -132,7 +132,7 @@ sub disco_show {
$self->manage_selection();
foreach my $name (sort(keys %{$self->{result}})) {
$self->{output}->add_disco_entry(name => $name,
state => $self->{result}->{$name}->{temperature}
temperature => $self->{result}->{$name}->{temperature}
);
}
}

View File

@ -139,12 +139,16 @@ sub run {
foreach my $name (sort(keys %{$self->{result}})) {
my $exit = $self->{perfdata}->threshold_check(value => $self->{result}->{$name}->{temperature}, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->output_add(long_msg => sprintf("Harddrive '%s' Temperature : %s", $name,
$self->{result}->{$name}->{temperature}));
$self->{output}->output_add(long_msg => sprintf("Harddrive '%s' Temperature : %s%s",
$name,
$self->{result}->{$name}->{temperature},
$self->{result}->{$name}->{unit}));
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1) || (defined($self->{option_results}->{name}) && !defined($self->{option_results}->{use_regexp}))) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Harddrive '%s' Temperature : %s", $name,
$self->{result}->{$name}->{temperature}));
short_msg => sprintf("Harddrive '%s' Temperature : %s%s",
$name,
$self->{result}->{$name}->{temperature},
$self->{result}->{$name}->{unit}));
}
my $extra_label = '';