commit
676f9f8f7a
|
@ -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}));
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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}));
|
||||
|
|
Loading…
Reference in New Issue