Fix some errors in Solaris local mode

This commit is contained in:
Quentin garnier 2014-04-11 16:16:26 +02:00
parent 4a151d32b8
commit f5092350b1
3 changed files with 8 additions and 6 deletions

View File

@ -117,7 +117,8 @@ sub run {
}
}
my ($exit_code) = check_threshold($volumes_errors, $OPTION{warning}, $OPTION{critical});
my ($exit_code) = $self->{perfdata}->threshold_check(value => $volumes_errors,
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
if ($volumes_errors > 0) {
$self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("Some volumes problems:" . $volumes));

View File

@ -61,7 +61,7 @@ sub new {
"sudo" => { name => 'sudo' },
"command:s" => { name => 'command', default => 'prtdiag' },
"command-path:s" => { name => 'command_path', default => '/usr/platform/`/sbin/uname -i`/sbin' },
"command-options:s" => { name => 'command_options', default => '-v 2&1' },
"command-options:s" => { name => 'command_options', default => '-v 2>&1' },
"config-file:s" => { name => 'config_file' },
});
$self->{conf} = {};
@ -266,6 +266,7 @@ sub prtdiag {
sub run {
my ($self, %options) = @_;
$self->load_prtdiag_config();
$self->prtdiag();
$self->{output}->display();
$self->{output}->exit();

View File

@ -160,11 +160,11 @@ sub run {
my ($exit_code) = $self->{perfdata}->threshold_check(value => $num_metastat_errors,
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
if ($num_metastat_errors > 0) {
output_add(severity => $exit_code,
short_msg => sprintf("Some metadevices need maintenance:" . $metastat_name));
$self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("Some metadevices need maintenance:" . $metastat_name));
} else {
output_add(severity => 'OK',
short_msg => "No problems on metadevices");
$self->{output}->output_add(severity => 'OK',
short_msg => "No problems on metadevices");
}
($exit_code) = $self->{perfdata}->threshold_check(value => $num_metadb_errors,