Fix oracle timezone

This commit is contained in:
garnier-quentin 2015-04-26 20:56:26 +02:00
parent d43e849bc9
commit d719701e7d
3 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ sub check_options {
}
}
if (defined($self->{option_results}->{timezone})) {
if (defined($self->{option_results}->{timezone}) && $self->{option_results}->{timezone} ne '') {
$ENV{TZ} = $self->{option_results}->{timezone};
}
}
@ -141,7 +141,7 @@ sub run {
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $label),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $label),
min => 0);
my $exit_code = $self->{perfdata}->threshold_check(value => $backup_age, threshold => [ { label => 'critical-' . $label, 'exit_litteral' => 'critical' }, { label => 'warning-' . $label, exit_litteral => 'warning' } ]);
my $exit_code = $self->{perfdata}->threshold_check(value => $backup_age, threshold => [ { label => 'critical-' . $label, exit_litteral => 'critical' }, { label => 'warning-' . $label, exit_litteral => 'warning' } ]);
if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit_code,

View File

@ -81,7 +81,7 @@ sub run {
$self->{sql}->query(query => $query);
my $rman_backup_problems = $self->{sql}->fetchrow_array();
my $exit_code = $self->{perfdata}->threshold_check(value => $rman_backup_problems, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
my $exit_code = $self->{perfdata}->threshold_check(value => $rman_backup_problems, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("rman had %i problems during the last %i days", $rman_backup_problems, $self->{option_results}->{retention}));
$self->{output}->perfdata_add(label => 'rman_backup_problems',

View File

@ -70,7 +70,7 @@ sub check_options {
$self->{output}->option_exit();
}
if (defined($self->{option_results}->{timezone})) {
if (defined($self->{option_results}->{timezone}) && $self->{option_results}->{timezone} ne '') {
$ENV{TZ} = $self->{option_results}->{timezone};
}
}