(plugin) check kubernetes cluster through azure API (#3351)

* add plugin to check kubernetes cluster through azure API

* ordering modes alphabeticaly in plugin.pm file, allocatableresources now contains CPU cores and memory

* removing loop to define custom aggregation type
This commit is contained in:
lchrdn 2021-12-30 16:02:03 +01:00 committed by GitHub
parent d474dd2ca4
commit 756d6dfa37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 823 additions and 0 deletions

View File

@ -0,0 +1,150 @@
#
# 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::compute::aks::mode::allocatableresources;
use base qw(cloud::azure::custom::mode);
use strict;
use warnings;
sub get_metrics_mapping {
my ($self, %options) = @_;
my $metrics_mapping = {
'kube_node_status_allocatable_cpu_cores' => {
'output' => 'Allocatable CPU Cores',
'label' => 'allocatable-cpu-cores',
'nlabel' => 'aks.node.allocatable.cpu.cores',
'unit' => '',
'min' => '0',
},
'kube_node_status_allocatable_memory_bytes' => {
'output' => 'Allocatable Memory Bytes',
'label' => 'allocatable-memory-bytes',
'nlabel' => 'aks.node.allocatable.memory.bytes',
'unit' => 'B',
'min' => '0',
}
};
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 <name> with --resource-group option or --resource <id>.');
$self->{output}->option_exit();
}
my $resource = $self->{option_results}->{resource};
my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : '';
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ContainerService\/managedClusters\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
$self->{az_resource} = $resource;
$self->{az_resource_group} = $resource_group;
$self->{az_resource_type} = 'managedClusters';
$self->{az_resource_namespace} = 'Microsoft.ContainerService';
$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} = ['Average'];
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 remaining Azure Kubernetes Cluster Allocatable Memory in Bytes.
Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=allocatablememory --custommode=api
--resource=<cluster_id> --resource-group=<resourcegroup_id> --warning-allocatable-memory-bytes=16GB: --critical-allocatable-memory-bytes=8GB:
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=allocatablememory --custommode=api
--resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ContainerService/managedClusters/<cluster_id>'
--warning-allocatable-memory-bytes=16GB: --critical-allocatable-memory-bytes=8GB:
=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-allocatable-memory-bytes>
Set warning threshold for remaining allocatable memory in bytes.
It is a range, set 16GB: to get WARNING if there are less than 16GB allocatable left.
=item B<--critical-allocatable-memory-bytes>
Set critical threshold for remaining allocatable memory in bytes.
It is a range, set 8GB: to get CRITICAL if there are less than 8GB allocatable left.
=item B<--warning-allocatable-cpu-cores>
Set warning threshold for number of remaining allocatable CPU Cores.
It is a range, set 10: to get WARNING if there are less than 10 CPU cores allocatable remaining.
=item B<--critical-allocatable-cpu-cores>
Set critical threshold for number of remaining allocatable CPU Cores.
It is a range, set 5: to get CRITICAL if there are less than 5 CPU cores allocatable remaining.
=back
=cut

View File

@ -0,0 +1,133 @@
#
# 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::compute::aks::mode::cpu;
use base qw(cloud::azure::custom::mode);
use strict;
use warnings;
sub get_metrics_mapping {
my ($self, %options) = @_;
my $metrics_mapping = {
'node_cpu_usage_percentage' => {
'output' => 'CPU percent',
'label' => 'cpu-usage',
'nlabel' => 'aks.node.cpu.utilization.percentage',
'unit' => '%',
'min' => '0',
'max' => '100'
}
};
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 <name> with --resource-group option or --resource <id>.');
$self->{output}->option_exit();
}
my $resource = $self->{option_results}->{resource};
my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : '';
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ContainerService\/managedClusters\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
$self->{az_resource} = $resource;
$self->{az_resource_group} = $resource_group;
$self->{az_resource_type} = 'managedClusters';
$self->{az_resource_namespace} = 'Microsoft.ContainerService';
$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} = ['Average'];
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 Kubernetes Cluster CPU usage in percentage.
Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=cpu --custommode=api
--resource=<cluster_id> --resource-group=<resourcegroup_id> --warning-cpu-usage='80' --critical-cpu-usage='90'
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=cpu --custommode=api
--resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ContainerService/managedClusters/<cluster_id>'
--warning-cpu-usage='80' --critical-cpu-usage='90'
=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-cpu-usage>
Set warning threshold for CPU utilization percentage.
=item B<--critical-cpu-usage>
Set critical threshold for CPU utilization percentage.
=back
=cut

View File

@ -0,0 +1,56 @@
#
# 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::compute::aks::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.ContainerService';
$self->{type} = 'managedClusters';
}
1;
__END__
=head1 MODE
Managed Cluster Discovery.
=over 8
=item B<--location>
Specify resources location.
=item B<--prettify>
Prettify JSON output.
=back
=cut

View File

