Fix oracle timezone
This commit is contained in:
parent
d43e849bc9
commit
d719701e7d
|
@ -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};
|
$ENV{TZ} = $self->{option_results}->{timezone};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ sub run {
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $label),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $label),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $label),
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $label),
|
||||||
min => 0);
|
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)) {
|
if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
$self->{output}->output_add(severity => $exit_code,
|
||||||
|
|
|
@ -81,7 +81,7 @@ sub run {
|
||||||
$self->{sql}->query(query => $query);
|
$self->{sql}->query(query => $query);
|
||||||
my $rman_backup_problems = $self->{sql}->fetchrow_array();
|
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,
|
$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}));
|
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',
|
$self->{output}->perfdata_add(label => 'rman_backup_problems',
|
||||||
|
|
|
@ -70,7 +70,7 @@ sub check_options {
|
||||||
$self->{output}->option_exit();
|
$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};
|
$ENV{TZ} = $self->{option_results}->{timezone};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue