From 83305b73e06c63deb8b067c4a297d3722c0f8383 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 5 May 2020 14:53:41 +0200 Subject: [PATCH] Break change: move netapp directories - can add some new plugins for netapp --- .../oncommandapi/custom/api.pm} | 12 +-- .../oncommandapi}/mode/aggregateraidstatus.pm | 19 +++-- .../oncommandapi}/mode/aggregatestatus.pm | 19 +++-- .../oncommandapi}/mode/aggregateusage.pm | 16 ++-- .../oncommandapi}/mode/clusterio.pm | 16 ++-- .../oncommandapi}/mode/clusterstatus.pm | 15 ++-- .../oncommandapi}/mode/clusterusage.pm | 14 +--- .../oncommandapi}/mode/diskfailed.pm | 11 ++- .../oncommandapi}/mode/diskspare.pm | 13 ++-- .../oncommandapi}/mode/fcportstatus.pm | 17 ++--- .../oncommandapi}/mode/listaggregates.pm | 17 ++--- .../oncommandapi}/mode/listclusters.pm | 13 ++-- .../oncommandapi}/mode/listfcports.pm | 17 ++--- .../oncommandapi}/mode/listluns.pm | 15 ++-- .../oncommandapi}/mode/listnodes.pm | 13 ++-- .../oncommandapi}/mode/listsnapmirrors.pm | 15 ++-- .../oncommandapi}/mode/listvolumes.pm | 15 ++-- .../oncommandapi}/mode/lunalignment.pm | 11 ++- .../oncommandapi}/mode/lunonline.pm | 11 ++- .../oncommandapi}/mode/lunusage.pm | 8 +- .../oncommandapi}/mode/nodefailoverstatus.pm | 17 ++--- .../oncommandapi}/mode/nodehardwarestatus.pm | 19 +++-- .../oncommandapi}/mode/qtreestatus.pm | 17 ++--- .../oncommandapi}/mode/snapmirrorstatus.pm | 17 ++--- .../oncommandapi}/mode/snapmirrorusage.pm | 9 +-- .../oncommandapi}/mode/volumeio.pm | 17 ++--- .../oncommandapi}/mode/volumestatus.pm | 13 ++-- .../oncommandapi}/mode/volumeusage.pm | 14 ++-- storage/netapp/ontap/oncommandapi/plugin.pm | 75 +++++++++++++++++++ .../{ => ontap}/snmp/mode/aggregatestate.pm | 6 +- .../netapp/{ => ontap}/snmp/mode/cacheage.pm | 12 +-- .../snmp/mode/components/communication.pm | 2 +- .../snmp/mode/components/electronics.pm | 2 +- .../{ => ontap}/snmp/mode/components/fan.pm | 2 +- .../{ => ontap}/snmp/mode/components/psu.pm | 2 +- .../{ => ontap}/snmp/mode/components/raid.pm | 2 +- .../snmp/mode/components/temperature.pm | 2 +- .../snmp/mode/components/voltage.pm | 2 +- .../{ => ontap}/snmp/mode/cpstatistics.pm | 2 +- .../netapp/{ => ontap}/snmp/mode/cpuload.pm | 13 ++-- .../{ => ontap}/snmp/mode/diskfailed.pm | 11 ++- .../netapp/{ => ontap}/snmp/mode/failover.pm | 2 +- storage/netapp/{ => ontap}/snmp/mode/fan.pm | 11 ++- .../netapp/{ => ontap}/snmp/mode/filesys.pm | 14 ++-- .../{ => ontap}/snmp/mode/globalstatus.pm | 2 +- .../{ => ontap}/snmp/mode/listfilesys.pm | 8 +- .../{ => ontap}/snmp/mode/listsnapvault.pm | 2 +- .../{ => ontap}/snmp/mode/ndmpsessions.pm | 13 ++-- storage/netapp/{ => ontap}/snmp/mode/nvram.pm | 11 ++- .../{ => ontap}/snmp/mode/partnerstatus.pm | 11 ++- storage/netapp/{ => ontap}/snmp/mode/psu.pm | 26 ++++--- .../{ => ontap}/snmp/mode/qtreeusage.pm | 14 ++-- .../{ => ontap}/snmp/mode/sharecalls.pm | 2 +- storage/netapp/{ => ontap}/snmp/mode/shelf.pm | 11 ++- storage/netapp/{ => ontap}/snmp/mode/sis.pm | 2 +- .../{ => ontap}/snmp/mode/snapmirrorlag.pm | 2 +- .../{ => ontap}/snmp/mode/snapshotage.pm | 17 ++--- .../{ => ontap}/snmp/mode/snapvaultusage.pm | 10 +-- .../{ => ontap}/snmp/mode/temperature.pm | 24 +++--- .../{ => ontap}/snmp/mode/volumeoptions.pm | 20 ++--- storage/netapp/ontap/snmp/plugin.pm | 72 ++++++++++++++++++ storage/netapp/restapi/plugin.pm | 75 ------------------- storage/netapp/snmp/plugin.pm | 72 ------------------ 63 files changed, 463 insertions(+), 501 deletions(-) rename storage/netapp/{restapi/custom/restapi.pm => ontap/oncommandapi/custom/api.pm} (96%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/aggregateraidstatus.pm (89%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/aggregatestatus.pm (89%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/aggregateusage.pm (96%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/clusterio.pm (92%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/clusterstatus.pm (90%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/clusterusage.pm (92%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/diskfailed.pm (93%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/diskspare.pm (93%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/fcportstatus.pm (90%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listaggregates.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listclusters.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listfcports.pm (90%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listluns.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listnodes.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listsnapmirrors.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/listvolumes.pm (91%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/lunalignment.pm (95%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/lunonline.pm (94%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/lunusage.pm (96%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/nodefailoverstatus.pm (90%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/nodehardwarestatus.pm (89%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/qtreestatus.pm (89%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/snapmirrorstatus.pm (88%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/snapmirrorusage.pm (94%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/volumeio.pm (94%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/volumestatus.pm (88%) rename storage/netapp/{restapi => ontap/oncommandapi}/mode/volumeusage.pm (98%) create mode 100644 storage/netapp/ontap/oncommandapi/plugin.pm rename storage/netapp/{ => ontap}/snmp/mode/aggregatestate.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/cacheage.pm (90%) rename storage/netapp/{ => ontap}/snmp/mode/components/communication.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/components/electronics.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/components/fan.pm (98%) rename storage/netapp/{ => ontap}/snmp/mode/components/psu.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/components/raid.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/components/temperature.pm (98%) rename storage/netapp/{ => ontap}/snmp/mode/components/voltage.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/cpstatistics.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/cpuload.pm (89%) rename storage/netapp/{ => ontap}/snmp/mode/diskfailed.pm (93%) rename storage/netapp/{ => ontap}/snmp/mode/failover.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/fan.pm (96%) rename storage/netapp/{ => ontap}/snmp/mode/filesys.pm (97%) rename storage/netapp/{ => ontap}/snmp/mode/globalstatus.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/listfilesys.pm (95%) rename storage/netapp/{ => ontap}/snmp/mode/listsnapvault.pm (98%) rename storage/netapp/{ => ontap}/snmp/mode/ndmpsessions.pm (89%) rename storage/netapp/{ => ontap}/snmp/mode/nvram.pm (95%) rename storage/netapp/{ => ontap}/snmp/mode/partnerstatus.pm (96%) rename storage/netapp/{ => ontap}/snmp/mode/psu.pm (82%) rename storage/netapp/{ => ontap}/snmp/mode/qtreeusage.pm (95%) rename storage/netapp/{ => ontap}/snmp/mode/sharecalls.pm (98%) rename storage/netapp/{ => ontap}/snmp/mode/shelf.pm (95%) rename storage/netapp/{ => ontap}/snmp/mode/sis.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/snapmirrorlag.pm (99%) rename storage/netapp/{ => ontap}/snmp/mode/snapshotage.pm (93%) rename storage/netapp/{ => ontap}/snmp/mode/snapvaultusage.pm (96%) rename storage/netapp/{ => ontap}/snmp/mode/temperature.pm (84%) rename storage/netapp/{ => ontap}/snmp/mode/volumeoptions.pm (92%) create mode 100644 storage/netapp/ontap/snmp/plugin.pm delete mode 100644 storage/netapp/restapi/plugin.pm delete mode 100644 storage/netapp/snmp/plugin.pm diff --git a/storage/netapp/restapi/custom/restapi.pm b/storage/netapp/ontap/oncommandapi/custom/api.pm similarity index 96% rename from storage/netapp/restapi/custom/restapi.pm rename to storage/netapp/ontap/oncommandapi/custom/api.pm index 79808d4c4..e231c59be 100644 --- a/storage/netapp/restapi/custom/restapi.pm +++ b/storage/netapp/ontap/oncommandapi/custom/api.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::custom::restapi; +package storage::netapp::ontap::oncommandapi::custom::api; use strict; use warnings; @@ -48,10 +48,10 @@ sub new { "proto:s@" => { name => 'proto' }, "username:s@" => { name => 'username' }, "password:s@" => { name => 'password' }, - "timeout:s@" => { name => 'timeout' }, + "timeout:s@" => { name => 'timeout' } }); } - $options{options}->add_help(package => __PACKAGE__, sections => 'REST API OPTIONS', once => 1); + $options{options}->add_help(package => __PACKAGE__, sections => 'OnCommand API OPTIONS', once => 1); $self->{output} = $options{output}; $self->{mode} = $options{mode}; @@ -202,13 +202,13 @@ __END__ =head1 NAME -NetApp OnCommand REST API +NetApp OnCommand API =head1 SYNOPSIS -NetApp OnCommand Rest API custom mode +NetApp OnCommand API custom mode -=head1 REST API OPTIONS +=head1 OnCommand API OPTIONS =over 8 diff --git a/storage/netapp/restapi/mode/aggregateraidstatus.pm b/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm similarity index 89% rename from storage/netapp/restapi/mode/aggregateraidstatus.pm rename to storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm index 2e5fe5aab..efabba77d 100644 --- a/storage/netapp/restapi/mode/aggregateraidstatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::aggregateraidstatus; +package storage::netapp::ontap::oncommandapi::mode::aggregateraidstatus; use base qw(centreon::plugins::templates::counter); @@ -75,15 +75,14 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /normal/i' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /normal/i' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/aggregatestatus.pm b/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm similarity index 89% rename from storage/netapp/restapi/mode/aggregatestatus.pm rename to storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm index f8a3c302a..0b4cfc128 100644 --- a/storage/netapp/restapi/mode/aggregatestatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::aggregatestatus; +package storage::netapp::ontap::oncommandapi::mode::aggregatestatus; use base qw(centreon::plugins::templates::counter); @@ -74,15 +74,14 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{state} !~ /online/i' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{state} !~ /online/i' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/aggregateusage.pm b/storage/netapp/ontap/oncommandapi/mode/aggregateusage.pm similarity index 96% rename from storage/netapp/restapi/mode/aggregateusage.pm rename to storage/netapp/ontap/oncommandapi/mode/aggregateusage.pm index 0d40d551e..98343674c 100644 --- a/storage/netapp/restapi/mode/aggregateusage.pm +++ b/storage/netapp/ontap/oncommandapi/mode/aggregateusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::aggregateusage; +package storage::netapp::ontap::oncommandapi::mode::aggregateusage; use base qw(centreon::plugins::templates::counter); @@ -190,13 +190,13 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - "filter-state:s" => { name => 'filter_state' }, - "filter-type:s" => { name => 'filter_type' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' }, + 'filter-state:s' => { name => 'filter_state' }, + 'filter-type:s' => { name => 'filter_type' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' } }); return $self; diff --git a/storage/netapp/restapi/mode/clusterio.pm b/storage/netapp/ontap/oncommandapi/mode/clusterio.pm similarity index 92% rename from storage/netapp/restapi/mode/clusterio.pm rename to storage/netapp/ontap/oncommandapi/mode/clusterio.pm index 8d1d7098b..93b09c122 100644 --- a/storage/netapp/restapi/mode/clusterio.pm +++ b/storage/netapp/ontap/oncommandapi/mode/clusterio.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::clusterio; +package storage::netapp::ontap::oncommandapi::mode::clusterio; use base qw(centreon::plugins::templates::counter); @@ -66,17 +66,11 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); - - return $self; -} + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); + return $self; } sub manage_selection { diff --git a/storage/netapp/restapi/mode/clusterstatus.pm b/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm similarity index 90% rename from storage/netapp/restapi/mode/clusterstatus.pm rename to storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm index 204125de0..6669aaa4b 100644 --- a/storage/netapp/restapi/mode/clusterstatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::clusterstatus; +package storage::netapp::ontap::oncommandapi::mode::clusterstatus; use base qw(centreon::plugins::templates::counter); @@ -77,13 +77,12 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /ok/i' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /ok/i' }, + }); + return $self; } diff --git a/storage/netapp/restapi/mode/clusterusage.pm b/storage/netapp/ontap/oncommandapi/mode/clusterusage.pm similarity index 92% rename from storage/netapp/restapi/mode/clusterusage.pm rename to storage/netapp/ontap/oncommandapi/mode/clusterusage.pm index e1fa5b455..a90f45f24 100644 --- a/storage/netapp/restapi/mode/clusterusage.pm +++ b/storage/netapp/ontap/oncommandapi/mode/clusterusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::clusterusage; +package storage::netapp::ontap::oncommandapi::mode::clusterusage; use base qw(centreon::plugins::templates::counter); @@ -65,19 +65,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); -} - sub manage_selection { my ($self, %options) = @_; diff --git a/storage/netapp/restapi/mode/diskfailed.pm b/storage/netapp/ontap/oncommandapi/mode/diskfailed.pm similarity index 93% rename from storage/netapp/restapi/mode/diskfailed.pm rename to storage/netapp/ontap/oncommandapi/mode/diskfailed.pm index a889a8c3c..6ba8e3680 100644 --- a/storage/netapp/restapi/mode/diskfailed.pm +++ b/storage/netapp/ontap/oncommandapi/mode/diskfailed.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::diskfailed; +package storage::netapp::ontap::oncommandapi::mode::diskfailed; use base qw(centreon::plugins::templates::counter); @@ -59,11 +59,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - }); + $options{options}->add_options(arguments => { + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' } + }); return $self; } diff --git a/storage/netapp/restapi/mode/diskspare.pm b/storage/netapp/ontap/oncommandapi/mode/diskspare.pm similarity index 93% rename from storage/netapp/restapi/mode/diskspare.pm rename to storage/netapp/ontap/oncommandapi/mode/diskspare.pm index f374105f3..49fa4ffb1 100644 --- a/storage/netapp/restapi/mode/diskspare.pm +++ b/storage/netapp/ontap/oncommandapi/mode/diskspare.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::diskspare; +package storage::netapp::ontap::oncommandapi::mode::diskspare; use base qw(centreon::plugins::templates::counter); @@ -68,12 +68,11 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - }); - + $options{options}->add_options(arguments => { + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/fcportstatus.pm b/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm similarity index 90% rename from storage/netapp/restapi/mode/fcportstatus.pm rename to storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm index 2fb447760..91e9892ea 100644 --- a/storage/netapp/restapi/mode/fcportstatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::fcportstatus; +package storage::netapp::ontap::oncommandapi::mode::fcportstatus; use base qw(centreon::plugins::templates::counter); @@ -78,14 +78,13 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /online/i || %{state} !~ /online/i' }, - }); - + + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /online/i || %{state} !~ /online/i' }, + }); + return $self; } diff --git a/storage/netapp/restapi/mode/listaggregates.pm b/storage/netapp/ontap/oncommandapi/mode/listaggregates.pm similarity index 91% rename from storage/netapp/restapi/mode/listaggregates.pm rename to storage/netapp/ontap/oncommandapi/mode/listaggregates.pm index ad6d9523b..5ecff30f3 100644 --- a/storage/netapp/restapi/mode/listaggregates.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listaggregates.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listaggregates; +package storage::netapp::ontap::oncommandapi::mode::listaggregates; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,19 +30,18 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-node:s" => { name => 'filter_node' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-node:s' => { name => 'filter_node' }, + 'filter-cluster:s' => { name => 'filter_cluster' } + }); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listclusters.pm b/storage/netapp/ontap/oncommandapi/mode/listclusters.pm similarity index 91% rename from storage/netapp/restapi/mode/listclusters.pm rename to storage/netapp/ontap/oncommandapi/mode/listclusters.pm index e53c40921..8a37cfcdf 100644 --- a/storage/netapp/restapi/mode/listclusters.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listclusters.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listclusters; +package storage::netapp::ontap::oncommandapi::mode::listclusters; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,17 +30,16 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listfcports.pm b/storage/netapp/ontap/oncommandapi/mode/listfcports.pm similarity index 90% rename from storage/netapp/restapi/mode/listfcports.pm rename to storage/netapp/ontap/oncommandapi/mode/listfcports.pm index cfa4d1f2a..6d6db9dc4 100644 --- a/storage/netapp/restapi/mode/listfcports.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listfcports.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listfcports; +package storage::netapp::ontap::oncommandapi::mode::listfcports; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -29,18 +29,17 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); - + + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); + return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listluns.pm b/storage/netapp/ontap/oncommandapi/mode/listluns.pm similarity index 91% rename from storage/netapp/restapi/mode/listluns.pm rename to storage/netapp/ontap/oncommandapi/mode/listluns.pm index e32683eaa..f1573d14f 100644 --- a/storage/netapp/restapi/mode/listluns.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listluns.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listluns; +package storage::netapp::ontap::oncommandapi::mode::listluns; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,17 +30,16 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); + return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listnodes.pm b/storage/netapp/ontap/oncommandapi/mode/listnodes.pm similarity index 91% rename from storage/netapp/restapi/mode/listnodes.pm rename to storage/netapp/ontap/oncommandapi/mode/listnodes.pm index 2582ac4d5..3aa48728b 100644 --- a/storage/netapp/restapi/mode/listnodes.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listnodes.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listnodes; +package storage::netapp::ontap::oncommandapi::mode::listnodes; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,17 +30,16 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listsnapmirrors.pm b/storage/netapp/ontap/oncommandapi/mode/listsnapmirrors.pm similarity index 91% rename from storage/netapp/restapi/mode/listsnapmirrors.pm rename to storage/netapp/ontap/oncommandapi/mode/listsnapmirrors.pm index 9c7fbdabf..4daaa6ec3 100644 --- a/storage/netapp/restapi/mode/listsnapmirrors.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listsnapmirrors.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listsnapmirrors; +package storage::netapp::ontap::oncommandapi::mode::listsnapmirrors; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,17 +30,16 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); + return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/listvolumes.pm b/storage/netapp/ontap/oncommandapi/mode/listvolumes.pm similarity index 91% rename from storage/netapp/restapi/mode/listvolumes.pm rename to storage/netapp/ontap/oncommandapi/mode/listvolumes.pm index 5e691600f..9aef0f99b 100644 --- a/storage/netapp/restapi/mode/listvolumes.pm +++ b/storage/netapp/ontap/oncommandapi/mode/listvolumes.pm @@ -18,9 +18,9 @@ # limitations under the License. # -package storage::netapp::restapi::mode::listvolumes; +package storage::netapp::ontap::oncommandapi::mode::listvolumes; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; @@ -30,17 +30,16 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); + return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::check_options(%options); + $self->SUPER::init(%options); } sub manage_selection { diff --git a/storage/netapp/restapi/mode/lunalignment.pm b/storage/netapp/ontap/oncommandapi/mode/lunalignment.pm similarity index 95% rename from storage/netapp/restapi/mode/lunalignment.pm rename to storage/netapp/ontap/oncommandapi/mode/lunalignment.pm index 7107e6aca..b2604736a 100644 --- a/storage/netapp/restapi/mode/lunalignment.pm +++ b/storage/netapp/ontap/oncommandapi/mode/lunalignment.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::lunalignment; +package storage::netapp::ontap::oncommandapi::mode::lunalignment; use base qw(centreon::plugins::templates::counter); @@ -95,11 +95,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-volume:s" => { name => 'filter_volume' }, - }); - + $options{options}->add_options(arguments => { + 'filter-volume:s' => { name => 'filter_volume' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/lunonline.pm b/storage/netapp/ontap/oncommandapi/mode/lunonline.pm similarity index 94% rename from storage/netapp/restapi/mode/lunonline.pm rename to storage/netapp/ontap/oncommandapi/mode/lunonline.pm index 4081006f1..b587ebed7 100644 --- a/storage/netapp/restapi/mode/lunonline.pm +++ b/storage/netapp/ontap/oncommandapi/mode/lunonline.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::lunonline; +package storage::netapp::ontap::oncommandapi::mode::lunonline; use base qw(centreon::plugins::templates::counter); @@ -77,11 +77,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-volume:s" => { name => 'filter_volume' }, - }); - + $options{options}->add_options(arguments => { + 'filter-volume:s' => { name => 'filter_volume' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/lunusage.pm b/storage/netapp/ontap/oncommandapi/mode/lunusage.pm similarity index 96% rename from storage/netapp/restapi/mode/lunusage.pm rename to storage/netapp/ontap/oncommandapi/mode/lunusage.pm index bb29b6b78..670374608 100644 --- a/storage/netapp/restapi/mode/lunusage.pm +++ b/storage/netapp/ontap/oncommandapi/mode/lunusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::lunusage; +package storage::netapp::ontap::oncommandapi::mode::lunusage; use base qw(centreon::plugins::templates::counter); @@ -119,9 +119,9 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, + 'filter-name:s' => { name => 'filter_name' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' } }); return $self; diff --git a/storage/netapp/restapi/mode/nodefailoverstatus.pm b/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm similarity index 90% rename from storage/netapp/restapi/mode/nodefailoverstatus.pm rename to storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm index 284ff0f04..b29e252f9 100644 --- a/storage/netapp/restapi/mode/nodefailoverstatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::nodefailoverstatus; +package storage::netapp::ontap::oncommandapi::mode::nodefailoverstatus; use base qw(centreon::plugins::templates::counter); @@ -80,14 +80,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{state} !~ /connected/i || %{interconnect} !~ /up/i'}, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-cluster:s' => { name => 'filter_cluster' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{state} !~ /connected/i || %{interconnect} !~ /up/i'} + }); + return $self; } diff --git a/storage/netapp/restapi/mode/nodehardwarestatus.pm b/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm similarity index 89% rename from storage/netapp/restapi/mode/nodehardwarestatus.pm rename to storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm index ca92f5068..73cff9aa7 100644 --- a/storage/netapp/restapi/mode/nodehardwarestatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::nodehardwarestatus; +package storage::netapp::ontap::oncommandapi::mode::nodehardwarestatus; use base qw(centreon::plugins::templates::counter); @@ -96,15 +96,14 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-cluster:s" => { name => 'filter_cluster' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /not healthy/i || ' . - '%{temperature} !~ /ok/i || %{battery_status} !~ /battery_ok|battery_fully_charge|battery_over_charged/i' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-cluster:s' => { name => 'filter_cluster' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} =~ /not healthy/i || ' . + '%{temperature} !~ /ok/i || %{battery_status} !~ /battery_ok|battery_fully_charge|battery_over_charged/i' }, + }); + return $self; } diff --git a/storage/netapp/restapi/mode/qtreestatus.pm b/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm similarity index 89% rename from storage/netapp/restapi/mode/qtreestatus.pm rename to storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm index 28140e10b..f74c34678 100644 --- a/storage/netapp/restapi/mode/qtreestatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::qtreestatus; +package storage::netapp::ontap::oncommandapi::mode::qtreestatus; use base qw(centreon::plugins::templates::counter); @@ -77,14 +77,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-volume:s" => { name => 'filter_volume' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-volume:s' => { name => 'filter_volume' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/snapmirrorstatus.pm b/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm similarity index 88% rename from storage/netapp/restapi/mode/snapmirrorstatus.pm rename to storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm index 11c42f7e0..e193f4ec2 100644 --- a/storage/netapp/restapi/mode/snapmirrorstatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::snapmirrorstatus; +package storage::netapp::ontap::oncommandapi::mode::snapmirrorstatus; use base qw(centreon::plugins::templates::counter); @@ -72,14 +72,13 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{state} !~ /snapmirrored/i || %{update} =~ /not healthy/i' }, - }); - + + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{state} !~ /snapmirrored/i || %{update} =~ /not healthy/i' }, + }); + return $self; } diff --git a/storage/netapp/restapi/mode/snapmirrorusage.pm b/storage/netapp/ontap/oncommandapi/mode/snapmirrorusage.pm similarity index 94% rename from storage/netapp/restapi/mode/snapmirrorusage.pm rename to storage/netapp/ontap/oncommandapi/mode/snapmirrorusage.pm index f10fd42eb..b035117fd 100644 --- a/storage/netapp/restapi/mode/snapmirrorusage.pm +++ b/storage/netapp/ontap/oncommandapi/mode/snapmirrorusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::snapmirrorusage; +package storage::netapp::ontap::oncommandapi::mode::snapmirrorusage; use base qw(centreon::plugins::templates::counter); @@ -75,10 +75,9 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); return $self; } diff --git a/storage/netapp/restapi/mode/volumeio.pm b/storage/netapp/ontap/oncommandapi/mode/volumeio.pm similarity index 94% rename from storage/netapp/restapi/mode/volumeio.pm rename to storage/netapp/ontap/oncommandapi/mode/volumeio.pm index bef4bd515..674020deb 100644 --- a/storage/netapp/restapi/mode/volumeio.pm +++ b/storage/netapp/ontap/oncommandapi/mode/volumeio.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::volumeio; +package storage::netapp::ontap::oncommandapi::mode::volumeio; use base qw(centreon::plugins::templates::counter); @@ -110,14 +110,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "filter-state:s" => { name => 'filter_state' }, - "filter-style:s" => { name => 'filter_style' }, - "filter-type:s" => { name => 'filter_type' }, - }); - + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'filter-state:s' => { name => 'filter_state' }, + 'filter-style:s' => { name => 'filter_style' }, + 'filter-type:s' => { name => 'filter_type' } + }); + return $self; } diff --git a/storage/netapp/restapi/mode/volumestatus.pm b/storage/netapp/ontap/oncommandapi/mode/volumestatus.pm similarity index 88% rename from storage/netapp/restapi/mode/volumestatus.pm rename to storage/netapp/ontap/oncommandapi/mode/volumestatus.pm index 7d0788a35..be5fe5f38 100644 --- a/storage/netapp/restapi/mode/volumestatus.pm +++ b/storage/netapp/ontap/oncommandapi/mode/volumestatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::volumestatus; +package storage::netapp::ontap::oncommandapi::mode::volumestatus; use base qw(centreon::plugins::templates::counter); @@ -73,12 +73,11 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status' }, - "critical-status:s" => { name => 'critical_status', default => '%{state} !~ /online/i' }, - }); + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, + 'warning-status:s' => { name => 'warning_status' }, + 'critical-status:s' => { name => 'critical_status', default => '%{state} !~ /online/i' }, + }); return $self; } diff --git a/storage/netapp/restapi/mode/volumeusage.pm b/storage/netapp/ontap/oncommandapi/mode/volumeusage.pm similarity index 98% rename from storage/netapp/restapi/mode/volumeusage.pm rename to storage/netapp/ontap/oncommandapi/mode/volumeusage.pm index a17a9053b..8b0e6a76f 100644 --- a/storage/netapp/restapi/mode/volumeusage.pm +++ b/storage/netapp/ontap/oncommandapi/mode/volumeusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::restapi::mode::volumeusage; +package storage::netapp::ontap::oncommandapi::mode::volumeusage; use base qw(centreon::plugins::templates::counter); @@ -371,12 +371,12 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "filter-state:s" => { name => 'filter_state' }, - "filter-style:s" => { name => 'filter_style' }, - "filter-type:s" => { name => 'filter_type' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-state:s' => { name => 'filter_state' }, + 'filter-style:s' => { name => 'filter_style' }, + 'filter-type:s' => { name => 'filter_type' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' } }); return $self; diff --git a/storage/netapp/ontap/oncommandapi/plugin.pm b/storage/netapp/ontap/oncommandapi/plugin.pm new file mode 100644 index 000000000..4ad4c4235 --- /dev/null +++ b/storage/netapp/ontap/oncommandapi/plugin.pm @@ -0,0 +1,75 @@ +# +# Copyright 2020 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 storage::netapp::ontap::oncommandapi::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} = '1.0'; + %{$self->{modes}} = ( + 'aggregate-raid-status' => 'storage::netapp::ontap::oncommandapi::mode::aggregateraidstatus', + 'aggregate-status' => 'storage::netapp::ontap::oncommandapi::mode::aggregatestatus', + 'aggregate-usage' => 'storage::netapp::ontap::oncommandapi::mode::aggregateusage', + 'cluster-io' => 'storage::netapp::ontap::oncommandapi::mode::clusterio', + 'cluster-status' => 'storage::netapp::ontap::oncommandapi::mode::clusterstatus', + 'cluster-usage' => 'storage::netapp::ontap::oncommandapi::mode::clusterusage', + 'disk-failed' => 'storage::netapp::ontap::oncommandapi::mode::diskfailed', + 'disk-spare' => 'storage::netapp::ontap::oncommandapi::mode::diskspare', + 'fc-port-status' => 'storage::netapp::ontap::oncommandapi::mode::fcportstatus', + 'list-aggregates' => 'storage::netapp::ontap::oncommandapi::mode::listaggregates', + 'list-clusters' => 'storage::netapp::ontap::oncommandapi::mode::listclusters', + 'list-fc-ports' => 'storage::netapp::ontap::oncommandapi::mode::listfcports', + 'list-luns' => 'storage::netapp::ontap::oncommandapi::mode::listluns', + 'list-nodes' => 'storage::netapp::ontap::oncommandapi::mode::listnodes', + 'list-snapmirrors' => 'storage::netapp::ontap::oncommandapi::mode::listsnapmirrors', + 'list-volumes' => 'storage::netapp::ontap::oncommandapi::mode::listvolumes', + 'lun-alignment' => 'storage::netapp::ontap::oncommandapi::mode::lunalignment', + 'lun-online' => 'storage::netapp::ontap::oncommandapi::mode::lunonline', + 'lun-usage' => 'storage::netapp::ontap::oncommandapi::mode::lunusage', + 'node-failover-status' => 'storage::netapp::ontap::oncommandapi::mode::nodefailoverstatus', + 'node-hardware-status' => 'storage::netapp::ontap::oncommandapi::mode::nodehardwarestatus', + 'qtree-status' => 'storage::netapp::ontap::oncommandapi::mode::qtreestatus', + 'snapmirror-status' => 'storage::netapp::ontap::oncommandapi::mode::snapmirrorstatus', + 'snapmirror-usage' => 'storage::netapp::ontap::oncommandapi::mode::snapmirrorusage', + 'volume-io' => 'storage::netapp::ontap::oncommandapi::mode::volumeio', + 'volume-status' => 'storage::netapp::ontap::oncommandapi::mode::volumestatus', + 'volume-usage' => 'storage::netapp::ontap::oncommandapi::mode::volumeusage' + ); + + $self->{custom_modes}{api} = 'storage::netapp::ontap::oncommandapi::custom::api'; + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check NetApp ONTAP with OnCommand API. + +=cut diff --git a/storage/netapp/snmp/mode/aggregatestate.pm b/storage/netapp/ontap/snmp/mode/aggregatestate.pm similarity index 97% rename from storage/netapp/snmp/mode/aggregatestate.pm rename to storage/netapp/ontap/snmp/mode/aggregatestate.pm index a87b0d1bf..823eeab8e 100644 --- a/storage/netapp/snmp/mode/aggregatestate.pm +++ b/storage/netapp/ontap/snmp/mode/aggregatestate.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::aggregatestate; +package storage::netapp::ontap::snmp::mode::aggregatestate; use base qw(centreon::plugins::templates::counter); @@ -92,8 +92,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + 'filter-name:s' => { name => 'filter_name' }, + 'threshold-overload:s@' => { name => 'threshold_overload' }, }); return $self; diff --git a/storage/netapp/snmp/mode/cacheage.pm b/storage/netapp/ontap/snmp/mode/cacheage.pm similarity index 90% rename from storage/netapp/snmp/mode/cacheage.pm rename to storage/netapp/ontap/snmp/mode/cacheage.pm index 42a635250..4179acdfd 100644 --- a/storage/netapp/snmp/mode/cacheage.pm +++ b/storage/netapp/ontap/snmp/mode/cacheage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::cacheage; +package storage::netapp::ontap::snmp::mode::cacheage; use base qw(centreon::plugins::mode); @@ -30,11 +30,11 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - }); + $options{options}->add_options(arguments => { + 'warning:s' => { name => 'warning' }, + 'critical:s' => { name => 'critical' } + }); + return $self; } diff --git a/storage/netapp/snmp/mode/components/communication.pm b/storage/netapp/ontap/snmp/mode/components/communication.pm similarity index 97% rename from storage/netapp/snmp/mode/components/communication.pm rename to storage/netapp/ontap/snmp/mode/components/communication.pm index af300bd00..7ade3583c 100644 --- a/storage/netapp/snmp/mode/components/communication.pm +++ b/storage/netapp/ontap/snmp/mode/components/communication.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::communication; +package storage::netapp::ontap::snmp::mode::components::communication; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/components/electronics.pm b/storage/netapp/ontap/snmp/mode/components/electronics.pm similarity index 97% rename from storage/netapp/snmp/mode/components/electronics.pm rename to storage/netapp/ontap/snmp/mode/components/electronics.pm index baa71f596..26a46f461 100644 --- a/storage/netapp/snmp/mode/components/electronics.pm +++ b/storage/netapp/ontap/snmp/mode/components/electronics.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::electronics; +package storage::netapp::ontap::snmp::mode::components::electronics; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/components/fan.pm b/storage/netapp/ontap/snmp/mode/components/fan.pm similarity index 98% rename from storage/netapp/snmp/mode/components/fan.pm rename to storage/netapp/ontap/snmp/mode/components/fan.pm index adaad1e0e..0bbb27e8d 100644 --- a/storage/netapp/snmp/mode/components/fan.pm +++ b/storage/netapp/ontap/snmp/mode/components/fan.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::fan; +package storage::netapp::ontap::snmp::mode::components::fan; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/components/psu.pm b/storage/netapp/ontap/snmp/mode/components/psu.pm similarity index 97% rename from storage/netapp/snmp/mode/components/psu.pm rename to storage/netapp/ontap/snmp/mode/components/psu.pm index 976d6128d..af0e15c2c 100644 --- a/storage/netapp/snmp/mode/components/psu.pm +++ b/storage/netapp/ontap/snmp/mode/components/psu.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::psu; +package storage::netapp::ontap::snmp::mode::components::psu; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/components/raid.pm b/storage/netapp/ontap/snmp/mode/components/raid.pm similarity index 97% rename from storage/netapp/snmp/mode/components/raid.pm rename to storage/netapp/ontap/snmp/mode/components/raid.pm index b45687a41..81f6d444d 100644 --- a/storage/netapp/snmp/mode/components/raid.pm +++ b/storage/netapp/ontap/snmp/mode/components/raid.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::raid; +package storage::netapp::ontap::snmp::mode::components::raid; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/components/temperature.pm b/storage/netapp/ontap/snmp/mode/components/temperature.pm similarity index 98% rename from storage/netapp/snmp/mode/components/temperature.pm rename to storage/netapp/ontap/snmp/mode/components/temperature.pm index a65fe4520..07ab84fed 100644 --- a/storage/netapp/snmp/mode/components/temperature.pm +++ b/storage/netapp/ontap/snmp/mode/components/temperature.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::temperature; +package storage::netapp::ontap::snmp::mode::components::temperature; use strict; use warnings; diff --git a/storage/netapp/snmp/mode/components/voltage.pm b/storage/netapp/ontap/snmp/mode/components/voltage.pm similarity index 99% rename from storage/netapp/snmp/mode/components/voltage.pm rename to storage/netapp/ontap/snmp/mode/components/voltage.pm index 44cb565d0..7c005ef84 100644 --- a/storage/netapp/snmp/mode/components/voltage.pm +++ b/storage/netapp/ontap/snmp/mode/components/voltage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::components::voltage; +package storage::netapp::ontap::snmp::mode::components::voltage; use strict; use warnings; diff --git a/storage/netapp/snmp/mode/cpstatistics.pm b/storage/netapp/ontap/snmp/mode/cpstatistics.pm similarity index 99% rename from storage/netapp/snmp/mode/cpstatistics.pm rename to storage/netapp/ontap/snmp/mode/cpstatistics.pm index ee376e7c6..bf5d06254 100644 --- a/storage/netapp/snmp/mode/cpstatistics.pm +++ b/storage/netapp/ontap/snmp/mode/cpstatistics.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::cpstatistics; +package storage::netapp::ontap::snmp::mode::cpstatistics; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/cpuload.pm b/storage/netapp/ontap/snmp/mode/cpuload.pm similarity index 89% rename from storage/netapp/snmp/mode/cpuload.pm rename to storage/netapp/ontap/snmp/mode/cpuload.pm index 3e72d960f..3618e3f55 100644 --- a/storage/netapp/snmp/mode/cpuload.pm +++ b/storage/netapp/ontap/snmp/mode/cpuload.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::cpuload; +package storage::netapp::ontap::snmp::mode::cpuload; use base qw(centreon::plugins::mode); @@ -30,11 +30,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - }); + $options{options}->add_options(arguments => { + 'warning:s' => { name => 'warning' }, + 'critical:s' => { name => 'critical' } + }); return $self; } @@ -94,4 +93,4 @@ Threshold critical in percent. =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/diskfailed.pm b/storage/netapp/ontap/snmp/mode/diskfailed.pm similarity index 93% rename from storage/netapp/snmp/mode/diskfailed.pm rename to storage/netapp/ontap/snmp/mode/diskfailed.pm index 7bc508245..9d598479d 100644 --- a/storage/netapp/snmp/mode/diskfailed.pm +++ b/storage/netapp/ontap/snmp/mode/diskfailed.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::diskfailed; +package storage::netapp::ontap::snmp::mode::diskfailed; use base qw(centreon::plugins::mode); @@ -29,10 +29,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } @@ -81,4 +80,4 @@ If you are in cluster mode, the following mode doesn't work. Ask to netapp to ad =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/failover.pm b/storage/netapp/ontap/snmp/mode/failover.pm similarity index 99% rename from storage/netapp/snmp/mode/failover.pm rename to storage/netapp/ontap/snmp/mode/failover.pm index af106abf5..cfb350a99 100644 --- a/storage/netapp/snmp/mode/failover.pm +++ b/storage/netapp/ontap/snmp/mode/failover.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::failover; +package storage::netapp::ontap::snmp::mode::failover; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/fan.pm b/storage/netapp/ontap/snmp/mode/fan.pm similarity index 96% rename from storage/netapp/snmp/mode/fan.pm rename to storage/netapp/ontap/snmp/mode/fan.pm index 4da8e0931..911d155b2 100644 --- a/storage/netapp/snmp/mode/fan.pm +++ b/storage/netapp/ontap/snmp/mode/fan.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::fan; +package storage::netapp::ontap::snmp::mode::fan; use base qw(centreon::plugins::mode); @@ -29,10 +29,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } @@ -104,4 +103,4 @@ Check if fans are failed (not operating within the recommended RPM range). =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/filesys.pm b/storage/netapp/ontap/snmp/mode/filesys.pm similarity index 97% rename from storage/netapp/snmp/mode/filesys.pm rename to storage/netapp/ontap/snmp/mode/filesys.pm index ec864f19d..b197795b9 100644 --- a/storage/netapp/snmp/mode/filesys.pm +++ b/storage/netapp/ontap/snmp/mode/filesys.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::filesys; +package storage::netapp::ontap::snmp::mode::filesys; use base qw(centreon::plugins::templates::counter); @@ -186,12 +186,12 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - 'units:s' => { name => 'units', default => '%' }, - 'free' => { name => 'free' }, - 'filter-name:s' => { name => 'filter_name' }, - 'filter-type:s' => { name => 'filter_type' }, - 'filter-vserver:s' => { name => 'filter_vserver' }, - 'filter-vserver-state:s' => { name => 'filter_vserver_state' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-type:s' => { name => 'filter_type' }, + 'filter-vserver:s' => { name => 'filter_vserver' }, + 'filter-vserver-state:s' => { name => 'filter_vserver_state' }, 'unknown-vserver-status:s' => { name => 'unknown_vserver_status', default => '' }, 'warning-vserver-status:s' => { name => 'warning_vserver_status', default => '' }, 'critical-vserver-status:s' => { name => 'critical_vserver_status', default => '' }, diff --git a/storage/netapp/snmp/mode/globalstatus.pm b/storage/netapp/ontap/snmp/mode/globalstatus.pm similarity index 99% rename from storage/netapp/snmp/mode/globalstatus.pm rename to storage/netapp/ontap/snmp/mode/globalstatus.pm index 476f1a798..7aead567f 100644 --- a/storage/netapp/snmp/mode/globalstatus.pm +++ b/storage/netapp/ontap/snmp/mode/globalstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::globalstatus; +package storage::netapp::ontap::snmp::mode::globalstatus; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/listfilesys.pm b/storage/netapp/ontap/snmp/mode/listfilesys.pm similarity index 95% rename from storage/netapp/snmp/mode/listfilesys.pm rename to storage/netapp/ontap/snmp/mode/listfilesys.pm index 606864535..3885646a9 100644 --- a/storage/netapp/snmp/mode/listfilesys.pm +++ b/storage/netapp/ontap/snmp/mode/listfilesys.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::listfilesys; +package storage::netapp::ontap::snmp::mode::listfilesys; use base qw(centreon::plugins::mode); @@ -31,9 +31,9 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - 'filter-name:s' => { name => 'filter_name' }, - 'filter-type:s' => { name => 'filter_type' }, - 'skip-total-zero' => { name => 'skip_total_zero' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-type:s' => { name => 'filter_type' }, + 'skip-total-zero' => { name => 'skip_total_zero' } }); return $self; diff --git a/storage/netapp/snmp/mode/listsnapvault.pm b/storage/netapp/ontap/snmp/mode/listsnapvault.pm similarity index 98% rename from storage/netapp/snmp/mode/listsnapvault.pm rename to storage/netapp/ontap/snmp/mode/listsnapvault.pm index 56b89f058..8c2ce7957 100644 --- a/storage/netapp/snmp/mode/listsnapvault.pm +++ b/storage/netapp/ontap/snmp/mode/listsnapvault.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::listsnapvault; +package storage::netapp::ontap::snmp::mode::listsnapvault; use base qw(centreon::plugins::mode); diff --git a/storage/netapp/snmp/mode/ndmpsessions.pm b/storage/netapp/ontap/snmp/mode/ndmpsessions.pm similarity index 89% rename from storage/netapp/snmp/mode/ndmpsessions.pm rename to storage/netapp/ontap/snmp/mode/ndmpsessions.pm index 5876197c8..a84a75a2e 100644 --- a/storage/netapp/snmp/mode/ndmpsessions.pm +++ b/storage/netapp/ontap/snmp/mode/ndmpsessions.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::ndmpsessions; +package storage::netapp::ontap::snmp::mode::ndmpsessions; use base qw(centreon::plugins::mode); @@ -30,11 +30,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - }); + $options{options}->add_options(arguments => { + 'warning:s' => { name => 'warning' }, + 'critical:s' => { name => 'critical' } + }); return $self; } @@ -94,4 +93,4 @@ Threshold critical. =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/nvram.pm b/storage/netapp/ontap/snmp/mode/nvram.pm similarity index 95% rename from storage/netapp/snmp/mode/nvram.pm rename to storage/netapp/ontap/snmp/mode/nvram.pm index 1251c00f9..822b8198d 100644 --- a/storage/netapp/snmp/mode/nvram.pm +++ b/storage/netapp/ontap/snmp/mode/nvram.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::nvram; +package storage::netapp::ontap::snmp::mode::nvram; use base qw(centreon::plugins::mode); @@ -56,10 +56,9 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); + $options{options}->add_options(arguments => { + 'threshold-overload:s@' => { name => 'threshold_overload' }, + }); return $self; } @@ -172,4 +171,4 @@ Example: --threshold-overload='nvram,CRITICAL,^(?!(ok)$)' =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/partnerstatus.pm b/storage/netapp/ontap/snmp/mode/partnerstatus.pm similarity index 96% rename from storage/netapp/snmp/mode/partnerstatus.pm rename to storage/netapp/ontap/snmp/mode/partnerstatus.pm index 04e8a4f01..f9fda6ba0 100644 --- a/storage/netapp/snmp/mode/partnerstatus.pm +++ b/storage/netapp/ontap/snmp/mode/partnerstatus.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::partnerstatus; +package storage::netapp::ontap::snmp::mode::partnerstatus; use base qw(centreon::plugins::mode); @@ -55,10 +55,9 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); + $options{options}->add_options(arguments => { + 'threshold-overload:s@' => { name => 'threshold_overload' }, + }); return $self; } @@ -196,4 +195,4 @@ Example: --threshold-overload='partner,CRITICAL,^(?!(ok)$)' =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/psu.pm b/storage/netapp/ontap/snmp/mode/psu.pm similarity index 82% rename from storage/netapp/snmp/mode/psu.pm rename to storage/netapp/ontap/snmp/mode/psu.pm index 9b922ce07..afc08db3a 100644 --- a/storage/netapp/snmp/mode/psu.pm +++ b/storage/netapp/ontap/snmp/mode/psu.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::psu; +package storage::netapp::ontap::snmp::mode::psu; use base qw(centreon::plugins::mode); @@ -30,9 +30,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -51,13 +50,16 @@ sub run { my $oid_nodeName = '.1.3.6.1.4.1.789.1.25.2.1.1'; my $oid_nodeEnvFailedPowerSupplyCount = '.1.3.6.1.4.1.789.1.25.2.1.21'; my $oid_nodeEnvFailedPowerSupplyMessage = '.1.3.6.1.4.1.789.1.25.2.1.22'; - my $results = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oid_envFailedPowerSupplyCount }, - { oid => $oid_envFailedPowerSupplyMessage }, - { oid => $oid_nodeName }, - { oid => $oid_nodeEnvFailedPowerSupplyCount }, - { oid => $oid_nodeEnvFailedPowerSupplyMessage } - ], nothing_quit => 1); + my $results = $self->{snmp}->get_multiple_table( + oids => [ + { oid => $oid_envFailedPowerSupplyCount }, + { oid => $oid_envFailedPowerSupplyMessage }, + { oid => $oid_nodeName }, + { oid => $oid_nodeEnvFailedPowerSupplyCount }, + { oid => $oid_nodeEnvFailedPowerSupplyMessage } + ], + nothing_quit => 1 + ); if (defined($results->{$oid_envFailedPowerSupplyCount}->{$oid_envFailedPowerSupplyCount . '.0'})) { $self->{output}->output_add(severity => 'OK', @@ -104,4 +106,4 @@ Check if power supplies are failed (in degraded mode). =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/qtreeusage.pm b/storage/netapp/ontap/snmp/mode/qtreeusage.pm similarity index 95% rename from storage/netapp/snmp/mode/qtreeusage.pm rename to storage/netapp/ontap/snmp/mode/qtreeusage.pm index 921dc4784..9271687a4 100644 --- a/storage/netapp/snmp/mode/qtreeusage.pm +++ b/storage/netapp/ontap/snmp/mode/qtreeusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::qtreeusage; +package storage::netapp::ontap::snmp::mode::qtreeusage; use base qw(centreon::plugins::templates::counter); @@ -136,12 +136,12 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - "filter-vserver:s" => { name => 'filter_vserver' }, - "filter-volume:s" => { name => 'filter_volume' }, - "filter-qtree:s" => { name => 'filter_qtree' }, - "not-kbytes" => { name => 'not_kbytes' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' }, + 'filter-vserver:s' => { name => 'filter_vserver' }, + 'filter-volume:s' => { name => 'filter_volume' }, + 'filter-qtree:s' => { name => 'filter_qtree' }, + 'not-kbytes' => { name => 'not_kbytes' }, }); return $self; diff --git a/storage/netapp/snmp/mode/sharecalls.pm b/storage/netapp/ontap/snmp/mode/sharecalls.pm similarity index 98% rename from storage/netapp/snmp/mode/sharecalls.pm rename to storage/netapp/ontap/snmp/mode/sharecalls.pm index 582e18395..f524fdfe6 100644 --- a/storage/netapp/snmp/mode/sharecalls.pm +++ b/storage/netapp/ontap/snmp/mode/sharecalls.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::sharecalls; +package storage::netapp::ontap::snmp::mode::sharecalls; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/shelf.pm b/storage/netapp/ontap/snmp/mode/shelf.pm similarity index 95% rename from storage/netapp/snmp/mode/shelf.pm rename to storage/netapp/ontap/snmp/mode/shelf.pm index 298eb8f31..86b80fa1b 100644 --- a/storage/netapp/snmp/mode/shelf.pm +++ b/storage/netapp/ontap/snmp/mode/shelf.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::shelf; +package storage::netapp::ontap::snmp::mode::shelf; use base qw(centreon::plugins::templates::hardware); @@ -79,7 +79,7 @@ sub set_system { ], }; - $self->{components_path} = 'storage::netapp::snmp::mode::components'; + $self->{components_path} = 'storage::netapp::ontap::snmp::mode::components'; $self->{components_module} = ['communication', 'psu', 'fan', 'temperature', 'voltage', 'electronics', 'raid']; } @@ -100,9 +100,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -162,4 +161,4 @@ Example: --critical='temperature,.*,25' --warning='temperature,.*,35' =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/sis.pm b/storage/netapp/ontap/snmp/mode/sis.pm similarity index 99% rename from storage/netapp/snmp/mode/sis.pm rename to storage/netapp/ontap/snmp/mode/sis.pm index 46e12663d..5b8ecd318 100644 --- a/storage/netapp/snmp/mode/sis.pm +++ b/storage/netapp/ontap/snmp/mode/sis.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::sis; +package storage::netapp::ontap::snmp::mode::sis; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/snapmirrorlag.pm b/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm similarity index 99% rename from storage/netapp/snmp/mode/snapmirrorlag.pm rename to storage/netapp/ontap/snmp/mode/snapmirrorlag.pm index 3f5eb2087..da872b363 100644 --- a/storage/netapp/snmp/mode/snapmirrorlag.pm +++ b/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::snapmirrorlag; +package storage::netapp::ontap::snmp::mode::snapmirrorlag; use base qw(centreon::plugins::templates::counter); diff --git a/storage/netapp/snmp/mode/snapshotage.pm b/storage/netapp/ontap/snmp/mode/snapshotage.pm similarity index 93% rename from storage/netapp/snmp/mode/snapshotage.pm rename to storage/netapp/ontap/snmp/mode/snapshotage.pm index cc147816a..c0c30e266 100644 --- a/storage/netapp/snmp/mode/snapshotage.pm +++ b/storage/netapp/ontap/snmp/mode/snapshotage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::snapshotage; +package storage::netapp::ontap::snmp::mode::snapshotage; use base qw(centreon::plugins::mode); @@ -38,15 +38,14 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "name:s" => { name => 'name' }, - "regexp" => { name => 'use_regexp' }, - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - }); - $self->{snapshot_id_selected} = []; + $options{options}->add_options(arguments => { + 'name:s' => { name => 'name' }, + 'regexp' => { name => 'use_regexp' }, + 'warning:s' => { name => 'warning' }, + 'critical:s' => { name => 'critical' }, + }); + $self->{snapshot_id_selected} = []; return $self; } diff --git a/storage/netapp/snmp/mode/snapvaultusage.pm b/storage/netapp/ontap/snmp/mode/snapvaultusage.pm similarity index 96% rename from storage/netapp/snmp/mode/snapvaultusage.pm rename to storage/netapp/ontap/snmp/mode/snapvaultusage.pm index 24ac978e7..e39bc7c0c 100644 --- a/storage/netapp/snmp/mode/snapvaultusage.pm +++ b/storage/netapp/ontap/snmp/mode/snapvaultusage.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::snapvaultusage; +package storage::netapp::ontap::snmp::mode::snapvaultusage; use base qw(centreon::plugins::templates::counter); @@ -111,10 +111,10 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "unknown-status:s" => { name => 'unknown_status', default => '' }, - "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '' }, + 'filter-name:s' => { name => 'filter_name' }, + 'unknown-status:s' => { name => 'unknown_status', default => '' }, + 'warning-status:s' => { name => 'warning_status', default => '' }, + 'critical-status:s' => { name => 'critical_status', default => '' }, }); return $self; diff --git a/storage/netapp/snmp/mode/temperature.pm b/storage/netapp/ontap/snmp/mode/temperature.pm similarity index 84% rename from storage/netapp/snmp/mode/temperature.pm rename to storage/netapp/ontap/snmp/mode/temperature.pm index 18100d5b5..75c4fbdad 100644 --- a/storage/netapp/snmp/mode/temperature.pm +++ b/storage/netapp/ontap/snmp/mode/temperature.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::temperature; +package storage::netapp::ontap::snmp::mode::temperature; use base qw(centreon::plugins::mode); @@ -34,10 +34,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } @@ -54,11 +53,14 @@ sub run { my $oid_envOverTemperature = '.1.3.6.1.4.1.789.1.2.4.1'; my $oid_nodeName = '.1.3.6.1.4.1.789.1.25.2.1.1'; my $oid_nodeEnvOverTemperature = '.1.3.6.1.4.1.789.1.25.2.1.18'; - my $results = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oid_envOverTemperature }, - { oid => $oid_nodeName }, - { oid => $oid_nodeEnvOverTemperature }, - ], nothing_quit => 1); + my $results = $self->{snmp}->get_multiple_table( + oids => [ + { oid => $oid_envOverTemperature }, + { oid => $oid_nodeName }, + { oid => $oid_nodeEnvOverTemperature }, + ], + nothing_quit => 1 + ); if (defined($results->{$oid_envOverTemperature}->{$oid_envOverTemperature . '.0'})) { $self->{output}->output_add(severity => 'OK', @@ -101,4 +103,4 @@ Check if hardware is currently operating outside of its recommended temperature =back =cut - \ No newline at end of file + diff --git a/storage/netapp/snmp/mode/volumeoptions.pm b/storage/netapp/ontap/snmp/mode/volumeoptions.pm similarity index 92% rename from storage/netapp/snmp/mode/volumeoptions.pm rename to storage/netapp/ontap/snmp/mode/volumeoptions.pm index 07f308682..5bef56586 100644 --- a/storage/netapp/snmp/mode/volumeoptions.pm +++ b/storage/netapp/ontap/snmp/mode/volumeoptions.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package storage::netapp::snmp::mode::volumeoptions; +package storage::netapp::ontap::snmp::mode::volumeoptions; use base qw(centreon::plugins::templates::counter); @@ -28,7 +28,7 @@ use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold) sub custom_options_threshold { my ($self, %options) = @_; - + my $status = catalog_status_threshold($self, %options); if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { $self->{instance_mode}->{global}->{failed}++; @@ -105,14 +105,14 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "filter-name:s" => { name => 'filter_name' }, - "filter-status:s" => { name => 'filter_status' }, - "unknown-status:s" => { name => 'unknown_status', default => '' }, - "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '' }, - "unknown-options:s" => { name => 'unknown_options', default => '' }, - "warning-options:s" => { name => 'warning_options', default => '' }, - "critical-options:s" => { name => 'critical_options', default => '' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-status:s' => { name => 'filter_status' }, + 'unknown-status:s' => { name => 'unknown_status', default => '' }, + 'warning-status:s' => { name => 'warning_status', default => '' }, + 'critical-status:s' => { name => 'critical_status', default => '' }, + 'unknown-options:s' => { name => 'unknown_options', default => '' }, + 'warning-options:s' => { name => 'warning_options', default => '' }, + 'critical-options:s' => { name => 'critical_options', default => '' }, }); return $self; diff --git a/storage/netapp/ontap/snmp/plugin.pm b/storage/netapp/ontap/snmp/plugin.pm new file mode 100644 index 000000000..8eabd7c9e --- /dev/null +++ b/storage/netapp/ontap/snmp/plugin.pm @@ -0,0 +1,72 @@ +# +# Copyright 2020 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 storage::netapp::ontap::snmp::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_snmp); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'aggregatestate' => 'storage::netapp::ontap::snmp::mode::aggregatestate', + 'cache-age' => 'storage::netapp::ontap::snmp::mode::cacheage', + 'cp-statistics' => 'storage::netapp::ontap::snmp::mode::cpstatistics', + 'cpuload' => 'storage::netapp::ontap::snmp::mode::cpuload', + 'diskfailed' => 'storage::netapp::ontap::snmp::mode::diskfailed', + 'failover' => 'storage::netapp::ontap::snmp::mode::failover', + 'fan' => 'storage::netapp::ontap::snmp::mode::fan', + 'filesys' => 'storage::netapp::ontap::snmp::mode::filesys', + 'list-filesys' => 'storage::netapp::ontap::snmp::mode::listfilesys', + 'list-snapvault' => 'storage::netapp::ontap::snmp::mode::listsnapvault', + 'global-status' => 'storage::netapp::ontap::snmp::mode::globalstatus', + 'ndmpsessions' => 'storage::netapp::ontap::snmp::mode::ndmpsessions', + 'nvram' => 'storage::netapp::ontap::snmp::mode::nvram', + 'partnerstatus' => 'storage::netapp::ontap::snmp::mode::partnerstatus', + 'psu' => 'storage::netapp::ontap::snmp::mode::psu', + 'qtree-usage' => 'storage::netapp::ontap::snmp::mode::qtreeusage', + 'share-calls' => 'storage::netapp::ontap::snmp::mode::sharecalls', + 'shelf' => 'storage::netapp::ontap::snmp::mode::shelf', + 'sis' => 'storage::netapp::ontap::snmp::mode::sis', + 'snapmirrorlag' => 'storage::netapp::ontap::snmp::mode::snapmirrorlag', + 'snapshotage' => 'storage::netapp::ontap::snmp::mode::snapshotage', + 'snapvault-usage' => 'storage::netapp::ontap::snmp::mode::snapvaultusage', + 'temperature' => 'storage::netapp::ontap::snmp::mode::temperature', + 'uptime' => 'snmp_standard::mode::uptime', + 'volumeoptions' => 'storage::netapp::ontap::snmp::mode::volumeoptions' + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Netapp ONTAP in SNMP. + +=cut diff --git a/storage/netapp/restapi/plugin.pm b/storage/netapp/restapi/plugin.pm deleted file mode 100644 index 64709c915..000000000 --- a/storage/netapp/restapi/plugin.pm +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright 2020 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 storage::netapp::restapi::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} = '1.0'; - %{$self->{modes}} = ( - 'aggregate-raid-status' => 'storage::netapp::restapi::mode::aggregateraidstatus', - 'aggregate-status' => 'storage::netapp::restapi::mode::aggregatestatus', - 'aggregate-usage' => 'storage::netapp::restapi::mode::aggregateusage', - 'cluster-io' => 'storage::netapp::restapi::mode::clusterio', - 'cluster-status' => 'storage::netapp::restapi::mode::clusterstatus', - 'cluster-usage' => 'storage::netapp::restapi::mode::clusterusage', - 'disk-failed' => 'storage::netapp::restapi::mode::diskfailed', - 'disk-spare' => 'storage::netapp::restapi::mode::diskspare', - 'fc-port-status' => 'storage::netapp::restapi::mode::fcportstatus', - 'list-aggregates' => 'storage::netapp::restapi::mode::listaggregates', - 'list-clusters' => 'storage::netapp::restapi::mode::listclusters', - 'list-fc-ports' => 'storage::netapp::restapi::mode::listfcports', - 'list-luns' => 'storage::netapp::restapi::mode::listluns', - 'list-nodes' => 'storage::netapp::restapi::mode::listnodes', - 'list-snapmirrors' => 'storage::netapp::restapi::mode::listsnapmirrors', - 'list-volumes' => 'storage::netapp::restapi::mode::listvolumes', - 'lun-alignment' => 'storage::netapp::restapi::mode::lunalignment', - 'lun-online' => 'storage::netapp::restapi::mode::lunonline', - 'lun-usage' => 'storage::netapp::restapi::mode::lunusage', - 'node-failover-status' => 'storage::netapp::restapi::mode::nodefailoverstatus', - 'node-hardware-status' => 'storage::netapp::restapi::mode::nodehardwarestatus', - 'qtree-status' => 'storage::netapp::restapi::mode::qtreestatus', - 'snapmirror-status' => 'storage::netapp::restapi::mode::snapmirrorstatus', - 'snapmirror-usage' => 'storage::netapp::restapi::mode::snapmirrorusage', - 'volume-io' => 'storage::netapp::restapi::mode::volumeio', - 'volume-status' => 'storage::netapp::restapi::mode::volumestatus', - 'volume-usage' => 'storage::netapp::restapi::mode::volumeusage', - ); - - $self->{custom_modes}{api} = 'storage::netapp::restapi::custom::restapi'; - return $self; -} - -1; - -__END__ - -=head1 PLUGIN DESCRIPTION - -Check NetApp with OnCommand API. - -=cut diff --git a/storage/netapp/snmp/plugin.pm b/storage/netapp/snmp/plugin.pm deleted file mode 100644 index 134b9e3c0..000000000 --- a/storage/netapp/snmp/plugin.pm +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright 2020 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 storage::netapp::snmp::plugin; - -use strict; -use warnings; -use base qw(centreon::plugins::script_snmp); - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - %{$self->{modes}} = ( - 'aggregatestate' => 'storage::netapp::snmp::mode::aggregatestate', - 'cache-age' => 'storage::netapp::snmp::mode::cacheage', - 'cp-statistics' => 'storage::netapp::snmp::mode::cpstatistics', - 'cpuload' => 'storage::netapp::snmp::mode::cpuload', - 'diskfailed' => 'storage::netapp::snmp::mode::diskfailed', - 'failover' => 'storage::netapp::snmp::mode::failover', - 'fan' => 'storage::netapp::snmp::mode::fan', - 'filesys' => 'storage::netapp::snmp::mode::filesys', - 'list-filesys' => 'storage::netapp::snmp::mode::listfilesys', - 'list-snapvault' => 'storage::netapp::snmp::mode::listsnapvault', - 'global-status' => 'storage::netapp::snmp::mode::globalstatus', - 'ndmpsessions' => 'storage::netapp::snmp::mode::ndmpsessions', - 'nvram' => 'storage::netapp::snmp::mode::nvram', - 'partnerstatus' => 'storage::netapp::snmp::mode::partnerstatus', - 'psu' => 'storage::netapp::snmp::mode::psu', - 'qtree-usage' => 'storage::netapp::snmp::mode::qtreeusage', - 'share-calls' => 'storage::netapp::snmp::mode::sharecalls', - 'shelf' => 'storage::netapp::snmp::mode::shelf', - 'sis' => 'storage::netapp::snmp::mode::sis', - 'snapmirrorlag' => 'storage::netapp::snmp::mode::snapmirrorlag', - 'snapshotage' => 'storage::netapp::snmp::mode::snapshotage', - 'snapvault-usage' => 'storage::netapp::snmp::mode::snapvaultusage', - 'temperature' => 'storage::netapp::snmp::mode::temperature', - 'uptime' => 'snmp_standard::mode::uptime', - 'volumeoptions' => 'storage::netapp::snmp::mode::volumeoptions', - ); - - return $self; -} - -1; - -__END__ - -=head1 PLUGIN DESCRIPTION - -Check Netapp in SNMP (Some Check needs ONTAP 8.x). - -=cut