From a36a6648880e46e3ef4be5f97a65a12cc5ac78f9 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:27:02 +0200 Subject: [PATCH 01/10] Update connections.pm fix ; $metric_type (servers, flexibleServers) don't exist in $metrics_mapping hash (active_connections, connections_failed) same bug in several modes of this plugin. --- centreon-plugins/cloud/azure/database/mysql/mode/connections.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm index 48d0e6a28..66e341d5e 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm @@ -123,7 +123,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From d0e87b5277c4b1860e32b7f52bf3f17ec370ce24 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:30:20 +0200 Subject: [PATCH 02/10] Update replication.pm --- centreon-plugins/cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm index ea1c89602..7a56d4ad6 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 6b84926568efb904c229128e18feaef30efb1a68 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:30:55 +0200 Subject: [PATCH 03/10] Update storage.pm --- centreon-plugins/cloud/azure/database/mysql/mode/storage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm index adf639d37..b919e41aa 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm @@ -146,7 +146,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 1f20357f07679c5fd95950d3bd4739b738d0293d Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:47:38 +0200 Subject: [PATCH 04/10] Update replication.pm --- centreon-plugins/cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm index 7a56d4ad6..00c7328b9 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 5d2a2705a9b7b5bb9c2c621c2156f89d70a252f3 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:47:57 +0200 Subject: [PATCH 05/10] Update connections.pm --- centreon-plugins/cloud/azure/database/mysql/mode/connections.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm index 66e341d5e..3e6d3cfe3 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm @@ -123,7 +123,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From c1b3aa74c9deb309c83aabcfc3fa10e5006c3202 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:54:33 +0200 Subject: [PATCH 06/10] Update storage.pm --- centreon-plugins/cloud/azure/database/mysql/mode/storage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm index b919e41aa..c8e323642 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm @@ -126,7 +126,7 @@ sub check_options { $self->{az_resource_type} = $resource_type; $self->{az_resource_namespace} = 'Microsoft.DBforMySQL'; $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_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT15M'; $self->{az_aggregations} = ['Maximum']; if (defined($self->{option_results}->{aggregation})) { $self->{az_aggregations} = []; @@ -146,7 +146,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From af007e438c440e86ceb4aa2aec2cefda486effc7 Mon Sep 17 00:00:00 2001 From: matoy Date: Wed, 19 May 2021 15:08:27 +0200 Subject: [PATCH 07/10] Update cloud/azure/database/mysql/mode/storage.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- centreon-plugins/cloud/azure/database/mysql/mode/storage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm index c8e323642..8596b89fc 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/storage.pm @@ -146,10 +146,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { 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; From 951576e59427853e3ce285fa1f51b50e01bfdb50 Mon Sep 17 00:00:00 2001 From: matoy Date: Wed, 19 May 2021 15:08:40 +0200 Subject: [PATCH 08/10] Update cloud/azure/database/mysql/mode/replication.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- .../cloud/azure/database/mysql/mode/replication.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm index 00c7328b9..99497d770 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm @@ -109,10 +109,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + ${metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { 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; From ca8c7150044baf044333c9776dacfbd5aa87b1f8 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Wed, 19 May 2021 15:58:25 +0200 Subject: [PATCH 09/10] Update connections.pm --- .../cloud/azure/database/mysql/mode/connections.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm index 3e6d3cfe3..ed7fed9a0 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/connections.pm @@ -123,10 +123,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { 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; From dfcb0ebc74c689644350c69fe18760d580f3d5a4 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Wed, 19 May 2021 16:00:56 +0200 Subject: [PATCH 10/10] Update replication.pm --- centreon-plugins/cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm index 99497d770..24bade192 100644 --- a/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm +++ b/centreon-plugins/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - ${metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$metrics_mapping_transformed}) {