Refs #5389: Fix Output
This commit is contained in:
parent
0775b0707c
commit
ffef495ced
|
@ -110,7 +110,7 @@ sub run {
|
||||||
my $drive_display = '';
|
my $drive_display = '';
|
||||||
my $drive_display_append = '';
|
my $drive_display_append = '';
|
||||||
foreach my $name (sort(keys %{$self->{result}})) {
|
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 = ', ';
|
$drive_display_append = ', ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ sub disco_show {
|
||||||
$self->manage_selection();
|
$self->manage_selection();
|
||||||
foreach my $name (sort(keys %{$self->{result}})) {
|
foreach my $name (sort(keys %{$self->{result}})) {
|
||||||
$self->{output}->add_disco_entry(name => $name,
|
$self->{output}->add_disco_entry(name => $name,
|
||||||
state => $self->{result}->{$name}->{temperature}
|
temperature => $self->{result}->{$name}->{temperature}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,12 +139,16 @@ sub run {
|
||||||
foreach my $name (sort(keys %{$self->{result}})) {
|
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' } ]);
|
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->{output}->output_add(long_msg => sprintf("Harddrive '%s' Temperature : %s%s",
|
||||||
$self->{result}->{$name}->{temperature}));
|
$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}))) {
|
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,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("Harddrive '%s' Temperature : %s", $name,
|
short_msg => sprintf("Harddrive '%s' Temperature : %s%s",
|
||||||
$self->{result}->{$name}->{temperature}));
|
$name,
|
||||||
|
$self->{result}->{$name}->{temperature},
|
||||||
|
$self->{result}->{$name}->{unit}));
|
||||||
}
|
}
|
||||||
|
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
|
|
Loading…
Reference in New Issue