+ fix typo threshold (sub) & add missing call

This commit is contained in:
Sims24 2016-05-23 15:04:49 +02:00
parent 44f9d9a6c9
commit 5e053c25a0
1 changed files with 4 additions and 3 deletions

View File

@ -48,18 +48,18 @@ sub new {
return $self;
}
sub check_treshold_overload {
sub check_threshold_overload {
my ($self, %options) = @_;
$self->{overload_th} = {};
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
if ($val !~ /(.*?)=(.*)/) {
$self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'.");
$self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'.");
$self->{output}->option_exit();
}
my ($filter, $threshold) = ($1, $2);
if ($self->{output}->is_litteral_status(status => $threshold) == 0) {
$self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'.");
$self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'.");
$self->{output}->option_exit();
}
$self->{overload_th}->{$filter} = $threshold;
@ -69,6 +69,7 @@ sub check_treshold_overload {
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
$self->check_threshold_overload();
}
sub get_severity {