From 359f66677f47ba3fda4b135054a7ff8f5a2d4f7f Mon Sep 17 00:00:00 2001 From: matoy Date: Fri, 21 May 2021 09:01:28 +0200 Subject: [PATCH 01/22] New plugin for StorageSync service (discovery, 2 modes, 3 metrics) New plugin for StorageSync service (discovery, 2 modes, 3 metrics) []# /usr/lib/centreon/plugins//centreon-plugins/centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --custommode='api' --mode='heartbeat' --subscription='xxx' --tenant='xxx' --client-id='xxx' --client-secret='***' --resource-group='xxx' --resource='xxx' --critical-heartbeat='1:' OK: Instance 'xxx' Statistic 'maximum' Metrics Heartbeat: 1.00 | 'xxx~maximum#storage.storagesync.heartbeat'=1.00;;1:;0; []# /usr/lib/centreon/plugins//centreon-plugins/centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --custommode='api' --mode='sessions' --subscription='xxx' --tenant='xxx' --client-id='xxx' --client-secret='***' --resource-group='xxx' --resource='xxx' --warning-item-errors='15' --critical-item-errors='20' --zeroed OK: Instance 'xxx' Statistic 'total' Metrics Item errors: 0.00, Files Synced: 0.00 | 'xxx~total#storage.storagesync.item.errors'=0.00;0:15;0:20;0; 'xxx~total#storage.storagesync.files.synced'=0.00;;;0; --- .../storage/storagesync/mode/discovery.pm | 60 +++++++ .../storage/storagesync/mode/heartbeat.pm | 143 +++++++++++++++++ .../storage/storagesync/mode/sessions.pm | 151 ++++++++++++++++++ cloud/azure/storage/storagesync/plugin.pm | 62 +++++++ 4 files changed, 416 insertions(+) create mode 100644 cloud/azure/storage/storagesync/mode/discovery.pm create mode 100644 cloud/azure/storage/storagesync/mode/heartbeat.pm create mode 100644 cloud/azure/storage/storagesync/mode/sessions.pm create mode 100644 cloud/azure/storage/storagesync/plugin.pm diff --git a/cloud/azure/storage/storagesync/mode/discovery.pm b/cloud/azure/storage/storagesync/mode/discovery.pm new file mode 100644 index 000000000..ded6c1b61 --- /dev/null +++ b/cloud/azure/storage/storagesync/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::mode::discovery; + +use base qw(cloud::azure::management::monitor::mode::discovery); + +use strict; +use warnings; + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->{namespace} = 'microsoft.storagesync'; + $self->{type} = 'storageSyncServices'; +} + +1; + +__END__ + +=head1 MODE + +Azure Storage Sync Service discovery. + +=over 8 + +=item B<--resource-group> + +Specify resource group. + +=item B<--location> + +Specify location. + +=item B<--prettify> + +Prettify JSON output. + +=back + +=cut diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm new file mode 100644 index 000000000..ecbad8c6a --- /dev/null +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -0,0 +1,143 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::mode::heartbeat; + +use base qw(cloud::azure::custom::mode); + +use strict; +use warnings; + +sub get_metrics_mapping { + my ($self, %options) = @_; + + my $metrics_mapping = { + 'storagesyncserverheartbeat' => { + 'output' => 'Heartbeat', + 'label' => 'heartbeat', + 'nlabel' => 'storage.storagesync.heartbeat', + 'unit' => '', + 'min' => '0', + 'max' => '' + } + }; + + return $metrics_mapping; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'filter-metric:s' => { name => 'filter_metric' }, + 'resource:s' => { name => 'resource' }, + 'resource-group:s' => { name => 'resource_group' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + if (!defined($self->{option_results}->{resource}) || $self->{option_results}->{resource} eq '') { + $self->{output}->add_option_msg(short_msg => 'Need to specify either --resource with --resource-group option or --resource .'); + $self->{output}->option_exit(); + } + my $resource = $self->{option_results}->{resource}; + my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : ''; + if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.Cache\/Redis\/(.*)$/) { + $resource_group = $1; + $resource = $2; + } + + $self->{az_resource} = $resource; + $self->{az_resource_group} = $resource_group; + $self->{az_resource_type} = 'storageSyncServices'; + $self->{az_resource_namespace} = 'microsoft.storagesync'; + $self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900; + $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT5M'; + $self->{az_aggregations} = ['Maximum']; + if (defined($self->{option_results}->{aggregation})) { + $self->{az_aggregations} = []; + foreach my $stat (@{$self->{option_results}->{aggregation}}) { + if ($stat ne '') { + push @{$self->{az_aggregations}}, ucfirst(lc($stat)); + } + } + } + + foreach my $metric (keys %{$self->{metrics_mapping}}) { + next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' + && $metric !~ /$self->{option_results}->{filter_metric}/); + push @{$self->{az_metrics}}, $metric; + } +} + +1; + +__END__ + +=head1 MODE + +Check Azure Storage Sync Service Heartbeat. + +Example: + +Using resource name : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=heartbeat --custommode=api +--resource= --resource-group= --aggregation='maximum' +--critical-heartbeat='1:' + +Using resource id : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=heartbeat --custommode=api +--resource='/subscriptions//resourceGroups//providers/microsoft.storagesync/storageSyncServices/' +--aggregation='maximum' --critical-heartbeat='1:' + +Default aggregation: 'maximum' / 'minimum', 'maximum' and 'total' are valid. + +=over 8 + +=item B<--resource> + +Set resource name or id (Required). + +=item B<--resource-group> + +Set resource group (Required if resource's name is used). + +=item B<--warning-*> + +Warning threshold where '*' can be: +'heartbeat'. + +=item B<--critical-*> + +Critical threshold where '*' can be: +'heartbeat'. + +=back + +=cut diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm new file mode 100644 index 000000000..d03f7faa1 --- /dev/null +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -0,0 +1,151 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::mode::sessions; + +use base qw(cloud::azure::custom::mode); + +use strict; +use warnings; + +sub get_metrics_mapping { + my ($self, %options) = @_; + + my $metrics_mapping = { + 'StorageSyncSyncSessionAppliedFilesCount' => { + 'output' => 'Files Synced', + 'label' => 'files-synced', + 'nlabel' => 'storage.storagesync.files.synced', + 'unit' => '', + 'min' => '0', + 'max' => '' + }, + 'StorageSyncSyncSessionPerItemErrorsCount' => { + 'output' => 'Item errors', + 'label' => 'item-errors', + 'nlabel' => 'storage.storagesync.item.errors', + 'unit' => '', + 'min' => '0', + 'max' => '' + } + }; + + return $metrics_mapping; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'filter-metric:s' => { name => 'filter_metric' }, + 'resource:s' => { name => 'resource' }, + 'resource-group:s' => { name => 'resource_group' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + if (!defined($self->{option_results}->{resource}) || $self->{option_results}->{resource} eq '') { + $self->{output}->add_option_msg(short_msg => 'Need to specify either --resource with --resource-group option or --resource .'); + $self->{output}->option_exit(); + } + my $resource = $self->{option_results}->{resource}; + my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : ''; + if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.Cache\/Redis\/(.*)$/) { + $resource_group = $1; + $resource = $2; + } + + $self->{az_resource} = $resource; + $self->{az_resource_group} = $resource_group; + $self->{az_resource_type} = 'storageSyncServices'; + $self->{az_resource_namespace} = 'microsoft.storagesync'; + $self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900; + $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT5M'; + $self->{az_aggregations} = ['Total']; + if (defined($self->{option_results}->{aggregation})) { + $self->{az_aggregations} = []; + foreach my $stat (@{$self->{option_results}->{aggregation}}) { + if ($stat ne '') { + push @{$self->{az_aggregations}}, ucfirst(lc($stat)); + } + } + } + + foreach my $metric (keys %{$self->{metrics_mapping}}) { + next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' + && $metric !~ /$self->{option_results}->{filter_metric}/); + push @{$self->{az_metrics}}, $metric; + } +} + +1; + +__END__ + +=head1 MODE + +Check Azure Storage Sync Service Files Synced and Errors. + +Example: + +Using resource name : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=files-synced --custommode=api +--resource= --resource-group= --aggregation='total' +--warning-item-errors='15' --critical-item-errors='20' + +Using resource id : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=files-synced --custommode=api +--resource='/subscriptions//resourceGroups//providers/microsoft.storagesync/storageSyncServices/' +--aggregation='total' --warning-item-errors='15' --critical-item-errors='20' + +Default aggregation: 'total' / 'minimum', 'maximum' and 'average' are valid. + +=over 8 + +=item B<--resource> + +Set resource name or id (Required). + +=item B<--resource-group> + +Set resource group (Required if resource's name is used). + +=item B<--warning-*> + +Warning threshold where '*' can be: +'item-errors', 'files-synced'. + +=item B<--critical-*> + +Critical threshold where '*' can be: +'item-errors', 'files-synced'. + +=back + +=cut diff --git a/cloud/azure/storage/storagesync/plugin.pm b/cloud/azure/storage/storagesync/plugin.pm new file mode 100644 index 000000000..ab83b30b9 --- /dev/null +++ b/cloud/azure/storage/storagesync/plugin.pm @@ -0,0 +1,62 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_custom); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new( package => __PACKAGE__, %options ); + bless $self, $class; + + $self->{version} = '0.1'; + $self->{modes} = { + 'discovery' => 'cloud::azure::storage::storagesync::mode::discovery', + 'heartbeat' => 'cloud::azure::storage::storagesync::mode::heartbeat', + 'sessions' => 'cloud::azure::storage::storagesync::mode::sessions' + }; + + $self->{custom_modes}->{azcli} = 'cloud::azure::custom::azcli'; + $self->{custom_modes}->{api} = 'cloud::azure::custom::api'; + return $self; +} + +sub init { + my ($self, %options) = @_; + + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' } + }); + + $self->SUPER::init(%options); +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Microsoft Azure Redis Cache service. + +=cut From 23276556550c56ff8c2cbdd61bbae12742cd6701 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:10 +0200 Subject: [PATCH 02/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index d03f7faa1..e1c07e917 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -32,7 +32,7 @@ sub get_metrics_mapping { 'StorageSyncSyncSessionAppliedFilesCount' => { 'output' => 'Files Synced', 'label' => 'files-synced', - 'nlabel' => 'storage.storagesync.files.synced', + 'nlabel' => 'storagesync.files.synced.count', 'unit' => '', 'min' => '0', 'max' => '' From 7a64fe5be84893ab1a6adc47ed1c89645227440a Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:16 +0200 Subject: [PATCH 03/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index ecbad8c6a..04d1b0236 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -128,10 +128,9 @@ Set resource name or id (Required). Set resource group (Required if resource's name is used). -=item B<--warning-*> +=item B<--warning-heartbeat> -Warning threshold where '*' can be: -'heartbeat'. +Warning threshold. =item B<--critical-*> From bf2dc8488e7efc8edb53ceeabbf762898f5615de Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:25 +0200 Subject: [PATCH 04/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 04d1b0236..0349253bb 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -100,7 +100,7 @@ __END__ =head1 MODE -Check Azure Storage Sync Service Heartbeat. +Check Azure Storage Sync server online status. Example: From ec0aabd22cbe32156c746db6d2fb45df59b21d71 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:30 +0200 Subject: [PATCH 05/22] Update cloud/azure/storage/storagesync/plugin.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/plugin.pm b/cloud/azure/storage/storagesync/plugin.pm index ab83b30b9..494f03709 100644 --- a/cloud/azure/storage/storagesync/plugin.pm +++ b/cloud/azure/storage/storagesync/plugin.pm @@ -57,6 +57,6 @@ __END__ =head1 PLUGIN DESCRIPTION -Check Microsoft Azure Redis Cache service. +Check Microsoft Azure Storage Sync service. =cut From 6e13a28b6677b1c8a8be9e76f9973ee9b7075a66 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:35 +0200 Subject: [PATCH 06/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index e1c07e917..63b47b710 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -37,7 +37,7 @@ sub get_metrics_mapping { 'min' => '0', 'max' => '' }, - 'StorageSyncSyncSessionPerItemErrorsCount' => { + 'storagesyncsyncsessionperitemerrorscount' => { 'output' => 'Item errors', 'label' => 'item-errors', 'nlabel' => 'storage.storagesync.item.errors', From 45102dd726c2babb966b97b5d9fd8cf6bab2ae6e Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:41 +0200 Subject: [PATCH 07/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index 63b47b710..f8631bd7f 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -29,7 +29,7 @@ sub get_metrics_mapping { my ($self, %options) = @_; my $metrics_mapping = { - 'StorageSyncSyncSessionAppliedFilesCount' => { + 'storagesyncsyncsessionappliedfilescount' => { 'output' => 'Files Synced', 'label' => 'files-synced', 'nlabel' => 'storagesync.files.synced.count', From 71ec2c1d16e7555c96f5988f103fdc8ffe5f48a4 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:49 +0200 Subject: [PATCH 08/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 0349253bb..04049316c 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -32,7 +32,7 @@ sub get_metrics_mapping { 'storagesyncserverheartbeat' => { 'output' => 'Heartbeat', 'label' => 'heartbeat', - 'nlabel' => 'storage.storagesync.heartbeat', + 'nlabel' => 'storagesync.heartbeat.count', 'unit' => '', 'min' => '0', 'max' => '' From 1b872e07043152bd7c542e1ec7d3f966c3f1a1fd Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:53:55 +0200 Subject: [PATCH 09/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 04049316c..9dcb9513b 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -132,10 +132,9 @@ Set resource group (Required if resource's name is used). Warning threshold. -=item B<--critical-*> +=item B<--critical-heartbeat> -Critical threshold where '*' can be: -'heartbeat'. +Critical threshold. =back From 6f27c2e2e909d084b06f34c4c76db317454a6ae6 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:01 +0200 Subject: [PATCH 10/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index f8631bd7f..fa483fd21 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -40,7 +40,7 @@ sub get_metrics_mapping { 'storagesyncsyncsessionperitemerrorscount' => { 'output' => 'Item errors', 'label' => 'item-errors', - 'nlabel' => 'storage.storagesync.item.errors', + 'nlabel' => 'storagesync.item.errors.count', 'unit' => '', 'min' => '0', 'max' => '' From ac0995a3eef28c450830b3e021d4535c45569718 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:08 +0200 Subject: [PATCH 11/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 9dcb9513b..8b2279a02 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -116,7 +116,7 @@ perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --m --resource='/subscriptions//resourceGroups//providers/microsoft.storagesync/storageSyncServices/' --aggregation='maximum' --critical-heartbeat='1:' -Default aggregation: 'maximum' / 'minimum', 'maximum' and 'total' are valid. +Default aggregation: 'maximum' / 'minimum', 'average' and 'total' are valid. =over 8 From 97a75bf460d71e429215ba6f36f616ef82a124ed Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:18 +0200 Subject: [PATCH 12/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index fa483fd21..5866f6170 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -44,7 +44,15 @@ sub get_metrics_mapping { 'unit' => '', 'min' => '0', 'max' => '' - } + }, + 'storagesyncbatchtransferredfilebytes' => { + 'output' => 'Bytes synced', + 'label' => 'bytes-synced', + 'nlabel' => 'storage.storagesync.bytes.synced.bytes', + 'unit' => 'B', + 'min' => '0', + 'max' => '' + } }; return $metrics_mapping; From 440875b70f214fbcec26735f637bb08698695ddc Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:25 +0200 Subject: [PATCH 13/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index 5866f6170..bbc2c4a4f 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -147,7 +147,7 @@ Set resource group (Required if resource's name is used). =item B<--warning-*> Warning threshold where '*' can be: -'item-errors', 'files-synced'. +'item-errors', 'files-synced', 'bytes-synced'. =item B<--critical-*> From 787c1aec67a47e2c1fc8d287b89b246ac75d5724 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:32 +0200 Subject: [PATCH 14/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index bbc2c4a4f..df06510dc 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -152,7 +152,7 @@ Warning threshold where '*' can be: =item B<--critical-*> Critical threshold where '*' can be: -'item-errors', 'files-synced'. +'item-errors', 'files-synced', 'bytes-synced'. =back From 248ac60289cec01bbea36a646260f191806c1a62 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:40 +0200 Subject: [PATCH 15/22] Update cloud/azure/storage/storagesync/plugin.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/plugin.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/azure/storage/storagesync/plugin.pm b/cloud/azure/storage/storagesync/plugin.pm index 494f03709..c756c98b8 100644 --- a/cloud/azure/storage/storagesync/plugin.pm +++ b/cloud/azure/storage/storagesync/plugin.pm @@ -31,9 +31,9 @@ sub new { $self->{version} = '0.1'; $self->{modes} = { - 'discovery' => 'cloud::azure::storage::storagesync::mode::discovery', - 'heartbeat' => 'cloud::azure::storage::storagesync::mode::heartbeat', - 'sessions' => 'cloud::azure::storage::storagesync::mode::sessions' + 'discovery' => 'cloud::azure::storage::storagesync::mode::discovery', + 'files-synced' => 'cloud::azure::storage::storagesync::mode::filessync', + 'server-status' => 'cloud::azure::storage::storagesync::mode::serverstatus' }; $self->{custom_modes}->{azcli} = 'cloud::azure::custom::azcli'; From 657c1afcfce6138abc6887a61431cc2de4425be1 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:48 +0200 Subject: [PATCH 16/22] Update cloud/azure/storage/storagesync/mode/sessions.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/sessions.pm index df06510dc..75dc6a7c7 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/sessions.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package cloud::azure::storage::storagesync::mode::sessions; +package cloud::azure::storage::storagesync::mode::filessync; use base qw(cloud::azure::custom::mode); From 343e0915e6fee99464e45ddff64b74362457539f Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:54:55 +0200 Subject: [PATCH 17/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 8b2279a02..01038dff9 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package cloud::azure::storage::storagesync::mode::heartbeat; +package cloud::azure::storage::storagesync::mode::serverstatus; use base qw(cloud::azure::custom::mode); From 8529866f7ee7d8ccb1efac886cc870eea761db42 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:55:03 +0200 Subject: [PATCH 18/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index 01038dff9..d3c9f970d 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -106,9 +106,9 @@ Example: Using resource name : -perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=heartbeat --custommode=api +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=server-status --custommode=api --resource= --resource-group= --aggregation='maximum' ---critical-heartbeat='1:' +--critical-heartbeat='1:1' Using resource id : From 9574d8a49cc3623ae40f61b4386d801ed66beb15 Mon Sep 17 00:00:00 2001 From: matoy Date: Tue, 8 Jun 2021 19:55:13 +0200 Subject: [PATCH 19/22] Update cloud/azure/storage/storagesync/mode/heartbeat.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/storage/storagesync/mode/heartbeat.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/heartbeat.pm index d3c9f970d..5c4a01eb9 100644 --- a/cloud/azure/storage/storagesync/mode/heartbeat.pm +++ b/cloud/azure/storage/storagesync/mode/heartbeat.pm @@ -112,9 +112,9 @@ perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --m Using resource id : -perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=heartbeat --custommode=api +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=server-status --custommode=api --resource='/subscriptions//resourceGroups//providers/microsoft.storagesync/storageSyncServices/' ---aggregation='maximum' --critical-heartbeat='1:' +--aggregation='maximum' --critical-heartbeat='1:1' Default aggregation: 'maximum' / 'minimum', 'average' and 'total' are valid. From c5528721618e4a5d9fbb239758ea4506e0139f62 Mon Sep 17 00:00:00 2001 From: itoussies Date: Wed, 9 Jun 2021 14:21:51 +0200 Subject: [PATCH 20/22] Add modes health & recalls --- .../mode/{sessions.pm => filessync.pm} | 2 +- .../azure/storage/storagesync/mode/health.pm | 78 ++++++++ .../storage/storagesync/mode/recallls.pm | 177 ++++++++++++++++++ .../mode/{heartbeat.pm => serverstatus.pm} | 0 cloud/azure/storage/storagesync/plugin.pm | 2 + 5 files changed, 258 insertions(+), 1 deletion(-) rename cloud/azure/storage/storagesync/mode/{sessions.pm => filessync.pm} (98%) create mode 100644 cloud/azure/storage/storagesync/mode/health.pm create mode 100644 cloud/azure/storage/storagesync/mode/recallls.pm rename cloud/azure/storage/storagesync/mode/{heartbeat.pm => serverstatus.pm} (100%) diff --git a/cloud/azure/storage/storagesync/mode/sessions.pm b/cloud/azure/storage/storagesync/mode/filessync.pm similarity index 98% rename from cloud/azure/storage/storagesync/mode/sessions.pm rename to cloud/azure/storage/storagesync/mode/filessync.pm index 75dc6a7c7..08186231b 100644 --- a/cloud/azure/storage/storagesync/mode/sessions.pm +++ b/cloud/azure/storage/storagesync/mode/filessync.pm @@ -48,7 +48,7 @@ sub get_metrics_mapping { 'storagesyncbatchtransferredfilebytes' => { 'output' => 'Bytes synced', 'label' => 'bytes-synced', - 'nlabel' => 'storage.storagesync.bytes.synced.bytes', + 'nlabel' => 'storagesync.bytes.synced.bytes', 'unit' => 'B', 'min' => '0', 'max' => '' diff --git a/cloud/azure/storage/storagesync/mode/health.pm b/cloud/azure/storage/storagesync/mode/health.pm new file mode 100644 index 000000000..38040976c --- /dev/null +++ b/cloud/azure/storage/storagesync/mode/health.pm @@ -0,0 +1,78 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::mode::health; + +use base qw(cloud::azure::management::monitor::mode::health); + +use strict; +use warnings; + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->{az_resource_type} = 'storageSyncServices'; + $self->{az_resource_namespace} = 'microsoft.storagesync'; +} + +1; + +__END__ + +=head1 MODE + +Check Azure Storage Sync status. + +(Usefull to determine host status) + +=over 8 + +=item B<--resource> + +Set resource name or id (Required). + +=item B<--resource-group> + +Set resource group (Required if resource's name is used). + +=item B<--warning-status> + +Set warning threshold for status (Default: ''). +Can used special variables like: %{status}, %{summary} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). +Can used special variables like: %{status}, %{summary} + +=item B<--unknown-status> + +Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). +Can used special variables like: %{status}, %{summary} + +=item B<--ok-status> + +Set ok threshold for status (Default: '%{status} =~ /^Available$/'). +Can used special variables like: %{status}, %{summary} + +=back + +=cut diff --git a/cloud/azure/storage/storagesync/mode/recallls.pm b/cloud/azure/storage/storagesync/mode/recallls.pm new file mode 100644 index 000000000..8ebab8932 --- /dev/null +++ b/cloud/azure/storage/storagesync/mode/recallls.pm @@ -0,0 +1,177 @@ +# +# Copyright 2021 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::azure::storage::storagesync::mode::recalls; + +use base qw(cloud::azure::custom::mode); + +use strict; +use warnings; + +sub get_metrics_mapping { + my ($self, %options) = @_; + + my $metrics_mapping = { + 'storagesyncrecallcomputedsuccessrate' => { + 'output' => 'Cloud tiering recall success rate', + 'label' => 'successful-recalls', + 'nlabel' => 'storagesync.recalls.succesful.percentage', + 'unit' => '%', + 'min' => '0', + 'max' => '100' + }, + 'storagesyncrecallednetworkbytesbyapplication' => { + 'output' => 'Cloud tiering recall size by application', + 'label' => 'application-recalls-size', + 'nlabel' => 'storagesync.recalls.application.size.bytes', + 'unit' => 'B', + 'min' => '0', + 'max' => '' + }, + 'storagesyncrecalledtotalnetworkbytes' => { + 'output' => 'Cloud tiering recall size', + 'label' => 'recalls-size', + 'nlabel' => 'storagesync.recalls.size.bytes', + 'unit' => 'B', + 'min' => '0', + 'max' => '' + }, + 'storagesyncrecalliototalsizebytes' => { + 'output' => 'Cloud tiering recall', + 'label' => 'total-recalls-size', + 'nlabel' => 'storagesync.recalls.total.size.bytes', + 'unit' => 'B', + 'min' => '0', + 'max' => '' + }, + 'storagesyncrecallthroughputbytespersecond' => { + 'output' => 'Cloud tiering recall throughput', + 'label' => 'throughput-recalls-size', + 'nlabel' => 'storagesync.recalls.throughput.size.bytespersecond', + 'unit' => 'B/s', + 'min' => '0', + 'max' => '' + } + }; + + return $metrics_mapping; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'filter-metric:s' => { name => 'filter_metric' }, + 'resource:s' => { name => 'resource' }, + 'resource-group:s' => { name => 'resource_group' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + if (!defined($self->{option_results}->{resource}) || $self->{option_results}->{resource} eq '') { + $self->{output}->add_option_msg(short_msg => 'Need to specify either --resource with --resource-group option or --resource .'); + $self->{output}->option_exit(); + } + my $resource = $self->{option_results}->{resource}; + my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : ''; + if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.Cache\/Redis\/(.*)$/) { + $resource_group = $1; + $resource = $2; + } + + $self->{az_resource} = $resource; + $self->{az_resource_group} = $resource_group; + $self->{az_resource_type} = 'storageSyncServices'; + $self->{az_resource_namespace} = 'microsoft.storagesync'; + $self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900; + $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT5M'; + $self->{az_aggregations} = ['Total']; + if (defined($self->{option_results}->{aggregation})) { + $self->{az_aggregations} = []; + foreach my $stat (@{$self->{option_results}->{aggregation}}) { + if ($stat ne '') { + push @{$self->{az_aggregations}}, ucfirst(lc($stat)); + } + } + } + + foreach my $metric (keys %{$self->{metrics_mapping}}) { + next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' + && $metric !~ /$self->{option_results}->{filter_metric}/); + push @{$self->{az_metrics}}, $metric; + } +} + +1; + +__END__ + +=head1 MODE + +Check Azure Storage Sync Service Files data recalls statistics. + +Example: + +Using resource name : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=recalls --custommode=api +--resource= --resource-group= --aggregation='total' +--warning-recalls-size='15' --critical-recalls-size='20' + +Using resource id : + +perl centreon_plugins.pl --plugin=cloud::azure::storage::storagesync::plugin --mode=recalls --custommode=api +--resource='/subscriptions//resourceGroups//providers/microsoft.storagesync/storageSyncServices/' +--aggregation='total' --warning-recalls-size='15' --critical-recalls-size='20' + +Default aggregation: 'total' / 'minimum', 'maximum' and 'average' are valid. + +=over 8 + +=item B<--resource> + +Set resource name or id (Required). + +=item B<--resource-group> + +Set resource group (Required if resource's name is used). + +=item B<--warning-*> + +Warning threshold where '*' can be: +'successful-recalls', 'application-recalls-size', +'recalls-size', 'total-recalls-size', 'throughput-recalls-size'. + +=item B<--critical-*> + +Critical threshold where '*' can be: +'successful-recalls', 'application-recalls-size', 'recalls-size', +'total-recalls-size', 'throughput-recalls-size'. + +=back + +=cut diff --git a/cloud/azure/storage/storagesync/mode/heartbeat.pm b/cloud/azure/storage/storagesync/mode/serverstatus.pm similarity index 100% rename from cloud/azure/storage/storagesync/mode/heartbeat.pm rename to cloud/azure/storage/storagesync/mode/serverstatus.pm diff --git a/cloud/azure/storage/storagesync/plugin.pm b/cloud/azure/storage/storagesync/plugin.pm index c756c98b8..a1949e9e3 100644 --- a/cloud/azure/storage/storagesync/plugin.pm +++ b/cloud/azure/storage/storagesync/plugin.pm @@ -33,6 +33,8 @@ sub new { $self->{modes} = { 'discovery' => 'cloud::azure::storage::storagesync::mode::discovery', 'files-synced' => 'cloud::azure::storage::storagesync::mode::filessync', + 'health' => 'cloud::azure::storage::storagesync::mode::health', + 'recalls' => 'cloud::azure::storage::storagesync::mode::recalls', 'server-status' => 'cloud::azure::storage::storagesync::mode::serverstatus' }; From 7ec26d085e379558a2b6a80f9db6a92ed3ce65f7 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Thu, 10 Jun 2021 19:38:47 +0200 Subject: [PATCH 21/22] Delete health.pm --- .../azure/storage/storagesync/mode/health.pm | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 cloud/azure/storage/storagesync/mode/health.pm diff --git a/cloud/azure/storage/storagesync/mode/health.pm b/cloud/azure/storage/storagesync/mode/health.pm deleted file mode 100644 index 38040976c..000000000 --- a/cloud/azure/storage/storagesync/mode/health.pm +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright 2021 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::azure::storage::storagesync::mode::health; - -use base qw(cloud::azure::management::monitor::mode::health); - -use strict; -use warnings; - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); - - $self->{az_resource_type} = 'storageSyncServices'; - $self->{az_resource_namespace} = 'microsoft.storagesync'; -} - -1; - -__END__ - -=head1 MODE - -Check Azure Storage Sync status. - -(Usefull to determine host status) - -=over 8 - -=item B<--resource> - -Set resource name or id (Required). - -=item B<--resource-group> - -Set resource group (Required if resource's name is used). - -=item B<--warning-status> - -Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} - -=item B<--critical-status> - -Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} - -=item B<--unknown-status> - -Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} - -=item B<--ok-status> - -Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} - -=back - -=cut From 31f7f58e129191ea93e5c55916a676c60aec2361 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Thu, 10 Jun 2021 19:39:38 +0200 Subject: [PATCH 22/22] Update plugin.pm --- cloud/azure/storage/storagesync/plugin.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/cloud/azure/storage/storagesync/plugin.pm b/cloud/azure/storage/storagesync/plugin.pm index a1949e9e3..54559e49a 100644 --- a/cloud/azure/storage/storagesync/plugin.pm +++ b/cloud/azure/storage/storagesync/plugin.pm @@ -33,7 +33,6 @@ sub new { $self->{modes} = { 'discovery' => 'cloud::azure::storage::storagesync::mode::discovery', 'files-synced' => 'cloud::azure::storage::storagesync::mode::filessync', - 'health' => 'cloud::azure::storage::storagesync::mode::health', 'recalls' => 'cloud::azure::storage::storagesync::mode::recalls', 'server-status' => 'cloud::azure::storage::storagesync::mode::serverstatus' };