mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
cleaning code (storage)
This commit is contained in:
parent
e4ded14b2c
commit
4b2018384e
@ -25,13 +25,11 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -49,10 +47,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -94,7 +92,7 @@ sub custom_swap_perfdata {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -112,10 +110,10 @@ sub custom_swap_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{available} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{available} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_available} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_available} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -231,13 +229,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
memTotalSwap => { oid => '.1.3.6.1.4.1.2021.4.3' },
|
memTotalSwap => { oid => '.1.3.6.1.4.1.2021.4.3' },
|
||||||
memAvailSwap => { oid => '.1.3.6.1.4.1.2021.4.4' },
|
memAvailSwap => { oid => '.1.3.6.1.4.1.2021.4.4' },
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_client_perfdata {
|
sub custom_client_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -41,7 +39,7 @@ sub custom_client_threshold {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = defined($instance_mode->{option_results}->{percent}) ? $self->{result_values}->{prct_active} : $self->{result_values}->{active} ;
|
$threshold_value = defined($self->{instance_mode}->{option_results}->{percent}) ? $self->{result_values}->{prct_active} : $self->{result_values}->{active} ;
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
{ label => 'warning-' . $self->{label}, exit_litteral => 'warning' } ]);
|
{ label => 'warning-' . $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
@ -129,20 +127,13 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"percent" => { name => 'percent' },
|
"percent" => { name => 'percent' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $oid_ReadMegabytesPerSecond = '.1.3.6.1.4.1.526.20.3.2.0';
|
my $oid_ReadMegabytesPerSecond = '.1.3.6.1.4.1.526.20.3.2.0';
|
||||||
my $oid_WriteMegabytesPerSecond = '.1.3.6.1.4.1.526.20.3.3.0';
|
my $oid_WriteMegabytesPerSecond = '.1.3.6.1.4.1.526.20.3.3.0';
|
||||||
my $oid_MessagesPerSecond = '.1.3.6.1.4.1.526.20.3.4.0';
|
my $oid_MessagesPerSecond = '.1.3.6.1.4.1.526.20.3.4.0';
|
||||||
|
@ -25,19 +25,17 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{allocated};
|
$total_options{total} = $self->{result_values}->{allocated};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -58,10 +56,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
{ label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
{ label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
@ -152,21 +150,14 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $oid_TotalSystemMB = '.1.3.6.1.4.1.526.20.4.2.0';
|
my $oid_TotalSystemMB = '.1.3.6.1.4.1.526.20.4.2.0';
|
||||||
my $oid_TotalAllocatedMB = '.1.3.6.1.4.1.526.20.4.3.0';
|
my $oid_TotalAllocatedMB = '.1.3.6.1.4.1.526.20.4.3.0';
|
||||||
my $oid_TotalUsedMB = '.1.3.6.1.4.1.526.20.4.4.0';
|
my $oid_TotalUsedMB = '.1.3.6.1.4.1.526.20.4.4.0';
|
||||||
|
@ -98,21 +98,19 @@ sub sc_init {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = $self->{result_values}->{type} . '_used';
|
my $label = $self->{result_values}->{type} . '_used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = $self->{result_values}->{type} . '_free';
|
$label = $self->{result_values}->{type} . '_free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -129,10 +127,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -177,8 +175,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"cem-host:s" => { name => 'cem_host' },
|
"cem-host:s" => { name => 'cem_host' },
|
||||||
"cem-user:s" => { name => 'cem_user' },
|
"cem-user:s" => { name => 'cem_user' },
|
||||||
"cem-password:s" => { name => 'cem_password' },
|
"cem-password:s" => { name => 'cem_password' },
|
||||||
@ -195,6 +192,7 @@ sub new {
|
|||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,8 +208,6 @@ sub check_options {
|
|||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
|
@ -25,21 +25,19 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -56,10 +54,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -117,8 +115,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
@ -127,13 +124,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub prefix_volume_output {
|
sub prefix_volume_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -43,19 +43,17 @@ sub set_counters {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -72,10 +70,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -115,21 +113,14 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -46,10 +44,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -110,10 +108,10 @@ sub custom_snapshot_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -194,8 +192,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"filter-node:s" => { name => 'filter_node' },
|
"filter-node:s" => { name => 'filter_node' },
|
||||||
"filter-cluster:s" => { name => 'filter_cluster' },
|
"filter-cluster:s" => { name => 'filter_cluster' },
|
||||||
@ -208,13 +205,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -46,10 +44,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -122,8 +120,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
@ -132,13 +129,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -46,10 +44,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -156,10 +154,10 @@ sub custom_snapshot_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -215,10 +213,10 @@ sub custom_compression_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -275,10 +273,10 @@ sub custom_deduplication_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -379,8 +377,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"filter-state:s" => { name => 'filter_state' },
|
"filter-state:s" => { name => 'filter_state' },
|
||||||
"filter-style:s" => { name => 'filter_style' },
|
"filter-style:s" => { name => 'filter_style' },
|
||||||
@ -392,13 +389,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -71,22 +71,20 @@ sub set_counters {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return if ($self->{result_values}->{total} <= 0);
|
return if ($self->{result_values}->{total} <= 0);
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -104,10 +102,10 @@ sub custom_usage_threshold {
|
|||||||
return 'ok' if ($self->{result_values}->{total} <= 0);
|
return 'ok' if ($self->{result_values}->{total} <= 0);
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -166,23 +164,16 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"filter-type:s" => { name => 'filter_type' },
|
"filter-type:s" => { name => 'filter_type' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
my %map_types = (
|
my %map_types = (
|
||||||
1 => 'traditionalVolume',
|
1 => 'traditionalVolume',
|
||||||
2 => 'flexibleVolume',
|
2 => 'flexibleVolume',
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub set_counters {
|
sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -51,14 +49,14 @@ sub custom_usage_perfdata {
|
|||||||
|
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if ($self->{result_values}->{total} > 0 && defined($instance_mode->{option_results}->{free})) {
|
if ($self->{result_values}->{total} > 0 && defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{name} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{name} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($self->{result_values}->{total} > 0 && $instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{result_values}->{total} > 0 && $self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -74,13 +72,13 @@ sub custom_usage_threshold {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
# cannot use '%' or free option with unlimited system
|
# cannot use '%' or free option with unlimited system
|
||||||
return 'ok' if ($self->{result_values}->{total} <= 0 && ($instance_mode->{option_results}->{units} eq '%' || $instance_mode->{option_results}->{free}));
|
return 'ok' if ($self->{result_values}->{total} <= 0 && ($self->{instance_mode}->{option_results}->{units} eq '%' || $self->{instance_mode}->{option_results}->{free}));
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -136,8 +134,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
"filter-vserver:s" => { name => 'filter_vserver' },
|
"filter-vserver:s" => { name => 'filter_vserver' },
|
||||||
@ -149,13 +146,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
qrV2Tree => { oid => '.1.3.6.1.4.1.789.1.4.6.1.14' },
|
qrV2Tree => { oid => '.1.3.6.1.4.1.789.1.4.6.1.14' },
|
||||||
qrV264KBytesUsed => { oid => '.1.3.6.1.4.1.789.1.4.6.1.25' },
|
qrV264KBytesUsed => { oid => '.1.3.6.1.4.1.789.1.4.6.1.25' },
|
||||||
|
@ -25,21 +25,19 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = $self->{result_values}->{label} . '_used';
|
my $label = $self->{result_values}->{label} . '_used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = $self->{result_values}->{label} . '_free';
|
$label = $self->{result_values}->{label} . '_free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -56,10 +54,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -128,8 +126,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"filter-project:s" => { name => 'filter_project' },
|
"filter-project:s" => { name => 'filter_project' },
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
@ -139,13 +136,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub prefix_share_output {
|
sub prefix_share_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -25,21 +25,19 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $label = 'used';
|
my $label = 'used';
|
||||||
my $value_perf = $self->{result_values}->{used};
|
my $value_perf = $self->{result_values}->{used};
|
||||||
if (defined($instance_mode->{option_results}->{free})) {
|
if (defined($self->{instance_mode}->{option_results}->{free})) {
|
||||||
$label = 'free';
|
$label = 'free';
|
||||||
$value_perf = $self->{result_values}->{free};
|
$value_perf = $self->{result_values}->{free};
|
||||||
}
|
}
|
||||||
my $extra_label = '';
|
my $extra_label = '';
|
||||||
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
$extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0);
|
||||||
my %total_options = ();
|
my %total_options = ();
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$total_options{total} = $self->{result_values}->{total};
|
$total_options{total} = $self->{result_values}->{total};
|
||||||
$total_options{cast_int} = 1;
|
$total_options{cast_int} = 1;
|
||||||
}
|
}
|
||||||
@ -56,10 +54,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
return $exit;
|
return $exit;
|
||||||
@ -144,8 +142,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"units:s" => { name => 'units', default => '%' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"free" => { name => 'free' },
|
"free" => { name => 'free' },
|
||||||
@ -154,13 +151,6 @@ sub new {
|
|||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::check_options(%options);
|
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub prefix_volume_output {
|
sub prefix_volume_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -43,10 +41,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -71,8 +69,8 @@ sub custom_usage_output {
|
|||||||
sub custom_usage_calc {
|
sub custom_usage_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{result_values}->{total} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_disk_capacity'});
|
$self->{result_values}->{total} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_disk_capacity'});
|
||||||
$self->{result_values}->{used} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_used_disk_space'});
|
$self->{result_values}->{used} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_used_disk_space'});
|
||||||
|
|
||||||
if ($self->{result_values}->{total} != 0) {
|
if ($self->{result_values}->{total} != 0) {
|
||||||
$self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used};
|
$self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used};
|
||||||
@ -116,8 +114,8 @@ sub custom_volume_output {
|
|||||||
sub custom_volume_calc {
|
sub custom_volume_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{result_values}->{volume} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
$self->{result_values}->{volume} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
||||||
$self->{result_values}->{total} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_disk_capacity'});
|
$self->{result_values}->{total} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_disk_capacity'});
|
||||||
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
||||||
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
||||||
|
|
||||||
@ -219,8 +217,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"ssh-option:s@" => { name => 'ssh_option' },
|
"ssh-option:s@" => { name => 'ssh_option' },
|
||||||
"ssh-path:s" => { name => 'ssh_path' },
|
"ssh-path:s" => { name => 'ssh_path' },
|
||||||
@ -244,8 +241,6 @@ sub check_options {
|
|||||||
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
||||||
$self->{option_results}->{remote} = 1;
|
$self->{option_results}->{remote} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_usage_perfdata {
|
sub custom_usage_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -43,10 +41,10 @@ sub custom_usage_threshold {
|
|||||||
|
|
||||||
my ($exit, $threshold_value);
|
my ($exit, $threshold_value);
|
||||||
$threshold_value = $self->{result_values}->{used};
|
$threshold_value = $self->{result_values}->{used};
|
||||||
$threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
if ($instance_mode->{option_results}->{units} eq '%') {
|
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
|
||||||
$threshold_value = $self->{result_values}->{prct_used};
|
$threshold_value = $self->{result_values}->{prct_used};
|
||||||
$threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free}));
|
$threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free}));
|
||||||
}
|
}
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
$exit = $self->{perfdata}->threshold_check(value => $threshold_value,
|
||||||
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' },
|
||||||
@ -71,8 +69,8 @@ sub custom_usage_output {
|
|||||||
sub custom_usage_calc {
|
sub custom_usage_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{result_values}->{total} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_total'});
|
$self->{result_values}->{total} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_total'});
|
||||||
$self->{result_values}->{free} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_free'});
|
$self->{result_values}->{free} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_free'});
|
||||||
|
|
||||||
if ($self->{result_values}->{total} != 0) {
|
if ($self->{result_values}->{total} != 0) {
|
||||||
$self->{result_values}->{used} = $self->{result_values}->{total} - $self->{result_values}->{free};
|
$self->{result_values}->{used} = $self->{result_values}->{total} - $self->{result_values}->{free};
|
||||||
@ -129,8 +127,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"ssh-option:s@" => { name => 'ssh_option' },
|
"ssh-option:s@" => { name => 'ssh_option' },
|
||||||
"ssh-path:s" => { name => 'ssh_path' },
|
"ssh-path:s" => { name => 'ssh_path' },
|
||||||
@ -154,8 +151,6 @@ sub check_options {
|
|||||||
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
||||||
$self->{option_results}->{remote} = 1;
|
$self->{option_results}->{remote} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_volume_perfdata {
|
sub custom_volume_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -56,7 +54,7 @@ sub custom_volume_output {
|
|||||||
sub custom_volume_calc {
|
sub custom_volume_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{result_values}->{volume} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
$self->{result_values}->{volume} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
||||||
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
||||||
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
||||||
|
|
||||||
@ -196,8 +194,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"ssh-option:s@" => { name => 'ssh_option' },
|
"ssh-option:s@" => { name => 'ssh_option' },
|
||||||
"ssh-path:s" => { name => 'ssh_path' },
|
"ssh-path:s" => { name => 'ssh_path' },
|
||||||
@ -219,8 +216,6 @@ sub check_options {
|
|||||||
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
||||||
$self->{option_results}->{remote} = 1;
|
$self->{option_results}->{remote} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
|
@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::counter);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $instance_mode;
|
|
||||||
|
|
||||||
sub custom_volume_perfdata {
|
sub custom_volume_perfdata {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -56,7 +54,7 @@ sub custom_volume_output {
|
|||||||
sub custom_volume_calc {
|
sub custom_volume_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{result_values}->{volume} = $instance_mode->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
$self->{result_values}->{volume} = $self->{instance_mode}->convert_to_bytes(raw_value => $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}});
|
||||||
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
$self->{result_values}->{display} = $options{extra_options}->{display_ref};
|
||||||
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
||||||
|
|
||||||
@ -115,8 +113,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"ssh-option:s@" => { name => 'ssh_option' },
|
"ssh-option:s@" => { name => 'ssh_option' },
|
||||||
"ssh-path:s" => { name => 'ssh_path' },
|
"ssh-path:s" => { name => 'ssh_path' },
|
||||||
@ -138,8 +135,6 @@ sub check_options {
|
|||||||
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') {
|
||||||
$self->{option_results}->{remote} = 1;
|
$self->{option_results}->{remote} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode = $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user