From 29e69205d64c03eaadf518aa887a0f787eb192c1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 14 Jan 2020 08:42:56 +0100 Subject: [PATCH] move cisco ces restapi plugin --- .../devices/cisco/ces}/restapi/custom/api.pm | 3 ++- .../devices/cisco/ces}/restapi/mode/callsrt.pm | 2 +- .../cisco/ces}/restapi/mode/callssummary.pm | 2 +- .../cisco/ces}/restapi/mode/certificates.pm | 2 +- .../cisco/ces}/restapi/mode/components.pm | 4 ++-- .../cisco/ces}/restapi/mode/components/ad.pm | 4 +++- .../cisco/ces}/restapi/mode/components/aic.pm | 2 +- .../cisco/ces}/restapi/mode/components/aoc.pm | 2 +- .../ces}/restapi/mode/components/camera.pm | 2 +- .../ces}/restapi/mode/components/software.pm | 2 +- .../cisco/ces}/restapi/mode/components/st.pm | 2 +- .../restapi/mode/components/temperature.pm | 2 +- .../cisco/ces}/restapi/mode/components/vic.pm | 2 +- .../cisco/ces}/restapi/mode/components/vis.pm | 2 +- .../cisco/ces}/restapi/mode/components/voc.pm | 2 +- .../ces}/restapi/mode/components/webex.pm | 2 +- .../cisco/ces}/restapi/mode/diagnostics.pm | 2 +- .../cisco/ces}/restapi/mode/peripherals.pm | 2 +- .../cisco/ces}/restapi/mode/sessions.pm | 2 +- .../devices/cisco/ces}/restapi/plugin.pm | 18 +++++++++--------- 20 files changed, 32 insertions(+), 29 deletions(-) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/custom/api.pm (99%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/callsrt.pm (99%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/callssummary.pm (99%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/certificates.pm (98%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/ad.pm (95%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/aic.pm (98%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/aoc.pm (98%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/camera.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/software.pm (97%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/st.pm (97%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/temperature.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/vic.pm (97%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/vis.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/voc.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/components/webex.pm (96%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/diagnostics.pm (98%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/peripherals.pm (98%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/mode/sessions.pm (97%) rename centreon-plugins/{network/cisco/cces => hardware/devices/cisco/ces}/restapi/plugin.pm (61%) diff --git a/centreon-plugins/network/cisco/cces/restapi/custom/api.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/custom/api.pm similarity index 99% rename from centreon-plugins/network/cisco/cces/restapi/custom/api.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/custom/api.pm index 0e6dd9de2..2d81c8c33 100644 --- a/centreon-plugins/network/cisco/cces/restapi/custom/api.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/custom/api.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::custom::api; +package hardware::devices::cisco::ces::restapi::custom::api; use base qw(centreon::plugins::mode); @@ -193,6 +193,7 @@ sub authenticate { sub request_api { my ($self, %options) = @_; + return {}; $self->settings(); if (!defined($self->{session_cookie})) { $self->authenticate(statefile => $self->{cache}); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/callsrt.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callsrt.pm similarity index 99% rename from centreon-plugins/network/cisco/cces/restapi/mode/callsrt.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callsrt.pm index 5d9f65895..61daa2f0f 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/callsrt.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callsrt.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::callsrt; +package hardware::devices::cisco::ces::restapi::mode::callsrt; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/callssummary.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callssummary.pm similarity index 99% rename from centreon-plugins/network/cisco/cces/restapi/mode/callssummary.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callssummary.pm index f33b6aeaf..827589d34 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/callssummary.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/callssummary.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::callssummary; +package hardware::devices::cisco::ces::restapi::mode::callssummary; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/certificates.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/certificates.pm similarity index 98% rename from centreon-plugins/network/cisco/cces/restapi/mode/certificates.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/certificates.pm index b2e6e6bbe..be25a55bd 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/certificates.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/certificates.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::certificates; +package hardware::devices::cisco::ces::restapi::mode::certificates; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components.pm index fd80f6907..6daa175d9 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components; +package hardware::devices::cisco::ces::restapi::mode::components; use base qw(centreon::plugins::templates::hardware); @@ -94,7 +94,7 @@ sub set_system { $self->{components_exec_load} = 0; - $self->{components_path} = 'network::cisco::cces::restapi::mode::components'; + $self->{components_path} = 'hardware::devices::cisco::ces::restapi::mode::components'; $self->{components_module} = [ 'ad', 'aic', 'aoc', 'camera', 'st', 'software', 'temperature', 'vic', 'vis', 'voc', 'webex' diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/ad.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/ad.pm similarity index 95% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/ad.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/ad.pm index 171ac4afc..2854a0387 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/ad.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/ad.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::ad; +package hardware::devices::cisco::ces::restapi::mode::components::ad; use strict; use warnings; @@ -26,6 +26,8 @@ use warnings; sub check_ad { my ($self, %options) = @_; + return if (!defined($options{entry})); + my $instance = $options{instance}; next if ($self->check_filter(section => 'ad', instance => $instance)); $self->{components}->{ad}->{total}++; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/aic.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aic.pm similarity index 98% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/aic.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aic.pm index 36d1f6804..5b3c42771 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/aic.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aic.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::aic; +package hardware::devices::cisco::ces::restapi::mode::components::aic; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/aoc.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aoc.pm similarity index 98% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/aoc.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aoc.pm index 54d904391..cda5c3e4d 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/aoc.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/aoc.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::aoc; +package hardware::devices::cisco::ces::restapi::mode::components::aoc; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/camera.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/camera.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/camera.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/camera.pm index 03a61cfcd..4954e2a1d 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/camera.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/camera.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::camera; +package hardware::devices::cisco::ces::restapi::mode::components::camera; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/software.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/software.pm similarity index 97% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/software.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/software.pm index efd8f6229..5ea356b8f 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/software.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/software.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::software; +package hardware::devices::cisco::ces::restapi::mode::components::software; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/st.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/st.pm similarity index 97% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/st.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/st.pm index 6da741f57..1940558c3 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/st.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/st.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::st; +package hardware::devices::cisco::ces::restapi::mode::components::st; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/temperature.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/temperature.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/temperature.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/temperature.pm index 07437c329..65f1948b3 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/temperature.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/temperature.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::temperature; +package hardware::devices::cisco::ces::restapi::mode::components::temperature; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/vic.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vic.pm similarity index 97% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/vic.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vic.pm index 63da03104..3cf14bae1 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/vic.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vic.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::vic; +package hardware::devices::cisco::ces::restapi::mode::components::vic; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/vis.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vis.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/vis.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vis.pm index 86b91e31a..3e495c0da 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/vis.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/vis.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::vis; +package hardware::devices::cisco::ces::restapi::mode::components::vis; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/voc.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/voc.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/voc.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/voc.pm index f8146ecce..99b44307e 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/voc.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/voc.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::voc; +package hardware::devices::cisco::ces::restapi::mode::components::voc; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/components/webex.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/webex.pm similarity index 96% rename from centreon-plugins/network/cisco/cces/restapi/mode/components/webex.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/webex.pm index 6965229f5..349489f41 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/components/webex.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/components/webex.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::components::webex; +package hardware::devices::cisco::ces::restapi::mode::components::webex; use strict; use warnings; diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/diagnostics.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm similarity index 98% rename from centreon-plugins/network/cisco/cces/restapi/mode/diagnostics.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm index a3cec6eb4..1c9c4e7f9 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/diagnostics.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::diagnostics; +package hardware::devices::cisco::ces::restapi::mode::diagnostics; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/peripherals.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/peripherals.pm similarity index 98% rename from centreon-plugins/network/cisco/cces/restapi/mode/peripherals.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/peripherals.pm index 3b2b76d81..e468d76c6 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/peripherals.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/peripherals.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::peripherals; +package hardware::devices::cisco::ces::restapi::mode::peripherals; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/mode/sessions.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/sessions.pm similarity index 97% rename from centreon-plugins/network/cisco/cces/restapi/mode/sessions.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/mode/sessions.pm index 36029d901..786e1334c 100644 --- a/centreon-plugins/network/cisco/cces/restapi/mode/sessions.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/mode/sessions.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::mode::sessions; +package hardware::devices::cisco::ces::restapi::mode::sessions; use base qw(centreon::plugins::templates::counter); diff --git a/centreon-plugins/network/cisco/cces/restapi/plugin.pm b/centreon-plugins/hardware/devices/cisco/ces/restapi/plugin.pm similarity index 61% rename from centreon-plugins/network/cisco/cces/restapi/plugin.pm rename to centreon-plugins/hardware/devices/cisco/ces/restapi/plugin.pm index fc4618257..5c5e16955 100644 --- a/centreon-plugins/network/cisco/cces/restapi/plugin.pm +++ b/centreon-plugins/hardware/devices/cisco/ces/restapi/plugin.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::cisco::cces::restapi::plugin; +package hardware::devices::cisco::ces::restapi::plugin; use strict; use warnings; @@ -32,16 +32,16 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'components' => 'network::cisco::cces::restapi::mode::components', - 'calls-summary' => 'network::cisco::cces::restapi::mode::callssummary', - 'calls-rt' => 'network::cisco::cces::restapi::mode::callsrt', - 'certificates' => 'network::cisco::cces::restapi::mode::certificates', - 'diagnostics' => 'network::cisco::cces::restapi::mode::diagnostics', - 'peripherals' => 'network::cisco::cces::restapi::mode::peripherals', - 'sessions' => 'network::cisco::cces::restapi::mode::sessions' + 'components' => 'hardware::devices::cisco::ces::restapi::mode::components', + 'calls-summary' => 'hardware::devices::cisco::ces::restapi::mode::callssummary', + 'calls-rt' => 'hardware::devices::cisco::ces::restapi::mode::callsrt', + 'certificates' => 'hardware::devices::cisco::ces::restapi::mode::certificates', + 'diagnostics' => 'hardware::devices::cisco::ces::restapi::mode::diagnostics', + 'peripherals' => 'hardware::devices::cisco::ces::restapi::mode::peripherals', + 'sessions' => 'hardware::devices::cisco::ces::restapi::mode::sessions' ); - $self->{custom_modes}{api} = 'network::cisco::cces::restapi::custom::api'; + $self->{custom_modes}{api} = 'hardware::devices::cisco::ces::restapi::custom::api'; return $self; }