From 56fd9d25277e2523f731f62364f79fb9635bb6d2 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Tue, 1 Oct 2019 14:38:15 +0200 Subject: [PATCH] add a discovery mode per azure services --- .../compute/virtualmachine/mode/discovery.pm | 60 +++++++++++++++++++ .../azure/compute/virtualmachine/plugin.pm | 20 +++---- .../azure/database/sqldatabase/plugin.pm | 13 ++-- .../database/sqlserver/mode/discovery.pm | 60 +++++++++++++++++++ .../cloud/azure/database/sqlserver/plugin.pm | 12 ++-- .../management/monitor/mode/discovery.pm | 13 ++-- .../management/recovery/mode/discovery.pm | 60 +++++++++++++++++++ .../cloud/azure/management/recovery/plugin.pm | 16 ++--- .../cloud/azure/management/resource/plugin.pm | 15 +++-- .../network/expressroute/mode/discovery.pm | 60 +++++++++++++++++++ .../azure/network/expressroute/plugin.pm | 14 ++--- .../networkinterface/mode/discovery.pm | 60 +++++++++++++++++++ .../azure/network/networkinterface/plugin.pm | 12 ++-- .../network/virtualnetwork/mode/discovery.pm | 60 +++++++++++++++++++ .../azure/network/virtualnetwork/plugin.pm | 8 +-- .../network/vpngateway/mode/discovery.pm | 60 +++++++++++++++++++ .../cloud/azure/network/vpngateway/plugin.pm | 14 ++--- .../storage/storageaccount/mode/discovery.pm | 60 +++++++++++++++++++ .../azure/storage/storageaccount/plugin.pm | 8 +-- 19 files changed, 554 insertions(+), 71 deletions(-) create mode 100644 centreon-plugins/cloud/azure/compute/virtualmachine/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/database/sqlserver/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/management/recovery/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/network/expressroute/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/network/networkinterface/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/network/virtualnetwork/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/network/vpngateway/mode/discovery.pm create mode 100644 centreon-plugins/cloud/azure/storage/storageaccount/mode/discovery.pm diff --git a/centreon-plugins/cloud/azure/compute/virtualmachine/mode/discovery.pm b/centreon-plugins/cloud/azure/compute/virtualmachine/mode/discovery.pm new file mode 100644 index 000000000..52f536fe0 --- /dev/null +++ b/centreon-plugins/cloud/azure/compute/virtualmachine/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::virtualmachine::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.Compute'; + $self->{type} = 'virtualMachines'; +} + +1; + +__END__ + +=head1 MODE + +Virtual Machine discovery. + +=over 8 + +=item B<--resource-group> + +Specify resources resource group. + +=item B<--location> + +Specify resources location. + +=item B<--prettify> + +Prettify JSON output. + +=back + +=cut diff --git a/centreon-plugins/cloud/azure/compute/virtualmachine/plugin.pm b/centreon-plugins/cloud/azure/compute/virtualmachine/plugin.pm index 88ba42fb2..cfd91aaac 100644 --- a/centreon-plugins/cloud/azure/compute/virtualmachine/plugin.pm +++ b/centreon-plugins/cloud/azure/compute/virtualmachine/plugin.pm @@ -31,12 +31,13 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'cpu' => 'cloud::azure::compute::virtualmachine::mode::cpu', - 'diskio' => 'cloud::azure::compute::virtualmachine::mode::diskio', - 'list-resources' => 'cloud::azure::compute::virtualmachine::mode::listresources', - 'network' => 'cloud::azure::compute::virtualmachine::mode::network', - 'vm-sizes' => 'cloud::azure::compute::virtualmachine::mode::vmsizes', - 'vms-state' => 'cloud::azure::compute::virtualmachine::mode::vmsstate', + 'cpu' => 'cloud::azure::compute::virtualmachine::mode::cpu', + 'discovery' => 'cloud::azure::compute::virtualmachine::mode::discovery', + 'diskio' => 'cloud::azure::compute::virtualmachine::mode::diskio', + 'list-resources' => 'cloud::azure::compute::virtualmachine::mode::listresources', + 'network' => 'cloud::azure::compute::virtualmachine::mode::network', + 'vm-sizes' => 'cloud::azure::compute::virtualmachine::mode::vmsizes', + 'vms-state' => 'cloud::azure::compute::virtualmachine::mode::vmsstate', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -47,10 +48,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/database/sqldatabase/plugin.pm b/centreon-plugins/cloud/azure/database/sqldatabase/plugin.pm index f52b74c99..daf489a32 100644 --- a/centreon-plugins/cloud/azure/database/sqldatabase/plugin.pm +++ b/centreon-plugins/cloud/azure/database/sqldatabase/plugin.pm @@ -31,9 +31,9 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'database-size' => 'cloud::azure::database::sqldatabase::mode::databasesize', - 'database-status' => 'cloud::azure::database::sqldatabase::mode::databasestatus', - 'list-databases' => 'cloud::azure::database::sqldatabase::mode::listdatabases', + 'database-size' => 'cloud::azure::database::sqldatabase::mode::databasesize', + 'database-status' => 'cloud::azure::database::sqldatabase::mode::databasestatus', + 'list-databases' => 'cloud::azure::database::sqldatabase::mode::listdatabases', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -44,10 +44,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-06-01-preview' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-06-01-preview' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/database/sqlserver/mode/discovery.pm b/centreon-plugins/cloud/azure/database/sqlserver/mode/discovery.pm new file mode 100644 index 000000000..5177688dd --- /dev/null +++ b/centreon-plugins/cloud/azure/database/sqlserver/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::database::sqlserver::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.Sql'; + $self->{type} = 'servers'; +} + +1; + +__END__ + +=head1 MODE + +SQL Server 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/centreon-plugins/cloud/azure/database/sqlserver/plugin.pm b/centreon-plugins/cloud/azure/database/sqlserver/plugin.pm index 8d744f8ec..872443f04 100644 --- a/centreon-plugins/cloud/azure/database/sqlserver/plugin.pm +++ b/centreon-plugins/cloud/azure/database/sqlserver/plugin.pm @@ -31,8 +31,9 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'server-status' => 'cloud::azure::database::sqlserver::mode::serverstatus', - 'list-servers' => 'cloud::azure::database::sqlserver::mode::listservers', + 'discovery' => 'cloud::azure::database::sqlserver::mode::discovery', + 'server-status' => 'cloud::azure::database::sqlserver::mode::serverstatus', + 'list-servers' => 'cloud::azure::database::sqlserver::mode::listservers', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -43,10 +44,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-06-01-preview' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-06-01-preview' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/management/monitor/mode/discovery.pm b/centreon-plugins/cloud/azure/management/monitor/mode/discovery.pm index fb2106a81..1f363641a 100644 --- a/centreon-plugins/cloud/azure/management/monitor/mode/discovery.pm +++ b/centreon-plugins/cloud/azure/management/monitor/mode/discovery.pm @@ -45,6 +45,11 @@ sub new { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + + $self->{namespace} = $self->{option_results}->{namespace}; + $self->{type} = $self->{option_results}->{type}; + $self->{location} = $self->{option_results}->{location}; + $self->{resource_group} = $self->{option_results}->{resource_group}; } sub run { @@ -56,10 +61,10 @@ sub run { $disco_stats->{start_time} = time(); my $resources = $options{custom}->azure_list_resources( - namespace => $self->{option_results}->{namespace}, - resource_type => $self->{option_results}->{type}, - location => $self->{option_results}->{location}, - resource_group => $self->{option_results}->{resource_group} + namespace => $self->{namespace}, + resource_type => $self->{type}, + location => $self->{location}, + resource_group => $self->{resource_group} ); $disco_stats->{end_time} = time(); diff --git a/centreon-plugins/cloud/azure/management/recovery/mode/discovery.pm b/centreon-plugins/cloud/azure/management/recovery/mode/discovery.pm new file mode 100644 index 000000000..115aa0d30 --- /dev/null +++ b/centreon-plugins/cloud/azure/management/recovery/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::management::recovery::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.RecoveryServices'; + $self->{type} = 'vaults'; +} + +1; + +__END__ + +=head1 MODE + +Vault 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/centreon-plugins/cloud/azure/management/recovery/plugin.pm b/centreon-plugins/cloud/azure/management/recovery/plugin.pm index f5a2c443b..d29c208b3 100644 --- a/centreon-plugins/cloud/azure/management/recovery/plugin.pm +++ b/centreon-plugins/cloud/azure/management/recovery/plugin.pm @@ -31,10 +31,11 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'backup-items-status' => 'cloud::azure::management::recovery::mode::backupitemsstatus', - 'backup-jobs-status' => 'cloud::azure::management::recovery::mode::backupjobsstatus', - 'list-backup-jobs' => 'cloud::azure::management::recovery::mode::listbackupjobs', - 'list-vaults' => 'cloud::azure::management::recovery::mode::listvaults', + 'backup-items-status' => 'cloud::azure::management::recovery::mode::backupitemsstatus', + 'backup-jobs-status' => 'cloud::azure::management::recovery::mode::backupjobsstatus', + 'discovery' => 'cloud::azure::management::recovery::mode::discovery', + 'list-backup-jobs' => 'cloud::azure::management::recovery::mode::listbackupjobs', + 'list-vaults' => 'cloud::azure::management::recovery::mode::listvaults', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -45,10 +46,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-07-10' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-07-10' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/management/resource/plugin.pm b/centreon-plugins/cloud/azure/management/resource/plugin.pm index 1c1e11fc1..18a8fae25 100644 --- a/centreon-plugins/cloud/azure/management/resource/plugin.pm +++ b/centreon-plugins/cloud/azure/management/resource/plugin.pm @@ -31,10 +31,10 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'deployments-status' => 'cloud::azure::management::resource::mode::deploymentsstatus', - 'list-groups' => 'cloud::azure::management::resource::mode::listgroups', - 'list-resources' => 'cloud::azure::management::resource::mode::listresources', - 'items' => 'cloud::azure::management::resource::mode::items', + 'deployments-status' => 'cloud::azure::management::resource::mode::deploymentsstatus', + 'list-groups' => 'cloud::azure::management::resource::mode::listgroups', + 'list-resources' => 'cloud::azure::management::resource::mode::listresources', + 'items' => 'cloud::azure::management::resource::mode::items', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -45,10 +45,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/network/expressroute/mode/discovery.pm b/centreon-plugins/cloud/azure/network/expressroute/mode/discovery.pm new file mode 100644 index 000000000..359d22b6f --- /dev/null +++ b/centreon-plugins/cloud/azure/network/expressroute/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::network::expressroute::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.Network'; + $self->{type} = 'expressRouteCircuits'; +} + +1; + +__END__ + +=head1 MODE + +Express Route 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/centreon-plugins/cloud/azure/network/expressroute/plugin.pm b/centreon-plugins/cloud/azure/network/expressroute/plugin.pm index 1a7d2f3bd..7da99382f 100644 --- a/centreon-plugins/cloud/azure/network/expressroute/plugin.pm +++ b/centreon-plugins/cloud/azure/network/expressroute/plugin.pm @@ -31,9 +31,10 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'circuit-status' => 'cloud::azure::network::expressroute::mode::circuitstatus', - 'list-circuits' => 'cloud::azure::network::expressroute::mode::listcircuits', - 'traffic' => 'cloud::azure::network::expressroute::mode::traffic', + 'circuit-status' => 'cloud::azure::network::expressroute::mode::circuitstatus', + 'discovery' => 'cloud::azure::network::expressroute::mode::discovery', + 'list-circuits' => 'cloud::azure::network::expressroute::mode::listcircuits', + 'traffic' => 'cloud::azure::network::expressroute::mode::traffic', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -44,10 +45,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/network/networkinterface/mode/discovery.pm b/centreon-plugins/cloud/azure/network/networkinterface/mode/discovery.pm new file mode 100644 index 000000000..06ba56357 --- /dev/null +++ b/centreon-plugins/cloud/azure/network/networkinterface/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::network::networkinterface::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.Network'; + $self->{type} = 'networkInterfaces'; +} + +1; + +__END__ + +=head1 MODE + +Network Interface 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/centreon-plugins/cloud/azure/network/networkinterface/plugin.pm b/centreon-plugins/cloud/azure/network/networkinterface/plugin.pm index 5ff6139b1..9fe312373 100644 --- a/centreon-plugins/cloud/azure/network/networkinterface/plugin.pm +++ b/centreon-plugins/cloud/azure/network/networkinterface/plugin.pm @@ -31,8 +31,9 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'list-resources' => 'cloud::azure::network::networkinterface::mode::listresources', - 'traffic' => 'cloud::azure::network::networkinterface::mode::traffic', + 'discovery' => 'cloud::azure::network::networkinterface::mode::discovery', + 'list-resources' => 'cloud::azure::network::networkinterface::mode::listresources', + 'traffic' => 'cloud::azure::network::networkinterface::mode::traffic', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -43,10 +44,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/network/virtualnetwork/mode/discovery.pm b/centreon-plugins/cloud/azure/network/virtualnetwork/mode/discovery.pm new file mode 100644 index 000000000..fd721e79b --- /dev/null +++ b/centreon-plugins/cloud/azure/network/virtualnetwork/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::network::virtualnetwork::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.Network'; + $self->{type} = 'virtualNetworks'; +} + +1; + +__END__ + +=head1 MODE + +Virtual Network 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/centreon-plugins/cloud/azure/network/virtualnetwork/plugin.pm b/centreon-plugins/cloud/azure/network/virtualnetwork/plugin.pm index 89710f641..ebe87763b 100644 --- a/centreon-plugins/cloud/azure/network/virtualnetwork/plugin.pm +++ b/centreon-plugins/cloud/azure/network/virtualnetwork/plugin.pm @@ -31,6 +31,7 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( + 'discovery' => 'cloud::azure::network::virtualnetwork::mode::discovery', 'list-virtual-networks' => 'cloud::azure::network::virtualnetwork::mode::listvirtualnetworks', 'peerings-status' => 'cloud::azure::network::virtualnetwork::mode::peeringsstatus', ); @@ -43,10 +44,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/network/vpngateway/mode/discovery.pm b/centreon-plugins/cloud/azure/network/vpngateway/mode/discovery.pm new file mode 100644 index 000000000..d21007d7b --- /dev/null +++ b/centreon-plugins/cloud/azure/network/vpngateway/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::network::vpngateway::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.Network'; + $self->{type} = 'virtualNetworkGateways'; +} + +1; + +__END__ + +=head1 MODE + +VPN Gateway 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/centreon-plugins/cloud/azure/network/vpngateway/plugin.pm b/centreon-plugins/cloud/azure/network/vpngateway/plugin.pm index bad6e1082..2b383729e 100644 --- a/centreon-plugins/cloud/azure/network/vpngateway/plugin.pm +++ b/centreon-plugins/cloud/azure/network/vpngateway/plugin.pm @@ -31,9 +31,10 @@ sub new { $self->{version} = '0.1'; %{ $self->{modes} } = ( - 'site-traffic' => 'cloud::azure::network::vpngateway::mode::sitetraffic', - 'tunnel-traffic' => 'cloud::azure::network::vpngateway::mode::tunneltraffic', - 'vpn-gateway-status' => 'cloud::azure::network::vpngateway::mode::vpngatewaystatus', + 'discovery' => 'cloud::azure::network::vpngateway::mode::discovery', + 'site-traffic' => 'cloud::azure::network::vpngateway::mode::sitetraffic', + 'tunnel-traffic' => 'cloud::azure::network::vpngateway::mode::tunneltraffic', + 'vpn-gateway-status' => 'cloud::azure::network::vpngateway::mode::vpngatewaystatus', ); $self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli'; @@ -44,10 +45,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); } diff --git a/centreon-plugins/cloud/azure/storage/storageaccount/mode/discovery.pm b/centreon-plugins/cloud/azure/storage/storageaccount/mode/discovery.pm new file mode 100644 index 000000000..8363eeaa6 --- /dev/null +++ b/centreon-plugins/cloud/azure/storage/storageaccount/mode/discovery.pm @@ -0,0 +1,60 @@ +# +# Copyright 2019 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::storageaccount::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.Storage'; + $self->{type} = 'storageAccounts'; +} + +1; + +__END__ + +=head1 MODE + +Storage Account 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/centreon-plugins/cloud/azure/storage/storageaccount/plugin.pm b/centreon-plugins/cloud/azure/storage/storageaccount/plugin.pm index adb174801..88d08fbe4 100644 --- a/centreon-plugins/cloud/azure/storage/storageaccount/plugin.pm +++ b/centreon-plugins/cloud/azure/storage/storageaccount/plugin.pm @@ -35,6 +35,7 @@ sub new { 'blob-capacity' => 'cloud::azure::storage::storageaccount::mode::blobcapacity', 'blob-container-count' => 'cloud::azure::storage::storageaccount::mode::blobcontainercount', 'blob-count' => 'cloud::azure::storage::storageaccount::mode::blobcount', + 'discovery' => 'cloud::azure::storage::storageaccount::mode::discovery', 'file-capacity' => 'cloud::azure::storage::storageaccount::mode::filecapacity', 'file-count' => 'cloud::azure::storage::storageaccount::mode::filecount', 'file-share-count' => 'cloud::azure::storage::storageaccount::mode::filesharecount', @@ -59,10 +60,9 @@ sub new { sub init { my ($self, %options) = @_; - $self->{options}->add_options(arguments => - { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, - }); + $self->{options}->add_options(arguments => { + 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + }); $self->SUPER::init(%options); }