From 56bbe18b3c7bbce2bf4b32fb09b6089cfffd9519 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 26 Jun 2015 13:16:55 +0200 Subject: [PATCH] + Change cisco SB path (Fix #84) --- .../cisco/smallbusiness/{ => snmp}/mode/components/fan.pm | 2 +- .../cisco/smallbusiness/{ => snmp}/mode/components/psu.pm | 2 +- .../common/cisco/smallbusiness/{ => snmp}/mode/cpu.pm | 8 ++++---- .../cisco/smallbusiness/{ => snmp}/mode/environment.pm | 6 +++--- .../smallbusiness/{sf500 => standard/snmp}/plugin.pm | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) rename centreon/common/cisco/smallbusiness/{ => snmp}/mode/components/fan.pm (98%) rename centreon/common/cisco/smallbusiness/{ => snmp}/mode/components/psu.pm (98%) rename centreon/common/cisco/smallbusiness/{ => snmp}/mode/cpu.pm (96%) rename centreon/common/cisco/smallbusiness/{ => snmp}/mode/environment.pm (98%) rename network/cisco/smallbusiness/{sf500 => standard/snmp}/plugin.pm (93%) diff --git a/centreon/common/cisco/smallbusiness/mode/components/fan.pm b/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm similarity index 98% rename from centreon/common/cisco/smallbusiness/mode/components/fan.pm rename to centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm index df296fcfd..cfc2f9b53 100644 --- a/centreon/common/cisco/smallbusiness/mode/components/fan.pm +++ b/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm @@ -33,7 +33,7 @@ # #################################################################################### -package centreon::common::cisco::smallbusiness::mode::components::fan; +package centreon::common::cisco::smallbusiness::snmp::mode::components::fan; use strict; use warnings; diff --git a/centreon/common/cisco/smallbusiness/mode/components/psu.pm b/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm similarity index 98% rename from centreon/common/cisco/smallbusiness/mode/components/psu.pm rename to centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm index acd455e19..892df8081 100644 --- a/centreon/common/cisco/smallbusiness/mode/components/psu.pm +++ b/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm @@ -33,7 +33,7 @@ # #################################################################################### -package centreon::common::cisco::smallbusiness::mode::components::psu; +package centreon::common::cisco::smallbusiness::snmp::mode::components::psu; use strict; use warnings; diff --git a/centreon/common/cisco/smallbusiness/mode/cpu.pm b/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm similarity index 96% rename from centreon/common/cisco/smallbusiness/mode/cpu.pm rename to centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm index 9ea56e321..463c49461 100644 --- a/centreon/common/cisco/smallbusiness/mode/cpu.pm +++ b/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm @@ -33,7 +33,7 @@ # #################################################################################### -package centreon::common::cisco::smallbusiness::mode::cpu; +package centreon::common::cisco::smallbusiness::snmp::mode::cpu; use base qw(centreon::plugins::mode); @@ -117,17 +117,17 @@ sub run { short_msg => sprintf("CPU: %.2f%% (1sec), %.2f%% (1min), %.2f%% (5min)", $cpu1sec, $cpu1min, $cpu5min)); - $self->{output}->perfdata_add(label => "cpu_1s", + $self->{output}->perfdata_add(label => "cpu_1s", unit => '%', value => $cpu1sec, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1s'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1s'), min => 0, max => 100); - $self->{output}->perfdata_add(label => "cpu_1m", + $self->{output}->perfdata_add(label => "cpu_1m", unit => '%', value => $cpu1min, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1m'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1m'), min => 0, max => 100); - $self->{output}->perfdata_add(label => "cpu_5m", + $self->{output}->perfdata_add(label => "cpu_5m", unit => '%', value => $cpu5min, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn5m'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit5m'), diff --git a/centreon/common/cisco/smallbusiness/mode/environment.pm b/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm similarity index 98% rename from centreon/common/cisco/smallbusiness/mode/environment.pm rename to centreon/common/cisco/smallbusiness/snmp/mode/environment.pm index b3e6f74e8..ce1f6fbc7 100644 --- a/centreon/common/cisco/smallbusiness/mode/environment.pm +++ b/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm @@ -33,7 +33,7 @@ # #################################################################################### -package centreon::common::cisco::smallbusiness::mode::environment; +package centreon::common::cisco::smallbusiness::snmp::mode::environment; use base qw(centreon::plugins::mode); @@ -116,7 +116,7 @@ sub run { my @components = ('psu', 'fan'); foreach (@components) { if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::cisco::smallbusiness::mode::components::$_"; + my $mod_name = "centreon::common::cisco::smallbusiness::snmp::mode::components::$_"; centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, error_msg => "Cannot load module '$mod_name'."); my $func = $mod_name->can('load'); @@ -132,7 +132,7 @@ sub run { foreach (@components) { if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::cisco::smallbusiness::mode::components::$_"; + my $mod_name = "centreon::common::cisco::smallbusiness::snmp::mode::components::$_"; my $func = $mod_name->can('check'); $func->($self); } diff --git a/network/cisco/smallbusiness/sf500/plugin.pm b/network/cisco/smallbusiness/standard/snmp/plugin.pm similarity index 93% rename from network/cisco/smallbusiness/sf500/plugin.pm rename to network/cisco/smallbusiness/standard/snmp/plugin.pm index 516f5aedc..61b76cf71 100644 --- a/network/cisco/smallbusiness/sf500/plugin.pm +++ b/network/cisco/smallbusiness/standard/snmp/plugin.pm @@ -33,7 +33,7 @@ # #################################################################################### -package network::cisco::smallbusiness::sf500::plugin; +package network::cisco::smallbusiness::standard::snmp::plugin; use strict; use warnings; @@ -47,8 +47,8 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'cpu' => 'centreon::common::cisco::smallbusiness::mode::cpu', - 'environment' => 'centreon::common::cisco::smallbusiness::mode::environment', + 'cpu' => 'centreon::common::cisco::smallbusiness::snmp::mode::cpu', + 'environment' => 'centreon::common::cisco::smallbusiness::snmp::mode::environment', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'packet-errors' => 'snmp_standard::mode::packeterrors', 'spanning-tree' => 'snmp_standard::mode::spanningtree', @@ -64,6 +64,6 @@ __END__ =head1 PLUGIN DESCRIPTION -Check Cisco SB SF500 series switches in SNMP. +Check Cisco SB series switches in SNMP. =cut