(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). Filter controller name (Can be a regexp).
=item B<--warning-instance-*> =item B<--warning-*> B<--critical-*>
Threshold warning. Thresholds.
Can be: 'controller-data-read-bytespersecond', 'controller-data-written-bytespersecond', Can be: 'data-read-bytespersecond', 'data-written-bytespersecond',
'controller-reads-count', 'controller-writes-count', 'reads-count', 'writes-count',
'controller-data-transfer-bytespersecond', 'controller-iops-ops', 'data-transfer-bytespersecond', 'controller-iops-ops',
'controller-commands-forwarded-count', 'commands-forwarded-count',
'controller-cache-write-usage-percentage', 'controller-cache-write-hits-count', 'cache-write-usage-percentage', 'cache-write-hits-count',
'controller-cache-write-misses-count', 'controller-cache-read-hits-count', 'cache-write-misses-count', 'cache-read-hits-count',
'controller-cache-read-misses-count', 'controller-cpu-utilization-percentage'. 'cache-read-misses-count', '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'.
=back =back

View File

@ -45,14 +45,14 @@ sub check_options {
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; 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 { sub run {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->manage_selection(%options); my $controllers = $self->manage_selection(%options);
foreach my $controller (@{$self->{result}->{controllers}}) { foreach my $controller (@{$controllers->{controllers}}) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $controller->{'durable-id'} !~ /$self->{option_results}->{filter_name}/); && $controller->{'durable-id'} !~ /$self->{option_results}->{filter_name}/);
@ -81,10 +81,10 @@ sub disco_format {
sub disco_show { sub disco_show {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->manage_selection(%options); my $controllers = $self->manage_selection(%options);
foreach my $controller (@{$self->{controllers}}) { foreach my $controller (@{$controllers->{controllers}}) {
$self->{output}->add_disco_entry( $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 { sub manage_selection {
my ($self, %options) = @_; 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 { sub run {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->manage_selection(%options); my $volumes = $self->manage_selection(%options);
foreach my $volume (@{$self->{result}->{volumes}}) { foreach my $volume (@{$volumes->{volumes}}) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $volume->{'volume-name'} !~ /$self->{option_results}->{filter_name}/); && $volume->{'volume-name'} !~ /$self->{option_results}->{filter_name}/);
@ -82,8 +82,8 @@ sub disco_format {
sub disco_show { sub disco_show {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->manage_selection(%options); my $volumes = $self->manage_selection(%options);
foreach my $volume (@{$self->{volumes}}) { foreach my $volume (@{$volumes->{volumes}}) {
$self->{output}->add_disco_entry( $self->{output}->add_disco_entry(
name => $volume->{'volume-name'}, name => $volume->{'volume-name'},
volumegroup => $volume->{'volume-group'}, volumegroup => $volume->{'volume-group'},

View File

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