(plugin) storage::dell::me4::restapi - fix service discovery modes and fix help (#3810)

* (plugin) storage::dell::me4::restapi - fix service discovery modes and help

* (plugin) storage::dell::me4::restapi - fix service discovery modes and help
This commit is contained in:
qgarnier 2022-08-05 09:46:43 +02:00 committed by GitHub
parent 61becef121
commit 230701ef9a
4 changed files with 29 additions and 50 deletions

View File

@ -200,27 +200,16 @@ Check controllers statistics.
Filter controller name (Can be a regexp).
=item B<--warning-instance-*>
=item B<--warning-*> B<--critical-*>
Threshold warning.
Can be: 'controller-data-read-bytespersecond', 'controller-data-written-bytespersecond',
'controller-reads-count', 'controller-writes-count',
'controller-data-transfer-bytespersecond', 'controller-iops-ops',
'controller-commands-forwarded-count',
'controller-cache-write-usage-percentage', 'controller-cache-write-hits-count',
'controller-cache-write-misses-count', 'controller-cache-read-hits-count',
'controller-cache-read-misses-count', 'controller-cpu-utilization-percentage'.
=item B<--critical-instance-*>
Threshold critical.
Can be: 'controller-data-read-bytespersecond', 'controller-data-written-bytespersecond',
'controller-reads-count', 'controller-writes-count',
'controller-data-transfer-bytespersecond', 'controller-iops-ops',
'controller-commands-forwarded-count',
'controller-cache-write-usage-percentage', 'controller-cache-write-hits-count',
'controller-cache-write-misses-count', 'controller-cache-read-hits-count',
'controller-cache-read-misses-count', 'controller-cpu-utilization-percentage'.
Thresholds.
Can be: 'data-read-bytespersecond', 'data-written-bytespersecond',
'reads-count', 'writes-count',
'data-transfer-bytespersecond', 'controller-iops-ops',
'commands-forwarded-count',
'cache-write-usage-percentage', 'cache-write-hits-count',
'cache-write-misses-count', 'cache-read-hits-count',
'cache-read-misses-count', 'cpu-utilization-percentage'.
=back

View File

@ -45,17 +45,17 @@ sub check_options {
sub manage_selection {
my ($self, %options) = @_;
$self->{result} = $options{custom}->request_api(method => 'GET', url_path => '/api/show/controllers');
return $options{custom}->request_api(method => 'GET', url_path => '/api/show/controllers');
}
sub run {
my ($self, %options) = @_;
$self->manage_selection(%options);
foreach my $controller (@{$self->{result}->{controllers}}) {
my $controllers = $self->manage_selection(%options);
foreach my $controller (@{$controllers->{controllers}}) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $controller->{'durable-id'} !~ /$self->{option_results}->{filter_name}/);
$self->{output}->output_add(
long_msg => sprintf(
"[name = %s]",
@ -81,10 +81,10 @@ sub disco_format {
sub disco_show {
my ($self, %options) = @_;
$self->manage_selection(%options);
foreach my $controller (@{$self->{controllers}}) {
my $controllers = $self->manage_selection(%options);
foreach my $controller (@{$controllers->{controllers}}) {
$self->{output}->add_disco_entry(
name => $controller->{'durable-id'},
name => $controller->{'durable-id'}
);
}
}

View File

@ -45,14 +45,14 @@ sub check_options {
sub manage_selection {
my ($self, %options) = @_;
$self->{result} = $options{custom}->request_api(method => 'GET', url_path => '/api/show/volumes');
return $options{custom}->request_api(method => 'GET', url_path => '/api/show/volumes');
}
sub run {
my ($self, %options) = @_;
$self->manage_selection(%options);
foreach my $volume (@{$self->{result}->{volumes}}) {
my $volumes = $self->manage_selection(%options);
foreach my $volume (@{$volumes->{volumes}}) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $volume->{'volume-name'} !~ /$self->{option_results}->{filter_name}/);
@ -82,8 +82,8 @@ sub disco_format {
sub disco_show {
my ($self, %options) = @_;
$self->manage_selection(%options);
foreach my $volume (@{$self->{volumes}}) {
my $volumes = $self->manage_selection(%options);
foreach my $volume (@{$volumes->{volumes}}) {
$self->{output}->add_disco_entry(
name => $volume->{'volume-name'},
volumegroup => $volume->{'volume-group'},

View File

@ -184,25 +184,15 @@ Check volumes statistics.
Filter volume name (Can be a regexp).
=item B<--warning-instance-*>
=item B<--warning-*> B<--critical-*>
Threshold warning.
Can be: 'volume-data-read-bytespersecond', 'volume-data-written-bytespersecond',
'volume-reads-count', 'volume-writes-count',
'volume-data-transfer-bytespersecond', 'volume-iops-ops',
'volume-cache-write-usage-percentage', 'volume-cache-write-hits-count',
'volume-cache-write-misses-count', 'volume-cache-read-hits-count',
'volume-cache-read-misses-count'.
=item B<--critical-instance-*>
Threshold critical.
Can be: 'volume-data-read-bytespersecond', 'volume-data-written-bytespersecond',
'volume-reads-count', 'volume-writes-count',
'volume-data-transfer-bytespersecond', 'volume-iops-ops',
'volume-cache-write-usage-percentage', 'volume-cache-write-hits-count',
'volume-cache-write-misses-count', 'volume-cache-read-hits-count',
'volume-cache-read-misses-count'.
Thresholds.
Can be: 'data-read-bytespersecond', 'data-written-bytespersecond',
'reads-count', 'writes-count',
'data-transfer-bytespersecond', 'iops-ops',
'cache-write-usage-percentage', 'cache-write-hits-count',
'cache-write-misses-count', 'cache-read-hits-count',
'cache-read-misses-count'.
=back