diff --git a/network/h3c/snmp/mode/components/default.pm b/centreon/common/h3c/snmp/mode/components/default.pm similarity index 98% rename from network/h3c/snmp/mode/components/default.pm rename to centreon/common/h3c/snmp/mode/components/default.pm index baf46f76c..436fcf499 100644 --- a/network/h3c/snmp/mode/components/default.pm +++ b/centreon/common/h3c/snmp/mode/components/default.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::components::default; +package centreon::common::h3c::snmp::mode::components::default; use strict; use warnings; diff --git a/network/h3c/snmp/mode/components/fan.pm b/centreon/common/h3c/snmp/mode/components/fan.pm similarity index 97% rename from network/h3c/snmp/mode/components/fan.pm rename to centreon/common/h3c/snmp/mode/components/fan.pm index 132bf9583..478522d17 100644 --- a/network/h3c/snmp/mode/components/fan.pm +++ b/centreon/common/h3c/snmp/mode/components/fan.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::components::fan; +package centreon::common::h3c::snmp::mode::components::fan; use strict; use warnings; diff --git a/network/h3c/snmp/mode/components/psu.pm b/centreon/common/h3c/snmp/mode/components/psu.pm similarity index 97% rename from network/h3c/snmp/mode/components/psu.pm rename to centreon/common/h3c/snmp/mode/components/psu.pm index b6db03d0d..252d2c5d5 100644 --- a/network/h3c/snmp/mode/components/psu.pm +++ b/centreon/common/h3c/snmp/mode/components/psu.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::components::psu; +package centreon::common::h3c::snmp::mode::components::psu; use strict; use warnings; diff --git a/network/h3c/snmp/mode/components/sensor.pm b/centreon/common/h3c/snmp/mode/components/sensor.pm similarity index 98% rename from network/h3c/snmp/mode/components/sensor.pm rename to centreon/common/h3c/snmp/mode/components/sensor.pm index c189956cc..4e6c379c0 100644 --- a/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon/common/h3c/snmp/mode/components/sensor.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::components::sensor; +package centreon::common::h3c::snmp::mode::components::sensor; use strict; use warnings; diff --git a/network/h3c/snmp/mode/cpu.pm b/centreon/common/h3c/snmp/mode/cpu.pm similarity index 99% rename from network/h3c/snmp/mode/cpu.pm rename to centreon/common/h3c/snmp/mode/cpu.pm index 926a79bb9..ab44a38f3 100644 --- a/network/h3c/snmp/mode/cpu.pm +++ b/centreon/common/h3c/snmp/mode/cpu.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::cpu; +package centreon::common::h3c::snmp::mode::cpu; use base qw(centreon::plugins::mode); diff --git a/network/h3c/snmp/mode/hardware.pm b/centreon/common/h3c/snmp/mode/hardware.pm similarity index 98% rename from network/h3c/snmp/mode/hardware.pm rename to centreon/common/h3c/snmp/mode/hardware.pm index 950f23c05..e0545eb69 100644 --- a/network/h3c/snmp/mode/hardware.pm +++ b/centreon/common/h3c/snmp/mode/hardware.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::hardware; +package centreon::common::h3c::snmp::mode::hardware; use base qw(centreon::plugins::templates::hardware); @@ -112,7 +112,7 @@ sub set_system { ], }; - $self->{components_path} = 'network::h3c::snmp::mode::components'; + $self->{components_path} = 'centreon::common::h3c::snmp::mode::components'; $self->{components_module} = ['chassis', 'backplane', 'container', 'psu', 'fan', 'sensor', 'module', 'port', 'stack', 'cpu', 'other', 'unknown']; diff --git a/network/h3c/snmp/mode/memory.pm b/centreon/common/h3c/snmp/mode/memory.pm similarity index 99% rename from network/h3c/snmp/mode/memory.pm rename to centreon/common/h3c/snmp/mode/memory.pm index 86b02960f..cc0ce1b30 100644 --- a/network/h3c/snmp/mode/memory.pm +++ b/centreon/common/h3c/snmp/mode/memory.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::h3c::snmp::mode::memory; +package centreon::common::h3c::snmp::mode::memory; use base qw(centreon::plugins::mode); diff --git a/network/h3c/snmp/plugin.pm b/network/h3c/snmp/plugin.pm index 3d05ba659..bd1fa2649 100644 --- a/network/h3c/snmp/plugin.pm +++ b/network/h3c/snmp/plugin.pm @@ -31,11 +31,11 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'cpu' => 'network::h3c::snmp::mode::cpu', - 'hardware' => 'network::h3c::snmp::mode::hardware', + 'cpu' => 'centreon::common::h3c::snmp::mode::cpu', + 'hardware' => 'centreon::common::h3c::snmp::mode::hardware', 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', - 'memory' => 'network::h3c::snmp::mode::memory', + 'memory' => 'centreon::common::h3c::snmp::mode::memory', ); return $self; diff --git a/network/hp/standard/snmp/plugin.pm b/network/hp/standard/snmp/plugin.pm new file mode 100644 index 000000000..5e6f4f667 --- /dev/null +++ b/network/hp/standard/snmp/plugin.pm @@ -0,0 +1,54 @@ +# +# Copyright 2019 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package network::hp::standard::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}} = ( + 'cpu' => 'centreon::common::h3c::snmp::mode::cpu', + 'hardware' => 'centreon::common::h3c::snmp::mode::hardware', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'memory' => 'centreon::common::h3c::snmp::mode::memory', + 'spanning-tree' => 'snmp_standard::mode::spanningtree', + 'uptime' => 'snmp_standard::mode::uptime', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check HP switches in SNMP. + +=cut diff --git a/snmp_standard/mode/spanningtree.pm b/snmp_standard/mode/spanningtree.pm index 635056a0c..844da61a1 100644 --- a/snmp_standard/mode/spanningtree.pm +++ b/snmp_standard/mode/spanningtree.pm @@ -51,7 +51,7 @@ sub custom_status_threshold { sub custom_status_output { my ($self, %options) = @_; - my $msg = " spanning tree state is '" . $self->{result_values}->{state} . "' [index: '" . $self->{result_values}->{index} . "']"; + my $msg = "spanning tree state is '" . $self->{result_values}->{state} . "' [index: '" . $self->{result_values}->{index} . "']"; return $msg; } @@ -88,7 +88,7 @@ sub set_counters { sub prefix_peers_output { my ($self, %options) = @_; - return "Port: '" . $options{instance_value}->{display} . "' "; + return "Port '" . $options{instance_value}->{display} . "' "; } sub new {