Merge pull request #410 from Sims24/threshold-typo

+ fix threshold typ
This commit is contained in:
qgarnier 2016-05-23 17:00:36 +02:00
commit 676f9f8f7a
35 changed files with 89 additions and 87 deletions

View File

@ -65,12 +65,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -72,12 +72,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -65,12 +65,12 @@ sub check_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 ($section, $status, $filter) = ('status', $1, $2);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -73,12 +73,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -369,14 +369,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(up|normal)$)'
=item B<--warning>
Set warning threshold for temperatures, voltages, sensors (syntax: type,regexp,treshold)
Set warning threshold for temperatures, voltages, sensors (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures, voltages, sensors (syntax: type,regexp,treshold)
Set critical threshold for temperatures, voltages, sensors (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
=cut

View File

@ -81,13 +81,13 @@ sub check_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 ($label, $filter, $threshold) = ($1, $2, $3);
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}->{$label} = {} if (!defined($self->{overload_th}->{$label}));

View File

@ -209,13 +209,13 @@ sub check_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;

View File

@ -111,12 +111,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -95,12 +95,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
@ -303,4 +303,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)'
=back
=cut
=cut

View File

@ -84,12 +84,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -290,12 +290,12 @@ Example: --threshold-overload='temperature,CRITICAL,^(?!(normal)$)'
=item B<--warning>
Set warning threshold for temperatures and humidity (syntax: type,regexp,treshold)
Set warning threshold for temperatures and humidity (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30' --warning='humidity,.*,90'
=item B<--critical>
Set critical threshold for temperature and humidity (syntax: type,regexp,treshold)
Set critical threshold for temperature and humidity (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back

View File

@ -257,12 +257,12 @@ Example: --threshold-overload='output,CRITICAL,^(?!(off)$)'
=item B<--warning>
Set warning threshold for temperatures and humidity (syntax: type,regexp,treshold)
Set warning threshold for temperatures and humidity (syntax: type,regexp,threshold)
Example: --warning='sensors,Int. Temp,30' --warning='sensors,Fuel Level,50:'
=item B<--critical>
Set critical threshold for temperature and humidity (syntax: type,regexp,treshold)
Set critical threshold for temperature and humidity (syntax: type,regexp,threshold)
Example: --warning='sensors,Int. Temp,35' --warning='sensors,Fuel Level,40:'
=back

View File

@ -293,14 +293,14 @@ Example: --threshold-overload='health,CRITICAL,^(?!(ok)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,treshold)
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures (syntax: type,regexp,treshold)
Set critical threshold for temperatures (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
=cut

View File

@ -141,12 +141,12 @@ Example: --threshold-overload='temperature.state,CRITICAL,^(?!(enabled)$)'
=item B<--warning>
Set warning threshold (syntax: type,regexp,treshold)
Set warning threshold (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold (syntax: type,regexp,treshold)
Set critical threshold (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back

View File

@ -104,12 +104,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
@ -283,4 +283,4 @@ Example: --threshold-overload='temperature,OK,other'
=back
=cut

View File

@ -91,12 +91,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -73,12 +73,12 @@ sub check_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 ($status, $filter) = ($1, $2);
if ($self->{output}->is_litteral_status(status => $status) == 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();
}
push @{$self->{overload_th}}, {filter => $filter, status => $status};

View File

@ -69,12 +69,12 @@ sub check_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 ($section, $status, $filter) = ('osource', $1, $2);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -84,12 +84,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
@ -162,4 +162,4 @@ Example: --threshold-overload='hastate,CRITICAL,^(?!(up)$)'
=back
=cut

View File

@ -78,12 +78,12 @@ sub check_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 ($section, $status, $filter) = ('psu', $1, $2);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
@ -356,4 +356,4 @@ Example: --threshold-overload='CRITICAL,^(?!(normal)$)'
=back
=cut
=cut

View File

@ -167,12 +167,12 @@ sub check_options {
}
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 ($section, $status, $filter) = ('vs', $1, $2);
if ($self->{output}->is_litteral_status(status => $status) == 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();
}
$overload_th->{$section} = [] if (!defined($overload_th->{$section}));

View File

@ -114,14 +114,14 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(ok)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,treshold)
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures (syntax: type,regexp,treshold)
Set critical threshold for temperatures (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
=cut

View File

@ -50,7 +50,7 @@ sub new {
return $self;
}
sub check_treshold_overload {
sub check_threshold_overload {
my ($self, %options) = @_;
$self->{overload_th} = {};
@ -72,7 +72,7 @@ sub check_treshold_overload {
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
$self->check_treshold_overload();
$self->check_threshold_overload();
}
sub get_severity {
@ -168,4 +168,4 @@ Example: --threshold-overload='peer,critical,active' --threshold-overload='curre
=back
=cut
=cut

View File

@ -47,7 +47,7 @@ sub new {
return $self;
}
sub check_treshold_overload {
sub check_threshold_overload {
my ($self, %options) = @_;
$self->{overload_th} = {};
@ -69,7 +69,7 @@ sub check_treshold_overload {
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
$self->check_treshold_overload();
$self->check_threshold_overload();
}
sub check_exclude {
@ -163,4 +163,4 @@ Can also exclude specific instance: --exclude=panorama#2#
=back
=cut

View File

@ -115,14 +115,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,treshold)
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures (syntax: type,regexp,treshold)
Set critical threshold for temperatures (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
=cut

View File

@ -100,12 +100,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -119,12 +119,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
@ -322,4 +322,4 @@ Example: --threshold-overload='sensors,CRITICAL,^(?!(ok)$)'
=back
=cut
=cut

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,7 +69,7 @@ sub check_treshold_overload {
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
$self->check_treshold_overload();
$self->check_threshold_overload();
}
sub get_severity {
@ -118,4 +118,4 @@ Example: --threshold-overload='(unknown|non critical)=critical'
=back
=cut

View File

@ -313,14 +313,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,treshold)
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures (syntax: type,regexp,treshold)
Set critical threshold for temperatures (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
=cut

View File

@ -151,12 +151,12 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(ok)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,treshold)
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,20'
=item B<--critical>
Set critical threshold for temperatures and battery charge (syntax: type,regexp,treshold)
Set critical threshold for temperatures and battery charge (syntax: type,regexp,threshold)
Example: --critical='temperature,1.1,25' --critical='battery,.*,20:'
=back

View File

@ -68,12 +68,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

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 {

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 {

View File

@ -77,12 +77,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));

View File

@ -143,12 +143,12 @@ sub check_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 ($section, $status, $filter) = ($1, $2, $3);
if ($self->{output}->is_litteral_status(status => $status) == 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}->{$section} = [] if (!defined($self->{overload_th}->{$section}));