@ -0,0 +1,147 @@
#
# 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::compute::aks::mode::storage;
use base qw(cloud::azure::custom::mode);
use strict;
use warnings;
sub get_metrics_mapping {
my ($self, %options) = @_;
my $metrics_mapping = {
'node_disk_usage_bytes' => {
'output' => 'Storage Used',
'label' => 'storage-used',
'nlabel' => 'aks.node.disk.usage.bytes',
'unit' => 'B',
'min' => '0'
},
'node_disk_usage_percentage' => {
'output' => 'Storage Percent',
'label' => 'storage-percent',
'nlabel' => 'aks.node.disk.usage.percentage',
'unit' => '%',
'min' => '0'
}
};
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 <name> with --resource-group option or --resource <id>.');
$self->{output}->option_exit();
}
my $resource = $self->{option_results}->{resource};
my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : '';
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ContainerService\/managedClusters\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
$self->{az_resource} = $resource;
$self->{az_resource_group} = $resource_group;
$self->{az_resource_type} = 'managedClusters';
$self->{az_resource_namespace} = 'Microsoft.ContainerService';
$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} = ['Average'];
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 Storage usage on Azure Kubernetes Cluster.
Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=storage --custommode=api
--resource=<cluster_id> --resource-group=<resourcegroup_id> --warning-storage-percent='90' --critical-storage-percent='95'
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=storage --custommode=api
--resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ContainerService/managedClusters/<cluster_id>'
--warning-storage-percent='90' --critical-storage-percent='95'
=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-storage-used>
Warning threshold in Bytes.
=item B<--critical-storage-used>
Critical threshold in Bytes.
=item B<--warning-storage-percent>
Warning threshold in percent.
=item B<--critical-storage-percent>
Critical threshold in percent.
=back
=cut

View File

@ -0,0 +1,140 @@
#
# 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::compute::aks::mode::traffic;
use base qw(cloud::azure::custom::mode);
use strict;
use warnings;
sub get_metrics_mapping {
my ($self, %options) = @_;
my $metrics_mapping = {
'node_network_out_bytes' => {
'output' => 'Network Out',
'label' => 'traffic-out',
'nlabel' => 'aks.node.traffic.out.bytes',
'unit' => 'B',
'min' => '0',
},
'node_network_in_bytes' => {
'output' => 'Network In',
'label' => 'traffic-in',
'nlabel' => 'aks.node.traffic.in.bytes',
'unit' => 'B',
'min' => '0',
}
};
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 <name> with --resource-group option or --resource <id>.');
$self->{output}->option_exit();
}
my $resource = $self->{option_results}->{resource};
my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : '';
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ContainerService\/managedClusters\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
$self->{az_resource} = $resource;
$self->{az_resource_group} = $resource_group;
$self->{az_resource_type} = 'managedClusters';
$self->{az_resource_namespace} = 'Microsoft.ContainerService';
$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} = ['Average'];
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 Kubernetes Cluster network traffic usage in Bytes.
Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=traffic --custommode=api
--resource=<cluster_id> --resource-group=<resourcegroup_id> --warning-traffic-out=10000 --critical-traffic-in=15000
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=traffic --custommode=api
--resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ContainerService/managedClusters/<cluster_id>'
--warning-traffic-out=10000 --critical-traffic-in=15000
=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: 'traffic-out', 'traffic-in'.
=item B<--critical-*>
Critical threshold where '*' can be: 'traffic-out', 'traffic-in'.
=back
=cut

View File

@ -0,0 +1,132 @@
#
# 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::compute::aks::mode::unneedednodes;
use base qw(cloud::azure::custom::mode);
use strict;
use warnings;
sub get_metrics_mapping {
my ($self, %options) = @_;
my $metrics_mapping = {
'cluster_autoscaler_unneeded_nodes_count' => {
'output' => 'Cluster Autoscaler Unneeded Nodes',
'label' => 'unneeded-nodes',
'nlabel' => 'aks.cluster.autoscaler.unneeded.nodes',
'unit' => '',
'min' => '0',
}
};
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 <name> with --resource-group option or --resource <id>.');
$self->{output}->option_exit();
}
my $resource = $self->{option_results}->{resource};
my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : '';
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ContainerService\/managedClusters\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
$self->{az_resource} = $resource;
$self->{az_resource_group} = $resource_group;
$self->{az_resource_type} = 'managedClusters';
$self->{az_resource_namespace} = 'Microsoft.ContainerService';
$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} = ['Average'];
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 Kubernetes Cluster Autoscaler unneeded nodes.
Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=unneedednodes --custommode=api
--resource=<cluster_id> --resource-group=<resourcegroup_id> --zeroed --warning-unneeded-nodes=5 --critical-unneeded-nodes=10
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::compute::aks::plugin --mode=unneedednodes --custommode=api
--resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ContainerService/managedClusters/<cluster_id>'
--zeroed --warning-unneeded-nodes=5 --critical-unneeded-nodes=10
=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-unneeded-nodes>
Set warning threshold for number of unneeded nodes.
=item B<--critical-unneeded-nodes>
Set critical threshold for number of unneeded nodes.
=back
=cut

View File

@ -0,0 +1,65 @@
#
# 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::compute::aks::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} } = (
'allocatableresources' => 'cloud::azure::compute::aks::mode::allocatableresources',
'cpu' => 'cloud::azure::compute::aks::mode::cpu',
'discovery' => 'cloud::azure::compute::aks::mode::discovery',
'storage' => 'cloud::azure::compute::aks::mode::storage',
'traffic' => 'cloud::azure::compute::aks::mode::traffic',
'unneedednodes' => 'cloud::azure::compute::aks::mode::unneedednodes'
);
$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 Kubernetes Service.
=cut