From 1149b90abeef65e59f388119d7b9a1557b4090e2 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Thu, 7 Jan 2016 15:15:21 +0100 Subject: [PATCH 001/346] add SNI support for subject name - #241 --- .../apps/protocols/x509/mode/validity.pm | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index e04750d08..59436d06c 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -148,13 +148,21 @@ sub run { #Subject Name } elsif ($self->{option_results}->{validity_mode} eq 'subject') { - my $subject_name = Net::SSLeay::X509_NAME_oneline(Net::SSLeay::X509_get_subject_name($cert)); - if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("Subject Name '%s' is present in Certificate: %s", $self->{option_results}->{subjectname}, $subject_name)); - } else { + my $subject_altname; + my @subject_name = Net::SSLeay::X509_get_subjectAltNames($cert); + foreach my $subject_name (@subject_name) { + if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { + $subject_altname = $subject_name; + next; + } + } + + if (!defined($subject_altname)) { $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Subject Name '%s' is not present in Certificate: %s", $self->{option_results}->{subjectname}, $subject_name)); + short_msg => sprintf("Subject Name '%s' is not present in Certificate", $self->{option_results}->{subjectname})); + } else { + $self->{output}->output_add(severity => 'OK', + short_msg => sprintf("Subject Name '%s' is present in Certificate", $self->{option_results}->{subjectname})); } $self->{output}->display(); @@ -210,7 +218,7 @@ Threshold critical in days (Days before expiration, eg: '30:' for 30 days before =item B<--subjectname> -Subject Name pattern +Subject Name pattern (SNI support) =item B<--issuername> From 256516c3db2e24c5ee7c9677aea9394ce9cafc83 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 10:44:01 +0100 Subject: [PATCH 002/346] + Fix sanity arguments --- centreon-plugins/centreon/plugins/options.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/options.pm b/centreon-plugins/centreon/plugins/options.pm index 6cae0cc3b..557e2f412 100644 --- a/centreon-plugins/centreon/plugins/options.pm +++ b/centreon-plugins/centreon/plugins/options.pm @@ -61,7 +61,7 @@ sub set_sanity { $centreon::plugins::alternative::Getopt::warn_message = 1; } - $self->{sanity} == 1; + $self->{sanity} = 1; } sub set_output { From be8bdf2ee8e1e00f4b3a6b97b549e8c55311854b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 10:51:47 +0100 Subject: [PATCH 003/346] + minor fix on github stats --- centreon-plugins/apps/github/mode/stats.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/apps/github/mode/stats.pm b/centreon-plugins/apps/github/mode/stats.pm index 12a8fc354..957a06a14 100644 --- a/centreon-plugins/apps/github/mode/stats.pm +++ b/centreon-plugins/apps/github/mode/stats.pm @@ -26,6 +26,7 @@ use strict; use warnings; use centreon::plugins::http; use JSON; +use Data::Dumper; sub new { my ($class, %options) = @_; @@ -79,8 +80,7 @@ sub run { }; if ($@) { - use Data::Dumper; - $self->{output}->add_option_msg(short_msg => "Cannot decode json response"); + $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->output_add(long_msg => Data::Dumper::Dumper(), debug => 1); $self->{output}->option_exit(); } @@ -93,11 +93,14 @@ sub run { short_msg => sprintf("%d forks - %d watchers - %d stars", $forks, $watchers, $stars)); $self->{output}->perfdata_add(label => 'forks', - value => $forks); + value => $forks, + min => 0); $self->{output}->perfdata_add(label => 'watchers', - value => $watchers); + value => $watchers, + min => 0); $self->{output}->perfdata_add(label => 'stars', - value => $stars); + value => $stars, + min => 0); $self->{output}->display(); $self->{output}->exit(); @@ -143,6 +146,8 @@ Specify password =item B<--timeout> +Threshold for HTTP timeout (Default: 5) + =back =cut From 2b1880531c4d35a06c6ebba8b016398387c9dc41 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 11:19:27 +0100 Subject: [PATCH 004/346] + enhance netapp shelf to avoid unitialized --- .../storage/netapp/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm index ebb6c82f9..ee488e8df 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm @@ -77,7 +77,7 @@ sub check { foreach my $num (split /,/, $result->{enclTempSensorsPresent}) { $num = centreon::plugins::misc::trim($num); - next if ($num !~ /[0-9]/); + next if ($num !~ /[0-9]/ || !defined($current_temp[$num - 1])); $warn_under_thr[$num - 1] =~ /(-*[0-9]+)C/; my $wu_thr = $1; diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm index e5892e6d4..98d6a7e4e 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm @@ -78,7 +78,7 @@ sub check { my @values = defined($result->{enclVoltSensorsPresent}) ? split /,/, $result->{enclVoltSensorsPresent} : (); foreach my $num (@values) { $num = centreon::plugins::misc::trim($num); - next if ($num !~ /[0-9]/); + next if ($num !~ /[0-9]/ || !defined($current_volt[$num - 1])); my $wu_thr = (defined($warn_under_thr[$num - 1]) && $warn_under_thr[$num - 1] =~ /(^|\s)(-*[0-9]+)/) ? $2 : ''; my $cu_thr = (defined($crit_under_thr[$num - 1]) && $crit_under_thr[$num - 1] =~ /(^|\s)(-*[0-9]+)/) ? $2 : ''; From 27d9d588481f072b25d414df39b60f5f26da41a8 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 14:29:55 +0100 Subject: [PATCH 005/346] + update: refactoring with hardware template class --- .../common/airespace/snmp/mode/hardware.pm | 1 - .../bluecoat/snmp/mode/components/disk.pm | 4 +- .../bluecoat/snmp/mode/components/sensor.pm | 4 +- .../network/bluecoat/snmp/mode/hardware.pm | 325 ++++-------------- .../network/checkpoint/mode/components/fan.pm | 8 +- .../network/checkpoint/mode/components/psu.pm | 8 +- .../checkpoint/mode/components/temperature.pm | 8 +- .../checkpoint/mode/components/voltage.pm | 8 +- .../network/checkpoint/mode/hardware.pm | 212 +++--------- .../ironport/snmp/mode/components/fan.pm | 8 +- .../ironport/snmp/mode/components/psu.pm | 8 +- .../ironport/snmp/mode/components/raid.pm | 8 +- .../snmp/mode/components/temperature.pm | 8 +- .../cisco/ironport/snmp/mode/hardware.pm | 252 ++------------ .../dlink/dgs3100/snmp/mode/components/fan.pm | 8 +- .../dlink/dgs3100/snmp/mode/components/psu.pm | 8 +- .../dlink/dgs3100/snmp/mode/hardware.pm | 214 +++--------- .../standard/snmp/mode/components/fan.pm | 8 +- .../standard/snmp/mode/components/psu.pm | 8 +- .../snmp/mode/components/temperature.pm | 8 +- .../dlink/standard/snmp/mode/hardware.pm | 252 +++----------- .../network/extreme/snmp/mode/hardware.pm | 1 - .../network/f5/bigip/mode/hardware.pm | 1 - .../standard/snmp/mode/components/fan.pm | 8 +- .../standard/snmp/mode/components/led.pm | 8 +- .../standard/snmp/mode/components/psu.pm | 8 +- .../snmp/mode/components/temperature.pm | 8 +- .../hirschmann/standard/snmp/mode/hardware.pm | 265 +++----------- .../hp/procurve/mode/components/sensor.pm | 8 +- .../network/hp/procurve/mode/environment.pm | 197 ++--------- .../common/junos/mode/components/fru.pm | 8 +- .../common/junos/mode/components/operating.pm | 8 +- .../juniper/common/junos/mode/hardware.pm | 285 +++------------ .../common/screenos/mode/components/fan.pm | 4 +- .../common/screenos/mode/components/module.pm | 4 +- .../common/screenos/mode/components/psu.pm | 4 +- .../screenos/mode/components/temperature.pm | 4 +- .../juniper/common/screenos/mode/hardware.pm | 256 ++------------ .../redback/snmp/mode/components/disk.pm | 8 +- .../redback/snmp/mode/components/fan.pm | 8 +- .../redback/snmp/mode/components/psu.pm | 8 +- .../snmp/mode/components/temperature.pm | 8 +- .../redback/snmp/mode/components/voltage.pm | 8 +- .../network/redback/snmp/mode/hardware.pm | 267 +++----------- 44 files changed, 562 insertions(+), 2190 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm index 339a9db7a..a9818172b 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm @@ -32,7 +32,6 @@ sub set_system { $self->{cb_hook2} = 'snmp_execute'; - #Example for threshold: $self->{thresholds} = { psu => [ ['not operational', 'CRITICAL'], diff --git a/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm b/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm index 4f481c016..cb078d198 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm @@ -44,9 +44,9 @@ my $mapping = { my $oid_deviceDiskValueEntry = '.1.3.6.1.4.1.3417.2.2.1.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_deviceDiskValueEntry }; + push @{$self->{request}}, { oid => $oid_deviceDiskValueEntry }; } sub check { diff --git a/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm b/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm index 73caaff1a..940ab82e6 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm @@ -66,9 +66,9 @@ my $mapping = { my $oid_deviceSensorValueEntry = '.1.3.6.1.4.1.3417.2.1.1.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_deviceSensorValueEntry }; + push @{$self->{request}}, { oid => $oid_deviceSensorValueEntry }; } sub check { diff --git a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm index af39b7603..9f9123069 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm @@ -20,49 +20,71 @@ package network::bluecoat::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; my $thresholds = { - sensor_opstatus => [ - ['ok', 'OK'], - ['unavailable', 'UNKNOWN'], - ['nonoperational', 'UNKNOWN'], - ], - sensor => [ - ['ok', 'OK'], - ['unknown', 'UNKNOWN'], - ['nonInstalled', 'OK'], - ['voltageLowWarning', 'WARNING'], - ['voltageLowCritical', 'CRITICAL'], - ['noPower', 'CRITICAL'], - ['voltageHighWarning', 'WARNING'], - ['voltageHighCritical', 'CRITICAL'], - ['voltageHighSevere', 'CRITICAL'], - ['temperatureHighWarning', 'WARNING'], - ['temperatureHighCritical', 'CRITICAL'], - ['temperatureHighSevere', 'CRITICAL'], - ['fanSlowWarning', 'WARNING'], - ['fanSlowCritical', 'CRITICAL'], - ['fanStopped', 'CRITICAL'], - ], - disk => [ - ['present', 'OK'], - ['initializing', 'OK'], - ['inserted', 'OK'], - ['offline', 'WARNING'], - ['removed', 'WARNING'], - ['notpresent', 'OK'], - ['empty', 'WARNING'], - ['ioerror', 'CRITICAL'], - ['unusable', 'CRITICAL'], - ['unknown', 'UNKNOWN'], - ], + }; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(sensor|disk|sensor_opstatus)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^sensor$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + sensor_opstatus => [ + ['ok', 'OK'], + ['unavailable', 'UNKNOWN'], + ['nonoperational', 'UNKNOWN'], + ], + sensor => [ + ['ok', 'OK'], + ['unknown', 'UNKNOWN'], + ['nonInstalled', 'OK'], + ['voltageLowWarning', 'WARNING'], + ['voltageLowCritical', 'CRITICAL'], + ['noPower', 'CRITICAL'], + ['voltageHighWarning', 'WARNING'], + ['voltageHighCritical', 'CRITICAL'], + ['voltageHighSevere', 'CRITICAL'], + ['temperatureHighWarning', 'WARNING'], + ['temperatureHighCritical', 'CRITICAL'], + ['temperatureHighSevere', 'CRITICAL'], + ['fanSlowWarning', 'WARNING'], + ['fanSlowCritical', 'CRITICAL'], + ['fanStopped', 'CRITICAL'], + ], + disk => [ + ['present', 'OK'], + ['initializing', 'OK'], + ['inserted', 'OK'], + ['offline', 'WARNING'], + ['removed', 'WARNING'], + ['notpresent', 'OK'], + ['empty', 'WARNING'], + ['ioerror', 'CRITICAL'], + ['unusable', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ], + }; + + $self->{components_path} = 'network::bluecoat::snmp::mode::components'; + $self->{components_module} = ['sensor', 'disk']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -70,241 +92,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "absent-problem:s@" => { name => 'absent_problem' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{absent_problem} = []; - foreach my $val (@{$self->{option_results}->{absent_problem}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($section !~ /^sensor|disk|sensor_opstatus$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload section '" . $val . "'."); - $self->{output}->option_exit(); - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if ($section !~ /^sensor$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('sensor', 'disk'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::bluecoat::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::bluecoat::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub absent_problem { - my ($self, %options) = @_; - - foreach (@{$self->{absent_problem}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($_->{instance}) || $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; - } - } - } - - return 0; -} - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/network/checkpoint/mode/components/fan.pm b/centreon-plugins/network/checkpoint/mode/components/fan.pm index 3bee03320..97d3400f0 100644 --- a/centreon-plugins/network/checkpoint/mode/components/fan.pm +++ b/centreon-plugins/network/checkpoint/mode/components/fan.pm @@ -37,9 +37,9 @@ my $mapping = { my $oid_fanSpeedSensorEntry = '.1.3.6.1.4.1.2620.1.6.7.8.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_fanSpeedSensorEntry, start => $mapping->{fanSpeedSensorName}->{oid}, end => $mapping->{fanSpeedSensorStatus}->{oid} }; + push @{$self->{request}}, { oid => $oid_fanSpeedSensorEntry, start => $mapping->{fanSpeedSensorName}->{oid}, end => $mapping->{fanSpeedSensorStatus}->{oid} }; } sub check { @@ -47,14 +47,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_fanSpeedSensorEntry}})) { next if ($oid !~ /^$mapping->{fanSpeedSensorStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanSpeedSensorEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); next if ($result->{fanSpeedSensorName} !~ /^[0-9a-zA-Z ]+$/); # sometimes there is some wrong values in hex $self->{components}->{fan}->{total}++; diff --git a/centreon-plugins/network/checkpoint/mode/components/psu.pm b/centreon-plugins/network/checkpoint/mode/components/psu.pm index f3801f1b0..e987a2623 100644 --- a/centreon-plugins/network/checkpoint/mode/components/psu.pm +++ b/centreon-plugins/network/checkpoint/mode/components/psu.pm @@ -29,9 +29,9 @@ my $mapping = { my $oid_powerSupplyStatus = '.1.3.6.1.4.1.2620.1.6.7.9.1.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_powerSupplyStatus }; + push @{$self->{request}}, { oid => $oid_powerSupplyStatus }; } sub check { @@ -39,14 +39,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyStatus}})) { next if ($oid !~ /^$mapping->{powerSupplyStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerSupplyStatus}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; $self->{output}->output_add(long_msg => sprintf("Power supply '%s' status is '%s'", diff --git a/centreon-plugins/network/checkpoint/mode/components/temperature.pm b/centreon-plugins/network/checkpoint/mode/components/temperature.pm index 60d24298b..9dac9032a 100644 --- a/centreon-plugins/network/checkpoint/mode/components/temperature.pm +++ b/centreon-plugins/network/checkpoint/mode/components/temperature.pm @@ -37,9 +37,9 @@ my $mapping = { my $oid_tempertureSensorEntry = '.1.3.6.1.4.1.2620.1.6.7.8.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_tempertureSensorEntry, start => $mapping->{tempertureSensorName}->{oid}, end => $mapping->{tempertureSensorStatus}->{oid} }; + push @{$self->{request}}, { oid => $oid_tempertureSensorEntry, start => $mapping->{tempertureSensorName}->{oid}, end => $mapping->{tempertureSensorStatus}->{oid} }; } sub check { @@ -47,14 +47,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_tempertureSensorEntry}})) { next if ($oid !~ /^$mapping->{tempertureSensorStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_tempertureSensorEntry}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); next if ($result->{tempertureSensorName} !~ /^[0-9a-zA-Z ]+$/); # sometimes there is some wrong values in hex $self->{components}->{temperature}->{total}++; diff --git a/centreon-plugins/network/checkpoint/mode/components/voltage.pm b/centreon-plugins/network/checkpoint/mode/components/voltage.pm index edc9aeb8b..b4d49bd5a 100644 --- a/centreon-plugins/network/checkpoint/mode/components/voltage.pm +++ b/centreon-plugins/network/checkpoint/mode/components/voltage.pm @@ -37,9 +37,9 @@ my $mapping = { my $oid_voltageSensorEntry = '.1.3.6.1.4.1.2620.1.6.7.8.3.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_voltageSensorEntry, start => $mapping->{voltageSensorName}->{oid}, end => $mapping->{voltageSensorStatus}->{oid} }; + push @{$self->{request}}, { oid => $oid_voltageSensorEntry, start => $mapping->{voltageSensorName}->{oid}, end => $mapping->{voltageSensorStatus}->{oid} }; } sub check { @@ -47,14 +47,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking voltages"); $self->{components}->{voltage} = {name => 'voltages', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'voltage')); + return if ($self->check_filter(section => 'voltage')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_voltageSensorEntry}})) { next if ($oid !~ /^$mapping->{voltageSensorStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_voltageSensorEntry}, instance => $instance); - next if ($self->check_exclude(section => 'voltage', instance => $instance)); + next if ($self->check_filter(section => 'voltage', instance => $instance)); next if ($result->{voltageSensorName} !~ /^[0-9a-zA-Z ]+$/); # sometimes there is some wrong values in hex $self->{components}->{voltage}->{total}++; diff --git a/centreon-plugins/network/checkpoint/mode/hardware.pm b/centreon-plugins/network/checkpoint/mode/hardware.pm index 95a058b2e..4225386b6 100644 --- a/centreon-plugins/network/checkpoint/mode/hardware.pm +++ b/centreon-plugins/network/checkpoint/mode/hardware.pm @@ -20,176 +20,65 @@ package network::checkpoint::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - temperature => [ - ['true', 'CRITICAL'], - ['reading error', 'CRITICAL'], - ['false', 'OK'], - ], - voltage => [ - ['true', 'CRITICAL'], - ['reading error', 'CRITICAL'], - ['false', 'OK'], - ], - fan => [ - ['true', 'CRITICAL'], - ['reading error', 'CRITICAL'], - ['false', 'OK'], - ], - psu => [ - ['up', 'OK'], - ['down', 'CRITICAL'], - ['.*', 'UNKNOWN'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(temperature|voltage|fan|psu)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + temperature => [ + ['true', 'CRITICAL'], + ['reading error', 'CRITICAL'], + ['false', 'OK'], + ], + voltage => [ + ['true', 'CRITICAL'], + ['reading error', 'CRITICAL'], + ['false', 'OK'], + ], + fan => [ + ['true', 'CRITICAL'], + ['reading error', 'CRITICAL'], + ['false', 'OK'], + ], + psu => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ['.*', 'UNKNOWN'], + ], + }; + + $self->{components_path} = 'network::checkpoint::mode::components'; + $self->{components_module} = ['voltage', 'fan', 'temperature', 'psu']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('voltage', 'fan', 'temperature', 'psu'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::checkpoint::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::checkpoint::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -205,15 +94,10 @@ Check hardware (fans, power supplies, temperatures, voltages). Which component to check (Default: '.*'). Can be: 'psu', 'fan', 'temperature', 'voltage'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='psu#1#' - -=item B<--absent-problem> - -Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fan#1# +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=psu,1 =item B<--no-component> @@ -222,7 +106,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='fan,CRITICAL,^(?!(false)$)' diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm index 6e91a53f8..708b6e310 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm @@ -30,9 +30,9 @@ my $mapping = { my $oid_fanEntry = '.1.3.6.1.4.1.15497.1.1.1.10.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_fanEntry, start => $mapping->{fanRPMs}->{oid} }; + push @{$self->{request}}, { oid => $oid_fanEntry, start => $mapping->{fanRPMs}->{oid} }; } sub check { @@ -40,14 +40,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_fanEntry}})) { next if ($oid !~ /^$mapping->{fanRPMs}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("Fan '%s' is '%s' rpm [instance = %s]", diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm index 782c11de5..7e4343418 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm @@ -37,9 +37,9 @@ my $mapping = { my $oid_powerSupplyEntry = '.1.3.6.1.4.1.15497.1.1.1.8.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_powerSupplyEntry, start => $mapping->{powerSupplyStatus}->{oid} }; + push @{$self->{request}}, { oid => $oid_powerSupplyEntry, start => $mapping->{powerSupplyStatus}->{oid} }; } sub check { @@ -47,14 +47,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'power supplies', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyEntry}})) { next if ($oid !~ /^$mapping->{powerSupplyStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerSupplyEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); if ($result->{powerSupplyStatus} =~ /powerSupplyNotInstalled/i) { $self->absent_problem(section => 'psu', instance => $instance); next; diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm index 9b6a80b85..d57bb01e6 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm @@ -36,9 +36,9 @@ my $mapping = { my $oid_raidEntry = '.1.3.6.1.4.1.15497.1.1.1.18.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_raidEntry, start => $mapping->{raidStatus}->{oid} }; + push @{$self->{request}}, { oid => $oid_raidEntry, start => $mapping->{raidStatus}->{oid} }; } sub check { @@ -46,14 +46,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking raids"); $self->{components}->{raid} = {name => 'raids', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'raid')); + return if ($self->check_filter(section => 'raid')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_raidEntry}})) { next if ($oid !~ /^$mapping->{raidStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_raidEntry}, instance => $instance); - next if ($self->check_exclude(section => 'raid', instance => $instance)); + next if ($self->check_filter(section => 'raid', instance => $instance)); $self->{components}->{raid}->{total}++; $self->{output}->output_add(long_msg => sprintf("Raid '%s' status is '%s' [instance = %s]", diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm index 8140b4c58..f58ccc5ad 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm @@ -44,9 +44,9 @@ my $mapping = { my $oid_temperatureEntry = '.1.3.6.1.4.1.15497.1.1.1.9.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_temperatureEntry, start => $mapping->{degreesCelsius}->{oid} }; + push @{$self->{request}}, { oid => $oid_temperatureEntry, start => $mapping->{degreesCelsius}->{oid} }; } sub check { @@ -54,14 +54,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_temperatureEntry}})) { next if ($oid !~ /^$mapping->{degreesCelsius}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureEntry}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add(long_msg => sprintf("Temperature '%s' is '%s' degree centigrade [instance = %s]", diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm index c7705df11..d1f10ff00 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm @@ -20,24 +20,43 @@ package network::cisco::ironport::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - psu => [ - ['powerSupplyNotInstalled', 'OK'], - ['powerSupplyHealthy', 'OK'], - ['powerSupplyNoAC', 'WARNING'], - ['powerSupplyFaulty', 'CRITICAL'], - ], - raid => [ - ['driveHealthy', 'OK'], - ['driveFailure', 'CRITICAL'], - ['driveRebuild', 'WARNING'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(raid|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + psu => [ + ['powerSupplyNotInstalled', 'OK'], + ['powerSupplyHealthy', 'OK'], + ['powerSupplyNoAC', 'WARNING'], + ['powerSupplyFaulty', 'CRITICAL'], + ], + raid => [ + ['driveHealthy', 'OK'], + ['driveFailure', 'CRITICAL'], + ['driveRebuild', 'WARNING'], + ], + }; + + $self->{components_path} = 'network::cisco::ironport::snmp::mode::components'; + $self->{components_module} = ['fan', 'temperature', 'psu', 'raid']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -46,207 +65,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(temperature|fan)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature or fan)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'temperature', 'psu', 'raid'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::cisco::ironport::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::cisco::ironport::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -262,10 +86,10 @@ Check Hardware (Fans, Power Supplies, Temperatures, Raids). Which component to check (Default: '.*'). Can be: 'fan', 'temperature', 'psu', 'raid'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan,temperature) -Can also exclude specific instance: --exclude=fan#1#,temperature#2# +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=temperature) +Can also exclude specific instance: --filter=fan,1 =item B<--absent-problem> @@ -279,7 +103,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='psu,CRITICAL,^(?!(powerSupplyHealthy)$)' diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm index 915d4087a..6b056206c 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm @@ -40,9 +40,9 @@ my $mapping = { my $oid_rlEnvMonFanStatusEntry = '.1.3.6.1.4.1.171.10.94.89.89.83.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rlEnvMonFanStatusEntry }; + push @{$self->{request}}, { oid => $oid_rlEnvMonFanStatusEntry }; } sub check { @@ -50,14 +50,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rlEnvMonFanStatusEntry}})) { next if ($oid !~ /^$mapping->{rlEnvMonFanStatusDescr}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rlEnvMonFanStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $result->{rlEnvMonFanStatusDescr})); + next if ($self->check_filter(section => 'fan', instance => $result->{rlEnvMonFanStatusDescr})); next if ($result->{rlEnvMonFanState} eq 'notPresent' && $self->absent_problem(section => 'fan', instance => $result->{rlEnvMonFanStatusDescr})); $self->{components}->{fan}->{total}++; diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm index e80dd4436..642cfb0bb 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm @@ -40,9 +40,9 @@ my $mapping = { my $oid_rlEnvMonSupplyStatusEntry = '.1.3.6.1.4.1.171.10.94.89.89.83.1.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rlEnvMonSupplyStatusEntry }; + push @{$self->{request}}, { oid => $oid_rlEnvMonSupplyStatusEntry }; } sub check { @@ -50,14 +50,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rlEnvMonSupplyStatusEntry}})) { next if ($oid !~ /^$mapping->{rlEnvMonSupplyStatusDescr}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rlEnvMonSupplyStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $result->{rlEnvMonSupplyStatusDescr})); + next if ($self->check_filter(section => 'psu', instance => $result->{rlEnvMonSupplyStatusDescr})); next if ($result->{rlEnvMonSupplyState} eq 'notPresent' && $self->absent_problem(section => 'psu', instance => $result->{rlEnvMonSupplyStatusDescr})); $self->{components}->{psu}->{total}++; diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm index d56eb2ecc..ff20f4981 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm @@ -20,189 +20,61 @@ package network::dlink::dgs3100::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - psu => [ - ['shutdown', 'WARNING'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['notFunctioning', 'CRITICAL'], - ['notPresent', 'OK'], - ['normal', 'OK'], - ], - fan => [ - ['shutdown', 'WARNING'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['notFunctioning', 'CRITICAL'], - ['notPresent', 'OK'], - ['normal', 'OK'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + psu => [ + ['shutdown', 'WARNING'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['notFunctioning', 'CRITICAL'], + ['notPresent', 'OK'], + ['normal', 'OK'], + ], + fan => [ + ['shutdown', 'WARNING'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['notFunctioning', 'CRITICAL'], + ['notPresent', 'OK'], + ['normal', 'OK'], + ], + }; + + $self->{components_path} = 'network::dlink::dgs3100::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::dlink::dgs3100::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::dlink::dgs3100::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -218,10 +90,10 @@ Check hardware (Fans, Power Supplies). Which component to check (Default: '.*'). Can be: 'psu', 'fan'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='fan#fan1_unit2#' +Exclude some parts (comma seperated list) (Example: --filter=psu) +Can also exclude specific instance: --filter=fan,fan1_unit2 =item B<--absent-problem> @@ -235,7 +107,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)' diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm index 4d0d9e5c2..deb12ab4d 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm @@ -41,9 +41,9 @@ my $mapping = { my $oid_swFanEntry = '.1.3.6.1.4.1.171.12.11.1.7.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_swFanEntry }; + push @{$self->{request}}, { oid => $oid_swFanEntry }; } sub check { @@ -51,14 +51,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_swFanEntry}})) { next if ($oid !~ /^$mapping->{swFanStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_swFanEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("fan '%s' status is %s [speed = %s].", diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm index 3f82dd5ba..fba713ac0 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm @@ -40,9 +40,9 @@ my $mapping = { my $oid_swPowerEntry = '.1.3.6.1.4.1.171.12.11.1.6.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_swPowerEntry }; + push @{$self->{request}}, { oid => $oid_swPowerEntry }; } sub check { @@ -50,14 +50,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_swPowerEntry}})) { next if ($oid !~ /^$mapping->{swPowerStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_swPowerEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; $self->{output}->output_add(long_msg => sprintf("Power supply '%s' status is %s.", diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm index 0fc334b51..463c51b49 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm @@ -30,9 +30,9 @@ my $mapping = { my $oid_swTemperatureEntry = '.1.3.6.1.4.1.171.12.11.1.8.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_swTemperatureEntry }; + push @{$self->{request}}, { oid => $oid_swTemperatureEntry }; } sub check { @@ -40,14 +40,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_swTemperatureEntry}})) { next if ($oid !~ /^$mapping->{swTemperatureCurrent}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_swTemperatureEntry}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add(long_msg => sprintf("Temperature '%s' is %dC.", diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm b/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm index 4e982c94d..dad5c3d63 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm @@ -20,222 +20,64 @@ package network::dlink::standard::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - psu => [ - ['connect', 'OK'], - ['working', 'OK'], - ['other', 'UNKNOWN'], - ['lowVoltage', 'WARNING'], - ['overCurrent', 'CRITICAL'], - ['fail', 'CRITICAL'], - ['disconnect', 'WARNING'], - ], - fan => [ - ['working', 'OK'], - ['fail', 'CRITICAL'], - ['other', 'UNKNOWN'], - ['speed-0', 'WARNING'], - ['speed-low', 'WARNING'], - ['speed-middle', 'OK'], - ['speed-high', 'WARNING'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + psu => [ + ['connect', 'OK'], + ['working', 'OK'], + ['other', 'UNKNOWN'], + ['lowVoltage', 'WARNING'], + ['overCurrent', 'CRITICAL'], + ['fail', 'CRITICAL'], + ['disconnect', 'WARNING'], + ], + fan => [ + ['working', 'OK'], + ['fail', 'CRITICAL'], + ['other', 'UNKNOWN'], + ['speed-0', 'WARNING'], + ['speed-low', 'WARNING'], + ['speed-middle', 'OK'], + ['speed-high', 'WARNING'], + ], + }; + + $self->{components_path} = 'network::dlink::standard::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'temperature']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(fan|temperature)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature or fan)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'temperature'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::dlink::standard::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::dlink::standard::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - 1; __END__ @@ -251,10 +93,10 @@ Check hardware (Fans, Power Supplies, Temperatures). Which component to check (Default: '.*'). Can be: 'psu', 'fan', 'temperature'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='fan#1.1#' +Exclude some parts (comma seperated list) (Example: --filter=psu) +Can also exclude specific instance: --filter=fan,1.1 =item B<--no-component> @@ -269,12 +111,12 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(working)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,threshold) +Set warning threshold for temperatures (syntax: section,[instance,]status,regexp) Example: --warning='temperature,.*,30' --warning='fan,.*,1000' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,threshold) +Set critical threshold for temperatures (syntax: section,[instance,]status,regexp) Example: --critical='temperature,.*,40' =back diff --git a/centreon-plugins/network/extreme/snmp/mode/hardware.pm b/centreon-plugins/network/extreme/snmp/mode/hardware.pm index 7d556d231..b7a908093 100644 --- a/centreon-plugins/network/extreme/snmp/mode/hardware.pm +++ b/centreon-plugins/network/extreme/snmp/mode/hardware.pm @@ -33,7 +33,6 @@ sub set_system { $self->{cb_hook2} = 'snmp_execute'; - #Example for threshold: $self->{thresholds} = { psu => [ ['notPresent', 'OK'], diff --git a/centreon-plugins/network/f5/bigip/mode/hardware.pm b/centreon-plugins/network/f5/bigip/mode/hardware.pm index 574e507ef..624e1c469 100644 --- a/centreon-plugins/network/f5/bigip/mode/hardware.pm +++ b/centreon-plugins/network/f5/bigip/mode/hardware.pm @@ -33,7 +33,6 @@ sub set_system { $self->{cb_hook2} = 'snmp_execute'; - #Example for threshold: $self->{thresholds} = { fan => [ ['bad', 'CRITICAL'], diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm index d4695f9da..be913512e 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm @@ -34,9 +34,9 @@ my $mapping = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{hmFanState}->{oid} }; + push @{$self->{request}}, { oid => $mapping->{hmFanState}->{oid} }; } sub check { @@ -44,14 +44,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{hmFanState}->{oid}}})) { next if ($oid !~ /^$mapping->{hmFanState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{hmFanState}->{oid}}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("fan '%s' status is %s [instance: %s].", diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm index cce547c46..92ea47020 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm @@ -34,9 +34,9 @@ my %map_led_status = ( my $oid_hmLEDGroup = '.1.3.6.1.4.1.248.14.1.1.35'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_hmLEDGroup }; + push @{$self->{request}}, { oid => $oid_hmLEDGroup }; } sub check_led { @@ -49,7 +49,7 @@ sub check_led { $options{mapping}->{$name}->{oid} =~ /\.(\d+)$/; my $instance = $1; - next if ($self->check_exclude(section => 'led', instance => $instance)); + next if ($self->check_filter(section => 'led', instance => $instance)); $self->{components}->{led}->{total}++; $self->{output}->output_add(long_msg => sprintf("Led '%s' status is %s [instance: %s].", @@ -70,7 +70,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking leds"); $self->{components}->{led} = {name => 'leds', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'led')); + return if ($self->check_filter(section => 'led')); my $mapping; if (defined($self->{results}->{$oid_hmLEDGroup}->{$oid_hmLEDGroup . '.1.1.0'})) { diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm index 9af81b65a..66abdf17f 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm @@ -36,9 +36,9 @@ my $mapping = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{hmPSState}->{oid} }; + push @{$self->{request}}, { oid => $mapping->{hmPSState}->{oid} }; } sub check { @@ -46,14 +46,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{hmPSState}->{oid}}})) { next if ($oid !~ /^$mapping->{hmPSState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{hmPSState}->{oid}}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); next if ($result->{hmPSState} =~ /notInstalled/i && $self->absent_problem(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm index 3f571bfb2..158bbe7ad 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm @@ -32,9 +32,9 @@ my $mapping = { my $oid_hmTempTable = '.1.3.6.1.4.1.248.14.2.5'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_hmTempTable }; + push @{$self->{request}}, { oid => $oid_hmTempTable }; } sub check { @@ -42,13 +42,13 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); return if (!defined($self->{results}->{$oid_hmTempTable}->{$mapping->{hmTemperature}->{oid} . '.0'})); my $instance = 0; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hmTempTable}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add(long_msg => sprintf("temperature is %dC [instance: %s].", diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm index 5371baf6c..f3310e394 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm @@ -20,29 +20,48 @@ package network::hirschmann::standard::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fan => [ - ['ok', 'OK'], - ['failed', 'CRITICAL'], - ], - psu => [ - ['ok', 'OK'], - ['failed', 'CRITICAL'], - ['notInstalled', 'OK'], - ['unknown', 'UNKNOWN'], - ], - led => [ - ['off', 'UNKNOWN'], - ['green', 'OK'], - ['yellow', 'WARNING'], - ['red', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|led)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ], + psu => [ + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ['notInstalled', 'OK'], + ['unknown', 'UNKNOWN'], + ], + led => [ + ['off', 'UNKNOWN'], + ['green', 'OK'], + ['yellow', 'WARNING'], + ['red', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'network::hirschmann::standard::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'temperature', 'led']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -51,208 +70,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; - return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(temperature)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'temperature', 'led'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::hirschmann::standard::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::hirschmann::standard::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -268,15 +91,15 @@ Check Hardware (Power Supplies, Fans, Temperatures, LEDs). Which component to check (Default: '.*'). Can be: 'fan', 'psu', 'temperature', 'led'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan) -Can also exclude specific instance: --exclude=fan#1.1#,psu#3.2# +Exclude some parts (comma seperated list) (Example: --filter=fan) +Can also exclude specific instance: --filter=fan,1.1 =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=psu#1.1# +Can be specific or global: --absent-problem=psu,1.1 =item B<--no-component> @@ -285,7 +108,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='psu,CRITICAL,^(?!(ok)$)' diff --git a/centreon-plugins/network/hp/procurve/mode/components/sensor.pm b/centreon-plugins/network/hp/procurve/mode/components/sensor.pm index de152d1a0..8d4ba0fe1 100644 --- a/centreon-plugins/network/hp/procurve/mode/components/sensor.pm +++ b/centreon-plugins/network/hp/procurve/mode/components/sensor.pm @@ -45,9 +45,9 @@ my $mapping = { my $oid_hpicfSensorEntry = '.1.3.6.1.4.1.11.2.14.11.1.2.6.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_hpicfSensorEntry }; + push @{$self->{request}}, { oid => $oid_hpicfSensorEntry }; } sub check { @@ -56,7 +56,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking sensors"); $self->{components}->{sensor} = {name => 'sensors', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'sensor')); + return if ($self->check_filter(section => 'sensor')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_hpicfSensorEntry}})) { next if ($oid !~ /^$mapping->{hpicfSensorStatus}->{oid}\.(.*)$/); @@ -64,7 +64,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hpicfSensorEntry}, instance => $instance_mapping); my $instance = $result->{hpicfSensorObjectId} . '.' . $instance_mapping; - next if ($self->check_exclude(section => 'sensor', instance => $instance)); + next if ($self->check_filter(section => 'sensor', instance => $instance)); next if ($result->{hpicfSensorStatus} =~ /not present/i && $self->absent_problem(section => 'sensor', instance => $instance)); $self->{components}->{sensor}->{total}++; diff --git a/centreon-plugins/network/hp/procurve/mode/environment.pm b/centreon-plugins/network/hp/procurve/mode/environment.pm index 64d39f504..807578994 100644 --- a/centreon-plugins/network/hp/procurve/mode/environment.pm +++ b/centreon-plugins/network/hp/procurve/mode/environment.pm @@ -20,179 +20,52 @@ package network::hp::procurve::mode::environment; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; -my $thresholds = { - sensor => [ - ['unknown', 'UNKNOWN'], - ['bad', 'CRITICAL'], - ['warning', 'WARNING'], - ['good', 'OK'], - ['not present', 'WARNING'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(sensor)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + sensor => [ + ['unknown', 'UNKNOWN'], + ['bad', 'CRITICAL'], + ['warning', 'WARNING'], + ['good', 'OK'], + ['not present', 'WARNING'], + ], + }; + + $self->{components_path} = 'network::hp::procurve::mode::components'; + $self->{components_module} = ['sensor']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ('sensor', $1, $2); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('sensor'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::hp::procurve::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::hp::procurve::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - 1; __END__ @@ -208,15 +81,15 @@ Check sensors (hpicfChassis.mib). Which component to check (Default: '.*'). Can be: 'sensor'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) -Can also exclude specific instance: --exclude=sensor#fan.1# +Exclude some parts (comma seperated list) (Example: --filter=sensor) +Can also exclude specific instance: --filter=sensor,fan.1 =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=sensor#temperature.2# +Can be specific or global: --absent-problem=sensor,temperature.2 =item B<--no-component> @@ -225,9 +98,9 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). -Example: --threshold-overload='CRITICAL,^(?!(good)$)' +Example: --threshold-overload='sensor,CRITICAL,^(?!(good)$)' =back diff --git a/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm b/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm index b9458b2e9..c45c8f059 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm @@ -76,9 +76,9 @@ my $mapping = { my $oid_jnxFruEntry = '.1.3.6.1.4.1.2636.3.1.15.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_jnxFruEntry, start => $mapping->{jnxFruName}->{oid}, end => $mapping->{jnxFruOfflineReason}->{oid} }; + push @{$self->{request}}, { oid => $oid_jnxFruEntry, start => $mapping->{jnxFruName}->{oid}, end => $mapping->{jnxFruOfflineReason}->{oid} }; } sub check { @@ -86,14 +86,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking frus"); $self->{components}->{fru} = {name => 'frus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fru')); + return if ($self->check_filter(section => 'fru')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_jnxFruEntry}})) { next if ($oid !~ /^$mapping->{jnxFruName}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_jnxFruEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fru', instance => $instance)); + next if ($self->check_filter(section => 'fru', instance => $instance)); next if ($result->{jnxFruState} =~ /empty/i && $self->absent_problem(section => 'fru', instance => $instance)); $self->{components}->{fru}->{total}++; diff --git a/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm b/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm index 3b3ad5bea..f6be53c42 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm @@ -41,9 +41,9 @@ my $mapping = { my $oid_jnxOperatingEntry = '.1.3.6.1.4.1.2636.3.1.13.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_jnxOperatingEntry, start => $mapping->{jnxOperatingDescr}->{oid}, end => $mapping->{jnxOperatingState}->{oid} }; + push @{$self->{request}}, { oid => $oid_jnxOperatingEntry, start => $mapping->{jnxOperatingDescr}->{oid}, end => $mapping->{jnxOperatingState}->{oid} }; } sub check { @@ -51,14 +51,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking operatings"); $self->{components}->{operating} = {name => 'operatings', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'operating')); + return if ($self->check_filter(section => 'operating')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_jnxOperatingEntry}})) { next if ($oid !~ /^$mapping->{jnxOperatingDescr}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_jnxOperatingEntry}, instance => $instance); - next if ($self->check_exclude(section => 'operating', instance => $instance)); + next if ($self->check_filter(section => 'operating', instance => $instance)); $self->{components}->{operating}->{total}++; $self->{output}->output_add(long_msg => sprintf("Operating '%s' state is %s [instance: %s]", diff --git a/centreon-plugins/network/juniper/common/junos/mode/hardware.pm b/centreon-plugins/network/juniper/common/junos/mode/hardware.pm index 8f31b2469..3c3eadde5 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/hardware.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/hardware.pm @@ -20,34 +20,54 @@ package network::juniper::common::junos::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fru => [ - ['unknown', 'UNKNOWN'], - ['present', 'OK'], - ['ready', 'OK'], - ['announce online', 'OK'], - ['online', 'OK'], - ['announce offline', 'WARNING'], - ['offline', 'CRITICAL'], - ['diagnostic', 'WARNING'], - ['standby', 'WARNING'], - ['empty', 'OK'], - ], - operating => [ - ['unknown', 'UNKNOWN'], - ['running', 'OK'], - ['ready', 'OK'], - ['reset', 'WARNING'], - ['runningAtFullSpeed', 'WARNING'], - ['down', 'CRITICAL'], - ['standby', 'OK'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fru|operating)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fru-temperature)$'; + + $self->{cb_hook1} = 'get_type'; + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fru => [ + ['unknown', 'UNKNOWN'], + ['present', 'OK'], + ['ready', 'OK'], + ['announce online', 'OK'], + ['online', 'OK'], + ['announce offline', 'WARNING'], + ['offline', 'CRITICAL'], + ['diagnostic', 'WARNING'], + ['standby', 'WARNING'], + ['empty', 'OK'], + ], + operating => [ + ['unknown', 'UNKNOWN'], + ['running', 'OK'], + ['ready', 'OK'], + ['reset', 'WARNING'], + ['runningAtFullSpeed', 'WARNING'], + ['down', 'CRITICAL'], + ['standby', 'OK'], + ], + }; + + $self->{components_path} = 'network::juniper::common::junos::mode::components'; + $self->{components_module} = ['fru', 'operating']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -56,220 +76,23 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(fru-temperature)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: fru-temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - $self->get_type(); - - my $snmp_request = []; - my @components = ('fru', 'operating'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::juniper::common::junos::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::juniper::common::junos::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - sub get_type { - my ($self) = @_; + my ($self, %options) = @_; my $oid_jnxBoxDescr = ".1.3.6.1.4.1.2636.3.1.2.0"; - my $result = $self->{snmp}->get_leef(oids => [$oid_jnxBoxDescr]); + my $result = $options{snmp}->get_leef(oids => [$oid_jnxBoxDescr]); $self->{env_type} = defined($result->{$oid_jnxBoxDescr}) ? $result->{$oid_jnxBoxDescr} : 'unknown'; $self->{output}->output_add(long_msg => sprintf("Environment type: %s", $self->{env_type})); } - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -285,15 +108,15 @@ Check Hardware (mib-jnx-chassis) (frus, operating). Which component to check (Default: '.*'). Can be: 'fru', 'operating'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fru) -Can also exclude specific instance: --exclude=fru#7.3.0.0# +Exclude some parts (comma seperated list) (Example: --filter=fru) +Can also exclude specific instance: --filter=fru,7.3.0.0 =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fru#7.1.0.0# +Can be specific or global: --absent-problem=fru,7.1.0.0 =item B<--no-component> @@ -302,18 +125,18 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='operating,CRITICAL,^(?!(running)$)' =item B<--warning> -Set warning threshold for fru temperatures (syntax: type,regexp,treshold) +Set warning threshold for fru temperatures (syntax: type,regexp,threshold) Example: --warning='fru-temperature,.*,30' =item B<--critical> -Set critical threshold for fru temperatures (syntax: type,regexp,treshold) +Set critical threshold for fru temperatures (syntax: type,regexp,threshold) Example: --critical='fru-temperature,.*,40' =back diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm index 0007759ec..7da0b128f 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm @@ -34,9 +34,9 @@ my $mapping = { my $oid_nsFanEntry = '.1.3.6.1.4.1.3224.21.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_nsFanEntry }; + push @{$self->{request}}, { oid => $oid_nsFanEntry }; } sub check { diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm index 568bc5011..a589fab14 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm @@ -35,9 +35,9 @@ my $mapping = { my $oid_nsSlotEntry = '.1.3.6.1.4.1.3224.21.5.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_nsSlotEntry }; + push @{$self->{request}}, { oid => $oid_nsSlotEntry }; } sub check { diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm index be8f99471..4b88ae158 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm @@ -34,9 +34,9 @@ my $mapping = { my $oid_nsPowerEntry = '.1.3.6.1.4.1.3224.21.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_nsPowerEntry }; + push @{$self->{request}}, { oid => $oid_nsPowerEntry }; } sub check { diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm index 05ec02119..047667e4f 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm @@ -30,9 +30,9 @@ my $mapping = { my $oid_nsTemperatureEntry = '.1.3.6.1.4.1.3224.21.4.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_nsTemperatureEntry }; + push @{$self->{request}}, { oid => $oid_nsTemperatureEntry }; } sub check { diff --git a/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm b/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm index 705f2c3b2..c4a808cb7 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm @@ -20,240 +20,58 @@ package network::juniper::common::screenos::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fan => [ - ['active', 'OK'], - ['.*', 'CRITICAL'], - ], - module => [ - ['active', 'OK'], - ['.*', 'CRITICAL'], - ], - psu => [ - ['active', 'OK'], - ['.*', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(psu|module|fan)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['active', 'OK'], + ['.*', 'CRITICAL'], + ], + module => [ + ['active', 'OK'], + ['.*', 'CRITICAL'], + ], + psu => [ + ['active', 'OK'], + ['.*', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'network::juniper::common::screenos::mode::components'; + $self->{components_module} = ['psu', 'fan', 'temperature', 'module']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($section !~ /^temperature|psu|module|fan$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload section '" . $val . "'."); - $self->{output}->option_exit(); - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if ($section !~ /^sensor$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('psu', 'fan', 'temperature', 'module'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::juniper::common::screenos::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::juniper::common::screenos::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/network/redback/snmp/mode/components/disk.pm b/centreon-plugins/network/redback/snmp/mode/components/disk.pm index afee478a8..209063263 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/disk.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/disk.pm @@ -37,9 +37,9 @@ my $mapping = { my $oid_rbnSRStorageEntry = '.1.3.6.1.4.1.2352.2.24.1.2.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rbnSRStorageEntry }; + push @{$self->{request}}, { oid => $oid_rbnSRStorageEntry }; } sub check { @@ -47,14 +47,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking disks"); $self->{components}->{disk} = {name => 'disks', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'disk')); + return if ($self->check_filter(section => 'disk')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rbnSRStorageEntry}})) { next if ($oid !~ /^$mapping->{rbnSRStorageStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rbnSRStorageEntry}, instance => $instance); - next if ($self->check_exclude(section => 'disk', instance => $instance)); + next if ($self->check_filter(section => 'disk', instance => $instance)); $self->{components}->{disk}->{total}++; $self->{output}->output_add(long_msg => sprintf("Disk '%s' status is %s [instance: %s].", diff --git a/centreon-plugins/network/redback/snmp/mode/components/fan.pm b/centreon-plugins/network/redback/snmp/mode/components/fan.pm index de66c2a0b..dcfedab8c 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/fan.pm @@ -38,9 +38,9 @@ my $mapping = { my $oid_rbnFanStatusEntry = '.1.3.6.1.4.1.2352.2.4.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rbnFanStatusEntry }; + push @{$self->{request}}, { oid => $oid_rbnFanStatusEntry }; } sub check { @@ -48,14 +48,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rbnFanStatusEntry}})) { next if ($oid !~ /^$mapping->{rbnFanStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rbnFanStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); next if ($result->{rbnFanStatus} =~ /absent/i && $self->absent_problem(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; diff --git a/centreon-plugins/network/redback/snmp/mode/components/psu.pm b/centreon-plugins/network/redback/snmp/mode/components/psu.pm index 0fcb8395d..6bea8f2d6 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/psu.pm @@ -38,9 +38,9 @@ my $mapping = { my $oid_rbnPowerStatusEntry = '.1.3.6.1.4.1.2352.2.4.1.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rbnPowerStatusEntry }; + push @{$self->{request}}, { oid => $oid_rbnPowerStatusEntry }; } sub check { @@ -48,14 +48,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rbnPowerStatusEntry}})) { next if ($oid !~ /^$mapping->{rbnPowerStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rbnPowerStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); next if ($result->{rbnPowerStatus} =~ /absent/i && $self->absent_problem(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; diff --git a/centreon-plugins/network/redback/snmp/mode/components/temperature.pm b/centreon-plugins/network/redback/snmp/mode/components/temperature.pm index 8aa26b996..4d712a1b7 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/temperature.pm @@ -31,9 +31,9 @@ my $mapping = { my $oid_rbnEntityTempSensorEntry = '.1.3.6.1.4.1.2352.2.4.1.6.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rbnEntityTempSensorEntry }; + push @{$self->{request}}, { oid => $oid_rbnEntityTempSensorEntry }; } sub check { @@ -41,14 +41,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rbnEntityTempSensorEntry}})) { next if ($oid !~ /^$mapping->{rbnEntityTempCurrent}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rbnEntityTempSensorEntry}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add(long_msg => sprintf("'%s' temperature is %dC [instance: %s].", diff --git a/centreon-plugins/network/redback/snmp/mode/components/voltage.pm b/centreon-plugins/network/redback/snmp/mode/components/voltage.pm index afdf75800..6ae69e7de 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/voltage.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/voltage.pm @@ -31,9 +31,9 @@ my $mapping = { my $oid_rbnVoltageSensorEntry = '.1.3.6.1.4.1.2352.2.4.1.3.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rbnVoltageSensorEntry }; + push @{$self->{request}}, { oid => $oid_rbnVoltageSensorEntry }; } sub check { @@ -41,14 +41,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking voltages"); $self->{components}->{voltage} = {name => 'voltages', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'voltage')); + return if ($self->check_filter(section => 'voltage')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rbnVoltageSensorEntry}})) { next if ($oid !~ /^$mapping->{rbnVoltageCurrent}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rbnVoltageSensorEntry}, instance => $instance); - next if ($self->check_exclude(section => 'voltage', instance => $instance)); + next if ($self->check_filter(section => 'voltage', instance => $instance)); $self->{components}->{voltage}->{total}++; $self->{output}->output_add(long_msg => sprintf("'%s' voltage is %d mV [instance: %s].", diff --git a/centreon-plugins/network/redback/snmp/mode/hardware.pm b/centreon-plugins/network/redback/snmp/mode/hardware.pm index 0d0c8044c..586330438 100644 --- a/centreon-plugins/network/redback/snmp/mode/hardware.pm +++ b/centreon-plugins/network/redback/snmp/mode/hardware.pm @@ -20,30 +20,49 @@ package network::redback::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fan => [ - ['unknown', 'UNKNOWN'], - ['normal', 'OK'], - ['failed', 'CRITICAL'], - ['absent', 'OK'], - ], - psu => [ - ['unknown', 'UNKNOWN'], - ['normal', 'OK'], - ['failed', 'CRITICAL'], - ['absent', 'OK'], - ], - disk => [ - ['operational', 'OK'], - ['failed', 'CRITICAL'], - ['degrading', 'WARNING'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|disk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['unknown', 'UNKNOWN'], + ['normal', 'OK'], + ['failed', 'CRITICAL'], + ['absent', 'OK'], + ], + psu => [ + ['unknown', 'UNKNOWN'], + ['normal', 'OK'], + ['failed', 'CRITICAL'], + ['absent', 'OK'], + ], + disk => [ + ['operational', 'OK'], + ['failed', 'CRITICAL'], + ['degrading', 'WARNING'], + ], + }; + + $self->{components_path} = 'network::redback::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'temperature', 'voltage', 'disk']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -52,208 +71,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; - return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(temperature|voltage)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature or voltage)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'temperature', 'voltage', 'disk'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::redback::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "network::redback::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -269,15 +92,15 @@ Check Hardware (Power Supplies, Fans, Temperatures, Voltages, Disks). Which component to check (Default: '.*'). Can be: 'fan', 'psu', 'temperature', 'voltage', 'disk'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan) -Can also exclude specific instance: --exclude=fan#1#,psu#3# +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,1 =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fan#1# +Can be specific or global: --absent-problem=fan,1 =item B<--no-component> @@ -286,7 +109,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' From 8ea10bda11711e346209bcb6fbd5aa99dbacaacb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 16:05:55 +0100 Subject: [PATCH 006/346] + update: refactoring with hardware template class --- .../centreon/plugins/templates/hardware.pm | 40 +- .../raritan/snmp/mode/components/sensor.pm | 4 +- .../pdu/raritan/snmp/mode/inletsensors.pm | 239 ++-------- .../pdu/raritan/snmp/mode/ocprotsensors.pm | 239 ++-------- .../pdu/raritan/snmp/mode/outletsensors.pm | 237 ++-------- .../h3c/snmp/mode/components/default.pm | 4 +- .../network/h3c/snmp/mode/components/fan.pm | 4 +- .../network/h3c/snmp/mode/components/psu.pm | 4 +- .../h3c/snmp/mode/components/sensor.pm | 4 +- .../network/h3c/snmp/mode/hardware.pm | 437 ++++++------------ .../snmp/mode/components/communication.pm | 8 +- .../snmp/mode/components/electronics.pm | 9 +- .../netapp/snmp/mode/components/fan.pm | 11 +- .../netapp/snmp/mode/components/psu.pm | 9 +- .../netapp/snmp/mode/components/raid.pm | 8 +- .../snmp/mode/components/temperature.pm | 8 +- .../netapp/snmp/mode/components/voltage.pm | 8 +- .../storage/netapp/snmp/mode/shelf.pm | 328 ++++--------- 18 files changed, 441 insertions(+), 1160 deletions(-) diff --git a/centreon-plugins/centreon/plugins/templates/hardware.pm b/centreon-plugins/centreon/plugins/templates/hardware.pm index 1e3b21d35..b060cc067 100644 --- a/centreon-plugins/centreon/plugins/templates/hardware.pm +++ b/centreon-plugins/centreon/plugins/templates/hardware.pm @@ -198,7 +198,7 @@ sub check_options { $self->{output}->option_exit(); } $self->call_object_callback(method_name => $self->{cb_threshold_numeric_check_section_option}, - section => $section, option_value => $val); + section => $section, option_name => $option, option_value => $val); my $position = 0; if (defined($self->{numeric_threshold}->{$section})) { @@ -215,12 +215,9 @@ sub check_options { } } -sub run { +sub load_components { my ($self, %options) = @_; - - $self->{loaded} = 0; - $self->call_object_callback(method_name => $self->{cb_hook1}, - %options); + foreach (@{$self->{components_module}}) { if (/$self->{option_results}->{component}/) { my $mod_name = $self->{components_path} . "::$_"; @@ -233,15 +230,10 @@ sub run { } } } - - if ($self->{loaded} == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - $self->call_object_callback(method_name => $self->{cb_hook2}, - %options); - +} + +sub exec_components { + my ($self, %options) = @_; foreach (@{$self->{components_module}}) { if (/$self->{option_results}->{component}/) { @@ -250,9 +242,23 @@ sub run { $func->($self); } } +} + +sub run { + my ($self, %options) = @_; + + $self->{loaded} = 0; + $self->call_object_callback(method_name => $self->{cb_hook1}, %options); + + $self->load_components(%options); + if ($self->{loaded} == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); + $self->{output}->option_exit(); + } - $self->call_object_callback(method_name => $self->{cb_hook3}, - %options); + $self->call_object_callback(method_name => $self->{cb_hook2}, %options); + $self->exec_components(%options); + $self->call_object_callback(method_name => $self->{cb_hook3}, %options); my $total_components = 0; my $display_by_component = ''; diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm index 8b5a1d7de..b9032d28e 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm @@ -25,9 +25,9 @@ use warnings; use hardware::pdu::raritan::snmp::mode::components::resources qw($mapping %raritan_type %map_type); sub load { - my (%options) = @_; + my ($self, %options) = @_; - push @{$options{request}}, { oid => $mapping->{$options{type} . '_label'}->{Label}->{oid} }, + push @{$self->{request}}, { oid => $mapping->{$options{type} . '_label'}->{Label}->{oid} }, { oid => $mapping->{$options{type}}->{Unit}->{oid} }, { oid => $mapping->{$options{type}}->{Decimal}->{oid} }, { oid => $mapping->{$options{type}}->{EnabledThresholds}->{oid} }, diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm index 7faf3a50b..5c057f615 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm @@ -20,210 +20,73 @@ package hardware::pdu::raritan::snmp::mode::inletsensors; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use hardware::pdu::raritan::snmp::mode::components::resources qw($thresholds %raritan_type); +sub set_system { + my ($self, %options) = @_; + + $self->{cb_threshold_numeric_check_section_option} = 'check_numeric_section_option'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = $thresholds; + + $self->{components_path} = 'hardware::pdu::raritan::snmp::mode::components'; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}, return_type => 1); +} + +sub check_numeric_section_option { + my ($self, %options) = @_; + + if (!defined($raritan_type{$options{section}})) { + $self->{output}->add_option_msg(short_msg => "Wrong $options{option_name} option '" . $options{option_value} . "'."); + $self->{output}->option_exit(); + } +} + +sub load_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, + error_msg => "Cannot load module '$mod_name'."); + my $func = $mod_name->can('load'); + $func->($self, type => 'inlet'); + + $self->{loaded} = 1; +} + +sub exec_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + my $func = $mod_name->can('check'); + $func->($self, component => $self->{option_results}->{component}, type => 'inlet'); +} + sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if (!defined($raritan_type{$section})) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - - my $mod_name = "hardware::pdu::raritan::snmp::mode::components::sensor"; - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, - error_msg => "Cannot load module '$mod_name'."); - my $func = $mod_name->can('load'); - $func->(type => 'inlet', request => $snmp_request); - - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request, return_type => 1); - - $func = $mod_name->can('check'); - $func->($self, component => $self->{option_results}->{component}, type => 'inlet'); - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s sensors are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No sensors are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm index 666aeb569..8bfdf2949 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm @@ -20,210 +20,73 @@ package hardware::pdu::raritan::snmp::mode::ocprotsensors; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use hardware::pdu::raritan::snmp::mode::components::resources qw($thresholds %raritan_type); +sub set_system { + my ($self, %options) = @_; + + $self->{cb_threshold_numeric_check_section_option} = 'check_numeric_section_option'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = $thresholds; + + $self->{components_path} = 'hardware::pdu::raritan::snmp::mode::components'; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}, return_type => 1); +} + +sub check_numeric_section_option { + my ($self, %options) = @_; + + if (!defined($raritan_type{$options{section}})) { + $self->{output}->add_option_msg(short_msg => "Wrong $options{option_name} option '" . $options{option_value} . "'."); + $self->{output}->option_exit(); + } +} + +sub load_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, + error_msg => "Cannot load module '$mod_name'."); + my $func = $mod_name->can('load'); + $func->($self, type => 'ocprot'); + + $self->{loaded} = 1; +} + +sub exec_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + my $func = $mod_name->can('check'); + $func->($self, component => $self->{option_results}->{component}, type => 'ocprot'); +} + sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if (!defined($raritan_type{$section})) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - - my $mod_name = "hardware::pdu::raritan::snmp::mode::components::sensor"; - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, - error_msg => "Cannot load module '$mod_name'."); - my $func = $mod_name->can('load'); - $func->(type => 'ocprot', request => $snmp_request); - - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request, return_type => 1); - - $func = $mod_name->can('check'); - $func->($self, component => $self->{option_results}->{component}, type => 'ocprot'); - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s sensors are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No sensors are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm index b6586f5a6..56b380224 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm @@ -20,12 +20,60 @@ package hardware::pdu::raritan::snmp::mode::outletsensors; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use hardware::pdu::raritan::snmp::mode::components::resources qw($thresholds %raritan_type); +sub set_system { + my ($self, %options) = @_; + + $self->{cb_threshold_numeric_check_section_option} = 'check_numeric_section_option'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = $thresholds; + + $self->{components_path} = 'hardware::pdu::raritan::snmp::mode::components'; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}, return_type => 1); +} + +sub check_numeric_section_option { + my ($self, %options) = @_; + + if (!defined($raritan_type{$options{section}})) { + $self->{output}->add_option_msg(short_msg => "Wrong $options{option_name} option '" . $options{option_value} . "'."); + $self->{output}->option_exit(); + } +} + +sub load_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, + error_msg => "Cannot load module '$mod_name'."); + my $func = $mod_name->can('load'); + $func->($self, type => 'outlet'); + + $self->{loaded} = 1; +} + +sub exec_components { + my ($self, %options) = @_; + + my $mod_name = $self->{components_path} . "::sensor"; + my $func = $mod_name->can('check'); + $func->($self, component => $self->{option_results}->{component}, type => 'outlet'); +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -33,197 +81,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if (!defined($raritan_type{$section})) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - - my $mod_name = "hardware::pdu::raritan::snmp::mode::components::sensor"; - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, - error_msg => "Cannot load module '$mod_name'."); - my $func = $mod_name->can('load'); - $func->(type => 'outlet', request => $snmp_request); - - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request, return_type => 1); - - $func = $mod_name->can('check'); - $func->($self, component => $self->{option_results}->{component}, type => 'outlet'); - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s sensors are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No sensors are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/network/h3c/snmp/mode/components/default.pm b/centreon-plugins/network/h3c/snmp/mode/components/default.pm index 6be93e67d..712f28b5f 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/default.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/default.pm @@ -48,7 +48,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking " . $options{component}); $self->{components}->{$options{component}} = {name => $options{component}, total => 0, skip => 0}; - return if ($self->check_exclude(section => $options{component})); + return if ($self->check_filter(section => $options{component})); my $mapping = { EntityExtErrorStatus => { oid => $self->{branch} . '.19', map => \%map_default_status }, @@ -58,7 +58,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance); next if (!defined($result->{EntityExtErrorStatus})); - next if ($self->check_exclude(section => $options{component}, instance => $instance)); + next if ($self->check_filter(section => $options{component}, instance => $instance)); if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) { $self->absent_problem(section => $options{component}, instance => $instance); next; diff --git a/centreon-plugins/network/h3c/snmp/mode/components/fan.pm b/centreon-plugins/network/h3c/snmp/mode/components/fan.pm index a4e2b1cfb..1d6d79511 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/fan.pm @@ -36,7 +36,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); my $mapping = { EntityExtErrorStatus => { oid => $self->{branch} . '.19', map => \%map_fan_status }, @@ -46,7 +46,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance); next if (!defined($result->{EntityExtErrorStatus})); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) { $self->absent_problem(section => 'fan', instance => $instance); next; diff --git a/centreon-plugins/network/h3c/snmp/mode/components/psu.pm b/centreon-plugins/network/h3c/snmp/mode/components/psu.pm index aa963bf58..39c553251 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/psu.pm @@ -36,7 +36,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'power supplies', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); my $mapping = { EntityExtErrorStatus => { oid => $self->{branch} . '.19', map => \%map_psu_status }, @@ -46,7 +46,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$self->{branch} . '.19'}, instance => $instance); next if (!defined($result->{EntityExtErrorStatus})); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) { $self->absent_problem(section => 'psu', instance => $instance); next; diff --git a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm index f6f5735c5..b8953d033 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm @@ -36,7 +36,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking sensors"); $self->{components}->{sensor} = {name => 'sensors', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'sensor')); + return if ($self->check_filter(section => 'sensor')); my $mapping = { EntityExtErrorStatus => { oid => $self->{branch} . '.19', map => \%map_sensor_status }, @@ -59,7 +59,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $results, instance => $instance); next if (!defined($result->{EntityExtErrorStatus})); - next if ($self->check_exclude(section => 'sensor', instance => $instance)); + next if ($self->check_filter(section => 'sensor', instance => $instance)); if ($result->{EntityExtErrorStatus} =~ /entityAbsent/i) { $self->absent_problem(section => 'sensor', instance => $instance); next; diff --git a/centreon-plugins/network/h3c/snmp/mode/hardware.pm b/centreon-plugins/network/h3c/snmp/mode/hardware.pm index ac5b9217a..8bcf36691 100644 --- a/centreon-plugins/network/h3c/snmp/mode/hardware.pm +++ b/centreon-plugins/network/h3c/snmp/mode/hardware.pm @@ -20,89 +20,138 @@ package network::h3c::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use centreon::plugins::statefile; -my $thresholds = { - psu => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['psuError', 'CRITICAL'], - ['hardwareFaulty', 'CRITICAL'], - ], - fan => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['fanError', 'CRITICAL'], - ['hardwareFaulty', 'CRITICAL'], - ], - sensor => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['sensorError', 'CRITICAL'], - ['hardwareFaulty', 'CRITICAL'], - ], - other => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - unknown => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - chassis => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - backplane => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - container => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - module => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - port => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - stack => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], - cpu => [ - ['notSupported', 'WARNING'], - ['normal', 'OK'], - ['entityAbsent', 'OK'], - ['hardwareFaulty', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook1} = 'init_cache'; + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + psu => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['psuError', 'CRITICAL'], + ['hardwareFaulty', 'CRITICAL'], + ], + fan => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['fanError', 'CRITICAL'], + ['hardwareFaulty', 'CRITICAL'], + ], + sensor => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['sensorError', 'CRITICAL'], + ['hardwareFaulty', 'CRITICAL'], + ], + other => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + unknown => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + chassis => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + backplane => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + container => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + module => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + port => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + stack => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + cpu => [ + ['notSupported', 'WARNING'], + ['normal', 'OK'], + ['entityAbsent', 'OK'], + ['hardwareFaulty', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'network::h3c::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'slot', 'temperature']; + + $self->{mapping_name} = { + 1 => 'other', 2 => 'unknown', 3 => 'chassis', 4 => 'backplane', 5 => 'container', 6 => 'psu', + 7 => 'fan', 8 => 'sensor', 9 => 'module', 10 => 'port', 11 => 'stack', 12 => 'cpu' + }; + $self->{mapping_component} = { + 1 => 'default', 2 => 'default', 3 => 'default', 4 => 'default', 5 => 'default', 6 => 'psu', + 7 => 'fan', 8 => 'sensor', 9 => 'default', 10 => 'default', 11 => 'default', 12 => 'default' + }; +} + +my $oid_hh3cEntityExtStateEntry = '.1.3.6.1.4.1.25506.2.6.1.1.1.1'; +my $oid_h3cEntityExtStateEntry = '.1.3.6.1.4.1.2011.10.2.6.1.1.1.1'; +my $oid_h3cEntityExtErrorStatus = '.1.3.6.1.4.1.2011.10.2.6.1.1.1.1.19'; +my $oid_hh3cEntityExtErrorStatus = '.1.3.6.1.4.1.25506.2.6.1.1.1.1.19'; + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); + $self->write_cache(); + + $self->{branch} = $oid_hh3cEntityExtStateEntry; + if (defined($self->{results}->{$oid_h3cEntityExtErrorStatus}) && scalar(keys %{$self->{results}->{$oid_h3cEntityExtErrorStatus}}) > 0) { + $self->{branch} = $oid_h3cEntityExtStateEntry; + } +} + +sub init_cache { + my ($self, %options) = @_; + + $self->{request} = [ + { oid => $oid_h3cEntityExtErrorStatus }, + { oid => $oid_hh3cEntityExtErrorStatus }, + ]; + $self->check_cache(%options); +} sub new { my ($class, %options) = @_; @@ -111,21 +160,11 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { "reload-cache-time:s" => { name => 'reload_cache_time', default => 180 }, }); - $self->{components} = {}; - $self->{no_components} = undef; - $self->{statefile_cache} = centreon::plugins::statefile->new(%options); - + $self->{statefile_cache} = centreon::plugins::statefile->new(%options); return $self; } @@ -133,54 +172,6 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /^(temperature)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } - $self->{statefile_cache}->check_options(%options); } @@ -193,8 +184,8 @@ my $oid_entPhysicalName = '.1.3.6.1.2.1.47.1.1.1.1.7'; sub check_cache { my ($self, %options) = @_; - $self->{hostname} = $self->{snmp}->get_hostname(); - $self->{snmp_port} = $self->{snmp}->get_port(); + $self->{hostname} = $options{snmp}->get_hostname(); + $self->{snmp_port} = $options{snmp}->get_port(); # init cache file $self->{write_cache} = 0; @@ -202,7 +193,7 @@ sub check_cache { my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp'); if ($has_cache_file == 0 || !defined($timestamp_cache) || ((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) { - push @{$self->{snmp_request}}, { oid => $oid_entPhysicalEntry, start => $oid_entPhysicalDescr, end => $oid_entPhysicalName }; + push @{$self->{request}}, { oid => $oid_entPhysicalEntry, start => $oid_entPhysicalDescr, end => $oid_entPhysicalName }; $self->{write_cache} = 1; } } @@ -250,159 +241,29 @@ sub get_instance_class { return @instances; } -sub run { +sub load_components { my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $oid_hh3cEntityExtStateEntry = '.1.3.6.1.4.1.25506.2.6.1.1.1.1'; - my $oid_h3cEntityExtStateEntry = '.1.3.6.1.4.1.2011.10.2.6.1.1.1.1'; - my $oid_h3cEntityExtErrorStatus = '.1.3.6.1.4.1.2011.10.2.6.1.1.1.1.19'; - my $oid_hh3cEntityExtErrorStatus = '.1.3.6.1.4.1.25506.2.6.1.1.1.1.19'; - $self->{snmp_request} = [ - { oid => $oid_h3cEntityExtErrorStatus }, - { oid => $oid_hh3cEntityExtErrorStatus }, - ]; - $self->check_cache(); - - my %mapping_name = ( - 1 => 'other', 2 => 'unknown', 3 => 'chassis', 4 => 'backplane', 5 => 'container', 6 => 'psu', - 7 => 'fan', 8 => 'sensor', 9 => 'module', 10 => 'port', 11 => 'stack', 12 => 'cpu' - ); - my %mapping_component = ( - 1 => 'default', 2 => 'default', 3 => 'default', 4 => 'default', 5 => 'default', 6 => 'psu', - 7 => 'fan', 8 => 'sensor', 9 => 'default', 10 => 'default', 11 => 'default', 12 => 'default' - ); - my $component = 0; - foreach (keys %mapping_name) { - if ($mapping_name{$_} =~ /$self->{option_results}->{component}/) { - my $mod_name = "network::h3c::snmp::mode::components::" . $mapping_component{$_}; + foreach (keys %{$self->{mapping_name}}) { + if ($self->{mapping_name}->{$_} =~ /$self->{option_results}->{component}/) { + my $mod_name = $self->{components_path} . "::" . $self->{mapping_component}->{$_}; centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod_name, error_msg => "Cannot load module '$mod_name'."); - $component = 1; + $self->{loaded} = 1; } } - if ($component == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } +} + +sub exec_components { + my ($self, %options) = @_; - $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{snmp_request}); - $self->write_cache(); - - $self->{branch} = $oid_hh3cEntityExtStateEntry; - if (defined($self->{results}->{$oid_h3cEntityExtErrorStatus}) && scalar(keys %{$self->{results}->{$oid_h3cEntityExtErrorStatus}}) > 0) { - $self->{branch} = $oid_h3cEntityExtStateEntry; - } - - foreach (keys %mapping_name) { - if ($mapping_name{$_} =~ /$self->{option_results}->{component}/) { - my $mod_name = "network::h3c::snmp::mode::components::" . $mapping_component{$_}; + foreach (keys %{$self->{mapping_name}}) { + if ($self->{mapping_name}->{$_} =~ /$self->{option_results}->{component}/) { + my $mod_name = $self->{components_path} . "::" . $self->{mapping_component}->{$_}; my $func = $mod_name->can('check'); - $func->($self, component => $mapping_name{$_}, component_class => $_); + $func->($self, component => $self->{mapping_name}->{$_}, component_class => $_); } } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; } 1; @@ -421,10 +282,10 @@ Which component to check (Default: '.*'). Can be: 'fan', 'psu', 'other', 'unknown', 'sensor', 'chassis', 'backplane', 'container', 'module', 'port', 'stack', 'cpu'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan) -Can also exclude specific instance: --exclude=fan#101# +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,101 =item B<--absent-problem> @@ -438,7 +299,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)' diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm b/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm index c8a9b297b..76d259daa 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm @@ -37,9 +37,9 @@ my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; my $oid_enclContactState = '.1.3.6.1.4.1.789.1.21.1.2.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclContactState }; + push @{$self->{request}}, { oid => $oid_enclContactState }; } sub check { @@ -47,13 +47,13 @@ sub check { $self->{output}->output_add(long_msg => "Checking communications"); $self->{components}->{communication} = {name => 'communications', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'communication')); + return if ($self->check_filter(section => 'communication')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; my $com_state = $map_com_states{$self->{results}->{$oid_enclContactState}->{$oid_enclContactState . '.' . $i}}; - next if ($self->check_exclude(section => 'communication', instance => $shelf_addr)); + next if ($self->check_filter(section => 'communication', instance => $shelf_addr)); $self->{components}->{communication}->{total}++; $self->{output}->output_add(long_msg => sprintf("Shelve '%s' communication state is '%s'", diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm b/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm index f1e25de26..d34b5046d 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm @@ -30,10 +30,9 @@ my $oid_enclElectronicsPresent = '.1.3.6.1.4.1.789.1.21.1.2.1.31'; my $oid_enclElectronicsFailed = '.1.3.6.1.4.1.789.1.21.1.2.1.33'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclElectronicsPresent }; - push @{$options{request}}, { oid => $oid_enclElectronicsFailed }; + push @{$self->{request}}, { oid => $oid_enclElectronicsPresent }, { oid => $oid_enclElectronicsFailed }; } sub check { @@ -41,7 +40,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking electronics"); $self->{components}->{electronics} = {name => 'electronics', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'electronics')); + return if ($self->check_filter(section => 'electronics')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; @@ -52,7 +51,7 @@ sub check { $num = centreon::plugins::misc::trim($num); next if ($num !~ /[0-9]/); - next if ($self->check_exclude(section => 'electronics', instance => $shelf_addr . '.' . $num)); + next if ($self->check_filter(section => 'electronics', instance => $shelf_addr . '.' . $num)); $self->{components}->{electronics}->{total}++; my $status = 'ok'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm b/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm index 2f8b5ba9b..3f2e6d3d6 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm @@ -31,11 +31,10 @@ my $oid_enclFansFailed = '.1.3.6.1.4.1.789.1.21.1.2.1.18'; my $oid_enclFansSpeed = '.1.3.6.1.4.1.789.1.21.1.2.1.62'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclFansPresent }; - push @{$options{request}}, { oid => $oid_enclFansFailed }; - push @{$options{request}}, { oid => $oid_enclFansSpeed }; + push @{$self->{request}}, { oid => $oid_enclFansPresent }, { oid => $oid_enclFansFailed }, + { oid => $oid_enclFansSpeed }; } sub check { @@ -43,7 +42,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; @@ -56,7 +55,7 @@ sub check { next if ($num !~ /[0-9]/); my $current_value = (defined($current_speed[$num - 1]) && $current_speed[$num - 1] =~ /(^|\s)([0-9]+)/) ? $2 : ''; - next if ($self->check_exclude(section => 'fan', instance => $shelf_addr . '.' . $num)); + next if ($self->check_filter(section => 'fan', instance => $shelf_addr . '.' . $num)); $self->{components}->{fan}->{total}++; my $status = 'ok'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm b/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm index 5f54b8fe8..6905fbc20 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm @@ -30,10 +30,9 @@ my $oid_enclPowerSuppliesPresent = '.1.3.6.1.4.1.789.1.21.1.2.1.13'; my $oid_enclPowerSuppliesFailed = '.1.3.6.1.4.1.789.1.21.1.2.1.15'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclPowerSuppliesPresent }; - push @{$options{request}}, { oid => $oid_enclPowerSuppliesFailed }; + push @{$self->{request}}, { oid => $oid_enclPowerSuppliesPresent }, { oid => $oid_enclPowerSuppliesFailed }; } sub check { @@ -41,7 +40,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; @@ -52,7 +51,7 @@ sub check { $num = centreon::plugins::misc::trim($num); next if ($num !~ /[0-9]/); - next if ($self->check_exclude(section => 'psu', instance => $shelf_addr . '.' . $num)); + next if ($self->check_filter(section => 'psu', instance => $shelf_addr . '.' . $num)); $self->{components}->{psu}->{total}++; my $status = 'ok'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm b/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm index 74bc1a659..adb9c9530 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm @@ -38,9 +38,9 @@ my %map_raid_states = ( my $oid_raidPStatus = '.1.3.6.1.4.1.789.1.6.10.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_raidPStatus }; + push @{$self->{request}}, { oid => $oid_raidPStatus }; } sub check { @@ -48,14 +48,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking raids"); $self->{components}->{raid} = {name => 'raids', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'raid')); + return if ($self->check_filter(section => 'raid')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_raidPStatus}})) { $oid =~ /^$oid_raidPStatus\.(.*)$/; my $instance = $1; my $raid_state = $map_raid_states{$self->{results}->{$oid_raidPStatus}->{$oid}}; - next if ($self->check_exclude(section => 'raid', instance => $instance)); + next if ($self->check_filter(section => 'raid', instance => $instance)); $self->{components}->{raid}->{total}++; $self->{output}->output_add(long_msg => sprintf("Raid '%s' state is '%s'", diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm index ee488e8df..48d131bb6 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm @@ -53,9 +53,9 @@ my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; my $oid_enclEntry = '.1.3.6.1.4.1.789.1.21.1.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclEntry, begin => $mapping->{enclTempSensorsPresent}->{oid}, end => $mapping->{enclTempSensorsUnderTempWarnThr}->{oid} }; + push @{$self->{request}}, { oid => $oid_enclEntry, begin => $mapping->{enclTempSensorsPresent}->{oid}, end => $mapping->{enclTempSensorsUnderTempWarnThr}->{oid} }; } sub check { @@ -63,7 +63,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_enclEntry}, instance => $i); @@ -90,7 +90,7 @@ sub check { $current_temp[$num - 1] =~ /(-*[0-9]+)C/; my $current_value = $1; - next if ($self->check_exclude(section => 'temperature', instance => $shelf_addr . '.' . $num)); + next if ($self->check_filter(section => 'temperature', instance => $shelf_addr . '.' . $num)); $self->{components}->{temperature}->{total}++; my $status = 'ok'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm index 98d6a7e4e..fa6f6cb39 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm @@ -53,9 +53,9 @@ my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; my $oid_enclTable = '.1.3.6.1.4.1.789.1.21.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_enclTable, begin => $mapping->{enclVoltSensorsPresent}->{oid}, end => $mapping->{enclVoltSensorsUnderVoltWarnThr}->{oid} }; + push @{$self->{request}}, { oid => $oid_enclTable, begin => $mapping->{enclVoltSensorsPresent}->{oid}, end => $mapping->{enclVoltSensorsUnderVoltWarnThr}->{oid} }; } sub check { @@ -63,7 +63,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking voltages"); $self->{components}->{voltage} = {name => 'voltages', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'voltage')); + return if ($self->check_filter(section => 'voltage')); for (my $i = 1; $i <= $self->{number_shelf}; $i++) { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_enclTable}, instance => $i); @@ -86,7 +86,7 @@ sub check { my $co_thr = (defined($crit_over_thr[$num - 1]) && $crit_over_thr[$num - 1] =~ /(^|\s)(-*[0-9]+)/) ? $2 : ''; my $current_value = ($current_volt[$num - 1] =~ /(^|\s)(-*[0-9]+)/) ? $2 : ''; - next if ($self->check_exclude(section => 'voltage', instance => $shelf_addr . '.' . $num)); + next if ($self->check_filter(section => 'voltage', instance => $shelf_addr . '.' . $num)); $self->{components}->{voltage}->{total}++; my $status = 'ok'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/shelf.pm b/centreon-plugins/storage/netapp/snmp/mode/shelf.pm index 16ea5dee0..e08b0df2b 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/shelf.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/shelf.pm @@ -20,61 +20,81 @@ package storage::netapp::snmp::mode::shelf; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; -my $thresholds = { - communication => [ - ['initializing', 'WARNING'], - ['transitioning', 'WARNING'], - ['inactive', 'CRITICAL'], - ['reconfiguring', 'WARNING'], - ['nonexistent', 'CRITICAL'], - ['active', 'OK'], - ], - raid => [ - ['initializing', 'WARNING'], - ['reconstructionInProgress', 'WARNING'], - ['parityVerificationInProgress', 'OK'], - ['scrubbingInProgress', 'OK'], - ['prefailed', 'CRITICAL'], - ['failed', 'CRITICAL'], - ['active', 'OK'], - ], - fan => [ - ['failed', 'CRITICAL'], - ['ok', 'OK'], - ], - psu => [ - ['failed', 'CRITICAL'], - ['ok', 'OK'], - ], - electronics => [ - ['failed', 'CRITICAL'], - ['ok', 'OK'], - ], - voltage => [ - ['under critical threshold', 'CRITICAL'], - ['under warning threshold', 'WARNING'], - ['over critical threshold', 'CRITICAL'], - ['over warning threshold', 'WARNING'], - ['ok', 'OK'], - ], - temperature => [ - ['under critical threshold', 'CRITICAL'], - ['under warning threshold', 'WARNING'], - ['over critical threshold', 'CRITICAL'], - ['over warning threshold', 'WARNING'], - ['ok', 'OK'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_numeric_check_section_option} = '^(voltage|temperature|fan)$'; + + $self->{cb_hook1} = 'init_shelf'; + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + communication => [ + ['initializing', 'WARNING'], + ['transitioning', 'WARNING'], + ['inactive', 'CRITICAL'], + ['reconfiguring', 'WARNING'], + ['nonexistent', 'CRITICAL'], + ['active', 'OK'], + ], + raid => [ + ['initializing', 'WARNING'], + ['reconstructionInProgress', 'WARNING'], + ['parityVerificationInProgress', 'OK'], + ['scrubbingInProgress', 'OK'], + ['prefailed', 'CRITICAL'], + ['failed', 'CRITICAL'], + ['active', 'OK'], + ], + fan => [ + ['failed', 'CRITICAL'], + ['ok', 'OK'], + ], + psu => [ + ['failed', 'CRITICAL'], + ['ok', 'OK'], + ], + electronics => [ + ['failed', 'CRITICAL'], + ['ok', 'OK'], + ], + voltage => [ + ['under critical threshold', 'CRITICAL'], + ['under warning threshold', 'WARNING'], + ['over critical threshold', 'CRITICAL'], + ['over warning threshold', 'WARNING'], + ['ok', 'OK'], + ], + temperature => [ + ['under critical threshold', 'CRITICAL'], + ['under warning threshold', 'WARNING'], + ['over critical threshold', 'CRITICAL'], + ['over warning threshold', 'WARNING'], + ['ok', 'OK'], + ], + }; + + $self->{components_path} = 'storage::netapp::snmp::mode::components'; + $self->{components_module} = ['communication', 'psu', 'fan', 'temperature', 'voltage', 'electronics', 'raid']; +} my $oid_enclNumber = '.1.3.6.1.4.1.789.1.21.1.1'; my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); + $self->{number_shelf} = defined($self->{results}->{$oid_enclNumber}->{$oid_enclNumber . '.0'}) ? $self->{results}->{$oid_enclNumber}->{$oid_enclNumber . '.0'} : -1; + $self->{shelf_addr} = $self->{results}->{$oid_enclChannelShelfAddr}; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -83,207 +103,15 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, }); - - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(voltage|temperature|fan)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: fan, voltage or temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('communication', 'psu', 'fan', 'temperature', 'voltage', 'electronics', 'raid'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "storage::netapp::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - push @{$snmp_request}, ({ oid => $oid_enclNumber }, { oid => $oid_enclChannelShelfAddr }); - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - $self->{number_shelf} = defined($self->{results}->{$oid_enclNumber}->{$oid_enclNumber . '.0'}) ? $self->{results}->{$oid_enclNumber}->{$oid_enclNumber . '.0'} : -1; - $self->{shelf_addr} = $self->{results}->{$oid_enclChannelShelfAddr}; - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "storage::netapp::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { +sub init_shelf { my ($self, %options) = @_; - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; + push @{$self->{request}}, ({ oid => $oid_enclNumber }, { oid => $oid_enclChannelShelfAddr }); } 1; @@ -301,15 +129,15 @@ Check Shelves hardware (temperatures, voltages, electronics, fan, power supplies Which component to check (Default: '.*'). Can be: 'psu', 'fan', 'communication', 'voltage', 'temperature', 'electronics', 'raid'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='psu#41239F00647-A#' +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=psu,41239F00647-A =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fan#41239F00647-fan02# +Can be specific or global: --absent-problem=fan,41239F00647-fan02 =item B<--no-component> @@ -318,19 +146,19 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='gfc,CRITICAL,^(?!(Online)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: regexp,treshold) +Set warning threshold for temperature, fan, voltage (syntax: type,regexp,threshold) Example: --warning='41239F00647-vimm46,20' --warning='41239F00647-vimm5.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: regexp,treshold) -Example: --critical='41239F00647-vimm46,25' --warning='41239F00647-vimm5.*,35' +Set critical threshold for temperature, fan, voltage (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,25' --warning='temperature,.*,35' =back From 9def083885f710a97d626d5fca0a1d9025f84eaa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jan 2016 16:39:50 +0100 Subject: [PATCH 007/346] + update: refactoring with hardware template class --- .../common/aruba/snmp/mode/components/fan.pm | 8 +- .../aruba/snmp/mode/components/module.pm | 8 +- .../common/aruba/snmp/mode/components/psu.pm | 8 +- .../common/aruba/snmp/mode/hardware.pm | 191 ++------- .../smallbusiness/snmp/mode/components/fan.pm | 8 +- .../smallbusiness/snmp/mode/components/psu.pm | 8 +- .../smallbusiness/snmp/mode/environment.pm | 214 +++-------- .../force10/snmp/mode/components/fan.pm | 4 +- .../force10/snmp/mode/components/psu.pm | 4 +- .../snmp/mode/components/temperature.pm | 4 +- .../common/force10/snmp/mode/hardware.pm | 291 ++------------ .../common/violin/snmp/mode/components/ca.pm | 8 +- .../common/violin/snmp/mode/components/fan.pm | 8 +- .../common/violin/snmp/mode/components/gfc.pm | 8 +- .../common/violin/snmp/mode/components/lfc.pm | 8 +- .../common/violin/snmp/mode/components/psu.pm | 9 +- .../snmp/mode/components/temperature.pm | 11 +- .../violin/snmp/mode/components/vimm.pm | 9 +- .../common/violin/snmp/mode/hardware.pm | 316 ++++----------- .../server/cisco/ucs/mode/components/blade.pm | 8 +- .../cisco/ucs/mode/components/chassis.pm | 8 +- .../server/cisco/ucs/mode/components/cpu.pm | 8 +- .../server/cisco/ucs/mode/components/fan.pm | 8 +- .../server/cisco/ucs/mode/components/fex.pm | 8 +- .../cisco/ucs/mode/components/iocard.pm | 8 +- .../cisco/ucs/mode/components/localdisk.pm | 8 +- .../cisco/ucs/mode/components/memory.pm | 8 +- .../server/cisco/ucs/mode/components/psu.pm | 8 +- .../server/cisco/ucs/mode/equipment.pm | 203 ++-------- .../snmp/mode/components/ambient.pm | 8 +- .../bladecenter/snmp/mode/components/blade.pm | 8 +- .../snmp/mode/components/blower.pm | 10 +- .../snmp/mode/components/chassisfan.pm | 8 +- .../snmp/mode/components/chassisstatus.pm | 8 +- .../snmp/mode/components/fanpack.pm | 8 +- .../snmp/mode/components/powermodule.pm | 8 +- .../snmp/mode/components/switchmodule.pm | 8 +- .../snmp/mode/components/systemhealth.pm | 9 +- .../ibm/bladecenter/snmp/mode/hardware.pm | 361 +++++------------- 39 files changed, 444 insertions(+), 1392 deletions(-) diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm index 14942b192..8a573f3f6 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm @@ -35,9 +35,9 @@ my $mapping = { my $oid_wlsxSysExtFanEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.17.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_wlsxSysExtFanEntry }; + push @{$self->{request}}, { oid => $oid_wlsxSysExtFanEntry }; } sub check { @@ -45,14 +45,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_wlsxSysExtFanEntry}})) { next if ($oid !~ /^$mapping->{sysExtFanStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_wlsxSysExtFanEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("Fan '%s' status is %s [instance: %s].", diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm index eebf2fd5d..8f3174630 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm @@ -55,9 +55,9 @@ my $mapping = { my $oid_wlsxSysExtCardEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.16.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_wlsxSysExtCardEntry }; + push @{$self->{request}}, { oid => $oid_wlsxSysExtCardEntry }; } sub check { @@ -65,14 +65,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking modules"); $self->{components}->{module} = {name => 'modules', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'module')); + return if ($self->check_filter(section => 'module')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_wlsxSysExtCardEntry}})) { next if ($oid !~ /^$mapping->{sysExtCardStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_wlsxSysExtCardEntry}, instance => $instance); - next if ($self->check_exclude(section => 'module', instance => $instance)); + next if ($self->check_filter(section => 'module', instance => $instance)); $self->{components}->{module}->{total}++; $self->{output}->output_add(long_msg => sprintf("Module '%s/%s' status is %s [instance: %s].", diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm index 754df13ed..bd031a919 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm @@ -35,9 +35,9 @@ my $mapping = { my $oid_wlsxSysExtPowerSupplyEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.18.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_wlsxSysExtPowerSupplyEntry }; + push @{$self->{request}}, { oid => $oid_wlsxSysExtPowerSupplyEntry }; } sub check { @@ -45,14 +45,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'power supplies', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_wlsxSysExtPowerSupplyEntry}})) { next if ($oid !~ /^$mapping->{sysExtPowerSupplyStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_wlsxSysExtPowerSupplyEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; $self->{output}->output_add(long_msg => sprintf("Power supply '%s' status is %s [instance: %s].", diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm index 3dfc4cb48..2bfeff3d3 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm @@ -20,168 +20,57 @@ package centreon::common::aruba::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fan => [ - ['active', 'OK'], - ['inactive', 'CRITICAL'], - ], - psu => [ - ['active', 'OK'], - ['inactive', 'CRITICAL'], - ], - module => [ - ['active', 'OK'], - ['inactive', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|module)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['active', 'OK'], + ['inactive', 'CRITICAL'], + ], + psu => [ + ['active', 'OK'], + ['inactive', 'CRITICAL'], + ], + module => [ + ['active', 'OK'], + ['inactive', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'centreon::common::aruba::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'module']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'module'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::aruba::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::aruba::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -197,10 +86,10 @@ Check hardware (modules, fans, power supplies). Which component to check (Default: '.*'). Can be: 'fan', 'psu', 'module'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan,module) -Can also exclude specific instance: --exclude=fan#1#2#,module#1#,psu +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,1 =item B<--no-component> @@ -209,7 +98,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='fan,OK,inactive' diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm index 97ab832e8..5d2166c4e 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm @@ -39,9 +39,9 @@ my $mapping = { my $oid_rlEnvMonFanStatusEntry = '.1.3.6.1.4.1.9.6.1.101.83.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rlEnvMonFanStatusEntry }; + push @{$self->{request}}, { oid => $oid_rlEnvMonFanStatusEntry }; } sub check { @@ -49,14 +49,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fan', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rlEnvMonFanStatusEntry}})) { next if ($oid !~ /^$mapping->{rlEnvMonFanState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rlEnvMonFanStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); if ($result->{rlEnvMonFanState} =~ /notPresent/i) { $self->absent_problem(section => 'fan', instance => $instance); next; diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm index 0e8a59860..e24a05483 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm @@ -39,9 +39,9 @@ my $mapping = { my $oid_rlEnvMonSupplyStatusEntry = '.1.3.6.1.4.1.9.6.1.101.83.1.2.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_rlEnvMonSupplyStatusEntry }; + push @{$self->{request}}, { oid => $oid_rlEnvMonSupplyStatusEntry }; } sub check { @@ -49,14 +49,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psu', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rlEnvMonSupplyStatusEntry}})) { next if ($oid !~ /^$mapping->{rlEnvMonSupplyState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rlEnvMonSupplyStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); if ($result->{rlEnvMonSupplyState} =~ /notPresent/i) { $self->absent_problem(section => 'psu', instance => $instance); next; diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm index b42b27843..e53c92eb7 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm @@ -20,189 +20,61 @@ package centreon::common::cisco::smallbusiness::snmp::mode::environment; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - fan => [ - ['normal', 'OK'], - ['notPresent', 'OK'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['shutdown', 'CRITICAL'], - ['notFunctioning', 'CRITICAL'], - ], - psu => [ - ['normal', 'OK'], - ['notPresent', 'OK'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['shutdown', 'CRITICAL'], - ['notFunctioning', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['normal', 'OK'], + ['notPresent', 'OK'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['shutdown', 'CRITICAL'], + ['notFunctioning', 'CRITICAL'], + ], + psu => [ + ['normal', 'OK'], + ['notPresent', 'OK'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['shutdown', 'CRITICAL'], + ['notFunctioning', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'centreon::common::cisco::smallbusiness::snmp::mode::components'; + $self->{components_module} = ['psu', 'fan']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('psu', 'fan'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - 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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::cisco::smallbusiness::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s]", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -218,10 +90,10 @@ Check environment (Fans, Power supplies). Which component to check (Default: '.*'). Can be: 'fan', 'psu'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='psu#0#' +Exclude some parts (comma seperated list) (Example: --filter=psu) +Can also exclude specific instance: --filter=psu,0 =item B<--absent-problem> @@ -235,7 +107,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm index 0f0cc9c0f..f3717d8d1 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm @@ -42,9 +42,9 @@ my $mapping = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{sseries}->{OperStatus}->{oid} }, + push @{$self->{request}}, { oid => $mapping->{sseries}->{OperStatus}->{oid} }, { oid => $mapping->{mseries}->{OperStatus}->{oid} }, { oid => $mapping->{zseries}->{OperStatus}->{oid} }; } diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm index 853f25d6f..4d754f55e 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm @@ -50,9 +50,9 @@ my $mapping = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{sseries}->{OperStatus}->{oid} }, + push @{$self->{request}}, { oid => $mapping->{sseries}->{OperStatus}->{oid} }, { oid => $mapping->{mseries}->{OperStatus}->{oid} }, { oid => $mapping->{zseries}->{OperStatus}->{oid} }; } diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm index 7e38f45bd..9dfa727f6 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm @@ -34,9 +34,9 @@ my $mapping = { my $oid_deviceSensorValueEntry = '.1.3.6.1.4.1.3417.2.1.1.1.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{sseries}->{Temp}->{oid} }, + push @{$self->{request}}, { oid => $mapping->{sseries}->{Temp}->{oid} }, { oid => $mapping->{mseries}->{Temp}->{oid} }; } diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm index 65b78494c..3f93c85b0 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm @@ -20,31 +20,49 @@ package centreon::common::force10::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; -my $thresholds = { - fan => [ - ['up', 'OK'], - ['absent', 'OK'], - ['down', 'CRITICAL'], - ], - psu => [ - ['up', 'OK'], - ['absent', 'OK'], - ['down', 'CRITICAL'], - - ['normal', 'OK'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['shutdown', 'CRITICAL'], - ['notPresent', 'OK'], - ['notFunctioning', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(psu|fan)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['up', 'OK'], + ['absent', 'OK'], + ['down', 'CRITICAL'], + ], + psu => [ + ['up', 'OK'], + ['absent', 'OK'], + ['down', 'CRITICAL'], + + ['normal', 'OK'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['shutdown', 'CRITICAL'], + ['notPresent', 'OK'], + ['notFunctioning', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'centreon::common::force10::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'temperature']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -53,241 +71,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "filter:s@" => { name => 'filter' }, - "absent-problem:s@" => { name => 'absent_problem' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{filter} = []; - foreach my $val (@{$self->{option_results}->{filter}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{filter}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{absent_problem} = []; - foreach my $val (@{$self->{option_results}->{absent_problem}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($section !~ /^psu|fan$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload section '" . $val . "'."); - $self->{output}->option_exit(); - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - next if (!defined($val) || $val eq ''); - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $value) = ($1, $2, $3); - if ($section !~ /^temperature$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, instance => $instance }; - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'temperature'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::force10::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::force10::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub absent_problem { - my ($self, %options) = @_; - - foreach (@{$self->{absent_problem}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($_->{instance}) || $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; - } - } - } - - return 0; -} - -sub check_filter { - my ($self, %options) = @_; - - foreach (@{$self->{filter}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($options{instance}) && !defined($_->{instance})) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } elsif (defined($options{instance}) && $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } - } - - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{instance}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm index 46d4533e9..cb91c747a 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm @@ -28,9 +28,9 @@ use warnings; my $oid_chassisSystemLedAlarm = '.1.3.6.1.4.1.35897.1.2.2.3.17.1.7'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_chassisSystemLedAlarm }; + push @{$self->{request}}, { oid => $oid_chassisSystemLedAlarm }; } sub check { @@ -38,7 +38,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking chassis alarm"); $self->{components}->{ca} = {name => 'chassis alarm', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'ca')); + return if ($self->check_filter(section => 'ca')); foreach my $oid (keys %{$self->{results}->{$oid_chassisSystemLedAlarm}}) { $oid =~ /^$oid_chassisSystemLedAlarm\.(.*)$/; @@ -46,7 +46,7 @@ sub check { my $instance = $array_name; my $ca_state = $self->{results}->{$oid_chassisSystemLedAlarm}->{$oid}; - next if ($self->check_exclude(section => 'ca', instance => $instance)); + next if ($self->check_filter(section => 'ca', instance => $instance)); $self->{components}->{ca}->{total}++; $self->{output}->output_add(long_msg => sprintf("Chassis alarm '%s' is %s.", diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm index a6f5d40cf..e08d5c627 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm @@ -28,9 +28,9 @@ use warnings; my $oid_arrayFanEntry_speed = '.1.3.6.1.4.1.35897.1.2.2.3.18.1.3'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_arrayFanEntry_speed }; + push @{$self->{request}}, { oid => $oid_arrayFanEntry_speed }; } sub check { @@ -38,7 +38,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid (keys %{$self->{results}->{$oid_arrayFanEntry_speed}}) { $oid =~ /^$oid_arrayFanEntry_speed\.(.*)$/; @@ -46,7 +46,7 @@ sub check { my $instance = $array_name . '-' . $fan_name; my $fan_state = $self->{results}->{$oid_arrayFanEntry_speed}->{$oid}; - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); next if ($fan_state =~ /Absent/i && $self->absent_problem(section => 'fan', instance => $instance)); diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm index e1ee67a82..1293a7f56 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm @@ -31,9 +31,9 @@ my $oid_enable = '.1.3.6.1.4.1.35897.1.2.1.10.1.4'; my $oid_portState = '.1.3.6.1.4.1.35897.1.2.1.10.1.8'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_globalTargetFcEntry }; + push @{$self->{request}}, { oid => $oid_globalTargetFcEntry }; } sub check { @@ -41,7 +41,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking global fc"); $self->{components}->{gfc} = {name => 'global fc', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'gfc')); + return if ($self->check_filter(section => 'gfc')); foreach my $oid (keys %{$self->{results}->{$oid_globalTargetFcEntry}}) { next if ($oid !~ /^$oid_wwn\.(.*)$/); @@ -53,7 +53,7 @@ sub check { $self->{output}->output_add(long_msg => sprintf("Skipping instance '$wwn' (not enable)")); next; } - next if ($self->check_exclude(section => 'gfc', instance => $wwn)); + next if ($self->check_filter(section => 'gfc', instance => $wwn)); $self->{components}->{gfc}->{total}++; $self->{output}->output_add(long_msg => sprintf("Global FC '%s' is %s.", diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm index d3c56bbb1..8bf9c5ec6 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm @@ -31,9 +31,9 @@ my $oid_enable = '.1.3.6.1.4.1.35897.1.2.1.6.1.3'; my $oid_portState = '.1.3.6.1.4.1.35897.1.2.1.6.1.7'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_localTargetFcEntry }; + push @{$self->{request}}, { oid => $oid_localTargetFcEntry }; } sub check { @@ -41,7 +41,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking local fc"); $self->{components}->{lfc} = {name => 'local fc', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'lfc')); + return if ($self->check_filter(section => 'lfc')); foreach my $oid (keys %{$self->{results}->{$oid_localTargetFcEntry}}) { next if ($oid !~ /^$oid_wwn\.(.*)$/); @@ -53,7 +53,7 @@ sub check { $self->{output}->output_add(long_msg => sprintf("Skipping instance '$wwn' (not enable)")); next; } - next if ($self->check_exclude(section => 'lfc', instance => $wwn)); + next if ($self->check_filter(section => 'lfc', instance => $wwn)); $self->{components}->{lfc}->{total}++; $self->{output}->output_add(long_msg => sprintf("Local FC '%s' is %s.", diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm index 23dd5510e..082ad10f2 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm @@ -29,10 +29,9 @@ my $oid_chassisSystemPowerPSUA = '.1.3.6.1.4.1.35897.1.2.2.3.17.1.17'; my $oid_chassisSystemPowerPSUB = '.1.3.6.1.4.1.35897.1.2.2.3.17.1.18'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_chassisSystemPowerPSUA }; - push @{$options{request}}, { oid => $oid_chassisSystemPowerPSUB }; + push @{$self->{request}}, { oid => $oid_chassisSystemPowerPSUA }, { oid => $oid_chassisSystemPowerPSUB }; } sub psu { @@ -45,7 +44,7 @@ sub psu { my $psu_state = $options{value}; - return if ($self->check_exclude(section => 'psu', instance => $instance)); + return if ($self->check_filter(section => 'psu', instance => $instance)); return if ($psu_state =~ /Absent/i && $self->absent_problem(section => 'psu', instance => $instance)); @@ -64,7 +63,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid (keys %{$self->{results}->{$oid_chassisSystemPowerPSUA}}) { psu($self, oid => $oid, oid_short => $oid_chassisSystemPowerPSUA, value => $self->{results}->{$oid_chassisSystemPowerPSUA}->{$oid}, diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm index c724a7251..daf330b81 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm @@ -30,11 +30,10 @@ my $oid_chassisSystemTempController = '.1.3.6.1.4.1.35897.1.2.2.3.17.1.21'; my $oid_arrayVimmEntry_temp = '.1.3.6.1.4.1.35897.1.2.2.3.16.1.12'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_arrayVimmEntry_temp }; - push @{$options{request}}, { oid => $oid_chassisSystemTempAmbient }; - push @{$options{request}}, { oid => $oid_chassisSystemTempController }; + push @{$self->{request}}, { oid => $oid_arrayVimmEntry_temp }, { oid => $oid_chassisSystemTempAmbient }, + { oid => $oid_chassisSystemTempController }; } sub temperature { @@ -47,7 +46,7 @@ sub temperature { my $temperature = $options{value}; - return if ($self->check_exclude(section => 'temperature', instance => $instance)); + return if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add(long_msg => sprintf("Temperature '%s' is %s degree centigrade.", @@ -68,7 +67,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid (keys %{$self->{results}->{$oid_chassisSystemTempAmbient}}) { temperature($self, oid => $oid, oid_short => $oid_chassisSystemTempAmbient, value => $self->{results}->{$oid_chassisSystemTempAmbient}->{$oid}, diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm index 8f0189ea9..63c36042e 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm @@ -39,10 +39,9 @@ my %map_vimm_present = ( ); sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_arrayVimmEntry_present }; - push @{$options{request}}, { oid => $oid_arrayVimmEntry_failed }; + push @{$self->{request}}, { oid => $oid_arrayVimmEntry_present }, { oid => $oid_arrayVimmEntry_failed }; } sub check { @@ -50,7 +49,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking vimms"); $self->{components}->{vimm} = {name => 'vimms', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'vimm')); + return if ($self->check_filter(section => 'vimm')); foreach my $oid (keys %{$self->{results}->{$oid_arrayVimmEntry_present}}) { next if ($oid !~ /^$oid_arrayVimmEntry_present\.(.*)$/); @@ -59,7 +58,7 @@ sub check { my ($dummy, $array_name, $vimm_name) = $self->convert_index(value => $1); my $instance = $array_name . '-' . $vimm_name; - next if ($self->check_exclude(section => 'vimm', instance => $instance)); + next if ($self->check_filter(section => 'vimm', instance => $instance)); next if ($map_vimm_present{$present} =~ /Absent/i && $self->absent_problem(section => 'vimm', instance => $instance)); diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm index f264e3e5b..1200df760 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm @@ -20,55 +20,77 @@ package centreon::common::violin::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; my $thresholds = { - vimm => [ - ['not failed', 'OK'], - ['failed', 'CRITICAL'], - ], - ca => [ - ['ON', 'CRITICAL'], - ['OFF', 'OK'], - ], - psu => [ - ['OFF', 'CRITICAL'], - ['Absent', 'OK'], - ['ON', 'OK'], - ], - fan => [ - ['OFF', 'CRITICAL'], - ['Absent', 'OK'], - ['Low', 'OK'], - ['Medium', 'OK'], - ['High', 'WARNING'], - ], - gfc => [ - ['Online', 'OK'], - ['Unconfigured', 'OK'], - ['Unknown', 'UNKNOWN'], - ['Not\s*Supported', 'WARNING'], - ['Dead', 'CRITICAL'], - ['Lost', 'CRITICAL'], - ['Failover\s*Failed', 'CRITICAL'], - ['Failover', 'WARNING'], - ], - lfc => [ - ['Online', 'OK'], - ['Unconfigured', 'OK'], - ['Unknown', 'UNKNOWN'], - ['Not\s*Supported', 'WARNING'], - ['Dead', 'CRITICAL'], - ['Lost', 'CRITICAL'], - ['Failover\s*Failed', 'CRITICAL'], - ['Failover', 'WARNING'], - ], + }; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(vimm|ca|psu|fan|gfc|lfc)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + vimm => [ + ['not failed', 'OK'], + ['failed', 'CRITICAL'], + ], + ca => [ + ['ON', 'CRITICAL'], + ['OFF', 'OK'], + ], + psu => [ + ['OFF', 'CRITICAL'], + ['Absent', 'OK'], + ['ON', 'OK'], + ], + fan => [ + ['OFF', 'CRITICAL'], + ['Absent', 'OK'], + ['Low', 'OK'], + ['Medium', 'OK'], + ['High', 'WARNING'], + ], + gfc => [ + ['Online', 'OK'], + ['Unconfigured', 'OK'], + ['Unknown', 'UNKNOWN'], + ['Not\s*Supported', 'WARNING'], + ['Dead', 'CRITICAL'], + ['Lost', 'CRITICAL'], + ['Failover\s*Failed', 'CRITICAL'], + ['Failover', 'WARNING'], + ], + lfc => [ + ['Online', 'OK'], + ['Unconfigured', 'OK'], + ['Unknown', 'UNKNOWN'], + ['Not\s*Supported', 'WARNING'], + ['Dead', 'CRITICAL'], + ['Lost', 'CRITICAL'], + ['Failover\s*Failed', 'CRITICAL'], + ['Failover', 'WARNING'], + ], + }; + + $self->{components_path} = 'centreon::common::violin::snmp::mode::components'; + $self->{components_module} = ['ca', 'psu', 'fan', 'vimm', 'temperature', 'gfc', 'lfc']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -76,202 +98,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ('temperature', $1, $2); - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('ca', 'psu', 'fan', 'vimm', 'temperature', 'gfc', 'lfc'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::violin::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "centreon::common::violin::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - sub convert_index { my ($self, %options) = @_; @@ -306,15 +138,15 @@ Check components (Fans, Power Supplies, Temperatures, Chassis alarm, vimm, globa Which component to check (Default: '.*'). Can be: 'psu', 'fan', 'ca', 'vimm', 'lfc', 'gfc', 'temperature'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='psu#41239F00647-A#' +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,41239F00647-A =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fan#41239F00647-fan02# +Can be specific or global: --absent-problem=fan,41239F00647-fan02 =item B<--no-component> @@ -323,19 +155,19 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='gfc,CRITICAL,^(?!(Online)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: regexp,treshold) -Example: --warning='41239F00647-vimm46,20' --warning='41239F00647-vimm5.*,30' +Set warning threshold for temperatures (syntax: type,regexp,threshold) +Example: --warning='temperature,41239F00647-vimm46,20' --warning='temperature,41239F00647-vimm5.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: regexp,treshold) -Example: --critical='41239F00647-vimm46,25' --warning='41239F00647-vimm5.*,35' +Set critical threshold for temperatures (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,25' --warning='temperature,.*,35' =back diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm index b5cba0ee6..e928ddf72 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsComputeBladeDn = '.1.3.6.1.4.1.9.9.719.1.9.2.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsComputeBladePresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsComputeBladePresence}->{oid} }, { oid => $mapping2->{cucsComputeBladeOperState}->{oid} }, { oid => $oid_cucsComputeBladeDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking blades"); $self->{components}->{blade} = {name => 'blades', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'blade')); + return if ($self->check_filter(section => 'blade')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsComputeBladeDn}})) { $oid =~ /\.(\d+)$/; @@ -55,7 +55,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsComputeBladeOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'blade', instance => $blade_dn)); - next if ($self->check_exclude(section => 'blade', instance => $blade_dn)); + next if ($self->check_filter(section => 'blade', instance => $blade_dn)); $self->{output}->output_add(long_msg => sprintf("blade '%s' state is '%s' [presence: %s].", $blade_dn, $result2->{cucsComputeBladeOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm index c395b04d6..b1413df31 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm @@ -32,9 +32,9 @@ my $mapping1 = { my $oid_cucsEquipmentChassisDn = '.1.3.6.1.4.1.9.9.719.1.15.7.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsEquipmentChassisOperState}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsEquipmentChassisOperState}->{oid} }, { oid => $oid_cucsEquipmentChassisDn }; } @@ -43,7 +43,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking chassis"); $self->{components}->{chassis} = {name => 'chassis', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'chassis')); + return if ($self->check_filter(section => 'chassis')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsEquipmentChassisDn}})) { $oid =~ /\.(\d+)$/; @@ -52,7 +52,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{$mapping1->{cucsEquipmentChassisOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'chassis', instance => $chassis_dn)); - next if ($self->check_exclude(section => 'chassis', instance => $chassis_dn)); + next if ($self->check_filter(section => 'chassis', instance => $chassis_dn)); $self->{components}->{chassis}->{total}++; diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm index 04194ef13..c49b1c074 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsProcessorUnitDn = '.1.3.6.1.4.1.9.9.719.1.41.9.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsProcessorUnitPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsProcessorUnitPresence}->{oid} }, { oid => $mapping2->{cucsProcessorUnitOperState}->{oid} }, { oid => $oid_cucsProcessorUnitDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking cpus"); $self->{components}->{cpu} = {name => 'cpus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'cpu')); + return if ($self->check_filter(section => 'cpu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsProcessorUnitDn}})) { $oid =~ /\.(\d+)$/; @@ -55,7 +55,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsProcessorUnitOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'cpu', instance => $cpu_dn)); - next if ($self->check_exclude(section => 'cpu', instance => $cpu_dn)); + next if ($self->check_filter(section => 'cpu', instance => $cpu_dn)); $self->{output}->output_add(long_msg => sprintf("cpu '%s' state is '%s' [presence: %s].", $cpu_dn, $result2->{cucsProcessorUnitOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm index 5fd1ce740..169341beb 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsEquipmentFanDn = '.1.3.6.1.4.1.9.9.719.1.15.12.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsEquipmentFanPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsEquipmentFanPresence}->{oid} }, { oid => $mapping2->{cucsEquipmentFanOperState}->{oid} }, { oid => $oid_cucsEquipmentFanDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsEquipmentFanDn}})) { $oid =~ /\.(\d+)$/; @@ -55,7 +55,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsEquipmentFanOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'fan', instance => $fan_dn)); - next if ($self->check_exclude(section => 'fan', instance => $fan_dn)); + next if ($self->check_filter(section => 'fan', instance => $fan_dn)); $self->{output}->output_add(long_msg => sprintf("fan '%s' state is '%s' [presence: %s].", $fan_dn, $result2->{cucsEquipmentFanOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm index 953912bea..a6845cc79 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsEquipmentFexDn = '.1.3.6.1.4.1.9.9.719.1.15.19.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsEquipmentFexPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsEquipmentFexPresence}->{oid} }, { oid => $mapping2->{cucsEquipmentFexOperState}->{oid} }, { oid => $oid_cucsEquipmentFexDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fabric extenders"); $self->{components}->{fex} = {name => 'fabric extenders', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fex')); + return if ($self->check_filter(section => 'fex')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsEquipmentFexDn}})) { $oid =~ /\.(\d+)$/; @@ -55,7 +55,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsEquipmentFexOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'fex', instance => $fex_dn)); - next if ($self->check_exclude(section => 'fex', instance => $fex_dn)); + next if ($self->check_filter(section => 'fex', instance => $fex_dn)); $self->{output}->output_add(long_msg => sprintf("Fabric extender '%s' state is '%s' [presence: %s].", $fex_dn, $result2->{cucsEquipmentFexOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm index 174bfc86e..b3808608f 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsEquipmentIOCardDn = '.1.3.6.1.4.1.9.9.719.1.15.30.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsEquipmentIOCardPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsEquipmentIOCardPresence}->{oid} }, { oid => $mapping2->{cucsEquipmentIOCardOperState}->{oid} }, { oid => $oid_cucsEquipmentIOCardDn }; } @@ -46,7 +46,7 @@ sub check { # In MIB 'CISCO-UNIFIED-COMPUTING-EQUIPMENT-MIB' $self->{output}->output_add(long_msg => "Checking io cards"); $self->{components}->{iocard} = {name => 'io cards', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'iocard')); + return if ($self->check_filter(section => 'iocard')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsEquipmentIOCardDn}})) { $oid =~ /\.(\d+)$/; @@ -56,7 +56,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsEquipmentIOCardOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'iocard', instance => $iocard_dn)); - next if ($self->check_exclude(section => 'iocard', instance => $iocard_dn)); + next if ($self->check_filter(section => 'iocard', instance => $iocard_dn)); $self->{output}->output_add(long_msg => sprintf("IO cards '%s' state is '%s' [presence: %s].", $iocard_dn, $result2->{cucsEquipmentIOCardOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm index 44104d87e..35f7c8306 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsStorageLocalDiskDn = '.1.3.6.1.4.1.9.9.719.1.45.4.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsStorageLocalDiskPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsStorageLocalDiskPresence}->{oid} }, { oid => $mapping2->{cucsStorageLocalDiskOperability}->{oid} }, { oid => $oid_cucsStorageLocalDiskDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking local disks"); $self->{components}->{localdisk} = {name => 'local disks', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'localdisk')); + return if ($self->check_filter(section => 'localdisk')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsStorageLocalDiskDn}})) { $oid =~ /\.(\d+)$/; @@ -55,7 +55,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsStorageLocalDiskOperability}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'localdisk', instance => $localdisk_dn)); - next if ($self->check_exclude(section => 'localdisk', instance => $localdisk_dn)); + next if ($self->check_filter(section => 'localdisk', instance => $localdisk_dn)); $self->{output}->output_add(long_msg => sprintf("local disk '%s' state is '%s' [presence: %s].", $localdisk_dn, $result2->{cucsStorageLocalDiskOperability}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm index ae442a0ee..d79451b60 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsMemoryUnitDn = '.1.3.6.1.4.1.9.9.719.1.30.11.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsMemoryUnitPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsMemoryUnitPresence}->{oid} }, { oid => $mapping2->{cucsMemoryUnitOperState}->{oid} }, { oid => $oid_cucsMemoryUnitDn }; } @@ -45,7 +45,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking memories"); $self->{components}->{memory} = {name => 'memories', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'memory')); + return if ($self->check_filter(section => 'memory')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsMemoryUnitDn}})) { $oid =~ /\.(\d+)$/; @@ -56,7 +56,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsMemoryUnitOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'memory', instance => $memory_dn)); - next if ($self->check_exclude(section => 'memory', instance => $memory_dn)); + next if ($self->check_filter(section => 'memory', instance => $memory_dn)); $self->{output}->output_add(long_msg => sprintf("memory '%s' state is '%s' [presence: %s].", $memory_dn, $result2->{cucsMemoryUnitOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm index 26a2bdec6..5180e6ae7 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm @@ -34,9 +34,9 @@ my $mapping2 = { my $oid_cucsEquipmentPsuDn = '.1.3.6.1.4.1.9.9.719.1.15.56.1.2'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping1->{cucsEquipmentPsuPresence}->{oid} }, + push @{$self->{request}}, { oid => $mapping1->{cucsEquipmentPsuPresence}->{oid} }, { oid => $mapping2->{cucsEquipmentPsuOperState}->{oid} }, { oid => $oid_cucsEquipmentPsuDn }; } @@ -46,7 +46,7 @@ sub check { # In MIB 'CISCO-UNIFIED-COMPUTING-EQUIPMENT-MIB' $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsEquipmentPsuDn}})) { $oid =~ /\.(\d+)$/; @@ -56,7 +56,7 @@ sub check { my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsEquipmentPsuOperState}->{oid}}, instance => $instance); next if ($self->absent_problem(section => 'psu', instance => $psu_dn)); - next if ($self->check_exclude(section => 'psu', instance => $psu_dn)); + next if ($self->check_filter(section => 'psu', instance => $psu_dn)); $self->{output}->output_add(long_msg => sprintf("power supply '%s' state is '%s' [presence: %s].", $psu_dn, $result2->{cucsEquipmentPsuOperState}, diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm index 91d7e45ac..fbd837d37 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm @@ -20,194 +20,45 @@ package hardware::server::cisco::ucs::mode::equipment; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use hardware::server::cisco::ucs::mode::components::resources qw($thresholds); +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|chassis|iocard|blade|fex|cpu|memory|localdisk)\.(presence|operability|overall_status)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = $thresholds; + + $self->{components_path} = 'hardware::server::cisco::ucs::mode::components'; + $self->{components_module} = ['fan', 'psu', 'chassis', 'iocard', 'blade', 'fex', 'cpu', 'memory', 'localdisk']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s@" => { name => 'absent_problem' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{absent_problem} = []; - foreach my $val (@{$self->{option_results}->{absent_problem}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] }; - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - next if (!defined($val) || $val eq ''); - my @values = split (/,/, $val); - if (scalar(@values) < 3) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $instance, $status, $filter); - if (scalar(@values) == 3) { - ($section, $status, $filter) = @values; - $instance = '.*'; - } else { - ($section, $instance, $status, $filter) = @values; - } - if ($section !~ /^(fan|psu|chassis|iocard|blade|fex|cpu|memory|localdisk)\.(presence|operability|overall_status)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload section '" . $val . "'."); - $self->{output}->option_exit(); - } - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('fan', 'psu', 'chassis', 'iocard', 'blade', 'fex', 'cpu', 'memory', 'localdisk'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::cisco::ucs::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::cisco::ucs::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub absent_problem { - my ($self, %options) = @_; - - foreach (@{$self->{absent_problem}}) { - if ($options{section} =~ /$_->{filter}/) { - if (!defined($_->{instance}) || $options{instance} =~ /$_->{instance}/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; - } - } - } - - return 0; -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && - (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { - $status = $_->{status}; - return $status; - } - } - } - my $label = defined($options{label}) ? $options{label} : $options{section}; - foreach (@{$thresholds->{$label}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -223,10 +74,10 @@ Check Hardware (Fans, Power supplies, chassis, io cards, blades, fabric extender Which component to check (Default: '.*'). Can be: 'fan', 'psu', 'chassis', 'iocard', 'blade', 'fex', 'cpu', 'memory', 'localdisk'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=fan) -Can be specific or global: --exclude=fan#/sys/chassis-7/fan-module-1-7/fan-1# +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,/sys/chassis-7/fan-module-1-7/fan-1 =item B<--absent-problem> diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm index eabf896d3..88361c9ff 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm @@ -40,9 +40,9 @@ my $oids = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_temperature, end => $oid_end }; + push @{$self->{request}}, { oid => $oid_temperature, end => $oid_end }; } sub check { @@ -50,7 +50,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking ambient"); $self->{components}->{ambient} = {name => 'ambient', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'ambient')); + return if ($self->check_filter(section => 'ambient')); my @sensors = ('mm', 'frontpanel', 'frontpanel2'); my $label = 'bladecenter'; @@ -68,7 +68,7 @@ sub check { } my $value = $1; - next if ($self->check_exclude(section => 'ambient', instance => $temp)); + next if ($self->check_filter(section => 'ambient', instance => $temp)); $self->{components}->{ambient}->{total}++; $self->{output}->output_add(long_msg => sprintf("ambient '%s' is %s degree centigrade.", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm index 2f020405a..dd9918b7d 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm @@ -59,9 +59,9 @@ my $mapping = { my $oid_bladeSystemStatusEntry = '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_bladeSystemStatusEntry, start => $mapping->{bladeId}->{oid}, end => $mapping->{bladeName}->{oid} }; + push @{$self->{request}}, { oid => $oid_bladeSystemStatusEntry, start => $mapping->{bladeId}->{oid}, end => $mapping->{bladeName}->{oid} }; } sub check { @@ -69,14 +69,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking blades"); $self->{components}->{blade} = {name => 'blades', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'blade')); + return if ($self->check_filter(section => 'blade')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_bladeSystemStatusEntry}})) { next if ($oid !~ /^$mapping->{bladeExists}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_bladeSystemStatusEntry}, instance => $instance); - next if ($self->check_exclude(section => 'blade', instance => $result->{bladeId})); + next if ($self->check_filter(section => 'blade', instance => $result->{bladeId})); if ($result->{bladeExists} =~ /false/i) { $self->{output}->output_add(long_msg => "skipping blade '" . $instance . "' : not exits"); next; diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm index b03b7c565..022cb698b 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm @@ -45,9 +45,9 @@ my $entry_controller_state = '30'; my $count = 4; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_blowers }; + push @{$self->{request}}, { oid => $oid_blowers }; } sub check { @@ -55,7 +55,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking blowers"); $self->{components}->{blower} = {name => 'blowers', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'blower')); + return if ($self->check_filter(section => 'blower')); for (my $i = 0; $i < $count; $i++) { my $instance = $i + 1; @@ -64,7 +64,7 @@ sub check { my $blower_speed = defined($self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'}) ? $self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'} : 'unknown'; my $ctrl_state = defined($self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'}) ? $map_controller_state{$self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'}} : undef; - next if ($self->check_exclude(section => 'blower', instance => $instance)); + next if ($self->check_filter(section => 'blower', instance => $instance)); next if ($blower_speed =~ /No Blower/i && $self->absent_problem(section => 'blower', instance => $instance)); $self->{components}->{blower}->{total}++; @@ -94,7 +94,7 @@ sub check { next if (!defined($ctrl_state)); - next if ($self->check_exclude(section => 'blowerctrl', instance => $instance)); + next if ($self->check_filter(section => 'blowerctrl', instance => $instance)); next if ($ctrl_state =~ /notPresent/i && $self->absent_problem(section => 'blowerctrl', instance => $instance)); $self->{output}->output_add(long_msg => sprintf("Blower controller '%s' state is %s.", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm index a3c90d7a2..f3648f55c 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm @@ -38,9 +38,9 @@ my $mapping = { my $oid_chassisFansEntry = '.1.3.6.1.4.1.2.3.51.2.2.3.50.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_chassisFansEntry }; + push @{$self->{request}}, { oid => $oid_chassisFansEntry }; } sub check { @@ -48,14 +48,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking chassis fan"); $self->{components}->{chassisfan} = {name => 'chassis fan', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'chassisfan')); + return if ($self->check_filter(section => 'chassisfan')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_chassisFansEntry}})) { next if ($oid !~ /^$mapping->{chassisFanState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_chassisFansEntry}, instance => $instance); - next if ($self->check_exclude(section => 'chassisfan', instance => $instance)); + next if ($self->check_filter(section => 'chassisfan', instance => $instance)); $self->{components}->{chassisfan}->{total}++; $self->{output}->output_add(long_msg => sprintf("Chassis fan '%s' is %s rpm [status: %s, instance: %s]", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm index db8b4a56a..f4a315fdb 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm @@ -64,9 +64,9 @@ my %map_test_state = ( ); sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_mmBistAndChassisStatus, end => $oid_bistLogicalNetworkLink }; + push @{$self->{request}}, { oid => $oid_mmBistAndChassisStatus, end => $oid_bistLogicalNetworkLink }; } sub check { @@ -74,7 +74,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking chassis status"); $self->{components}->{chassisstatus} = {name => 'chassis-status', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'chassisstatus')); + return if ($self->check_filter(section => 'chassisstatus')); foreach my $name (sort keys %{$oids}) { if (!defined($self->{results}->{$oid_mmBistAndChassisStatus}->{$oids->{$name}})) { @@ -84,7 +84,7 @@ sub check { } my $value = $map_test_state{$self->{results}->{$oid_mmBistAndChassisStatus}->{$oids->{$name}}}; - next if ($self->check_exclude(section => 'chassisstatus', instance => $name)); + next if ($self->check_filter(section => 'chassisstatus', instance => $name)); $self->{components}->{chassisstatus}->{total}++; $self->{output}->output_add(long_msg => sprintf("Chassis status '%s' state is %s", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm index 918cd655a..7f9a067f2 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm @@ -43,9 +43,9 @@ my $mapping = { my $oid_fanPackEntry = '.1.3.6.1.4.1.2.3.51.2.2.6.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_fanPackEntry }; + push @{$self->{request}}, { oid => $oid_fanPackEntry }; } sub check { @@ -53,7 +53,7 @@ sub check { $self->{output}->output_add(long_msg => "Checking fanpack"); $self->{components}->{fanpack} = {name => 'fanpacks', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fanpack')); + return if ($self->check_filter(section => 'fanpack')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_fanPackEntry}})) { next if ($oid !~ /^$mapping->{fanPackState}->{oid}\.(.*)$/); @@ -64,7 +64,7 @@ sub check { $self->{output}->output_add(long_msg => "skipping fanpack '" . $instance . "' : not exits"); next; } - next if ($self->check_exclude(section => 'fanpack', instance => $instance)); + next if ($self->check_filter(section => 'fanpack', instance => $instance)); $self->{components}->{fanpack}->{total}++; $self->{output}->output_add(long_msg => sprintf("Fanpack '%s' is %s rpm [status: %s, instance: %s]", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm index dd4fd6135..27e6d8a5d 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm @@ -44,9 +44,9 @@ my $mapping = { my $oid_powerModuleHealthEntry = '.1.3.6.1.4.1.2.3.51.2.2.4.1.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_powerModuleHealthEntry, start => $mapping->{powerModuleExists}->{oid} }; + push @{$self->{request}}, { oid => $oid_powerModuleHealthEntry, start => $mapping->{powerModuleExists}->{oid} }; } sub check { @@ -54,14 +54,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking power modules"); $self->{components}->{powermodule} = {name => 'power modules', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'powermodule')); + return if ($self->check_filter(section => 'powermodule')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerModuleHealthEntry}})) { next if ($oid !~ /^$mapping->{powerModuleState}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerModuleHealthEntry}, instance => $instance); - next if ($self->check_exclude(section => 'powermodule', instance => $instance)); + next if ($self->check_filter(section => 'powermodule', instance => $instance)); next if ($result->{powerModuleExists} =~ /No/i && $self->absent_problem(section => 'powermodule', instance => $instance)); $self->{components}->{powermodule}->{total}++; diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm index 3d6c6b3f2..95e2517d2 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm @@ -36,9 +36,9 @@ my $mapping = { }; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $mapping->{smHealthState}->{oid} }; + push @{$self->{request}}, { oid => $mapping->{smHealthState}->{oid} }; } sub check { @@ -46,14 +46,14 @@ sub check { $self->{output}->output_add(long_msg => "Checking switch module"); $self->{components}->{switchmodule} = {name => 'switch modules', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'switchmodule')); + return if ($self->check_filter(section => 'switchmodule')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{smHealthState}->{oid}}})) { $oid =~ /^$mapping->{smHealthState}->{oid}\.(.*)/; my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{smHealthState}->{oid}}, instance => $instance); - next if ($self->check_exclude(section => 'switchmodule', instance => $instance)); + next if ($self->check_filter(section => 'switchmodule', instance => $instance)); $self->{components}->{switchmodule}->{total}++; $self->{output}->output_add(long_msg => sprintf("Switch module '%s' status is %s [instance: %s]", diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm index 4f4958292..18c5e49b0 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm @@ -34,9 +34,9 @@ my %map_systemhealth_state = ( ); sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_systemHealthStat }; + push @{$self->{request}}, { oid => $oid_systemHealthStat }; } sub check { @@ -44,8 +44,11 @@ sub check { $self->{output}->output_add(long_msg => "Checking system health"); $self->{components}->{systemhealth} = {name => 'system-health', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'systemhealth')); + return if ($self->check_filter(section => 'systemhealth')); + return if (!defined($self->{results}->{$oid_systemHealthStat}->{$oid_systemHealthStat . '.0'}) || + !defined($map_systemhealth_state{$self->{results}->{$oid_systemHealthStat}->{$oid_systemHealthStat . '.0'}})); + my $value = $map_systemhealth_state{$self->{results}->{$oid_systemHealthStat}->{$oid_systemHealthStat . '.0'}}; $self->{components}->{systemhealth}->{total}++; diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm index 1d939c6e7..7be62e343 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm @@ -20,74 +20,92 @@ package hardware::server::ibm::bladecenter::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - chassisstatus => [ - ['testSucceeded', 'OK'], - ['testFailed', 'CRITICAL'], - ], - systemhealth => [ - ['normal', 'OK'], - ['systemLevel', 'WARNING'], - ['nonCritical', 'WARNING'], - ['critical', 'CRITICAL'], - ], - powermodule => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['notAvailable', 'UNKNOWN'], - ], - fanpack => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['bad', 'CRITICAL'], - ], - chassisfan => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['bad', 'CRITICAL'], - ], - blower => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['bad', 'CRITICAL'], - ], - switchmodule => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['bad', 'CRITICAL'], - ], - blowerctrl => [ - ['unknown', 'UNKNOWN'], - ['operational', 'OK'], - ['flashing', 'WARNING'], - ['communicationError', 'CRITICAL'], - ['notPresent', 'UNKNOWN'], - ], - blade => [ - ['unknown', 'UNKNOWN'], - ['good', 'OK'], - ['warning', 'WARNING'], - ['critical', 'CRITICAL'], - ['kernelMode', 'WARNING'], - ['discovering', 'WARNING'], - ['commError', 'CRITICAL'], - ['noPower', 'WARNING'], - ['flashing', 'WARNING'], - ['initFailure', 'CRITICAL'], - ['insufficientPower', 'CRITICAL'], - ['powerDenied', 'CRITICAL'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_numeric_check_section_option} = '^(blower|ambient|fanpack|chassisfan)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + chassisstatus => [ + ['testSucceeded', 'OK'], + ['testFailed', 'CRITICAL'], + ], + systemhealth => [ + ['normal', 'OK'], + ['systemLevel', 'WARNING'], + ['nonCritical', 'WARNING'], + ['critical', 'CRITICAL'], + ], + powermodule => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['notAvailable', 'UNKNOWN'], + ], + fanpack => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['bad', 'CRITICAL'], + ], + chassisfan => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['bad', 'CRITICAL'], + ], + blower => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['bad', 'CRITICAL'], + ], + switchmodule => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['bad', 'CRITICAL'], + ], + blowerctrl => [ + ['unknown', 'UNKNOWN'], + ['operational', 'OK'], + ['flashing', 'WARNING'], + ['communicationError', 'CRITICAL'], + ['notPresent', 'UNKNOWN'], + ], + blade => [ + ['unknown', 'UNKNOWN'], + ['good', 'OK'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['kernelMode', 'WARNING'], + ['discovering', 'WARNING'], + ['commError', 'CRITICAL'], + ['noPower', 'WARNING'], + ['flashing', 'WARNING'], + ['initFailure', 'CRITICAL'], + ['insufficientPower', 'CRITICAL'], + ['powerDenied', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'hardware::server::ibm::bladecenter::snmp::mode::components'; + $self->{components_module} = ['ambient', 'powermodule', 'blade', 'blower', 'fanpack', 'chassisfan', 'systemhealth', 'chassisstatus', 'switchmodule']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -96,211 +114,12 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "absent-problem:s" => { name => 'absent' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{product_name} = undef; - $self->{serial} = undef; - $self->{romversion} = undef; - $self->{components} = {}; - $self->{no_components} = undef; - return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(blower|ambient|fanpack|chassisfan)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: blower, fanpack, chassisfan or ambient)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('ambient', 'powermodule', 'blade', 'blower', 'fanpack', 'chassisfan', 'systemhealth', 'chassisstatus', 'switchmodule'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::ibm::bladecenter::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::ibm::bladecenter::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -317,15 +136,15 @@ Which component to check (Default: 'all'). Can be: 'ambient', 'powermodule', 'fanpack', 'chassisfan', 'blower', 'blade', 'systemhealth', 'chassisstatus', 'switchmodule'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=blower,powermodule) -Can also exclude specific instance: --exclude=blower#1#,powermodule#2# +Exclude some parts (comma seperated list) (Example: --filter=blower --filter=powermodule) +Can also exclude specific instance: --filter=blower,1 =item B<--absent-problem> Return an error if an entity is not 'notAvailable' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=powermodule#2# +Can be specific or global: --absent-problem=powermodule,2 =item B<--no-component> @@ -334,18 +153,18 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='blade,OK,unknown' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold (syntax: type,regexp,threshold) Example: --warning='ambient,mm,30' --warning='ambient,frontpanel,35' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,treshold) +Set critical threshold (syntax: type,regexp,threshold) Example: --critical='blower,1,50' =back From 2c2ca06a16a9c5c747ec117b3ba669e42fffecbc Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 11 Jan 2016 20:10:31 +0100 Subject: [PATCH 008/346] + Can add userinfo in proxypac url (will be used to auth on proxy) (Fix #263) --- centreon-plugins/centreon/plugins/http.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/plugins/http.pm b/centreon-plugins/centreon/plugins/http.pm index 35af3e64f..452f765bd 100644 --- a/centreon-plugins/centreon/plugins/http.pm +++ b/centreon-plugins/centreon/plugins/http.pm @@ -153,10 +153,11 @@ sub set_proxy { if (defined($options{request}->{proxypac}) && $options{request}->{proxypac} ne '') { centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'HTTP::ProxyPAC', error_msg => "Cannot load module 'HTTP::ProxyPAC'."); - my $pac; + my ($pac, $pac_uri); eval { if ($options{request}->{proxypac} =~ /^(http|https):\/\//) { - $pac = HTTP::ProxyPAC->new(URI->new($options{request}->{proxypac})); + $pac_uri = URI->new($options{request}->{proxypac}); + $pac = HTTP::ProxyPAC->new($pac_uri); } else { $pac = HTTP::ProxyPAC->new($options{request}->{proxypac}); } @@ -167,7 +168,9 @@ sub set_proxy { } my $res = $pac->find_proxy($options{url}); if (defined($res->direct) && $res->direct != 1) { - $self->{ua}->proxy(['http', 'https'], $res->proxy); + my $proxy_uri = URI->new($res->proxy); + $proxy_uri->userinfo($pac_uri->userinfo) if (defined($pac_uri->userinfo)); + $self->{ua}->proxy(['http', 'https'], $proxy_uri->as_string); } } if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') { From 102103af41e67bd5047a60381a844db32a955b77 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 10:54:19 +0100 Subject: [PATCH 009/346] + Add option --filter-uom (Fix #220) --- centreon-plugins/centreon/plugins/output.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/centreon-plugins/centreon/plugins/output.pm b/centreon-plugins/centreon/plugins/output.pm index d60e116a6..37964541c 100644 --- a/centreon-plugins/centreon/plugins/output.pm +++ b/centreon-plugins/centreon/plugins/output.pm @@ -40,6 +40,7 @@ sub new { "range-perfdata:s" => { name => 'range_perfdata' }, "filter-perfdata:s" => { name => 'filter_perfdata' }, "change-perfdata:s@" => { name => 'change_perfdata' }, + "filter-uom:s" => { name => 'filter_uom' }, "verbose" => { name => 'verbose' }, "debug" => { name => 'debug' }, "opt-exit:s" => { name => 'opt_exit', default => 'unknown' }, @@ -282,6 +283,8 @@ sub output_json { my %values = (); foreach my $key (keys %$perf) { + $perf->{$key} = '' if (defined($self->{option_results}->{filter_uom}) && $key eq 'unit' && + $perf->{$key} !~ /$self->{option_results}->{filter_uom}/); $values{$key} = $perf->{$key}; } @@ -372,6 +375,8 @@ sub output_xml { $child_perfdata = $self->{xml_output}->createElement("perfdata"); $child_plugin_perfdata->addChild($child_perfdata); foreach my $key (keys %$perf) { + $perf->{$key} = '' if (defined($self->{option_results}->{filter_uom}) && $key eq 'unit' && + $perf->{$key} !~ /$self->{option_results}->{filter_uom}/); my $child = $self->{xml_output}->createElement($key); $child->appendText($perf->{$key}); $child_perfdata->addChild($child); @@ -412,6 +417,8 @@ sub output_txt { foreach my $perf (@{$self->{perfdatas}}) { next if (defined($self->{option_results}->{filter_perfdata}) && $perf->{label} !~ /$self->{option_results}->{filter_perfdata}/); + $perf->{unit} = '' if (defined($self->{option_results}->{filter_uom}) && + $perf->{unit} !~ /$self->{option_results}->{filter_uom}/); $self->range_perfdata(ranges => [\$perf->{warning}, \$perf->{critical}]); print " '" . $perf->{label} . "'=" . $perf->{value} . $perf->{unit} . ";" . $perf->{warning} . ";" . $perf->{critical} . ";" . $perf->{min} . ";" . $perf->{max}; } @@ -776,6 +783,10 @@ Syntax: regexp_matching,regexp_substitute Change perfdata range thresholds display: 1 = start value equals to '0' is removed, 2 = threshold range is not display. +=item B<--filter-uom> + +Filter UOM that match the regexp. + =item B<--opt-exit> Exit code for an option error, usage (default: unknown). From 170208c9bf7fa405c5b73e4ec9e01ec77541cea9 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 11:05:00 +0100 Subject: [PATCH 010/346] + add option --force-counters32 (Fix #213) --- centreon-plugins/snmp_standard/mode/interfaces.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/interfaces.pm b/centreon-plugins/snmp_standard/mode/interfaces.pm index fd06e2512..e681dd0e5 100644 --- a/centreon-plugins/snmp_standard/mode/interfaces.pm +++ b/centreon-plugins/snmp_standard/mode/interfaces.pm @@ -668,6 +668,7 @@ sub new { "show-cache" => { name => 'show_cache' }, "reload-cache-time:s" => { name => 'reload_cache_time', default => 180 }, "nagvis-perfdata" => { name => 'nagvis_perfdata' }, + "force-counters32" => { name => 'force_counters32' }, }); if ($self->{no_traffic} == 0) { $options{options}->add_options(arguments => { "add-traffic" => { name => 'add_traffic' } }); @@ -1053,7 +1054,7 @@ sub load_traffic { if ($self->{get_speed} == 1) { $self->{snmp}->load(oids => [$self->{oid_speed32}], instances => $self->{array_interface_selected}); } - if (!$self->{snmp}->is_snmpv1()) { + if (!$self->{snmp}->is_snmpv1() && !defined($self->{option_results}->{force_counters32})) { $self->{snmp}->load(oids => [$self->{oid_in64}, $self->{oid_out64}], instances => $self->{array_interface_selected}); if ($self->{get_speed} == 1) { $self->{snmp}->load(oids => [$self->{oid_speed64}], instances => $self->{array_interface_selected}); @@ -1076,7 +1077,7 @@ sub load_cast { $self->{snmp}->load(oids => [$self->{oid_ifInUcastPkts}, $self->{oid_ifInBroadcastPkts}, $self->{oid_ifInMulticastPkts}, $self->{oid_ifOutUcastPkts}, $self->{oid_ifOutMulticastPkts}, $self->{oid_ifOutBroadcastPkts}], instances => $self->{array_interface_selected}); - if (!$self->{snmp}->is_snmpv1()) { + if (!$self->{snmp}->is_snmpv1() && !defined($self->{option_results}->{force_counters32})) { $self->{snmp}->load(oids => [$self->{oid_ifHCInUcastPkts}, $self->{oid_ifHCInMulticastPkts}, $self->{oid_ifHCInBroadcastPkts}, $self->{oid_ifHCOutUcastPkts}, $self->{oid_ifHCOutMulticastPkts}, $self->{oid_ifHCOutBroadcastPkts}], instances => $self->{array_interface_selected}); @@ -1155,7 +1156,7 @@ sub add_result_traffic { $self->{interface_selected}->{$options{instance}}->{mode_traffic} = 32; $self->{interface_selected}->{$options{instance}}->{in} = $self->{results}->{$self->{oid_in32} . '.' . $options{instance}}; $self->{interface_selected}->{$options{instance}}->{out} = $self->{results}->{$self->{oid_out32} . '.' . $options{instance}}; - if (!$self->{snmp}->is_snmpv1()) { + if (!$self->{snmp}->is_snmpv1() && !defined($self->{option_results}->{force_counters32})) { if (defined($self->{results}->{$self->{oid_in64} . '.' . $options{instance}}) && $self->{results}->{$self->{oid_in64} . '.' . $options{instance}} ne '' && $self->{results}->{$self->{oid_in64} . '.' . $options{instance}} != 0) { $self->{interface_selected}->{$options{instance}}->{mode_traffic} = 64; @@ -1204,7 +1205,7 @@ sub add_result_cast { $self->{interface_selected}->{$options{instance}}->{oucast} = $self->{results}->{$self->{oid_ifOutUcastPkts} . '.' . $options{instance}}; $self->{interface_selected}->{$options{instance}}->{omcast} = defined($self->{results}->{$self->{oid_ifOutMulticastPkts} . '.' . $options{instance}}) ? $self->{results}->{$self->{oid_ifOutMulticastPkts} . '.' . $options{instance}} : 0; $self->{interface_selected}->{$options{instance}}->{obcast} = defined($self->{results}->{$self->{oid_ifOutBroadcastPkts} . '.' . $options{instance}}) ? $self->{results}->{$self->{oid_ifOutBroadcastPkts} . '.' . $options{instance}} : 0; - if (!$self->{snmp}->is_snmpv1()) { + if (!$self->{snmp}->is_snmpv1() && !defined($self->{option_results}->{force_counters32})) { my $iucast = $self->{results}->{$self->{oid_ifHCInUcastPkts} . '.' . $options{instance}}; if (defined($iucast) && $iucast =~ /[1-9]/) { $self->{interface_selected}->{$options{instance}}->{iucast} = $iucast; @@ -1315,6 +1316,10 @@ Set interface speed for outgoing traffic (in Mb). Don't skip counters when no change. +=item B<--force-counters32> + +Force to use 32 bits counters (even in snmp v2c and v3). Should be used when 64 bits counters are buggy. + =item B<--reload-cache-time> Time in minutes before reloading cache file (default: 180). From 76de873d2a8ce15a88315b7572da704340addd22 Mon Sep 17 00:00:00 2001 From: Meistercoach83 Date: Tue, 12 Jan 2016 11:18:10 +0100 Subject: [PATCH 011/346] Simple Mistype --- centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm index cf9db830a..cef7dfaf8 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm @@ -46,6 +46,6 @@ __END__ =head1 PLUGIN DESCRIPTION -Check Rarian PDU in SNMP. +Check Raritan PDU in SNMP. =cut From 342a5ce855893ad0d086a14a6e81273baa280075 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 12 Jan 2016 12:13:41 +0100 Subject: [PATCH 012/346] add support of alternative subject names - #277 --- centreon-plugins/apps/protocols/x509/mode/validity.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index 59436d06c..d1a381fd0 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -218,7 +218,7 @@ Threshold critical in days (Days before expiration, eg: '30:' for 30 days before =item B<--subjectname> -Subject Name pattern (SNI support) +Subject Name pattern (support alternative subject name) =item B<--issuername> From 60c6592cc20efd4f1c6a2063a40fc988130e038a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 12:26:07 +0100 Subject: [PATCH 013/346] + Fix #192 --- .../network/juniper/common/ive/mode/users.pm | 183 ++++++------------ 1 file changed, 59 insertions(+), 124 deletions(-) diff --git a/centreon-plugins/network/juniper/common/ive/mode/users.pm b/centreon-plugins/network/juniper/common/ive/mode/users.pm index 04619612e..22c066f5a 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/users.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/users.pm @@ -20,11 +20,53 @@ package network::juniper::common::ive::mode::users; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'web', set => { + key_values => [ { name => 'web' } ], + output_template => 'Current concurrent signed-in web users connections: %s', output_error_template => 'Current concurrent signed-in web users connections: %s', + perfdatas => [ + { label => 'web', value => 'web_absolute', template => '%s', min => 0 }, + ], + } + }, + { label => 'meeting', set => { + key_values => [ { name => 'meeting' } ], + output_template => 'Current concurrent meeting users connections: %s', output_error_template => 'Current concurrent meeting users connections: %s', + perfdatas => [ + { label => 'meeting', value => 'meeting_absolute', template => '%s', min => 0 }, + ], + } + }, + { label => 'node', set => { + key_values => [ { name => 'node' } ], + output_template => 'Current concurrent node logged users connections: %s', output_error_template => 'Current concurrent node logged users connections: %s', + perfdatas => [ + { label => 'node', value => 'node_absolute', template => '%s', min => 0 }, + ], + } + }, + { label => 'cluster', set => { + key_values => [ { name => 'cluster' } ], + output_template => 'Current concurrent cluster logged users connections: %s', output_error_template => 'Current concurrent cluster logged users connections: %s', + perfdatas => [ + { label => 'cluster', value => 'cluster_absolute', template => '%s', min => 0 }, + ], + } + }, + ]; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -33,114 +75,24 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "warning-web:s" => { name => 'warning_web' }, - "critical-web:s" => { name => 'critical_web' }, - "warning-meeting:s" => { name => 'warning_meeting' }, - "critical-meeting:s" => { name => 'critical_meeting' }, - "warning-node:s" => { name => 'warning_node' }, - "critical-node:s" => { name => 'critical_node' }, - "warning-cluster:s" => { name => 'warning_cluster' }, - "critical-cluster:s" => { name => 'critical_cluster' }, }); return $self; } -sub check_options { +sub manage_selection { my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning_web', value => $self->{option_results}->{warning_web})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning web threshold '" . $self->{option_results}->{warning_web} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_web', value => $self->{option_results}->{critical_web})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical web threshold '" . $self->{option_results}->{critical_web} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning_meeting', value => $self->{option_results}->{warning_meeting})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning meeting threshold '" . $self->{option_results}->{warning_meeting} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_meeting', value => $self->{option_results}->{critical_meeting})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical meeting threshold '" . $self->{option_results}->{critical_meeting} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning_node', value => $self->{option_results}->{warning_node})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning node threshold '" . $self->{option_results}->{warning_node} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_node', value => $self->{option_results}->{critical_node})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical node threshold '" . $self->{option_results}->{critical_node} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning_cluster', value => $self->{option_results}->{warning_cluster})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning cluster threshold '" . $self->{option_results}->{warning_cluster} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_cluster', value => $self->{option_results}->{critical_cluster})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical cluster threshold '" . $self->{option_results}->{critical_cluster} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; my $oid_signedInWebUsers = '.1.3.6.1.4.1.12532.2.0'; my $oid_meetingUserCount = '.1.3.6.1.4.1.12532.9.0'; my $oid_iveConcurrentUsers = '.1.3.6.1.4.1.12532.12.0'; my $oid_clusterConcurrentUsers = '.1.3.6.1.4.1.12532.13.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_signedInWebUsers, $oid_meetingUserCount, - $oid_iveConcurrentUsers, $oid_clusterConcurrentUsers], nothing_quit => 1); - - my $exit1 = $self->{perfdata}->threshold_check(value => $result->{$oid_signedInWebUsers}, - threshold => [ { label => 'critical_web', 'exit_litteral' => 'critical' }, { label => 'warning_web', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $result->{$oid_meetingUserCount}, - threshold => [ { label => 'critical_meeting', 'exit_litteral' => 'critical' }, { label => 'warning_meeting', exit_litteral => 'warning' } ]); - my $exit3 = $self->{perfdata}->threshold_check(value => $result->{$oid_iveConcurrentUsers}, - threshold => [ { label => 'critical_node', 'exit_litteral' => 'critical' }, { label => 'warning_node', exit_litteral => 'warning' } ]); - my $exit4 = $self->{perfdata}->threshold_check(value => $result->{$oid_clusterConcurrentUsers}, - threshold => [ { label => 'critical_cluster', 'exit_litteral' => 'critical' }, { label => 'warning_cluster', exit_litteral => 'warning' } ]); - - $self->{output}->output_add(severity => $exit1, - short_msg => sprintf("Current concurrent signed-in web users connections: %d", - $result->{$oid_signedInWebUsers})); - $self->{output}->output_add(severity => $exit2, - short_msg => sprintf("Current concurrent meeting users connections: %s", - defined($result->{$oid_meetingUserCount}) ? $result->{$oid_meetingUserCount} : 'unknown')); - $self->{output}->output_add(severity => $exit3, - short_msg => sprintf("Current concurrent node logged users connections: %d", - $result->{$oid_iveConcurrentUsers})); - $self->{output}->output_add(severity => $exit4, - short_msg => sprintf("Current concurrent cluster logged users connections: %d", - $result->{$oid_clusterConcurrentUsers})); - - $self->{output}->perfdata_add(label => "web", - value => $result->{$oid_signedInWebUsers}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_web'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_web'), - min => 0); - $self->{output}->perfdata_add(label => "meeting", - value => $result->{$oid_meetingUserCount}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_meeting'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_meeting'), - min => 0); - $self->{output}->perfdata_add(label => "node", - value => $result->{$oid_iveConcurrentUsers}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_node'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_node'), - min => 0); - $self->{output}->perfdata_add(label => "cluster", - value => $result->{$oid_clusterConcurrentUsers}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_cluster'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_cluster'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); + my $result = $options{snmp}->get_leef(oids => [$oid_signedInWebUsers, $oid_meetingUserCount, + $oid_iveConcurrentUsers, $oid_clusterConcurrentUsers], nothing_quit => 1); + $self->{global} = { web => $result->{$oid_signedInWebUsers}, + meeting => $result->{$oid_meetingUserCount}, + node => $result->{$oid_iveConcurrentUsers}, + cluster => $result->{$oid_clusterConcurrentUsers} }; } 1; @@ -153,37 +105,20 @@ Check users connections (web users, cluster users, node users, meeting users) (J =over 8 -=item B<--warning-web> +=item B<--filter-counters> -Threshold warning for users connected and uses the web feature. +Only display some counters (regexp can be used). +Example: --filter-counters='^web|meeting$' -=item B<--critical-web> +=item B<--warning-*> -Threshold critical for users connected and uses the web feature. +Threshold warning. +Can be: 'web', 'meeting', 'node', 'cluster'. -=item B<--warning-meeting> +=item B<--critical-*> -Threshold warning for secure meeting users connected. - -=item B<--critical-meeting> - -Threshold critical for secure meeting users connected. - -=item B<--warning-node> - -Threshold warning for users in this node that are logged in. - -=item B<--critical-node> - -Threshold critical for users in this node that are logged in. - -=item B<--warning-cluster> - -Threshold warning for users in this cluster that are logged in. - -=item B<--critical-cluster> - -Threshold critical for users in this cluster that are logged in. +Threshold critical. +Can be: 'web', 'meeting', 'node', 'cluster'. =back From 15481746f160418fa24dbe1645c8b23768ec3eaa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 12:26:26 +0100 Subject: [PATCH 014/346] + indentation fix --- .../centreon/common/airespace/snmp/mode/apstatus.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm index fabc1ca98..9fe95a357 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm @@ -216,7 +216,7 @@ sub manage_selection { $self->{global}->{$result2->{bsnAPOperationStatus}}++; $self->{ap}->{$instance} = { display => $result->{bsnAPName}, - opstatus => $result2->{bsnAPOperationStatus}, admstatus => $result3->{bsnAPAdminStatus}}; + opstatus => $result2->{bsnAPOperationStatus}, admstatus => $result3->{bsnAPAdminStatus}}; } if (scalar(keys %{$self->{ap}}) <= 0) { From aede14eceb90f39b1c7c7424c45697d519b2c37f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 15:10:39 +0100 Subject: [PATCH 015/346] + Fix #227 --- .../common/airespace/snmp/mode/apusers.pm | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm index 301becd8b..cc11527a1 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm @@ -30,6 +30,7 @@ sub set_counters { $self->{maps_counters_type} = [ { name => 'global', type => 0 }, + { name => 'ssid', type => 1, cb_prefix_output => 'prefix_ssid_output', message_multiple => 'All users by SSID are ok' } ]; $self->{maps_counters}->{global} = [ { label => 'total', set => { @@ -123,6 +124,24 @@ sub set_counters { } }, ]; + + $self->{maps_counters}->{ssid} = [ + { label => 'ssid', set => { + key_values => [ { name => 'total' }, { name => 'display' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ssid', value => 'total_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_ssid_output { + my ($self, %options) = @_; + + return "SSID '" . $options{instance_value}->{display} . "' "; } sub new { @@ -156,8 +175,12 @@ my $mapping = { my $mapping2 = { bsnMobileStationSsid => { oid => '.1.3.6.1.4.1.14179.2.1.4.1.7' }, }; +my $mapping3 = { + bsnDot11EssNumberOfMobileStations => { oid => '.1.3.6.1.4.1.14179.2.1.1.1.38' }, +}; my $oid_agentInventoryMachineModel = '.1.3.6.1.4.1.14179.1.1.1.3'; +my $oid_bsnDot11EssSsid = '.1.3.6.1.4.1.14179.2.1.1.1.2'; sub manage_selection { my ($self, %options) = @_; @@ -168,6 +191,8 @@ sub manage_selection { $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_agentInventoryMachineModel }, { oid => $mapping->{bsnMobileStationStatus}->{oid} }, { oid => $mapping2->{bsnMobileStationSsid}->{oid} }, + { oid => $oid_bsnDot11EssSsid }, + { oid => $mapping3->{bsnDot11EssNumberOfMobileStations}->{oid} }, ], nothing_quit => 1); $self->{output}->output_add(long_msg => "Model: " . $self->{results}->{$oid_agentInventoryMachineModel}->{$oid_agentInventoryMachineModel . '.0'}); @@ -178,12 +203,29 @@ sub manage_selection { my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{ $mapping2->{bsnMobileStationSsid}->{oid} }, instance => $instance); if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && $result2->{bsnMobileStationSsid} !~ /$self->{option_results}->{filter_ssid}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $result2->{bsnMobileStationSsid} . "': no matching filter."); + $self->{output}->output_add(long_msg => "Skipping '" . $result2->{bsnMobileStationSsid} . "': no matching filter.", debug => 1); next; } $self->{global}->{total}++; $self->{global}->{'total_' . $result->{bsnMobileStationStatus}}++; } + + # check by ssid + $self->{ssid} = {}; + foreach my $oid (keys %{$self->{results}->{ $oid_bsnDot11EssSsid }}) { + $oid =~ /^$oid_bsnDot11EssSsid\.(.*)$/; + my $instance = $1; + my $ssid_name = $self->{results}->{ $oid_bsnDot11EssSsid }->{$oid}; + my $result = $options{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{ $mapping3->{bsnDot11EssNumberOfMobileStations}->{oid} }, instance => $instance); + if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && + $ssid_name !~ /$self->{option_results}->{filter_ssid}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $ssid_name . "': no matching filter.", debug => 1); + next; + } + + $self->{ssid}->{$ssid_name} = { display => $ssid_name, total => 0 } if (!defined($self->{ssid}->{$ssid_name})); + $self->{ssid}->{$ssid_name}->{total} += $result->{bsnDot11EssNumberOfMobileStations}; + } } 1; @@ -206,14 +248,14 @@ Example: --filter-counters='^total|total-idle$' Threshold warning. Can be: 'total', 'total-idle', 'total-aaapending', 'total-authenticated', 'total-associated', 'total-powersave', 'total-disassociated', 'total-tobedeleted', -'total-probing', 'total-blacklisted'. +'total-probing', 'total-blacklisted', 'ssid'. =item B<--critical-*> Threshold critical. Can be: 'total', 'total-idle', 'total-aaapending', 'total-authenticated', 'total-associated', 'total-powersave', 'total-disassociated', 'total-tobedeleted', -'total-probing', 'total-blacklisted'. +'total-probing', 'total-blacklisted', 'ssid'. =item B<--filter-ssid> From 39a8ebc3e05d4399bfbad672cdcf9be9fb38d3d6 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 12 Jan 2016 15:15:28 +0100 Subject: [PATCH 016/346] add alternative subject names in long output --- centreon-plugins/apps/protocols/x509/mode/validity.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index d1a381fd0..fd3384e89 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -153,7 +153,11 @@ sub run { foreach my $subject_name (@subject_name) { if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { $subject_altname = $subject_name; - next; + } else { + if ($subject_name =~/[\w\-]+(\.[\w\-]+)*\.\w+/) { + $subject_altname = $subject_name; + $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_altname)); + } } } From 0e9d774e63ba33ad1e2f9e412b9f2f51988b6347 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 12 Jan 2016 18:07:32 +0100 Subject: [PATCH 017/346] + minor change in x509 --- .../apps/protocols/x509/mode/validity.pm | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index fd3384e89..7b21c96ce 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -142,36 +142,27 @@ sub run { threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); $self->{output}->output_add(severity => $exit, short_msg => sprintf("Certificate expiration days: %s - Validity Date: %s", $daysbefore, $notafterdate)); - - $self->{output}->display(); - $self->{output}->exit() - #Subject Name } elsif ($self->{option_results}->{validity_mode} eq 'subject') { - my $subject_altname; + my @subject_matched = (); my @subject_name = Net::SSLeay::X509_get_subjectAltNames($cert); foreach my $subject_name (@subject_name) { if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { - $subject_altname = $subject_name; + push @subject_matched, $subject_name; } else { - if ($subject_name =~/[\w\-]+(\.[\w\-]+)*\.\w+/) { - $subject_altname = $subject_name; - $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_altname)); + if ($subject_name =~ /[\w\-]+(\.[\w\-]+)*\.\w+/) { + $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_name), debug => 1); } } } - if (!defined($subject_altname)) { + if (@subject_matched == 0) { $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Subject Name '%s' is not present in Certificate", $self->{option_results}->{subjectname})); + short_msg => sprintf("No Subject Name matched '%s' in Certificate", $self->{option_results}->{subjectname})); } else { $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("Subject Name '%s' is present in Certificate", $self->{option_results}->{subjectname})); + short_msg => sprintf("Subject Name [%s] is present in Certificate", join(', ', @subject_matched))); } - - $self->{output}->display(); - $self->{output}->exit() - #Issuer Name } elsif ($self->{option_results}->{validity_mode} eq 'issuer') { my $issuer_name = Net::SSLeay::X509_NAME_oneline(Net::SSLeay::X509_get_issuer_name($cert)); @@ -182,10 +173,10 @@ sub run { $self->{output}->output_add(severity => 'CRITICAL', short_msg => sprintf("Issuer Name '%s' is not present in Certificate: %s", $self->{option_results}->{issuername}, $issuer_name)); } - - $self->{output}->display(); - $self->{output}->exit() } + + $self->{output}->display(); + $self->{output}->exit(); } } From facd9055fe45a0e7baf7fbdcf9f4215717cc4abd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 13 Jan 2016 11:42:03 +0100 Subject: [PATCH 018/346] + Fix #233 + Fix #158 --- .../juniper/common/screenos/mode/sessions.pm | 144 ++++++++---------- 1 file changed, 62 insertions(+), 82 deletions(-) diff --git a/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm b/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm index b529e1922..05531164e 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm @@ -20,99 +20,80 @@ package network::juniper::common::screenos::mode::sessions; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'usage', set => { + key_values => [ { name => 'prct_used' }, { name => 'total' }, { name => 'used' } ], + closure_custom_output => $self->can('custom_usage_output'), + perfdatas => [ + { label => 'sessions', value => 'used_absolute', template => '%s', + min => 0, max => 'total_absolute', threshold_total => 'total_absolute', cast_int => 1 }, + ], + } + }, + { label => 'failed', set => { + key_values => [ { name => 'failed', diff => 1 } ], + per_second => 1, + output_template => 'Failed sessions : %.2f/s', output_error_template => "Failed sessions : %s", + perfdatas => [ + { label => 'sessions_failed', value => 'failed_per_second', template => '%.2f', unit => '/s', + min => 0 }, + ], + } + }, + ]; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my $msg = sprintf("%.2f%% of the sessions limit reached (%d of max. %d)", + $self->{result_values}->{prct_used_absolute}, + $self->{result_values}->{used_absolute}, + $self->{result_values}->{total_absolute}); + return $msg; +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "warning-failed:s" => { name => 'warning_failed', }, - "critical:s" => { name => 'critical', }, - "critical-failed:s" => { name => 'critical_failed', }, + { }); return $self; } -sub check_options { +sub manage_selection { my ($self, %options) = @_; - $self->SUPER::init(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning-failed', value => $self->{option_results}->{warning_failed})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-failed threshold '" . $self->{option_results}->{warning_failed} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-failed', value => $self->{option_results}->{critical_failed})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-failed threshold '" . $self->{option_results}->{critical_failed} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - my $oid_nsResSessAllocate = '.1.3.6.1.4.1.3224.16.3.2.0'; my $oid_nsResSessMaxium = '.1.3.6.1.4.1.3224.16.3.3.0'; my $oid_nsResSessFailed = '.1.3.6.1.4.1.3224.16.3.4.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_nsResSessAllocate, $oid_nsResSessMaxium, $oid_nsResSessFailed], nothing_quit => 1); - - my $spu_done = 0; - my $cp_total = $result->{$oid_nsResSessMaxium}; - my $cp_used = $result->{$oid_nsResSessAllocate}; - my $cp_failed = $result->{$oid_nsResSessFailed}; - my $prct_used = $cp_used * 100 / $cp_total; - my $prct_failed = $cp_failed * 100 / $cp_total; - $spu_done = 1; - - my $exit_used = $self->{perfdata}->threshold_check(value => $prct_used, - threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - my $exit_failed = $self->{perfdata}->threshold_check(value => $prct_failed, - threshold => [ { label => 'critical-failed', 'exit_litteral' => 'critical' }, { label => 'warning-failed', exit_litteral => 'warning' } ]); - - $self->{output}->output_add(severity => $exit_used, - short_msg => sprintf("%.2f%% of the sessions limit reached (%d of max. %d)", - $prct_used, $cp_used, $cp_total)); - $self->{output}->output_add(severity => $exit_failed, - short_msg => sprintf("%.2f%% of failed sessions (%d of max. %d)", - $prct_failed, $cp_failed, $cp_total)); - - $self->{output}->perfdata_add(label => 'sessions', - value => $cp_used, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $cp_total, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $cp_total, cast_int => 1), - min => 0, max => $cp_total); - $self->{output}->perfdata_add(label => 'sessions_failed', - value => $cp_failed, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-failed', total => $cp_total, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-failed', total => $cp_total, cast_int => 1), - min => 0, max => $cp_total); - - if ($spu_done == 0) { - $self->{output}->add_option_msg(short_msg => "Cannot check sessions usage (no total values)."); - $self->{output}->option_exit(); - } - - $self->{output}->display(); - $self->{output}->exit(); + my $result = $options{snmp}->get_leef(oids => [$oid_nsResSessAllocate, $oid_nsResSessMaxium, $oid_nsResSessFailed], nothing_quit => 1); + $self->{global} = { total => $result->{$oid_nsResSessMaxium}, + used => $result->{$oid_nsResSessAllocate}, + failed => $result->{$oid_nsResSessFailed}, + prct_used => $result->{$oid_nsResSessAllocate} * 100 / $result->{$oid_nsResSessMaxium}, + }; + + $self->{cache_name} = "juniper_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); } 1; @@ -123,21 +104,20 @@ Check Juniper sessions usage and failed sessions (NETSCREEN-RESOURCE-MIB). =over 8 -=item B<--warning> +=item B<--filter-counters> -Threshold warning (percentage). +Only display some counters (regexp can be used). +Example: --filter-counters='^usage$' -=item B<--critical> +=item B<--warning-*> -Threshold critical (percentage). +Threshold warning. +Can be: 'usage' (%), 'failed'. -=item B<--warning-failed> +=item B<--critical-*> -Threshold warning on failed sessions (percentage). - -=item B<--critical-failed> - -Threshold critical in failed sessions (percentage). +Threshold critical. +Can be: 'usage' (%), 'failed'. =back From 4c2dea75b40b581b65f310c0bc376686250827f1 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 13 Jan 2016 15:52:07 +0100 Subject: [PATCH 019/346] #241 - Add SNI support (IO::Socket::SSL v1.56+ needed) --- .../apps/protocols/x509/mode/validity.pm | 150 ++++++++---------- 1 file changed, 62 insertions(+), 88 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index 7b21c96ce..430ac5e43 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -33,11 +33,12 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $self->{version} = '1.3'; + $self->{version} = '1.4'; $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => 443 }, + "port:s" => { name => 'port' }, + "servername:s" => { name => 'servername' }, "validity-mode:s" => { name => 'validity_mode' }, "warning-date:s" => { name => 'warning' }, "critical-date:s" => { name => 'critical' }, @@ -77,107 +78,76 @@ sub check_options { sub run { my ($self, %options) = @_; - #Global variables - my ($connection, $ctx, $ssl, $cert); + # Global variables + my ($cert, $client); - #Create Socket connection - $connection = IO::Socket::INET->new(PeerAddr => $self->{option_results}->{hostname}, - PeerPort => $self->{option_results}->{port}, - Timeout => $self->{option_results}->{timeout}, - ); - if (!defined($connection)) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("%s", $!)); - $self->{output}->display(); - $self->{output}->exit(); - } else { - #Create SSL context - eval { $ctx = Net::SSLeay::CTX_new() }; - if ($@) { + eval { $client = IO::Socket::SSL->new( + PeerHost => $self->{option_results}->{hostname}, + PeerPort => $self->{option_results}->{port}, + $self->{option_results}->{servername} ? ( SSL_hostname => $self->{option_results}->{servername} ):(), + ) }; + if ($@) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => sprintf ("%s", $!)); $self->{output}->display(); $self->{output}->exit() - } + } - #Create SSL connection - Net::SSLeay::CTX_set_options($ctx, &Net::SSLeay::OP_ALL); - - eval { $ssl = Net::SSLeay::new($ctx) }; - if ($@) { + #Retrieve Certificat + eval { $cert = $client->peer_certificate() }; + if ($@) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => sprintf("%s", $!)); $self->{output}->display(); $self->{output}->exit() - } + } - eval { Net::SSLeay::set_fd($ssl, fileno($connection)) }; - if ($@) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("%s", $!)); - - $self->{output}->display(); - $self->{output}->exit() - } - - eval { Net::SSLeay::connect($ssl) }; - if ($@) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("%s", $!)); - - $self->{output}->display(); - $self->{output}->exit() - } - - #Retrieve Certificat - $cert = Net::SSLeay::get_peer_certificate($ssl); - - #Expiration Date - if ($self->{option_results}->{validity_mode} eq 'expiration') { - (my $notafterdate = Net::SSLeay::P_ASN1_UTCTIME_put2string(Net::SSLeay::X509_get_notAfter($cert))) =~ s/ GMT//; - my $daysbefore = int((&UnixDate(&ParseDate($notafterdate),"%s") - time) / 86400); - my $exit = $self->{perfdata}->threshold_check(value => $daysbefore, - threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Certificate expiration days: %s - Validity Date: %s", $daysbefore, $notafterdate)); - #Subject Name - } elsif ($self->{option_results}->{validity_mode} eq 'subject') { - my @subject_matched = (); - my @subject_name = Net::SSLeay::X509_get_subjectAltNames($cert); - foreach my $subject_name (@subject_name) { - if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { - push @subject_matched, $subject_name; - } else { - if ($subject_name =~ /[\w\-]+(\.[\w\-]+)*\.\w+/) { - $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_name), debug => 1); - } + #Expiration Date + if ($self->{option_results}->{validity_mode} eq 'expiration') { + (my $notafterdate = Net::SSLeay::P_ASN1_UTCTIME_put2string(Net::SSLeay::X509_get_notAfter($cert))) =~ s/ GMT//; + my $daysbefore = int((&UnixDate(&ParseDate($notafterdate),"%s") - time) / 86400); + my $exit = $self->{perfdata}->threshold_check(value => $daysbefore, + threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Certificate expiration days: %s - Validity Date: %s", $daysbefore, $notafterdate)); + #Subject Name + } elsif ($self->{option_results}->{validity_mode} eq 'subject') { + my @subject_matched = (); + my @subject_name = Net::SSLeay::X509_get_subjectAltNames($cert); + foreach my $subject_name (@subject_name) { + if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { + push @subject_matched, $subject_name; + } else { + if ($subject_name =~ /[\w\-]+(\.[\w\-]+)*\.\w+/) { + $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_name), debug => 1); } } - - if (@subject_matched == 0) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("No Subject Name matched '%s' in Certificate", $self->{option_results}->{subjectname})); - } else { - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("Subject Name [%s] is present in Certificate", join(', ', @subject_matched))); - } - #Issuer Name - } elsif ($self->{option_results}->{validity_mode} eq 'issuer') { - my $issuer_name = Net::SSLeay::X509_NAME_oneline(Net::SSLeay::X509_get_issuer_name($cert)); - if ($issuer_name =~ /$self->{option_results}->{issuername}/mi) { - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("Issuer Name '%s' is present in Certificate: %s", $self->{option_results}->{issuername}, $issuer_name)); - } else { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Issuer Name '%s' is not present in Certificate: %s", $self->{option_results}->{issuername}, $issuer_name)); - } } - - $self->{output}->display(); - $self->{output}->exit(); + + if (@subject_matched == 0) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("No Subject Name matched '%s' in Certificate", $self->{option_results}->{subjectname})); + } else { + $self->{output}->output_add(severity => 'OK', + short_msg => sprintf("Subject Name [%s] is present in Certificate", join(', ', @subject_matched))); + } + + #Issuer Name + } elsif ($self->{option_results}->{validity_mode} eq 'issuer') { + my $issuer_name = Net::SSLeay::X509_NAME_oneline(Net::SSLeay::X509_get_issuer_name($cert)); + if ($issuer_name =~ /$self->{option_results}->{issuername}/mi) { + $self->{output}->output_add(severity => 'OK', + short_msg => sprintf("Issuer Name '%s' is present in Certificate: %s", $self->{option_results}->{issuername}, $issuer_name)); + } else { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("Issuer Name '%s' is not present in Certificate: %s", $self->{option_results}->{issuername}, $issuer_name)); + } } + + $self->{output}->display(); + $self->{output}->exit(); } 1; @@ -186,7 +156,7 @@ __END__ =head1 MODE -Check X509's certificate validity +Check X509's certificate validity (for SMTPS, POPS, IMAPS, HTTPS) =over 8 @@ -194,9 +164,13 @@ Check X509's certificate validity IP Addr/FQDN of the host +=item B<--servername> + +Servername of the host for SNI support (only with IO::Socket::SSL >= 1.56) (eg: foo.bar.com) + =item B<--port> -Port used by Server (Default: '443') +Port used by Server =item B<--validity-mode> From 9eed56aba24363a7c43e15d58550f3593750b312 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 14 Jan 2016 21:51:10 +0100 Subject: [PATCH 020/346] + fix little switch in get_severity call --- .../hardware/server/cisco/ucs/mode/components/iocard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm index b3808608f..f22c86b5d 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm @@ -74,7 +74,7 @@ sub check { $self->{components}->{iocard}->{total}++; - $exit = $self->get_severity(section => 'default.operability', label => 'iocard.operability', value => $result2->{cucsEquipmentIOCardOperState}); + $exit = $self->get_severity(section => 'iocard.operability', label => 'default.operability', value => $result2->{cucsEquipmentIOCardOperState}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("IO cards '%s' state is '%s'.", From 29ffc54aba2946ba3b5b5dcb26e8027de4a51ead Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 10:21:33 +0100 Subject: [PATCH 021/346] + Enhance timehost mode for vmware connector --- .../apps/vmware/connector/mode/timehost.pm | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/centreon-plugins/apps/vmware/connector/mode/timehost.pm b/centreon-plugins/apps/vmware/connector/mode/timehost.pm index ab46109f5..1f479ef66 100644 --- a/centreon-plugins/apps/vmware/connector/mode/timehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/timehost.pm @@ -35,8 +35,11 @@ sub new { { "esx-hostname:s" => { name => 'esx_hostname' }, "filter" => { name => 'filter' }, + "disconnect-status:s" => { name => 'disconnect_status', default => 'unknown' }, "scope-datacenter:s" => { name => 'scope_datacenter' }, "scope-cluster:s" => { name => 'scope_cluster' }, + "warning-time:s" => { name => 'warning_time' }, + "critical-time:s" => { name => 'critical_time' }, }); return $self; } @@ -44,6 +47,19 @@ sub new { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + + foreach my $label (('warning_time', 'critical_time')) { + if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) { + my ($label_opt) = $label; + $label_opt =~ tr/_/-/; + $self->{output}->add_option_msg(short_msg => "Wrong " . $label_opt . " threshold '" . $self->{option_results}->{$label} . "'."); + $self->{output}->option_exit(); + } + } + if ($self->{output}->is_litteral_status(status => $self->{option_results}->{disconnect_status}) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong disconnect-status option '" . $self->{option_results}->{disconnect_status} . "'."); + $self->{output}->option_exit(); + } } sub run { @@ -83,6 +99,17 @@ Search in following datacenter(s) (can be a regexp). Search in following cluster(s) (can be a regexp). +=item B<--disconnect-status> + +Status if VM disconnected (default: 'unknown'). + +=item B<--warning-time> + +Threshold warning in seconds. + +=item B<--critical-time> + +Threshold critical in seconds. =back From f412e893c1c85fa7cc4137fb90a54ce9ae9d6e7e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 14:24:41 +0100 Subject: [PATCH 022/346] + add plugin for dell ml6000 --- .../adic/tape/snmp/mode/components/global.pm | 75 +++++++++++++ .../snmp/mode/components/physicaldrive.pm | 78 +++++++++++++ .../tape/snmp/mode/components/subsystem.pm | 84 ++++++++++++++ .../common/adic/tape/snmp/mode/hardware.pm | 104 ++++++++++++++++++ .../storage/dell/ml6000/snmp/plugin.pm | 49 +++++++++ 5 files changed, 390 insertions(+) create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm create mode 100644 centreon-plugins/storage/dell/ml6000/snmp/plugin.pm diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm new file mode 100644 index 000000000..009adf378 --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm @@ -0,0 +1,75 @@ +# +# Copyright 2015 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 centreon::common::adic::tape::snmp::mode::components::global; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'good', + 2 => 'failed', + 3 => 'degraded', + 4 => 'warning', + 5 => 'informational', + 6 => 'unknown', + 7 => 'invalid', +); + +# In MIB 'ADIC-TAPE-LIBRARY-MIB' +my $mapping = { + libraryGlobalStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.1.8', map => \%map_status }, +}; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $mapping->{libraryGlobalStatus}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking global"); + $self->{components}->{global} = {name => 'global', total => 0, skip => 0}; + return if ($self->check_filter(section => 'global')); + + my $instance = '0'; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{libraryGlobalStatus}->{oid}}, instance => $instance); + if (!defined($result->{libraryGlobalStatus})) { + $self->{output}->output_add(long_msg => "skipping global status: no value."); + return ; + } + + return if ($self->check_filter(section => 'global', instance => $instance)); + $self->{components}->{physicaldrive}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("library global status is %s [instance: %s].", + $result->{libraryGlobalStatus}, $instance + )); + my $exit = $self->get_severity(section => 'global', label => 'default', value => $result->{libraryGlobalStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Library global status is %s", + $result->{libraryGlobalStatus})); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm new file mode 100644 index 000000000..3fea6962c --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm @@ -0,0 +1,78 @@ +# +# Copyright 2015 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 centreon::common::adic::tape::snmp::mode::components::physicaldrive; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'good', + 2 => 'failed', + 3 => 'degraded', + 4 => 'warning', + 5 => 'informational', + 6 => 'unknown', + 7 => 'invalid', +); + +# In MIB 'ADIC-TAPE-LIBRARY-MIB' +my $mapping = { + phDriveSerialNumber => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.2' }, + phDriveModel => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.3' }, + phDriveRasStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.11', map => \%map_status }, +}; +my $oid_physicalDriveEntry = '.1.3.6.1.4.1.3764.1.10.10.11.3.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_physicalDriveEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking physical drives"); + $self->{components}->{physicaldrive} = {name => 'physical drives', total => 0, skip => 0}; + return if ($self->check_filter(section => 'physicaldrive')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_physicalDriveEntry}})) { + next if ($oid !~ /^$mapping->{phDriveRasStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_physicalDriveEntry}, instance => $instance); + + next if ($self->check_filter(section => 'physicaldrive', instance => $instance)); + $self->{components}->{physicaldrive}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("physical drive '%s' status is %s [instance: %s, model: %s, serial: %s].", + $instance, $result->{phDriveRasStatus}, + $instance, $result->{phDriveModel}, $result->{phDriveSerialNumber} + )); + my $exit = $self->get_severity(section => 'physicaldrive', label => 'default', value => $result->{phDriveRasStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Physical drive '%s' status is %s", + $instance, $result->{phDriveRasStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm new file mode 100644 index 000000000..1e7c634d3 --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm @@ -0,0 +1,84 @@ +# +# Copyright 2015 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 centreon::common::adic::tape::snmp::mode::components::subsystem; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'good', + 2 => 'failed', + 3 => 'degraded', + 4 => 'warning', + 5 => 'informational', + 6 => 'unknown', + 7 => 'invalid', +); + +# In MIB 'ADIC-TAPE-LIBRARY-MIB' +my $mapping = { + powerStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.1', map => \%map_status, label => 'power', instance => 1 }, + coolingStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.2', map => \%map_status, label => 'cooling', instance => 2 }, + controlStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.3', map => \%map_status, label => 'control', instance => 3 }, + connectivityStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.4', map => \%map_status, label => 'connectivity', instance => 4 }, + roboticsStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.5', map => \%map_status, label => 'robotics', instance => 5 }, + mediaStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.6', map => \%map_status, label => 'media', instance => 6 }, + driveStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.12.6', map => \%map_status, label => 'drive', instance => 7 }, +}; +my $oid_rasSubSystem = '.1.3.6.1.4.1.3764.1.10.10.12'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_rasSubSystem }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking subsystems"); + $self->{components}->{subsystem} = {name => 'subsystems', total => 0, skip => 0}; + return if ($self->check_filter(section => 'subsystem')); + + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rasSubSystem}, instance => '0'); + foreach my $name (keys %$mapping) { + if (!defined($result->{$name})) { + $self->{output}->output_add(long_msg => sprintf("skipping %s status: no value.", $mapping->{$name}->{label})); + next; + } + + next if ($self->check_filter(section => 'subsystem', instance => $mapping->{$name}->{instance})); + $self->{components}->{physicaldrive}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("%s status is %s [instance: %s].", + $mapping->{$name}->{label}, $result->{$name}, + $mapping->{$name}->{instance} + )); + my $exit = $self->get_severity(section => 'subsystem', label => 'default', value => $result->{$name}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("%s status is %s", + ucfirst($mapping->{$name}->{label}), $result->{$name})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm new file mode 100644 index 000000000..c2d2e45ad --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm @@ -0,0 +1,104 @@ +# +# Copyright 2015 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 centreon::common::adic::tape::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(global|physicaldrive|subsystem)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + default => [ + ['good', 'OK'], + ['failed', 'CRITICAL'], + ['degraded', 'WARNING'], + ['warning', 'WARNING'], + ['informational', 'OK'], + ['unknown', 'UNKNOWN'], + ['invalid', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'centreon::common::adic::tape::snmp::mode::components'; + $self->{components_module} = ['global', 'physicaldrive', 'subsystem']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check Hardware (Power Supplies). + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'global', 'physicaldrive', 'subsystem'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=subsystem) +Can also exclude specific instance: --filter=physicaldrive,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='physicaldrive,OK,invalid' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm new file mode 100644 index 000000000..b053f3500 --- /dev/null +++ b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm @@ -0,0 +1,49 @@ +# +# Copyright 2015 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::dell::ml6000::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; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'hardware' => 'centreon::common::adic::tape::snmp::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Dell ML6000 in SNMP. + +=cut From 87b2ae8398721765cdb27ea3f5d559d3aa1676c4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 14:32:44 +0100 Subject: [PATCH 023/346] + fix ml6000 plugin --- .../centreon/common/adic/tape/snmp/mode/components/global.pm | 2 +- .../common/adic/tape/snmp/mode/components/physicaldrive.pm | 4 +++- .../common/adic/tape/snmp/mode/components/subsystem.pm | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm index 009adf378..e12a12ba1 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm @@ -59,7 +59,7 @@ sub check { } return if ($self->check_filter(section => 'global', instance => $instance)); - $self->{components}->{physicaldrive}->{total}++; + $self->{components}->{global}->{total}++; $self->{output}->output_add(long_msg => sprintf("library global status is %s [instance: %s].", $result->{libraryGlobalStatus}, $instance diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm index 3fea6962c..ae1b78b8b 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm @@ -22,6 +22,7 @@ package centreon::common::adic::tape::snmp::mode::components::physicaldrive; use strict; use warnings; +use centreon::plugins::misc; my %map_status = ( 1 => 'good', @@ -64,7 +65,8 @@ sub check { $self->{output}->output_add(long_msg => sprintf("physical drive '%s' status is %s [instance: %s, model: %s, serial: %s].", $instance, $result->{phDriveRasStatus}, - $instance, $result->{phDriveModel}, $result->{phDriveSerialNumber} + $instance, centreon::plugins::misc::trim($result->{phDriveModel}), + centreon::plugins::misc::trim($result->{phDriveSerialNumber}) )); my $exit = $self->get_severity(section => 'physicaldrive', label => 'default', value => $result->{phDriveRasStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm index 1e7c634d3..d9cb54327 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm @@ -66,7 +66,7 @@ sub check { } next if ($self->check_filter(section => 'subsystem', instance => $mapping->{$name}->{instance})); - $self->{components}->{physicaldrive}->{total}++; + $self->{components}->{subsystem}->{total}++; $self->{output}->output_add(long_msg => sprintf("%s status is %s [instance: %s].", $mapping->{$name}->{label}, $result->{$name}, From eac6785b3a458857db1a1c12cb9a109047e575b6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 14:34:24 +0100 Subject: [PATCH 024/346] + Fix help for adic tape hardware --- .../centreon/common/adic/tape/snmp/mode/hardware.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm index c2d2e45ad..8042c52d2 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm @@ -74,7 +74,7 @@ __END__ =head1 MODE -Check Hardware (Power Supplies). +Check Hardware. =over 8 From eed2bc10c129925f526b77902d9ea8553ac57ab3 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 15 Jan 2016 15:10:48 +0100 Subject: [PATCH 025/346] + Add cache age mode for netapp https://github.com/centreon/centreon-plugins/issues/282 --- .../storage/netapp/snmp/mode/cacheage.pm | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 centreon-plugins/storage/netapp/snmp/mode/cacheage.pm diff --git a/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm new file mode 100644 index 000000000..cc134adeb --- /dev/null +++ b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm @@ -0,0 +1,100 @@ +# +# Copyright 2015 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::mode::cacheage; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_cacheAge = ".1.3.6.1.4.1.789.1.2.2.23.0"; + + my $result = $self->{snmp}->get_leef(oids => [$oid_cacheAge], + nothing_quit => 1); + + my $exit = $self->{perfdata}->threshold_check(value => $results->{$oid_cacheAge}, + threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, + { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cache age is '%s' minutes", $results->{$oid_cacheAge})); + $self->{output}->perfdata_add(label => 'cache_age', unit => 'm', + value => $results->{$oid_cacheAge}, + warning => $self->{option_results}->{warning}, + critical => $self->{option_results}->{critical}, + min => 0); + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check age in minutes of the oldest read-only blocks in the buffer cache. + +=over 8 + +=item B<--warning> + +Threshold warning in minutes + +=item B<--critical> + +Threshold critical in minutes + +=back + +=cut From a9ee8ac99a1e9aad737ce2d41abe29e0725f79a7 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 15 Jan 2016 15:31:05 +0100 Subject: [PATCH 026/346] + Add cache age --- centreon-plugins/storage/netapp/snmp/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/storage/netapp/snmp/plugin.pm b/centreon-plugins/storage/netapp/snmp/plugin.pm index 26187634a..1ec2233b1 100644 --- a/centreon-plugins/storage/netapp/snmp/plugin.pm +++ b/centreon-plugins/storage/netapp/snmp/plugin.pm @@ -51,6 +51,7 @@ sub new { 'snapshotage' => 'storage::netapp::snmp::mode::snapshotage', 'temperature' => 'storage::netapp::snmp::mode::temperature', 'volumeoptions' => 'storage::netapp::snmp::mode::volumeoptions', + 'cache-age' => 'storage::netapp::snmp::mode::cacheage', ); return $self; From 6eb40f7e74ee749188e090382a0d273c89c30a4b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 16:24:51 +0100 Subject: [PATCH 027/346] + add apc plugin --- .../ups/apc/snmp/mode/batterystatus.pm | 264 ++++++++++++++++++ .../hardware/ups/apc/snmp/plugin.pm | 47 ++++ 2 files changed, 311 insertions(+) create mode 100644 centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm create mode 100644 centreon-plugins/hardware/ups/apc/snmp/plugin.pm diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm new file mode 100644 index 000000000..19cd8ec82 --- /dev/null +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -0,0 +1,264 @@ +# +# Copyright 2015 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 hardware::ups::apc::snmp::mode::batterystatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my %battery_status = ( + 1 => ['unknown', 'UNKNOWN'], + 2 => ['batteryNormal', 'OK'], + 3 => ['batteryLow', 'WARNING'], +); + +my %battery_replace_indicator = ( + 1 => ['noBatteryNeedsReplacing', 'OK'], + 2 => ['batteryNeedsReplacing', 'CRITICAL'], +); + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = sprintf("Battery status is '%s' [battery needs replace: %s]", $self->{result_values}->{status}, $self->{result_values}->{replace}); + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_upsBasicBatteryStatus'}; + $self->{result_values}->{replace} = $options{new_datas}->{$self->{instance} . '_upsAdvBatteryReplaceIndicator'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + ]; + + $self->{maps_counters}->{global} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'upsBasicBatteryStatus' }, { name => 'upsAdvBatteryReplaceIndicator' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'load', set => { + key_values => [ { name => 'upsAdvBatteryCapacity' } ], + output_template => 'Remaining capacity : %s %%', + perfdatas => [ + { label => 'load', value => 'upsAdvBatteryCapacity_absolute', template => '%s', + min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'time', set => { + key_values => [ { name => 'upsAdvBatteryRunTimeRemaining' } ], + output_template => 'Remaining time : %s minutes', + perfdatas => [ + { label => 'load_time', value => 'upsAdvBatteryRunTimeRemaining_absolute', template => '%s', + min => 0, unit => 'm' }, + ], + } + }, + { label => 'current', set => { + key_values => [ { name => 'upsAdvBatteryCurrent' } ], + output_template => 'Current : %s A', + perfdatas => [ + { label => 'current', value => 'upsAdvBatteryCurrent_absolute', template => '%s', + min => 0, unit => 'A' }, + ], + } + }, + { label => 'voltage', set => { + key_values => [ { name => 'upsAdvBatteryActualVoltage' } ], + output_template => 'Voltage : %s V', + perfdatas => [ + { label => 'voltage', value => 'upsAdvBatteryActualVoltage_absolute', template => '%s', + unit => 'V' }, + ], + } + }, + { label => 'temperature', set => { + key_values => [ { name => 'upsAdvBatteryTemperature' } ], + output_template => 'Temperature : %s C', + perfdatas => [ + { label => 'temperature', value => 'upsAdvBatteryTemperature_absolute', template => '%s', + unit => 'C'}, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "unknown-status:s" => { name => 'unknown_status', default => '%{status} =~ /unknown/i' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /batteryLow/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{replace} =~ /yes/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_battery_status = ( + 1 => 'unknown', + 2 => 'batteryNormal', + 3 => 'batteryLow', +); +my %map_replace_status = ( + 1 => 'no', + 2 => 'yes', +); + +my $mapping = { + upsBasicBatteryStatus => { oid => '.1.3.6.1.4.1.318.1.1.1.2.1.1', map => \%map_battery_status }, + upsBasicBatteryTimeOnBattery => { oid => '.1.3.6.1.4.1.318.1.1.1.2.1.2' }, +}; +my $mapping2 = { + upsAdvBatteryCapacity => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.1' }, + upsAdvBatteryTemperature => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.2' }, + upsAdvBatteryRunTimeRemaining => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.3' }, + upsAdvBatteryReplaceIndicator => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.4', map => \%map_replace_status }, + upsAdvBatteryActualVoltage => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.8' }, + upsAdvBatteryCurrent => { oid => '.1.3.6.1.4.1.318.1.1.1.2.2.9' }, +}; +my $oid_upsBasicBattery = '.1.3.6.1.4.1.318.1.1.1.2.1'; +my $oid_upsAdvBattery = '.1.3.6.1.4.1.318.1.1.1.2.2'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{global} = {}; + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_upsBasicBattery }, + { oid => $oid_upsAdvBattery }, + ], + nothing_quit => 1); + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0'); + my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0'); + + $self->{global}->{$name} = $result->{$name} foreach my $name (keys %{$mapping}); + $self->{global}->{$name} = $result2->{$name} foreach my $name (keys %{$mapping2}); +} + +1; + +__END__ + +=head1 MODE + +Check Battery Status and battery charge remaining. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status|load$' + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{status} =~ /unknown/i'). +Can used special variables like: %{status}, %{replace} + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{status} =~ /batteryLow/i'). +Can used special variables like: %{status}, %{replace} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{replace} =~ /yes/i'). +Can used special variables like: %{status}, %{replace} + +=item B<--warning-*> + +Threshold warning. +Can be: 'load', 'voltage', 'current', 'temperature', 'time'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'load', 'voltage', 'current', 'temperature', 'time'. + +=back + +=cut diff --git a/centreon-plugins/hardware/ups/apc/snmp/plugin.pm b/centreon-plugins/hardware/ups/apc/snmp/plugin.pm new file mode 100644 index 000000000..a1a69652b --- /dev/null +++ b/centreon-plugins/hardware/ups/apc/snmp/plugin.pm @@ -0,0 +1,47 @@ +# +# 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 hardware::ups::apc::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; + # $options->{options} = options object + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'battery-status' => 'hardware::ups::apc::snmp::mode::batterystatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check UPS APC through SNMP (POWERNET-MIB) + +=cut From 1abe917b38db801da01c5d0b0f9987896d174fea Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 16:40:45 +0100 Subject: [PATCH 028/346] + fix plugin apc --- .../hardware/ups/apc/snmp/mode/batterystatus.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index 19cd8ec82..7cfb998e0 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -208,15 +208,19 @@ sub manage_selection { $self->{global} = {}; $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_upsBasicBattery }, - { oid => $oid_upsAdvBattery }, - ], - nothing_quit => 1); + { oid => $oid_upsAdvBattery }, + ], + nothing_quit => 1); my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0'); my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0'); - $self->{global}->{$name} = $result->{$name} foreach my $name (keys %{$mapping}); - $self->{global}->{$name} = $result2->{$name} foreach my $name (keys %{$mapping2}); + foreach my $name (keys %{$mapping}) { + $self->{global}->{$name} = $result->{$name}; + } + foreach my $name (keys %{$mapping2}) { + $self->{global}->{$name} = $result2->{$name}; + } } 1; From 9ccddb72555742806a1118925183464a4e764266 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 15 Jan 2016 16:50:11 +0100 Subject: [PATCH 029/346] + Remove dead code --- .../hardware/ups/apc/snmp/mode/batterystatus.pm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index 7cfb998e0..67ecb1aad 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -25,17 +25,6 @@ use base qw(centreon::plugins::templates::counter); use strict; use warnings; -my %battery_status = ( - 1 => ['unknown', 'UNKNOWN'], - 2 => ['batteryNormal', 'OK'], - 3 => ['batteryLow', 'WARNING'], -); - -my %battery_replace_indicator = ( - 1 => ['noBatteryNeedsReplacing', 'OK'], - 2 => ['batteryNeedsReplacing', 'CRITICAL'], -); - my $instance_mode; sub custom_threshold_output { From cde5ff12ab01e6ecfbf561e9aa56e54bd51db4dc Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 18 Jan 2016 09:38:45 +0100 Subject: [PATCH 030/346] + add poe status for extreme network plugin --- .../extreme/snmp/mode/components/poe.pm | 98 +++++++++++++++++++ .../network/extreme/snmp/mode/hardware.pm | 22 ++++- 2 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 centreon-plugins/network/extreme/snmp/mode/components/poe.pm diff --git a/centreon-plugins/network/extreme/snmp/mode/components/poe.pm b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm new file mode 100644 index 000000000..1bbf8f1c7 --- /dev/null +++ b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm @@ -0,0 +1,98 @@ +# +# Copyright 2015 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::extreme::snmp::mode::components::poe; + +use strict; +use warnings; + +my %map_poe_status = ( + 1 => 'initializing', + 2 => 'operational', + 3 => 'downloadFail', + 4 => 'calibrationRequired', + 5 => 'invalidFirmware', + 6 => 'mismatchVersion', + 7 => 'updating', + 8 => 'invalidDevice', + 9 => 'notOperational', + 10 => 'other', +); + +my $mapping = { + extremePethSlotPoeStatus => { oid => '.1.3.6.1.4.1.1916.1.27.1.2.1.8', map => \%map_poe_status }, +}; +my $mapping2 = { + extremePethSlotMeasuredPower => { oid => '.1.3.6.1.4.1.1916.1.27.1.2.1.14' }, +}; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $mapping->{extremePethSlotPoeStatus}->{oid} }, + { oid => $mapping2->{extremePethSlotMeasuredPower}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking poes"); + $self->{components}->{poe} = {name => 'poes', total => 0, skip => 0}; + return if ($self->check_filter(section => 'poe')); + + my ($exit, $warn, $crit, $checked); + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{extremePethSlotPoeStatus}->{oid}}})) { + $oid =~ /^$mapping->{extremePethSlotPoeStatus}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{extremePethSlotPoeStatus}->{oid}}, instance => $instance); + my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{extremePethSlotMeasuredPower}->{oid}}, instance => $instance); + + next if ($self->check_filter(section => 'poe', instance => $instance)); + + $result2->{extremePethSlotMeasuredPower} = defined($result2->{extremePethSlotMeasuredPower}) && $result2->{extremePethSlotMeasuredPower} =~ /\d+/ ? + sprintf("%.3f", $result2->{extremePethSlotMeasuredPower} / 1000) : 'unknown'; + + $self->{components}->{poe}->{total}++; + $self->{output}->output_add(long_msg => sprintf("Poe '%s' status is '%s' [instance = %s, power = %s]", + $instance, $result->{extremePethSlotPoeStatus}, + $instance, $result2->{extremePethSlotMeasuredPower})); + $exit = $self->get_severity(section => 'poe', value => $result->{extremePethSlotPoeStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Poe '%s' status is '%s'", $instance, $result->{extremePethSlotPoeStatus})); + next; + } + + next if ($result2->{extremePethSlotMeasuredPower}) !~ /\d+/); + + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'poe', instance => $instance, value => $result2->{extremePethSlotMeasuredPower}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Poe '%s' is '%s' W", $instance, $result2->{extremePethSlotMeasuredPower})); + } + $self->{output}->perfdata_add(label => 'poe_power_' . $instance, unit => 'W', + value => $result2->{extremePethSlotMeasuredPower}, + warning => $warn, + critical => $crit, min => 0 + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/extreme/snmp/mode/hardware.pm b/centreon-plugins/network/extreme/snmp/mode/hardware.pm index b7a908093..2dc321f44 100644 --- a/centreon-plugins/network/extreme/snmp/mode/hardware.pm +++ b/centreon-plugins/network/extreme/snmp/mode/hardware.pm @@ -28,8 +28,8 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|slot)$'; - $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|psu\.power|psu\.fan)$'; + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|slot|poe)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|poe|psu\.power|psu\.fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -61,10 +61,22 @@ sub set_system { ['initializing', 'OK'], ['invalid', 'CRITICAL'], ], + poe => [ + ['initializing', 'OK'], + ['operational', 'OK'], + ['downloadFail', 'CRITICAL'], + ['calibrationRequired', 'CRITICAL'], + ['invalidFirmware', 'CRITICAL'], + ['mismatchVersion', 'CRITICAL'], + ['updating', 'OK'], + ['invalidDevice', 'CRITICAL'], + ['notOperational', 'CRITICAL'], + ['other', 'CRITICAL'], + ], }; $self->{components_path} = 'network::extreme::snmp::mode::components'; - $self->{components_module} = ['fan', 'psu', 'slot', 'temperature']; + $self->{components_module} = ['fan', 'psu', 'slot', 'temperature', 'poe']; } sub snmp_execute { @@ -93,14 +105,14 @@ __END__ =head1 MODE -Check Hardware (Fans, Power Supplies, Slot, Temperature). +Check Hardware (Fans, Power Supplies, Slot, Temperature, POEs). =over 8 =item B<--component> Which component to check (Default: '.*'). -Can be: 'fan', 'psu', 'slot', 'temperature'. +Can be: 'fan', 'psu', 'slot', 'temperature', 'poe'. =item B<--filter> From 84d4e94e0b6eb387803dfbef1000b41b06dc1e70 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 18 Jan 2016 09:39:58 +0100 Subject: [PATCH 031/346] + Fix poe status for extreme network --- centreon-plugins/network/extreme/snmp/mode/components/poe.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/extreme/snmp/mode/components/poe.pm b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm index 1bbf8f1c7..e6c78ea90 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/poe.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm @@ -80,7 +80,7 @@ sub check { next; } - next if ($result2->{extremePethSlotMeasuredPower}) !~ /\d+/); + next if ($result2->{extremePethSlotMeasuredPower} !~ /\d+/); ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'poe', instance => $instance, value => $result2->{extremePethSlotMeasuredPower}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { From f138be6b1e179e43c9920c778bf200c6167a8ac4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 11:20:05 +0100 Subject: [PATCH 032/346] + add plugin hp vc (Fix #229) --- .../hp/vc/snmp/mode/components/domain.pm | 68 +++++++++++ .../hp/vc/snmp/mode/components/enclosure.pm | 68 +++++++++++ .../hp/vc/snmp/mode/components/enet.pm | 68 +++++++++++ .../network/hp/vc/snmp/mode/components/fc.pm | 68 +++++++++++ .../hp/vc/snmp/mode/components/module.pm | 68 +++++++++++ .../vc/snmp/mode/components/physicalserver.pm | 67 +++++++++++ .../hp/vc/snmp/mode/components/port.pm | 65 +++++++++++ .../hp/vc/snmp/mode/components/profile.pm | 68 +++++++++++ .../hp/vc/snmp/mode/components/resources.pm | 106 ++++++++++++++++++ .../network/hp/vc/snmp/mode/hardware.pm | 105 +++++++++++++++++ centreon-plugins/network/hp/vc/snmp/plugin.pm | 50 +++++++++ 11 files changed, 801 insertions(+) create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/module.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/port.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/hardware.pm create mode 100644 centreon-plugins/network/hp/vc/snmp/plugin.pm diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm new file mode 100644 index 000000000..4a20275a9 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::domain; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcDomainName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.1.1' }, + vcDomainManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.1.2', map => $map_managed_status }, + vcDomainReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.1.10', map => $map_reason_code }, +}; +my $oid_vcDomain = '.1.3.6.1.4.1.11.5.7.5.2.1.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcDomain }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking domains"); + $self->{components}->{domain} = { name => 'domains', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'domain')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcDomain}})) { + next if ($oid !~ /^$mapping->{vcDomainManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcDomain}, instance => $instance); + + next if ($self->check_filter(section => 'domain', instance => $instance)); + $self->{components}->{domain}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("domain '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcDomainName}, $result->{vcDomainManagedStatus}, + $instance, $result->{vcDomainReasonCode} + )); + my $exit = $self->get_severity(section => 'domain', label => 'default', value => $result->{vcDomainManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Domain '%s' status is '%s'", + $result->{vcDomainName}, $result->{vcDomainManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm new file mode 100644 index 000000000..d78508fc1 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::enclosure; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcEnclosureName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.2.1.1.2' }, + vcEnclosureManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.2.1.1.3', map => $map_managed_status }, + vcEnclosureReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.2.1.1.9', map => $map_reason_code }, +}; +my $oid_vcEnclosureEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.2.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcEnclosureEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosures"); + $self->{components}->{enclosure} = { name => 'enclosures', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'enclosure')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcEnclosureEntry}})) { + next if ($oid !~ /^$mapping->{vcEnclosureManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcEnclosureEntry}, instance => $instance); + + next if ($self->check_filter(section => 'enclosure', instance => $instance)); + $self->{components}->{enclosure}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcEnclosureName}, $result->{vcEnclosureManagedStatus}, + $instance, $result->{vcEnclosureReasonCode} + )); + my $exit = $self->get_severity(section => 'enclosure', label => 'default', value => $result->{vcEnclosureManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure '%s' status is '%s'", + $result->{vcEnclosureName}, $result->{vcEnclosureManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm new file mode 100644 index 000000000..c2646072e --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::enet; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcEnetNetworkName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.6.1.1.2' }, + vcEnetNetworkManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.6.1.1.3', map => $map_managed_status }, + vcEnetNetworkReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.6.1.1.7', map => $map_reason_code }, +}; +my $oid_vcEnetNetworkEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.6.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcEnetNetworkEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking ethernet network"); + $self->{components}->{enet} = { name => 'enet', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'enet')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcEnetNetworkEntry}})) { + next if ($oid !~ /^$mapping->{vcEnetNetworkManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcEnetNetworkEntry}, instance => $instance); + + next if ($self->check_filter(section => 'enet', instance => $instance)); + $self->{components}->{enet}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("ethernet network '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcEnetNetworkName}, $result->{vcEnetNetworkManagedStatus}, + $instance, $result->{vcEnetNetworkReasonCode} + )); + my $exit = $self->get_severity(section => 'enet', label => 'default', value => $result->{vcEnetNetworkManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Ethernet network '%s' status is '%s'", + $result->{vcEnetNetworkName}, $result->{vcEnetNetworkManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm new file mode 100644 index 000000000..990d13996 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::fc; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcFcFabricName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.7.1.1.2' }, + vcFcFabricManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.7.1.1.3', map => $map_managed_status }, + vcFcFabricReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.7.1.1.6', map => $map_reason_code }, +}; +my $oid_vcFcFabricEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.7.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcFcFabricEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fc"); + $self->{components}->{fc} = { name => 'fc', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'fc')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcFcFabricEntry}})) { + next if ($oid !~ /^$mapping->{vcFcFabricManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcFcFabricEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fc', instance => $instance)); + $self->{components}->{fc}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fc '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcFcFabricName}, $result->{vcFcFabricManagedStatus}, + $instance, $result->{vcFcFabricReasonCode} + )); + my $exit = $self->get_severity(section => 'fc', label => 'default', value => $result->{vcFcFabricManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fc '%s' status is '%s'", + $result->{vcFcFabricName}, $result->{vcFcFabricManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm new file mode 100644 index 000000000..89654a38e --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::module; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcModuleProductName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.3.1.1.6' }, + vcModuleManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.3.1.1.3', map => $map_managed_status }, + vcModuleReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.3.1.1.15', map => $map_reason_code }, +}; +my $oid_vcModuleEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.3.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcModuleEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking modules"); + $self->{components}->{module} = { name => 'modules', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'module')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcModuleEntry}})) { + next if ($oid !~ /^$mapping->{vcModuleManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcModuleEntry}, instance => $instance); + + next if ($self->check_filter(section => 'module', instance => $instance)); + $self->{components}->{module}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("module '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcModuleProductName}, $result->{vcModuleManagedStatus}, + $instance, $result->{vcModuleReasonCode} + )); + my $exit = $self->get_severity(section => 'module', label => 'default', value => $result->{vcModuleManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Module '%s' status is '%s'", + $result->{vcModuleProductName}, $result->{vcModuleManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm new file mode 100644 index 000000000..04912d30a --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm @@ -0,0 +1,67 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::physicalserver; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcPhysicalServerManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.5.1.1.3', map => $map_managed_status }, + vcPhysicalServerReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.5.1.1.10', map => $map_reason_code }, +}; +my $oid_vcPhysicalServerEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.5.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcPhysicalServerEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking physical servers"); + $self->{components}->{physicalserver} = { name => 'physical servers', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'physicalserver')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcPhysicalServerEntry}})) { + next if ($oid !~ /^$mapping->{vcPhysicalServerManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcPhysicalServerEntry}, instance => $instance); + + next if ($self->check_filter(section => 'physicalserver', instance => $instance)); + $self->{components}->{physicalserver}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("physical server '%s' status is '%s' [instance: %s, reason: %s].", + $instance, $result->{vcPhysicalServerManagedStatus}, + $instance, $result->{vcPhysicalServerReasonCode} + )); + my $exit = $self->get_severity(section => 'physicalserver', label => 'default', value => $result->{vcPhysicalServerManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Physical server '%s' status is '%s'", + $result->{vcModuleProductName}, $result->{vcPhysicalServerManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm new file mode 100644 index 000000000..47a886e7b --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm @@ -0,0 +1,65 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::port; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcPortManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.4.1.1.3', map => $map_managed_status }, +}; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $mapping->{vcPortManagedStatus}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking ports"); + $self->{components}->{port} = { name => 'ports', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'port')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{vcPortManagedStatus}->{oid}}})) { + $oid =~ /^$mapping->{vcPortManagedStatus}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{vcPortManagedStatus}->{oid}}, instance => $instance); + + next if ($self->check_filter(section => 'port', instance => $instance)); + $self->{components}->{port}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("port '%s' status is '%s' [instance: %s].", + $instance, $result->{vcPortManagedStatus}, + $instance + )); + my $exit = $self->get_severity(section => 'port', label => 'default', value => $result->{vcPortManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Port '%s' status is '%s'", + $instance, $result->{vcPortManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm new file mode 100644 index 000000000..8322f2af5 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm @@ -0,0 +1,68 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::profile; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_managed_status $map_reason_code); + +my $mapping = { + vcProfileName => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.8.1.1.2' }, + vcProfileManagedStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.8.1.1.3', map => $map_managed_status }, + vcProfileReasonCode => { oid => '.1.3.6.1.4.1.11.5.7.5.2.1.1.8.1.1.8', map => $map_reason_code }, +}; +my $oid_vcProfileEntry = '.1.3.6.1.4.1.11.5.7.5.2.1.1.8.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcProfileEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking profiles"); + $self->{components}->{profile} = { name => 'profiles', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'profile')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcProfileEntry}})) { + next if ($oid !~ /^$mapping->{vcProfileManagedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcProfileEntry}, instance => $instance); + + next if ($self->check_filter(section => 'profile', instance => $instance)); + $self->{components}->{profile}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("profile '%s' status is '%s' [instance: %s, reason: %s].", + $result->{vcProfileName}, $result->{vcProfileManagedStatus}, + $instance, $result->{vcProfileReasonCode} + )); + my $exit = $self->get_severity(section => 'profile', label => 'default', value => $result->{vcProfileManagedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Profile '%s' status is '%s'", + $result->{vcProfileName}, $result->{vcProfileManagedStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm new file mode 100644 index 000000000..5e54fb0ac --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm @@ -0,0 +1,106 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our $map_managed_status; +our $map_reason_code; + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw($map_managed_status $map_reason_code); + +$map_managed_status = { + 1 => 'unknown', + 2 => 'normal', + 3 => 'warning', + 4 => 'minor', + 5 => 'major', + 6 => 'critical', + 7 => 'disabled', + 8 => 'info', +}; + +$map_reason_code = { + 100 => 'vcNetworkOk', + 101 => 'vcNetworkUnknown', + 102 => 'vcNetworkDisabled', + 104 => 'vcNetworkAbnormal', + 105 => 'vcNetworkFailed', + 106 => 'vcNetworkDegraded', + 109 => 'vcNetworkNoPortsAssignedToPrivateNetwork', + 200 => 'vcFabricOk', + 202 => 'vcFabricNoPortsConfigured', + 203 => 'vcFabricSomePortsAbnormal', + 204 => 'vcFabricAllPortsAbnormal', + 205 => 'vcFabricWwnMismatch', + 206 => 'vcFabricUnknown', + 300 => 'vcProfileOk', + 301 => 'vcProfileServerAbnormal', + 304 => 'vcProfileAllConnectionsFailed', + 309 => 'vcProfileSomeConnectionsUnmapped', + 310 => 'vcProfileAllConnectionsAbnormal', + 311 => 'vcProfileSomeConnectionsAbnormal', + 312 => 'vcProfileUEFIBootmodeIncompatibleWithServer', + 313 => 'vcProfileUnknown', + 400 => 'vcEnetmoduleOk', + 401 => 'vcEnetmoduleEnclosureDown', + 402 => 'vcEnetmoduleModuleMissing', + 404 => 'vcEnetmodulePortprotect', + 405 => 'vcEnetmoduleIncompatible', + 406 => 'vcEnetmoduleHwDegraded', + 407 => 'vcEnetmoduleUnknown', + 408 => 'vcFcmoduleOk', + 409 => 'vcFcmoduleEnclosureDown', + 410 => 'vcFcmoduleModuleMissing', + 412 => 'vcFcmoduleHwDegraded', + 413 => 'vcFcmoduleIncompatible', + 414 => 'vcFcmoduleUnknown', + 500 => 'vcPhysicalServerOk', + 501 => 'vcPhysicalServerEnclosureDown', + 502 => 'vcPhysicalServerFailed', + 503 => 'vcPhysicalServerDegraded', + 504 => 'vcPhysicalServerUnknown', + 600 => 'vcEnclosureOk', + 601 => 'vcEnclosureAllEnetModulesFailed', + 602 => 'vcEnclosureSomeEnetModulesAbnormal', + 603 => 'vcEnclosureSomeModulesOrServersIncompatible', + 604 => 'vcEnclosureSomeFcModulesAbnormal', + 605 => 'vcEnclosureSomeServersAbnormal', + 606 => 'vcEnclosureUnknown', + 700 => 'vcDomainOk', + 701 => 'vcDomainAbnormalEnclosuresAndProfiles', + 702 => 'vcDomainSomeEnclosuresAbnormal', + 703 => 'vcDomainUnmappedProfileConnections', + 706 => 'vcDomainStackingFailed', + 707 => 'vcDomainStackingNotRedundant', + 709 => 'vcDomainSomeProfilesAbnormal', + 712 => 'vcDomainUnknown', + 713 => 'vcDomainOverProvisioned', + 801 => 'vcDomainSflowIndirectlyDisabled', + 802 => 'vcDomainSflowFailed', + 803 => 'vcDomainSflowDegraded', + 901 => 'vcDomainPortMonitorIndirectlyDisabled', +}; + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm new file mode 100644 index 000000000..8519b9375 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm @@ -0,0 +1,105 @@ +# +# Copyright 2015 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::vc::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(domain|enclosure|module|port|physicalserver|enet|fc|profile)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + default => [ + ['unknown', 'UNKNOWN'], + ['normal', 'OK'], + ['warning', 'WARNING'], + ['minor', 'WARNING'], + ['major', 'CRITICAL'], + ['critical', 'CRITICAL'], + ['disabled', 'OK'], + ['info', 'OK'], + ], + }; + + $self->{components_path} = 'network::hp::vc::snmp::mode::components'; + $self->{components_module} = ['domain', 'enclosure', 'module', 'port', 'physicalserver', 'enet', 'fc', 'profile']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check Hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'domain', 'enclosure', 'module', 'port', 'physicalserver', 'enet', 'fc', 'profile'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/plugin.pm b/centreon-plugins/network/hp/vc/snmp/plugin.pm new file mode 100644 index 000000000..cc0253480 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2015 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::vc::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}} = ( + 'hardware' => 'network::hp::vc::snmp::mode::hardware', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check HP Virtual Connect in SNMP. + +=cut From a513ea83b292dbe5ecd7e327b3ca277f0f0c092d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 11:20:59 +0100 Subject: [PATCH 033/346] + update help --- centreon-plugins/network/hp/vc/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm index 8519b9375..6c50dcede 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm @@ -86,8 +86,8 @@ Can be: 'domain', 'enclosure', 'module', 'port', 'physicalserver', 'enet', 'fc', =item B<--filter> -Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) -Can also exclude specific instance: --filter=fan,1 +Exclude some parts (comma seperated list) (Example: --filter=enet --filter=fc) +Can also exclude specific instance: --filter=fc,1 =item B<--no-component> @@ -98,7 +98,7 @@ If total (with skipped) is 0. (Default: 'critical' returns). Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). -Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' +Example: --threshold-overload='module,CRITICAL,^(?!(normal)$)' =back From 28ab247fceec09412ed441fd42917cd065e7f773 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 14:39:45 +0100 Subject: [PATCH 034/346] + add moduleport in hp vc plugin --- .../hp/vc/snmp/mode/components/moduleport.pm | 74 +++++++++++++++++++ .../hp/vc/snmp/mode/components/resources.pm | 15 +++- .../network/hp/vc/snmp/mode/hardware.pm | 15 +++- 3 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm new file mode 100644 index 000000000..845184d05 --- /dev/null +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm @@ -0,0 +1,74 @@ +# +# Copyright 2015 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::vc::snmp::mode::components::moduleport; + +use strict; +use warnings; +use network::hp::vc::snmp::mode::components::resources qw($map_moduleport_loop_status $map_moduleport_protection_status); + +my $mapping = { + vcModulePortBpduLoopStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.3.1.1.6.1.3', map => $map_moduleport_loop_status }, + vcModulePortProtectionStatus => { oid => '.1.3.6.1.4.1.11.5.7.5.2.3.1.1.6.1.4', map => $map_moduleport_protection_status }, +}; +my $oid_vcModulePortEntry = '.1.3.6.1.4.1.11.5.7.5.2.3.1.1.6.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_vcModulePortEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking module ports"); + $self->{components}->{moduleport} = { name => 'module ports', total => 0, skip => 0 }; + return if ($self->check_filter(section => 'moduleport')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vcModulePortEntry}})) { + next if ($oid !~ /^$mapping->{vcModulePortBpduLoopStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vcModulePortEntry}, instance => $instance); + + next if ($self->check_filter(section => 'moduleport', instance => $instance)); + $self->{components}->{moduleport}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("module port '%s' loop status is '%s' [instance: %s, protection status: %s].", + $instance, $result->{vcModulePortBpduLoopStatus}, + $instance, $result->{vcModulePortProtectionStatus} + )); + my $exit = $self->get_severity(section => 'moduleport.loop', value => $result->{vcModulePortBpduLoopStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Module port '%s' loop status is '%s'", + $instance, $result->{vcModulePortBpduLoopStatus})); + } + + $exit = $self->get_severity(section => 'moduleport.protection', value => $result->{vcModulePortProtectionStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Module port '%s' protection status is '%s'", + $instance, $result->{vcModulePortProtectionStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm index 5e54fb0ac..a08ffb466 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm @@ -26,9 +26,11 @@ use Exporter; our $map_managed_status; our $map_reason_code; +our $map_moduleport_loop_status; +our $map_moduleport_protection_status; our @ISA = qw(Exporter); -our @EXPORT_OK = qw($map_managed_status $map_reason_code); +our @EXPORT_OK = qw($map_managed_status $map_reason_code $map_moduleport_loop_status $map_moduleport_protection_status); $map_managed_status = { 1 => 'unknown', @@ -103,4 +105,15 @@ $map_reason_code = { 901 => 'vcDomainPortMonitorIndirectlyDisabled', }; +$map_moduleport_protection_status = { + 1 => 'ok', + 2 => 'pause-flood-detected', + 3 => 'in-pause-condition', +}; + +$map_moduleport_loop_status = { + 1 => 'ok', + 2 => 'loop-dectected', +}; + 1; \ No newline at end of file diff --git a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm index 6c50dcede..6a45a36b4 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm @@ -28,7 +28,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(domain|enclosure|module|port|physicalserver|enet|fc|profile)$'; + $self->{regexp_threshold_overload_check_section_option} = '^(domain|enclosure|module|port|moduleport|physicalserver|enet|fc|profile)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -43,10 +43,19 @@ sub set_system { ['disabled', 'OK'], ['info', 'OK'], ], + 'moduleport.loop' => [ + ['ok', 'OK'], + ['loop-detected', 'CRITICAL'], + ], + 'moduleport.protection' => [ + ['ok', 'OK'], + ['pause-flood-detected', 'CRITICAL'], + ['in-pause-condition', 'WARNING'], + ], }; $self->{components_path} = 'network::hp::vc::snmp::mode::components'; - $self->{components_module} = ['domain', 'enclosure', 'module', 'port', 'physicalserver', 'enet', 'fc', 'profile']; + $self->{components_module} = ['domain', 'enclosure', 'module', 'moduleport', 'port', 'physicalserver', 'enet', 'fc', 'profile']; } sub snmp_execute { @@ -82,7 +91,7 @@ Check Hardware. =item B<--component> Which component to check (Default: '.*'). -Can be: 'domain', 'enclosure', 'module', 'port', 'physicalserver', 'enet', 'fc', 'profile'. +Can be: 'domain', 'enclosure', 'module', 'moduleport', 'port', 'physicalserver', 'enet', 'fc', 'profile'. =item B<--filter> From af5df3ca2123adea68bfdffb2da8ba9cbed561fa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 20:47:00 +0100 Subject: [PATCH 035/346] + Fix empty message for x509 --- .../apps/protocols/x509/mode/validity.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index 430ac5e43..ae7fc2363 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -87,21 +87,21 @@ sub run { $self->{option_results}->{servername} ? ( SSL_hostname => $self->{option_results}->{servername} ):(), ) }; if ($@) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf ("%s", $!)); + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("%s", $@)); - $self->{output}->display(); - $self->{output}->exit() + $self->{output}->display(); + $self->{output}->exit() } #Retrieve Certificat eval { $cert = $client->peer_certificate() }; if ($@) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("%s", $!)); + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("%s", $@)); - $self->{output}->display(); - $self->{output}->exit() + $self->{output}->display(); + $self->{output}->exit() } #Expiration Date From b4586c3e5a6e7fffed80b52fef39ea906f1457b3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 20:54:38 +0100 Subject: [PATCH 036/346] + Fix error message for x509 plugin --- .../apps/protocols/x509/mode/validity.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index ae7fc2363..ff178fa51 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -79,27 +79,25 @@ sub run { my ($self, %options) = @_; # Global variables - my ($cert, $client); - eval { $client = IO::Socket::SSL->new( + my $client = IO::Socket::SSL->new( PeerHost => $self->{option_results}->{hostname}, PeerPort => $self->{option_results}->{port}, $self->{option_results}->{servername} ? ( SSL_hostname => $self->{option_results}->{servername} ):(), - ) }; - if ($@) { + ) + if (!defined($client)) { $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("%s", $@)); - + short_msg => "failed to accept or ssl handshake: $!,$SSL_ERROR"); $self->{output}->display(); $self->{output}->exit() } #Retrieve Certificat + my $cert; eval { $cert = $client->peer_certificate() }; if ($@) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => sprintf("%s", $@)); - $self->{output}->display(); $self->{output}->exit() } From 07444455d4013076e24e3a416358f7aaed18cb9c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Jan 2016 20:57:54 +0100 Subject: [PATCH 037/346] + Fix x509 --- centreon-plugins/apps/protocols/x509/mode/validity.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index ff178fa51..f08b8756f 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -84,7 +84,7 @@ sub run { PeerHost => $self->{option_results}->{hostname}, PeerPort => $self->{option_results}->{port}, $self->{option_results}->{servername} ? ( SSL_hostname => $self->{option_results}->{servername} ):(), - ) + ); if (!defined($client)) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => "failed to accept or ssl handshake: $!,$SSL_ERROR"); From bf51c7b9dc99b7500bccc20df34b179ae21d8a32 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 14:27:22 +0100 Subject: [PATCH 038/346] + Update documentation --- centreon-plugins/docs/en/developer/guide.rst | 455 ++++++++++++++++--- centreon-plugins/docs/fr/developer/guide.rst | 82 ++-- 2 files changed, 424 insertions(+), 113 deletions(-) diff --git a/centreon-plugins/docs/en/developer/guide.rst b/centreon-plugins/docs/en/developer/guide.rst index 75a99b12e..8718d6c75 100644 --- a/centreon-plugins/docs/en/developer/guide.rst +++ b/centreon-plugins/docs/en/developer/guide.rst @@ -7,8 +7,16 @@ This document introduces the best practices in the development of "centreon-plug As all plugins are written in Perl, “there is more than one way to do it”. But to avoid reinventing the wheel, you should first take a look at the “example” directory, you will get an overview of how to build your own plugin and associated modes. +There are 3 chapters: + +* :ref:`Quick Start `: Howto create file structure. +* :ref:`Libraries Reference `: API description. +* :ref:`Model Classes Usage `: description of classes you should use for your plugin. + The lastest version is available on following git repository: http://git.centreon.com/centreon-plugins.git +.. _quick-start: + *********** Quick Start *********** @@ -218,7 +226,7 @@ For example, Warning and Critical thresholds must be validate in **check_options if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); $self->{output}->option_exit(); - } + } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); @@ -295,6 +303,8 @@ Once plugin and modes are developed, you can commit (commit messages in english) git commit -m "Add new plugin for XXXX refs #" git push +.. _libraries_reference: + ******************* Libraries reference ******************* @@ -1468,40 +1478,25 @@ Then, edit **plugin.pm** and add the following lines: .. code-block:: perl - ################################################################################ - # Copyright 2005-2015 MERETHIS - # Centreon is developped by : Julien Mathis and Romain Le Merlus under - # GPL Licence 2.0. # - # This program is free software; you can redistribute it and/or modify it under - # the terms of the GNU General Public License as published by the Free Software - # Foundation ; either version 2 of the License. + # Copyright 2015 Centreon (http://www.centreon.com/) # - # This program is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. See the GNU General Public License for more details. + # Centreon is a full-fledged industry-strength solution that meets + # the needs in IT infrastructure and application monitoring for + # service performance. # - # You should have received a copy of the GNU General Public License along with - # this program; if not, see . + # 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 # - # Linking this program statically or dynamically with other modules is making a - # combined work based on this program. Thus, the terms and conditions of the GNU - # General Public License cover the whole combination. + # http://www.apache.org/licenses/LICENSE-2.0 # - # As a special exception, the copyright holders of this program give MERETHIS - # permission to link this program with independent modules to produce an executable, - # regardless of the license terms of these independent modules, and to copy and - # distribute the resulting executable under terms of MERETHIS choice, provided that - # MERETHIS also meet, for each linked independent module, the terms and conditions - # of the license of that module. An independent module is a module which is not - # derived from this program. If you modify this program, you may extend this - # exception to your version of the program, but you are not obliged to do so. If you - # do not wish to do so, delete this exception statement from your version. + # 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. # - # For more information : contact@centreon.com - # Authors : your name - # - #################################################################################### # Path to the plugin package apps::pfsense::snmp::plugin; @@ -1573,40 +1568,25 @@ Edit **memorydroppedpackets.pm** and add the following lines: .. code-block:: perl - ################################################################################ - # Copyright 2005-2015 MERETHIS - # Centreon is developped by : Julien Mathis and Romain Le Merlus under - # GPL Licence 2.0. # - # This program is free software; you can redistribute it and/or modify it under - # the terms of the GNU General Public License as published by the Free Software - # Foundation ; either version 2 of the License. + # Copyright 2015 Centreon (http://www.centreon.com/) # - # This program is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. See the GNU General Public License for more details. + # Centreon is a full-fledged industry-strength solution that meets + # the needs in IT infrastructure and application monitoring for + # service performance. # - # You should have received a copy of the GNU General Public License along with - # this program; if not, see . + # 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 # - # Linking this program statically or dynamically with other modules is making a - # combined work based on this program. Thus, the terms and conditions of the GNU - # General Public License cover the whole combination. + # http://www.apache.org/licenses/LICENSE-2.0 # - # As a special exception, the copyright holders of this program give MERETHIS - # permission to link this program with independent modules to produce an executable, - # regardless of the license terms of these independent modules, and to copy and - # distribute the resulting executable under terms of MERETHIS choice, provided that - # MERETHIS also meet, for each linked independent module, the terms and conditions - # of the license of that module. An independent module is a module which is not - # derived from this program. If you modify this program, you may extend this - # exception to your version of the program, but you are not obliged to do so. If you - # do not wish to do so, delete this exception statement from your version. + # 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. # - # For more information : contact@centreon.com - # Authors : your name - # - #################################################################################### # Path to the plugin package apps::pfsense::snmp::mode::memorydroppedpackets; @@ -1796,5 +1776,366 @@ Output may display: OK: Dropped packets due to memory limitations : 0.00 /s | dropped_packets_Per_Sec=0.00;0;;1;2 +.. _model_classes_usage: + +******************* +Model Classes Usage +******************* + +------------ +Introduction +------------ + +With the experience of plugin development, we have created two classes: + +* centreon::plugins::templates::counter +* centreon::plugins::templates::hardware + +It was developed to have a more consistent code and less redundant code. According to context, you should use one of two classes for modes. +Following classes can be used for whatever plugin type (SNMP, Custom, DBI,...). + +------------- +Class counter +------------- + +When to use it ? +---------------- + +If you have some counters (CPU Usage, Memory, Session...), you should use that class. +If you have only one global counter to check, it's maybe not useful to use it (but only for these case). + +Class methods +------------- + +List of methods: + +* **new**: class constructor. Overload if you need to add some specific options or to use a statefile. +* **check_options**: overload if you need to check your specific options. +* **manage_selection**: overload if *mandatory*. Method to get informations for the equipment. +* **set_counters**: overload if **mandatory**. Method to configure counters. + +Examples +-------- + +Example 1 +^^^^^^^^^ + +We want to develop the following SNMP plugin: + +* measure the current sessions and current SSL sessions usages. + +.. code-block:: perl + + package my::module::name; + + use base qw(centreon::plugins::templates::counter); + + use strict; + use warnings; + + sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'sessions', set => { + key_values => [ { name => 'sessions' } ], + output_template => 'Current sessions : %s', + perfdatas => [ + { label => 'sessions', value => 'sessions_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'sessions-ssl', set => { + key_values => [ { name => 'sessions_ssl' } ], + output_template => 'Current ssl sessions : %s', + perfdatas => [ + { label => 'sessions_ssl', value => 'sessions_ssl_absolute', template => '%s', + min => 0 }, + ], + } + }, + ]; + } + + sub manage_selection { + my ($self, %options) = @_; + + # OIDs are fake. Only for the example. + my ($oid_sessions, $oid_sessions_ssl) = ('.1.2.3.4.0', '.1.2.3.5.0'); + + my $result = $options{snmp}->get_leef(oids => [ $oid_sessions, $oid_sessions_ssl ], + nothing_quit => 1); + $self->{global} = { sessions => $result->{$oid_sessions}, + sessions_ssl => $result->{$oid_sessions_ssl} + }; + } +Output may display: +:: + + OK: Current sessions : 24 - Current ssl sessions : 150 | sessions=24;;;0; sessions_ssl=150;;;0; + +As you can see, we create two arrays of hash tables in **set_counters** method. We use arrays to order the output. + +* **maps_counters_type**: global configuration. Attributes list: + + * *name*: the name is really important. It will be used in hash **map_counters** and also in **manage_selection** as you can see. + * *type*: 0 or 1. With 0 value, the output will be written in the short output. With the value 1, it depends if we have one or multiple instances. + * *message_multiple*: only useful with *type* 1 value. The message will be displayed in short ouput if we have multiple instances selected. + * *message_separator*: the string displayed between counters (Default: ', '). + * *cb_prefix_output*, *cb_suffix_output*: name of a method (in a string) to callback. Methods will return a string to be displayed before or after **all** counters. + * *cb_init*: name of a method (in a string) to callback. Method will return 0 or 1. With 1 value, counters are not checked. + +* **maps_counters**: complex structure to configure counters. Attributes list: + + * *label*: name used for threshold options. + * *threshold*: if we set the value to 0. There is no threshold check options (can be used if you want to set and check option yourself). + * *set*: hash table: + + * *keys_values*: array of hashes. Set values used for the counter. Order is important (by default, the first value is used to check). + + * *name*: attribute name. Need to match with attributes in **manage_selection** method! + * *diff*: if we set the value to 1, we'll have the difference between two checks (need a statefile!). + + * *output_template*: string to display. '%s' will be replaced by the first value of *keys_values*. + * *output_use*: which value to be used in *output_template* (If not set, we use the first value of *keys_values*). + * *per_second*: if we set the value to 1, the *diff* values will be calculated per seconds. + * *output_change_bytes*: if we set the value to 1 or 2, we can use a second '%s' in *output_template* to display the unit. 1 = divide by 1024 (Bytes), 2 = divide by 1000 (bits). + * *perfdata*: array of hashes. To configure perfdatas + + * *label*: name displayed. + * *value*: value to used. It's the name from *keys_values* with a **suffix**: '_absolute' or '_per_second' (depends of other options). + * *template*: value format (could be for example: '%.3f'). + * *unit*: unit displayed. + * *min*, *max*: min and max displayed. You can use a value from *keys_values*. + * *label_extra_instance*: if we set the value to 1, perhaps we'll have a suffix concat with *label*. + * *instance_use*: which value from *keys_values* to be used. To be used if *label_extra_instance* is 1. + +Example 2 +^^^^^^^^^ + +We want to add the current number of sessions by virtual servers. + +.. code-block:: perl + + package my::module::name; + + use base qw(centreon::plugins::templates::counter); + + use strict; + use warnings; + + sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' }, + { name => 'vs', type => 1, cb_prefix_output => 'prefix_vs_output', message_multiple => 'All Virtual servers are ok' } + ]; + $self->{maps_counters}->{global} = [ + { label => 'total-sessions', set => { + key_values => [ { name => 'sessions' } ], + output_template => 'current sessions : %s', + perfdatas => [ + { label => 'total_sessions', value => 'sessions_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-sessions-ssl', set => { + key_values => [ { name => 'sessions_ssl' } ], + output_template => 'current ssl sessions : %s', + perfdatas => [ + { label => 'total_sessions_ssl', value => 'sessions_ssl_absolute', template => '%s', + min => 0 }, + ], + } + }, + ]; + + $self->{maps_counters}->{vs} = [ + { label => 'sessions', set => { + key_values => [ { name => 'sessions' }, { name => 'display' } ], + output_template => 'current sessions : %s', + perfdatas => [ + { label => 'sessions', value => 'sessions_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'sessions-ssl', set => { + key_values => [ { name => 'sessions_ssl' }, { name => 'display' } ], + output_template => 'current ssl sessions : %s', + perfdatas => [ + { label => 'sessions_ssl', value => 'sessions_ssl_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; + } + + sub prefix_vs_output { + my ($self, %options) = @_; + + return "Virtual server '" . $options{instance_value}->{display} . "' "; + } + + sub prefix_global_output { + my ($self, %options) = @_; + + return "Total "; + } + + sub manage_selection { + my ($self, %options) = @_; + + # OIDs are fake. Only for the example. + my ($oid_sessions, $oid_sessions_ssl) = ('.1.2.3.4.0', '.1.2.3.5.0'); + + my $result = $options{snmp}->get_leef(oids => [ $oid_sessions, $oid_sessions_ssl ], + nothing_quit => 1); + $self->{global} = { sessions => $result->{$oid_sessions}, + sessions_ssl => $result->{$oid_sessions_ssl} + }; + my $oid_table_vs = '.1.2.3.10'; + my $mapping = { + vsName => { oid => '.1.2.3.10.1' }, + vsSessions => { oid => '.1.2.3.10.2' }, + vsSessionsSsl => { oid => '.1.2.3.10.3' }, + }; + + $self->{vs} = {}; + $result = $options{snmp}->get_table(oid => $oid_table_vs, + nothing_quit => 1); + foreach my $oid (keys %{$result->{ $oid_table_vs }}) { + next if ($oid !~ /^$mapping->{vsName}->{oid}\.(.*)$/; + my $instance = $1; + my $data = $options{snmp}->map_instance(mapping => $mapping, results => $result->{$oid_table_vs}, instance => $instance); + + $self->{vs}->{$instance} = { display => $data->{vsName}, + sessions => $data->{vsSessions}, sessions_ssl => $data->{vsSessionsSsl}}; + } + } + +If we have at least 2 virtual servers: +:: + + OK: Total current sessions : 24, current ssl sessions : 150 - All Virtual servers are ok | total_sessions=24;;;0; total_sessions_ssl=150;;;0; sessions_foo1=11;;;0; sessions_ssl_foo1=70;;;0; sessions_foo2=13;;;0; sessions_ssl_foo2=80;;;0; + Virtual server 'foo1' current sessions : 11, current ssl sessions : 70 + Virtual server 'foo2' current sessions : 13, current ssl sessions : 80 + +Example 3 +^^^^^^^^^ + +The model can also be used to check strings (not only counters). So we want to check the status of a virtualserver. + +.. code-block:: perl + + package my::module::name; + + use base qw(centreon::plugins::templates::counter); + + use strict; + use warnings; + + my $instance_mode; + + sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'vs', type => 1, cb_prefix_output => 'prefix_vs_output', message_multiple => 'All Virtual server status are ok' } + ]; + $self->{maps_counters}->{vs} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; + } + + sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + + if ($self->{result_values}->{status} =~ /problem/) { + $status = 'critical'; + } + return $status; + } + + sub custom_status_output { + my ($self, %options) = @_; + + my $msg = sprintf("status is '%s'", $self->{result_values}->{status}); + return $msg; + } + + sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; + } + + sub prefix_vs_output { + my ($self, %options) = @_; + + return "Virtual server '" . $options{instance_value}->{display} . "' "; + } + + sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + # Sometimes, you'll need to have access of the current object in the callback + $instance_mode = $self; + } + + sub manage_selection { + my ($self, %options) = @_; + + my $oid_table_vs = '.1.2.3.10'; + my $mapping = { + vsName => { oid => '.1.2.3.10.1' }, + vsStatus => { oid => '.1.2.3.10.4' }, + }; + + $self->{vs} = {}; + my $result = $options{snmp}->get_table(oid => $oid_table_vs, + nothing_quit => 1); + foreach my $oid (keys %{$result->{ $oid_table_vs }}) { + next if ($oid !~ /^$mapping->{vsName}->{oid}\.(.*)$/; + my $instance = $1; + my $data = $options{snmp}->map_instance(mapping => $mapping, results => $result->{$oid_table_vs}, instance => $instance); + + $self->{vs}->{$instance} = { display => $data->{vsName}, + status => $data->{vsStatus} }; + } + } + + +The following example show 4 new attributes: + +* *closure_custom_calc*: should be used to have a simple name (without '_absolute' or '_per_second'). Or to do some more complex calculation. +* *closure_custom_output*: should be used to have a more complex output (An example: want to display the total, free and used value at the same time). +* *closure_custom_perfdata*: should be used to manage yourself the perfdata. +* *closure_custom_threshold_check*: should be used to manage yourself the threshold check. + + +-------------- +Class hardware +-------------- + +TODO \ No newline at end of file diff --git a/centreon-plugins/docs/fr/developer/guide.rst b/centreon-plugins/docs/fr/developer/guide.rst index f38b5bfaf..b60071ab1 100644 --- a/centreon-plugins/docs/fr/developer/guide.rst +++ b/centreon-plugins/docs/fr/developer/guide.rst @@ -1468,40 +1468,25 @@ Ensuite, éditer le fichier **plugin.pm** et ajouter les lignes suivantes : .. code-block:: perl - ################################################################################ - # Copyright 2005-2015 MERETHIS - # Centreon is developped by : Julien Mathis and Romain Le Merlus under - # GPL Licence 2.0. # - # This program is free software; you can redistribute it and/or modify it under - # the terms of the GNU General Public License as published by the Free Software - # Foundation ; either version 2 of the License. + # Copyright 2015 Centreon (http://www.centreon.com/) # - # This program is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. See the GNU General Public License for more details. + # Centreon is a full-fledged industry-strength solution that meets + # the needs in IT infrastructure and application monitoring for + # service performance. # - # You should have received a copy of the GNU General Public License along with - # this program; if not, see . + # 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 # - # Linking this program statically or dynamically with other modules is making a - # combined work based on this program. Thus, the terms and conditions of the GNU - # General Public License cover the whole combination. + # http://www.apache.org/licenses/LICENSE-2.0 # - # As a special exception, the copyright holders of this program give MERETHIS - # permission to link this program with independent modules to produce an executable, - # regardless of the license terms of these independent modules, and to copy and - # distribute the resulting executable under terms of MERETHIS choice, provided that - # MERETHIS also meet, for each linked independent module, the terms and conditions - # of the license of that module. An independent module is a module which is not - # derived from this program. If you modify this program, you may extend this - # exception to your version of the program, but you are not obliged to do so. If you - # do not wish to do so, delete this exception statement from your version. + # 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. # - # For more information : contact@centreon.com - # Authors : your name - # - #################################################################################### # Chemin vers le plugin package apps::pfsense::snmp::plugin; @@ -1573,40 +1558,25 @@ Editer le fichier **memorydroppedpackets.pm** et ajouter les lignes suivantes : .. code-block:: perl - ################################################################################ - # Copyright 2005-2015 MERETHIS - # Centreon is developped by : Julien Mathis and Romain Le Merlus under - # GPL Licence 2.0. # - # This program is free software; you can redistribute it and/or modify it under - # the terms of the GNU General Public License as published by the Free Software - # Foundation ; either version 2 of the License. + # Copyright 2015 Centreon (http://www.centreon.com/) # - # This program is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. See the GNU General Public License for more details. + # Centreon is a full-fledged industry-strength solution that meets + # the needs in IT infrastructure and application monitoring for + # service performance. # - # You should have received a copy of the GNU General Public License along with - # this program; if not, see . + # 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 # - # Linking this program statically or dynamically with other modules is making a - # combined work based on this program. Thus, the terms and conditions of the GNU - # General Public License cover the whole combination. + # http://www.apache.org/licenses/LICENSE-2.0 # - # As a special exception, the copyright holders of this program give MERETHIS - # permission to link this program with independent modules to produce an executable, - # regardless of the license terms of these independent modules, and to copy and - # distribute the resulting executable under terms of MERETHIS choice, provided that - # MERETHIS also meet, for each linked independent module, the terms and conditions - # of the license of that module. An independent module is a module which is not - # derived from this program. If you modify this program, you may extend this - # exception to your version of the program, but you are not obliged to do so. If you - # do not wish to do so, delete this exception statement from your version. + # 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. # - # For more information : contact@centreon.com - # Authors : your name - # - #################################################################################### # Chemin vers le mode package apps::pfsense::snmp::mode::memorydroppedpackets; From c00ec7d4a44be1050542a69aa13d0bdf46d4aedd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 14:40:34 +0100 Subject: [PATCH 039/346] + remove dead plugin.pm --- centreon-plugins/hardware/pdu/apc/plugin.pm | 53 --------------------- 1 file changed, 53 deletions(-) delete mode 100644 centreon-plugins/hardware/pdu/apc/plugin.pm diff --git a/centreon-plugins/hardware/pdu/apc/plugin.pm b/centreon-plugins/hardware/pdu/apc/plugin.pm deleted file mode 100644 index abf5c80ad..000000000 --- a/centreon-plugins/hardware/pdu/apc/plugin.pm +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright 2015 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 hardware::pdu::apc::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; - # $options->{options} = options object - - $self->{version} = '0.1'; - %{$self->{modes}} = ( - 'load' => 'hardware::pdu::apc::mode::load', - 'psu' => 'hardware::pdu::apc::mode::psu', - 'outlet' => 'hardware::pdu::apc::mode::outlet', - 'temperature' => 'hardware::pdu::apc::mode::temperature', - 'humidity' => 'hardware::pdu::apc::mode::humidity', - ); - - return $self; -} - -1; - -__END__ - -=head1 PLUGIN DESCRIPTION - -Check APC PDU in SNMP (PowerNet-MIB). - -=cut From ef9e11780f061b8d7a31a236e3866e00cc43d766 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 15:04:07 +0100 Subject: [PATCH 040/346] + update doc --- centreon-plugins/docs/en/user/guide.rst | 34 +++++++++++++++++++++---- centreon-plugins/docs/fr/user/guide.rst | 30 +++++++++++++++++++--- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/docs/en/user/guide.rst b/centreon-plugins/docs/en/user/guide.rst index edbcdadf1..d975b00ce 100644 --- a/centreon-plugins/docs/en/user/guide.rst +++ b/centreon-plugins/docs/en/user/guide.rst @@ -140,7 +140,7 @@ Headers of the table mean: * Experimental: The check is still in development. +-------------+--------------------+----------------------------+--------------------------------------------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ -| | | Transport | Protocol | | | | +| | | Transport | Protocol | | | | | Category | Check +-------+----------+---------+--------+--------+-------+-------+----------+ Experimental | Comment | Perl dependencies | | | | SSH | TELNET | WSMAN | SNMP | HTTP | WMI | JMX | custom | | | | +=============+====================+=======+==========+=========+========+========+=======+=======+==========+==============+=============================================================+========================================================================+ @@ -188,7 +188,7 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Varnish | * | | | | | | | * | | Use varnish commands. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ -| | VMWare | | | | | | | | * | | Need 'centreon_esxd' connector from Merethis. | | +| | VMWare | | | | | | | | * | | Need 'centreon-vmware' connector from Centreon. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Pfsense | | | | * | | | | | | | | +-------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ @@ -224,9 +224,11 @@ Headers of the table mean: +-------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Informix | | | | | | | | * | | | DBI, DBD::Informix | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ -| | MS SQL | | | | | | | | * | | | DBI, DBD::Sybase | +| | Firebird | | | | | | | | * | | | DBI, DBD::Firebird | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ -| Database | MySQL | | | | | | | | * | | | DBI, DBD::mysql | +| | MS SQL | | | | | | | | * | | | DBI, DBD::Sybase | +| Database +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | MySQL | | | | | | | | * | | | DBI, DBD::mysql | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Oracle | | | | | | | | * | | | DBI, DBD::oracle, DateTime | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ @@ -234,12 +236,16 @@ Headers of the table mean: +-------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | ATS Apc | | | | * | | | | | * | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ -| | PDU Apc | | | | * | | | | | * | | | +| | PDU Apc | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | PDU Eaton | | | | * | | | | | * | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | PDU Raritan | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Standard Printers | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | Hwgste | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Sensorip | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Sensormetrix Em01 | | | | | * | | | | | | LWP::UserAgent, URI, HTTP::Cookies | @@ -266,12 +272,16 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Sun hardware | * | * | | * | | | | * | | Can monitor many sun hardware. | Net::Telnet, SNMP | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | UPS APC | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Mge | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Standard | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Powerware | | | | * | | | | | | | | +-------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | 3com | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Alcatel Omniswitch | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Arkoon | | | | * | | | | | | | | @@ -306,10 +316,14 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | HP Procurve | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | HP Virtual Connect | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Juniper | | | | * | | | | | | Can monitor 'SSG', 'SA', 'SRX', 'MAG', 'EX', 'Ggsn'. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Netasq | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | Oneaccess | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Palo Alto | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Radware Alteon | | | | * | | | | | * | | | @@ -348,6 +362,8 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Dell TL2000 | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | Dell ML6000 | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Celerra | * | | | | | | | * | | Use appliance commands. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Clariion | | | | | | | | * | | Need 'navisphere' command. | | @@ -356,6 +372,12 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Recoverypoint | * | | | | | | | * | | Use appliance commands. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | EMC Vplex | | | | | | * | | | | Use the JSON API. | JSON, LWP::UserAgent, URI, HTTP::Cookies | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | EMC Xtremio | | | | | | * | | | | Use the JSON API. | JSON, LWP::UserAgent, URI, HTTP::Cookies | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | Fujitsu Eternus DX | * | | | | | | | * | | Use appliance commands. | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | HP 3par | * | | | | | | | * | | Use appliance commands. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | HP Lefthand | | | | * | | | | | | | | @@ -376,6 +398,8 @@ Headers of the table mean: | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Netapp | | | | * | | | | | | | DateTime | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ +| | Nimble | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Panzura | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+-------------------------------------------------------------+------------------------------------------------------------------------+ | | Qnap | | | | * | | | | | | | | diff --git a/centreon-plugins/docs/fr/user/guide.rst b/centreon-plugins/docs/fr/user/guide.rst index 826096647..287b67cf0 100644 --- a/centreon-plugins/docs/fr/user/guide.rst +++ b/centreon-plugins/docs/fr/user/guide.rst @@ -140,7 +140,7 @@ Les en-têtes du tableau signifient : * Expérimental : Le point de contrôle est en cours de développement. +----------------+--------------------+----------------------------+--------------------------------------------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ -| | | Transport | Protocole | | | | +| | | Transport | Protocole | | | | | Categorie | Contrôle +-------+----------+---------+--------+--------+-------+-------+----------+ Experimental | Comment | Dépendances Perl | | | | SSH | TELNET | WSMAN | SNMP | HTTP | WMI | JMX | custom | | | | +================+====================+=======+==========+=========+========+========+=======+=======+==========+==============+===============================================================+========================================================================+ @@ -188,7 +188,7 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Varnish | * | | | | | | | * | | Utilise les commandes varnish. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ -| | VMWare | | | | | | | | * | | Requiert le connecteur 'centreon_esxd' de Merethis. | | +| | VMWare | | | | | | | | * | | Requiert le connecteur 'centreon-vmware' de Centreon. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Pfsense | | | | * | | | | | | | | +----------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ @@ -224,6 +224,8 @@ Les en-têtes du tableau signifient : +----------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Informix | | | | | | | | * | | | DBI, DBD::Informix | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Firebird | | | | | | | | * | | | DBI, DBD::Firebird | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | MS SQL | | | | | | | | * | | | DBI, DBD::Sybase | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | Bases de | MySQL | | | | | | | | * | | | DBI, DBD::mysql | @@ -234,12 +236,16 @@ Les en-têtes du tableau signifient : +----------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | ATS Apc | | | | * | | | | | * | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ -| | PDU Apc | | | | * | | | | | * | | | +| | PDU Apc | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | PDU Eaton | | | | * | | | | | * | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | PDU Raritan | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Standard Printers | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Hwgste | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Sensorip | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Sensormetrix Em01 | | | | | * | | | | | | LWP::UserAgent, URI, HTTP::Cookies | @@ -266,12 +272,16 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Sun hardware | * | * | | * | | | | * | | Peut superviser plusieurs types de matériel Sun. | Net::Telnet, SNMP | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | UPS APC | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Mge | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Standard | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | UPS Powerware | | | | * | | | | | | | | +----------------+--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | 3com | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Alcatel Omniswitch | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Arkoon | | | | * | | | | | | | | @@ -306,12 +316,16 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | HP Procurve | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | HP Virtual Connect | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Juniper | | | | * | | | | | | Peut superviser: 'SSG', 'SA', 'SRX', 'MAG', 'EX', 'Ggsn'. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Palo Alto | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Netasq | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Oneaccess | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Radware Alteon | | | | * | | | | | * | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Redback | | | | * | | | | | | | | @@ -348,6 +362,8 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Dell TL2000 | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Dell ML6000 | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Celerra | * | | | | | | | * | | Utilise les commandes de l'appliance. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Clariion | | | | | | | | * | | Requiert la commande 'navisphere'. | | @@ -356,6 +372,12 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | EMC Recoverypoint | * | | | | | | | * | | Utilise les commandes de l'appliance. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | EMC Vplex | | | | | | * | | | | Utilise l'API JSON. | JSON, LWP::UserAgent, URI, HTTP::Cookies | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | EMC Xtremio | | | | | | * | | | | Utilise l'API JSON. | JSON, LWP::UserAgent, URI, HTTP::Cookies | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Fujitsu Eternus DX | * | | | | | | | * | | Utilise les commandes de l'appliance. | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | HP 3par | * | | | | | | | * | | Utilise les commandes de l'appliance. | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | HP Lefthand | | | | * | | | | | | | | @@ -376,6 +398,8 @@ Les en-têtes du tableau signifient : | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Netapp | | | | * | | | | | | | DateTime | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ +| | Nimble | | | | * | | | | | | | | +| +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Panzura | | | | * | | | | | | | | | +--------------------+-------+----------+---------+--------+--------+-------+-------+----------+--------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | | Qnap | | | | * | | | | | | | | From 95b22801778b858eaa80e54696ce5c8acf4d1fe0 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 15:24:34 +0100 Subject: [PATCH 041/346] + Fix perfdatas raising from exchange 2010 mode get-queue --- .../common/powershell/exchange/2010/queues.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm index 6729980a8..ab7a2badc 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm @@ -63,6 +63,8 @@ sub check { my $checked = 0; $self->{output}->output_add(long_msg => $options{stdout}); + + $self->{perfdatas_queues} = {}; while ($options{stdout} =~ /\[identity=(.*?)\]\[deliverytype=(.*?)\]\[status=(.*?)\]\[isvalid=(.*?)\]\[messagecount=(.*?)\]\[\[error=(.*?)\]\]/msg) { $self->{data} = {}; ($self->{data}->{identity}, $self->{data}->{deliverytype}, $self->{data}->{status}, $self->{data}->{isvalid}, $self->{data}->{messagecount}, $self->{data}->{error}) = @@ -94,12 +96,21 @@ sub check { } if ($self->{data}->{messagecount} =~ /^(\d+)/) { - $self->{output}->perfdata_add(label => 'queue_length_' . $self->{data}->{identity}, - value => $1, - min => 0); + my $num = $1; + my $identity = $self->{data}->{identity}; + + $identity = $1 if ($self->{data}->{identity} =~ /^(.*\\)[0-9]+$/); + $self->{perfdatas_queues}->{$identity} = 0 if (!defined($self->{perfdatas_queues}->{$identity})); + $self->{perfdatas_queues}->{$identity} += $num; } } + foreach (keys %{$self->{perfdatas_queues}}) { + $self->{output}->perfdata_add(label => 'queue_length_' . $_, + value => $self->{perfdatas_queues}->{$_}, + min => 0); + } + if ($checked == 0) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => 'Cannot find informations'); From 89c073b11703301742133ff93f35335d3aaa1a0a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 16:09:29 +0100 Subject: [PATCH 042/346] + Update datadomain plugin (WIP) --- .../emc/DataDomain/mode/components/battery.pm | 10 +- .../emc/DataDomain/mode/components/disk.pm | 18 +- .../emc/DataDomain/mode/components/fan.pm | 10 +- .../emc/DataDomain/mode/components/psu.pm | 10 +- .../DataDomain/mode/components/temperature.pm | 10 +- .../storage/emc/DataDomain/mode/filesystem.pm | 147 ++------ .../storage/emc/DataDomain/mode/hardware.pm | 333 ++++-------------- 7 files changed, 150 insertions(+), 388 deletions(-) diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm index cb56fdedb..df53f1060 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm @@ -28,12 +28,18 @@ my %map_battery_status = (); my ($oid_nvramBatteryStatus, $oid_nvramBatteryCharge); my $oid_nvramBatteryEntry = '.1.3.6.1.4.1.19746.1.2.3.1.1'; +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_nvramBatteryEntry }; +} + sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking nvram batteries"); $self->{components}->{battery} = {name => 'nvram batteries', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'battery')); + return if ($self->check_filter(section => 'battery')); if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { $oid_nvramBatteryStatus = '.1.3.6.1.4.1.19746.1.2.3.1.1.3'; @@ -53,7 +59,7 @@ sub check { $map_battery_status{$self->{results}->{$oid_nvramBatteryEntry}->{$oid}} : 'unknown'; my $batt_value = $self->{results}->{$oid_nvramBatteryEntry}->{$oid_nvramBatteryCharge . '.' . $instance}; - next if ($self->check_exclude(section => 'battery', instance => $instance)); + next if ($self->check_filter(section => 'battery', instance => $instance)); next if ($batt_status =~ /disabled/i && $self->absent_problem(section => 'battery', instance => $instance)); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm index 668c8b179..02d8a330d 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm @@ -35,19 +35,23 @@ my %map_disk_status = ( 6 => 'available', # since OS 5.4 ); -sub check { +sub load { my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking disks"); - $self->{components}->{disk} = {name => 'disks', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'disk')); - my $oid_diskPropState; if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { $oid_diskPropState = '.1.3.6.1.4.1.19746.1.6.1.1.1.8'; } else { $oid_diskPropState = '.1.3.6.1.4.1.19746.1.6.1.1.1.7'; } + push @{$self->{request}}, { oid => $oid_diskPropState }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking disks"); + $self->{components}->{disk} = {name => 'disks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'disk')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_diskPropState}})) { $oid =~ /^$oid_diskPropState\.(.*)$/; @@ -55,7 +59,7 @@ sub check { my $disk_status = defined($map_disk_status{$self->{results}->{$oid_diskPropState}->{$oid}}) ? $map_disk_status{$self->{results}->{$oid_diskPropState}->{$oid}} : 'unknown'; - next if ($self->check_exclude(section => 'disk', instance => $instance)); + next if ($self->check_filter(section => 'disk', instance => $instance)); next if ($disk_status =~ /absent/i && $self->absent_problem(section => 'disk', instance => $instance)); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm index 63f4b207e..afa602edc 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm @@ -39,12 +39,18 @@ my %level_map = ( my ($oid_fanDescription, $oid_fanLevel, $oid_fanStatus); my $oid_fanPropertiesEntry = '.1.3.6.1.4.1.19746.1.1.3.1.1.1'; +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_fanPropertiesEntry }; +} + sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { $oid_fanDescription = '.1.3.6.1.4.1.19746.1.1.3.1.1.1.4'; @@ -64,7 +70,7 @@ sub check { $map_fan_status{$self->{results}->{$oid_fanPropertiesEntry}->{$oid}} : 'unknown'; my $fan_level = $self->{results}->{$oid_fanPropertiesEntry}->{$oid_fanLevel . '.' . $instance}; - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); next if ($fan_status =~ /notfound/i && $self->absent_problem(section => 'fan', instance => $instance)); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm index e93b5eb0b..84a8fcd08 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm @@ -27,12 +27,18 @@ my %map_psu_status = (); my ($oid_powerModuleDescription, $oid_powerModuleStatus); my $oid_powerModuleEntry = '.1.3.6.1.4.1.19746.1.1.1.1.1.1'; +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_powerModuleEntry }; +} + sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { $oid_powerModuleDescription = '.1.3.6.1.4.1.19746.1.1.1.1.1.1.3'; @@ -53,7 +59,7 @@ sub check { my $psu_status = defined($map_psu_status{$self->{results}->{$oid_powerModuleEntry}->{$oid}}) ? $map_psu_status{$self->{results}->{$oid_powerModuleEntry}->{$oid}} : 'unknown'; - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); next if ($psu_status =~ /absent/i && $self->absent_problem(section => 'psu', instance => $instance)); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm index 98d7e8c70..182e4517a 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm @@ -28,12 +28,18 @@ my %map_temp_status = (); my ($oid_tempSensorDescription, $oid_tempSensorCurrentValue, $oid_tempSensorStatus); my $oid_temperatureSensorEntry = '.1.3.6.1.4.1.19746.1.1.2.1.1.1'; +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_temperatureSensorEntry }; +} + sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { $oid_tempSensorDescription = '.1.3.6.1.4.1.19746.1.1.2.1.1.1.4'; @@ -57,7 +63,7 @@ sub check { $map_temp_status{$self->{results}->{$oid_temperatureSensorEntry}->{$oid}} : 'unknown'; my $temp_value = $self->{results}->{$oid_temperatureSensorEntry}->{$oid_tempSensorCurrentValue . '.' . $instance}; - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); next if ($temp_status =~ /absent|notfound/i && $self->absent_problem(section => 'temperature', instance => $instance)); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm index a52f80d39..f2e97a929 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm @@ -20,35 +20,40 @@ package storage::emc::DataDomain::mode::filesystem; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; use storage::emc::DataDomain::lib::functions; -use centreon::plugins::values; -my $oid_fileSystemSpaceEntry = '.1.3.6.1.4.1.19746.1.3.2.1.1'; -my $oid_sysDescr = '.1.3.6.1.2.1.1.1'; # 'Data Domain OS 5.4.1.1-411752' -my ($oid_fileSystemResourceName, $oid_fileSystemSpaceUsed, $oid_fileSystemSpaceAvail); +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'fs', type => 1, cb_prefix_output => 'prefix_fs_output', message_multiple => 'All filesystems are ok.' }, + ]; + + $self->{maps_counters}->{ap} = [ + { label => 'usage', set => { + key_values => [ { name => 'free' }, { name => 'used' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_used_calc'), + closure_custom_output => $self->can('custom_used_output'), + threshold_use => 'used_prct', output_error_template => '%s', + perfdatas => [ + { value => 'used', label => 'used', cast_int => 1, + unit => 'B', min => 0, max => 'total', threshold_total => 'total', + label_extra_instance => 1, instance_use => 'display' }, + ], + } + }, + ]; +} -my $maps_counters = { - usage => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ - { name => 'free' }, { name => 'used' }, { name => 'display' }, - ], - closure_custom_calc => \&custom_used_calc, - closure_custom_output => \&custom_used_output, - threshold_use => 'used_prct', - output_error_template => '%s', - perfdatas => [ - { value => 'used', label => 'used', cast_int => 1, - unit => 'B', min => 0, max => 'total', threshold_total => 'total', - label_extra_instance => 1, instance_use => 'display' }, - ], - } - }, -}; +sub prefix_fs_output { + my ($self, %options) = @_; + + return "Filesystem '" . $options{instance_value}->{display} . "' "; +} sub custom_used_calc { my ($self, %options) = @_; @@ -87,95 +92,14 @@ sub new { "filesystem:s" => { name => 'filesystem' }, "regexp" => { name => 'use_regexp' }, "regexp-isensitive" => { name => 'use_regexpi' }, - }); - - $self->{filesystem_id_selected} = {}; - - foreach (keys %{$maps_counters}) { - $options{options}->add_options(arguments => { - 'warning-' . $_ . ':s' => { name => 'warning-' . $_ }, - 'critical-' . $_ . ':s' => { name => 'critical-' . $_ }, - }); - my $class = $maps_counters->{$_}->{class}; - $maps_counters->{$_}->{obj} = $class->new(statefile => $self->{statefile_value}, - output => $self->{output}, perfdata => $self->{perfdata}, - label => $_); - $maps_counters->{$_}->{obj}->set(%{$maps_counters->{$_}->{set}}); - } + }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - foreach (keys %{$maps_counters}) { - $maps_counters->{$_}->{obj}->init(option_results => $self->{option_results}); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - $self->manage_selection(); - - my $multiple = 1; - if (scalar(keys %{$self->{filesystem_id_selected}}) == 1) { - $multiple = 0; - } - - if ($multiple == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'All filesystems are ok.'); - } - - foreach my $id (sort keys %{$self->{filesystem_id_selected}}) { - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits; - foreach (sort keys %{$maps_counters}) { - $maps_counters->{$_}->{obj}->set(instance => $id); - - my ($value_check) = $maps_counters->{$_}->{obj}->execute(values => $self->{filesystem_id_selected}->{$id}); - - if ($value_check != 0) { - $long_msg .= $long_msg_append . $maps_counters->{$_}->{obj}->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $maps_counters->{$_}->{obj}->threshold_check(); - push @exits, $exit2; - - my $output = $maps_counters->{$_}->{obj}->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $maps_counters->{$_}->{obj}->perfdata(extra_instance => $multiple); - } - - $self->{output}->output_add(long_msg => "Filesystem '" . $self->{filesystem_id_selected}->{$id}->{display} . "' $long_msg"); - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "Filesystem '" . $self->{filesystem_id_selected}->{$id}->{display} . "' $short_msg" - ); - } - - if ($multiple == 0) { - $self->{output}->output_add(short_msg => "Filesystem '" . $self->{filesystem_id_selected}->{$id}->{display} . "' $long_msg"); - } - } - - $self->{output}->display(); - $self->{output}->exit(); -} +my $oid_fileSystemSpaceEntry = '.1.3.6.1.4.1.19746.1.3.2.1.1'; +my $oid_sysDescr = '.1.3.6.1.2.1.1.1'; # 'Data Domain OS 5.4.1.1-411752' +my ($oid_fileSystemResourceName, $oid_fileSystemSpaceUsed, $oid_fileSystemSpaceAvail); sub add_result { my ($self, %options) = @_; @@ -189,11 +113,11 @@ sub add_result { sub manage_selection { my ($self, %options) = @_; - $self->{results} = $self->{snmp}->get_multiple_table(oids => [ + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_sysDescr }, { oid => $oid_fileSystemSpaceEntry }, - ], - , nothing_quit => 1); + ], + nothing_quit => 1); if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results}->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => 'Cannot get DataDomain OS version.'); @@ -265,7 +189,6 @@ sub disco_show { } } - 1; __END__ diff --git a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm index f7f7114e6..cd0f8b77b 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm @@ -20,61 +20,70 @@ package storage::emc::DataDomain::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; use storage::emc::DataDomain::lib::functions; -use storage::emc::DataDomain::mode::components::temperature; -use storage::emc::DataDomain::mode::components::psu; -use storage::emc::DataDomain::mode::components::fan; -use storage::emc::DataDomain::mode::components::disk; -use storage::emc::DataDomain::mode::components::battery; -my $oid_sysDescr = '.1.3.6.1.2.1.1.1'; # 'Data Domain OS 5.4.1.1-411752' -my $oid_powerModuleEntry = '.1.3.6.1.4.1.19746.1.1.1.1.1.1'; -my $oid_temperatureSensorEntry = '.1.3.6.1.4.1.19746.1.1.2.1.1.1'; -my $oid_fanPropertiesEntry = '.1.3.6.1.4.1.19746.1.1.3.1.1.1'; -my $oid_nvramBatteryEntry = '.1.3.6.1.4.1.19746.1.2.3.1.1'; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|temperature|psu|disk|battery)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(battery|temperature)$'; + + $self->{cb_hook1} = 'get_version'; # before the loads + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['notfound', 'OK'], + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ], + temperature => [ + ['failed', 'CRITICAL'], + ['ok', 'OK'], + ['notfound', 'OK'], + ['absent', 'OK'], + ['overheatWarning', 'WARNING'], + ['overheatCritical', 'CRITICAL'], + ], + psu => [ + ['absent', 'OK'], + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ['faulty', 'WARNING'], + ['acnone', 'WARNING'], + ['unknown', 'UNKNOWN'], + ], + disk => [ + ['ok', 'OK'], + ['spare', 'OK'], + ['available', 'OK'], + ['unknown', 'UNKNOWN'], + ['absent', 'OK'], + ['failed', 'CRITICAL'], + ], + battery => [ + ['ok', 'OK'], + ['disabled', 'OK'], + ['discharged', 'WARNING'], + ['softdisabled', 'OK'], + ['UNKNOWN', 'UNKNOWN'], + ], + }; + + $self->{components_path} = 'storage::emc::DataDomain::mode::components'; + $self->{components_module} = ['fan', 'temperature', 'psu', 'disk', 'battery']; +} -my $thresholds = { - fan => [ - ['notfound', 'OK'], - ['ok', 'OK'], - ['failed', 'CRITICAL'], - ], - temperature => [ - ['failed', 'CRITICAL'], - ['ok', 'OK'], - ['notfound', 'OK'], - ['absent', 'OK'], - ['overheatWarning', 'WARNING'], - ['overheatCritical', 'CRITICAL'], - ], - psu => [ - ['absent', 'OK'], - ['ok', 'OK'], - ['failed', 'CRITICAL'], - ['faulty', 'WARNING'], - ['acnone', 'WARNING'], - ['unknown', 'UNKNOWN'], - ], - disk => [ - ['ok', 'OK'], - ['spare', 'OK'], - ['available', 'OK'], - ['unknown', 'UNKNOWN'], - ['absent', 'OK'], - ['failed', 'CRITICAL'], - ], - battery => [ - ['ok', 'OK'], - ['disabled', 'OK'], - ['discharged', 'WARNING'], - ['softdisabled', 'OK'], - ['UNKNOWN', 'UNKNOWN'], - ], -}; +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -83,223 +92,25 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => 'all' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, + { }); - $self->{components} = {}; - $self->{no_components} = undef; return $self; } -sub check_options { +sub get_version { my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(battery|temperature)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: battery or temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - $self->{results_leef} = $self->{snmp}->get_leef(oids => [ $oid_sysDescr . '.0' ]); - if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results_leef}->{$oid_sysDescr . '.0'}))) { + my $oid_sysDescr = '.1.3.6.1.2.1.1.1.0'; # 'Data Domain OS 5.4.1.1-411752' + my $result = $self->{snmp}->get_leef(oids => [ $oid_sysDescr ]); + if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $result->{$oid_sysDescr}))) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => 'Cannot get DataDomain OS version.'); $self->{output}->display(); $self->{output}->exit(); } - my $oid_diskPropState; - if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.x')) { - $oid_diskPropState = '.1.3.6.1.4.1.19746.1.6.1.1.1.8'; - } else { - $oid_diskPropState = '.1.3.6.1.4.1.19746.1.6.1.1.1.7'; - } - - $self->{results} = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oid_powerModuleEntry }, - { oid => $oid_temperatureSensorEntry }, - { oid => $oid_fanPropertiesEntry }, - { oid => $oid_diskPropState }, - { oid => $oid_nvramBatteryEntry }, - ]); - - $self->{output}->output_add(long_msg => 'DataDomain OS version: ' . $self->{os_version} . '.'); - if ($self->{option_results}->{component} eq 'all') { - storage::emc::DataDomain::mode::components::psu::check($self); - storage::emc::DataDomain::mode::components::fan::check($self); - storage::emc::DataDomain::mode::components::disk::check($self); - storage::emc::DataDomain::mode::components::temperature::check($self); - storage::emc::DataDomain::mode::components::battery::check($self); - } elsif ($self->{option_results}->{component} eq 'fan') { - storage::emc::DataDomain::mode::components::fan::check($self); - } elsif ($self->{option_results}->{component} eq 'psu') { - storage::emc::DataDomain::mode::components::psu::check($self); - } elsif ($self->{option_results}->{component} eq 'disk') { - storage::emc::DataDomain::mode::components::disk::check($self); - } elsif ($self->{option_results}->{component} eq 'temperature') { - storage::emc::DataDomain::mode::components::temperature::check($self); - } elsif ($self->{option_results}->{component} eq 'battery') { - storage::emc::DataDomain::mode::components::battery::check($self); - } else { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; } 1; @@ -314,18 +125,18 @@ Check components (Fans, Power Supplies, Temperatures, Disks, Nvram Batteries). =item B<--component> -Which component to check (Default: 'all'). +Which component to check (Default: '.*'). Can be: 'psu', 'fan', 'disk', 'temperature', 'battery'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='psu#3.3#' +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=psu,3.3 =item B<--absent-problem> -Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=fan#1.1# +Return an error if an entity is not 'present' (default is skipping) +Can be specific or global: --absent-problem=psu,1 =item B<--no-component> @@ -334,14 +145,14 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='fan,CRITICAL,^(?!(ok)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: regexp,treshold) -Example: --warning='.*,20' +Set warning threshold for temperatures (syntax: type,regexp,treshold) +Example: --warning='temperature,.*,20' =item B<--critical> From cfd4d84d50febd5a94eca98529c74b7ed8df403b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 16:13:40 +0100 Subject: [PATCH 043/346] + Fix datadomain modes --- .../storage/emc/DataDomain/mode/filesystem.pm | 16 ++++++++-------- .../storage/emc/DataDomain/mode/hardware.pm | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm index f2e97a929..521e25d1b 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm @@ -33,7 +33,7 @@ sub set_counters { { name => 'fs', type => 1, cb_prefix_output => 'prefix_fs_output', message_multiple => 'All filesystems are ok.' }, ]; - $self->{maps_counters}->{ap} = [ + $self->{maps_counters}->{fs} = [ { label => 'usage', set => { key_values => [ { name => 'free' }, { name => 'used' }, { name => 'display' } ], closure_custom_calc => $self->can('custom_used_calc'), @@ -104,10 +104,10 @@ my ($oid_fileSystemResourceName, $oid_fileSystemSpaceUsed, $oid_fileSystemSpaceA sub add_result { my ($self, %options) = @_; - $self->{filesystem_id_selected}->{$options{instance}} = {}; - $self->{filesystem_id_selected}->{$options{instance}}->{display} = $self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemResourceName . '.' . $options{instance}}; - $self->{filesystem_id_selected}->{$options{instance}}->{free} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceAvail . '.' . $options{instance}} * 1024 * 1024 * 1024); - $self->{filesystem_id_selected}->{$options{instance}}->{used} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceUsed . '.' . $options{instance}} * 1024 * 1024 * 1024); + $self->{fs}->{$options{instance}} = {}; + $self->{fs}->{$options{instance}}->{display} = $self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemResourceName . '.' . $options{instance}}; + $self->{fs}->{$options{instance}}->{free} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceAvail . '.' . $options{instance}} * 1024 * 1024 * 1024); + $self->{fs}->{$options{instance}}->{used} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceUsed . '.' . $options{instance}} * 1024 * 1024 * 1024); } sub manage_selection { @@ -161,7 +161,7 @@ sub manage_selection { } } - if (scalar(keys %{$self->{filesystem_id_selected}}) <= 0 && !defined($options{disco})) { + if (scalar(keys %{$self->{fs}}) <= 0 && !defined($options{disco})) { if (defined($self->{option_results}->{device})) { $self->{output}->add_option_msg(short_msg => "No filesystem found '" . $self->{option_results}->{filesystem} . "'."); } else { @@ -183,8 +183,8 @@ sub disco_show { # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); - foreach (sort keys %{$self->{filesystem_id_selected}}) { - $self->{output}->add_disco_entry(name => $self->{filesystem_id_selected}->{$_}->{display}, + foreach (sort keys %{$self->{fs}}) { + $self->{output}->add_disco_entry(name => $self->{fs}->{$_}->{display}, deviceid => $_); } } diff --git a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm index cd0f8b77b..99261289f 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm @@ -102,7 +102,7 @@ sub get_version { my ($self, %options) = @_; my $oid_sysDescr = '.1.3.6.1.2.1.1.1.0'; # 'Data Domain OS 5.4.1.1-411752' - my $result = $self->{snmp}->get_leef(oids => [ $oid_sysDescr ]); + my $result = $options{snmp}->get_leef(oids => [ $oid_sysDescr ]); if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $result->{$oid_sysDescr}))) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => 'Cannot get DataDomain OS version.'); From fe3969d263e3a0d86c6b86d8ab393f42e92b56b7 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 17:16:28 +0100 Subject: [PATCH 044/346] + add replication for datadomain --- .../emc/DataDomain/mode/replication.pm | 236 ++++++++++++++++++ .../storage/emc/DataDomain/plugin.pm | 1 + 2 files changed, 237 insertions(+) create mode 100644 centreon-plugins/storage/emc/DataDomain/mode/replication.pm diff --git a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm new file mode 100644 index 000000000..48a8b70b8 --- /dev/null +++ b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm @@ -0,0 +1,236 @@ +# +# Copyright 2015 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::emc::DataDomain::mode::replication; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use storage::emc::DataDomain::lib::functions; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'repl', type => 1, cb_prefix_output => 'prefix_repl_output', message_multiple => 'All replications are ok' } }, + ]; + + $self->{maps_counters}->{global} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' } ], + output_template => "status is '%s'", + output_use => 'state', + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'offset', set => { + key_values => [ { name => 'offset' }, { name => 'display' } ], + output_template => 'last time peer sync : %s seconds ago', + perfdatas => [ + { label => 'offset', value => 'offset_absolute', template => '%s', + label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_repl_output { + my ($self, %options) = @_; + + if ($self->{multiple} == 1) { + return "Replication '" . $options{instance_value}->{display} . "' "; + } + return "Replication "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "unknown-status:s" => { name => 'unknown_status', default => '' }, + "warning-status:s" => { name => 'warning_status', default => '%{state} =~ /initializing|recovering/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /disabledNeedsResync|uninitialized/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my $oid_sysDescr = '.1.3.6.1.2.1.1.1'; # 'Data Domain OS 5.4.1.1-411752' +my $oid_replicationInfoEntry = '.1.3.6.1.4.1.19746.1.8.1.1.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{global} = {}; + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_sysDescr }, + { oid => $oid_replicationInfoEntry }, + ], + nothing_quit => 1); + if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results}->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => 'Cannot get DataDomain OS version.'); + $self->{output}->display(); + $self->{output}->exit(); + } + + my ($oid_replSource, $oid_replDestination, $oid_replState); + my %map_state = ( + 1 => 'enabled', 2 => 'disabled', 3 => 'disabledNeedsResync', + ); + if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.4')) { + %map_state = ( + 1 => 'initializing', 2 => 'normal', 3 => 'recovering', 4 => 'uninitialized', + ); + $oid_replSource = '.1.3.6.1.4.1.19746.1.8.1.1.1.7'; + $oid_replDestination = '.1.3.6.1.4.1.19746.1.8.1.1.1.8'; + $oid_replState = '.1.3.6.1.4.1.19746.1.8.1.1.1.3'; + } else if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.0') { + $oid_replSource = '.1.3.6.1.4.1.19746.1.8.1.1.1.7'; + $oid_replDestination = '.1.3.6.1.4.1.19746.1.8.1.1.1.8'; + $oid_replState = '.1.3.6.1.4.1.19746.1.8.1.1.1.3'; + } else { + $oid_replSource = '.1.3.6.1.4.1.19746.1.8.1.1.1.6'; + $oid_replDestination = '.1.3.6.1.4.1.19746.1.8.1.1.1.7'; + $oid_replState = '.1.3.6.1.4.1.19746.1.8.1.1.1.2'; + } + + my $mapping = { + replState => { oid => $oid_replState, map => \%map_state }, + replSource => { oid => $oid_replSource }, + replDestination => { oid => $oid_replDestination }, + replSyncedAsOfTime => { oid => '.1.3.6.1.4.1.19746.1.8.1.1.1.14' }, + }; + + foreach my $oid (keys %{$self->{results}->{$oid_replicationInfoEntry}}) { + next if ($oid !~ /^$mapping->{replState}->{oid}\.(.*)$/; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_replicationInfoEntry}, instance => $instance); + $self->{repl}->{$instance} = { display => $result->{replSource} . '/' . $result->{replDestination}, + state => $result->{replState}, + offset => (time() - $result->{replSyncedAsOfTime}) * -1 + }; + + } +} + +1; + +__END__ + +=head1 MODE + +Check Battery Status and battery charge remaining. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status|load$' + +=item B<--unknown-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{state} + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{state} =~ /initializing|recovering/i'). +Can used special variables like: %{state} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /disabledNeedsResync|uninitialized/i'). +Can used special variables like: %{state} + +=item B<--warning-*> + +Threshold warning. +Can be: 'offset'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'offset'. + +=back + +=cut diff --git a/centreon-plugins/storage/emc/DataDomain/plugin.pm b/centreon-plugins/storage/emc/DataDomain/plugin.pm index 9e760e3ef..91a9a413c 100644 --- a/centreon-plugins/storage/emc/DataDomain/plugin.pm +++ b/centreon-plugins/storage/emc/DataDomain/plugin.pm @@ -34,6 +34,7 @@ sub new { %{$self->{modes}} = ( 'hardware' => 'storage::emc::DataDomain::mode::hardware', 'filesystem-usage' => 'storage::emc::DataDomain::mode::filesystem', + 'replication' => 'storage::emc::DataDomain::mode::replication', ); return $self; From 6d05459f675212467f1f2d43f30e7a3ee20c3909 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 17:24:07 +0100 Subject: [PATCH 045/346] + add replication for datadomain --- .../storage/emc/DataDomain/mode/replication.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm index 48a8b70b8..9a9131792 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm @@ -66,10 +66,10 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'repl', type => 1, cb_prefix_output => 'prefix_repl_output', message_multiple => 'All replications are ok' } }, + { name => 'repl', type => 1, cb_prefix_output => 'prefix_repl_output', message_multiple => 'All replications are ok' }, ]; - $self->{maps_counters}->{global} = [ + $self->{maps_counters}->{repl} = [ { label => 'status', threshold => 0, set => { key_values => [ { name => 'state' } ], output_template => "status is '%s'", @@ -163,7 +163,7 @@ sub manage_selection { $oid_replSource = '.1.3.6.1.4.1.19746.1.8.1.1.1.7'; $oid_replDestination = '.1.3.6.1.4.1.19746.1.8.1.1.1.8'; $oid_replState = '.1.3.6.1.4.1.19746.1.8.1.1.1.3'; - } else if (centreon::plugins::misc::minimal_version($self->{os_version}, '5.0') { + } elsif (centreon::plugins::misc::minimal_version($self->{os_version}, '5.0')) { $oid_replSource = '.1.3.6.1.4.1.19746.1.8.1.1.1.7'; $oid_replDestination = '.1.3.6.1.4.1.19746.1.8.1.1.1.8'; $oid_replState = '.1.3.6.1.4.1.19746.1.8.1.1.1.3'; @@ -181,11 +181,12 @@ sub manage_selection { }; foreach my $oid (keys %{$self->{results}->{$oid_replicationInfoEntry}}) { - next if ($oid !~ /^$mapping->{replState}->{oid}\.(.*)$/; + next if ($oid !~ /^$mapping->{replState}->{oid}\.(.*)$/); + my $instance = $1; my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_replicationInfoEntry}, instance => $instance); $self->{repl}->{$instance} = { display => $result->{replSource} . '/' . $result->{replDestination}, state => $result->{replState}, - offset => (time() - $result->{replSyncedAsOfTime}) * -1 + offset => (time() - $result->{replSyncedAsOfTime}) }; } @@ -197,14 +198,14 @@ __END__ =head1 MODE -Check Battery Status and battery charge remaining. +Check replication. =over 8 =item B<--filter-counters> Only display some counters (regexp can be used). -Example: --filter-counters='^status|load$' +Example: --filter-counters='^status$' =item B<--unknown-status> From 4d80218e49a9fb0a38793c094467ea95b24ac178 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 17:40:57 +0100 Subject: [PATCH 046/346] + enhance case for emc vplex plugin --- .../storage/emc/vplex/restapi/mode/directors.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm index bebde25da..c713f64e8 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm @@ -126,7 +126,7 @@ sub run { $items->{$engine_name}->{$director_name}->{'communication-status'}, $items->{$engine_name}->{$director_name}->{'temperature-threshold-exceeded'}, $items->{$engine_name}->{$director_name}->{'voltage-threshold-exceeded'}, - $items->{$engine_name}->{$director_name}->{'vplex-splitter-status'})); + defined($items->{$engine_name}->{$director_name}->{'vplex-splitter-status'}) ? $items->{$engine_name}->{$director_name}->{'vplex-splitter-status'} : '-')); my $exit = $self->get_severity(section => 'director_health', instance => $instance, value => $items->{$engine_name}->{$director_name}->{'health-state'}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { @@ -152,11 +152,14 @@ sub run { short_msg => sprintf("Director '%s' voltage threshold exceeded is %s", $instance, $items->{$engine_name}->{$director_name}->{'voltage-threshold-exceeded'})); } - $exit = $self->get_severity(section => 'director_vplex_splitter', value => $items->{$engine_name}->{$director_name}->{'vplex-splitter-status'}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Director '%s' vplex splitter status is %s", + + if (defined($items->{$engine_name}->{$director_name}->{'vplex-splitter-status'})) { + $exit = $self->get_severity(section => 'director_vplex_splitter', value => $items->{$engine_name}->{$director_name}->{'vplex-splitter-status'}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Director '%s' vplex splitter status is %s", $instance, $items->{$engine_name}->{$director_name}->{'vplex-splitter-status'})); + } } } } From a7f5d5f8ab1e01930f05efc1ba909ecb4c8b60c9 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 19:09:18 +0100 Subject: [PATCH 047/346] + update licence date --- centreon-plugins/apps/activedirectory/local/mode/dcdiag.pm | 2 +- centreon-plugins/apps/activedirectory/local/mode/netdom.pm | 2 +- centreon-plugins/apps/activedirectory/local/plugin.pm | 2 +- centreon-plugins/apps/activedirectory/wsman/mode/dcdiag.pm | 2 +- centreon-plugins/apps/activedirectory/wsman/plugin.pm | 2 +- centreon-plugins/apps/apache/serverstatus/mode/cpuload.pm | 2 +- centreon-plugins/apps/apache/serverstatus/mode/requests.pm | 2 +- .../apps/apache/serverstatus/mode/responsetime.pm | 2 +- centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm | 2 +- centreon-plugins/apps/apache/serverstatus/mode/workers.pm | 2 +- centreon-plugins/apps/apache/serverstatus/plugin.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/batterycharge.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/batteryvoltage.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/linefrequency.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/linevoltage.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/loadpercentage.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/outputvoltage.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/temperature.pm | 2 +- centreon-plugins/apps/apcupsd/local/mode/timeleft.pm | 2 +- centreon-plugins/apps/apcupsd/local/plugin.pm | 2 +- centreon-plugins/apps/biztalk/sql/mode/rlocationdisabled.pm | 2 +- centreon-plugins/apps/bluemind/mode/incoming.pm | 2 +- centreon-plugins/apps/bluemind/plugin.pm | 2 +- centreon-plugins/apps/centreon/local/mode/metaservice.pm | 2 +- centreon-plugins/apps/centreon/local/mode/retentionbroker.pm | 2 +- centreon-plugins/apps/centreon/local/plugin.pm | 2 +- centreon-plugins/apps/centreon/map/jmx/mode/eventqueue.pm | 2 +- .../apps/centreon/map/jmx/mode/eventstatistics.pm | 2 +- centreon-plugins/apps/centreon/map/jmx/mode/gates.pm | 2 +- centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm | 2 +- centreon-plugins/apps/centreon/map/jmx/plugin.pm | 2 +- centreon-plugins/apps/centreon/sql/mode/countnotifications.pm | 2 +- centreon-plugins/apps/centreon/sql/mode/countproblems.pm | 2 +- centreon-plugins/apps/centreon/sql/mode/partitioning.pm | 2 +- centreon-plugins/apps/centreon/sql/mode/pollerdelay.pm | 2 +- centreon-plugins/apps/checkmyws/mode/status.pm | 2 +- centreon-plugins/apps/checkmyws/plugin.pm | 2 +- centreon-plugins/apps/citrix/local/mode/folder.pm | 2 +- centreon-plugins/apps/citrix/local/mode/license.pm | 2 +- centreon-plugins/apps/citrix/local/mode/session.pm | 2 +- centreon-plugins/apps/citrix/local/mode/zone.pm | 2 +- centreon-plugins/apps/citrix/local/plugin.pm | 2 +- centreon-plugins/apps/elasticsearch/mode/cluster.pm | 2 +- centreon-plugins/apps/elasticsearch/mode/indices.pm | 2 +- centreon-plugins/apps/elasticsearch/mode/nodescount.pm | 2 +- centreon-plugins/apps/elasticsearch/plugin.pm | 2 +- .../apps/exchange/2010/local/mode/activesyncmailbox.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/databases.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/imapmailbox.pm | 2 +- .../apps/exchange/2010/local/mode/listdatabases.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/mapimailbox.pm | 2 +- .../apps/exchange/2010/local/mode/outlookwebservices.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/owamailbox.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/queues.pm | 2 +- .../apps/exchange/2010/local/mode/replicationhealth.pm | 2 +- centreon-plugins/apps/exchange/2010/local/mode/services.pm | 2 +- centreon-plugins/apps/exchange/2010/local/plugin.pm | 2 +- centreon-plugins/apps/github/mode/commits.pm | 2 +- centreon-plugins/apps/github/mode/issues.pm | 2 +- centreon-plugins/apps/github/mode/pullrequests.pm | 2 +- centreon-plugins/apps/github/mode/stats.pm | 2 +- centreon-plugins/apps/github/mode/status.pm | 2 +- centreon-plugins/apps/github/plugin.pm | 2 +- centreon-plugins/apps/hddtemp/local/mode/temperature.pm | 2 +- centreon-plugins/apps/hddtemp/local/plugin.pm | 2 +- centreon-plugins/apps/hddtemp/remote/mode/listdrives.pm | 2 +- centreon-plugins/apps/hddtemp/remote/mode/temperature.pm | 2 +- centreon-plugins/apps/hddtemp/remote/plugin.pm | 2 +- centreon-plugins/apps/iis/local/mode/applicationpoolstate.pm | 2 +- centreon-plugins/apps/iis/local/mode/listapplicationpools.pm | 2 +- centreon-plugins/apps/iis/local/mode/listsites.pm | 2 +- centreon-plugins/apps/iis/local/mode/webservicestatistics.pm | 2 +- centreon-plugins/apps/iis/local/plugin.pm | 2 +- centreon-plugins/apps/iis/wsman/mode/applicationpoolstate.pm | 2 +- centreon-plugins/apps/iis/wsman/mode/listapplicationpools.pm | 2 +- centreon-plugins/apps/iis/wsman/plugin.pm | 2 +- centreon-plugins/apps/java/peoplesoft/jmx/mode/queuelength.pm | 2 +- centreon-plugins/apps/java/peoplesoft/jmx/mode/sessions.pm | 2 +- centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm | 2 +- centreon-plugins/apps/java/weblogic/jmx/mode/workmanager.pm | 2 +- centreon-plugins/apps/java/weblogic/jmx/plugin.pm | 2 +- centreon-plugins/apps/jenkins/mode/jobstate.pm | 2 +- centreon-plugins/apps/jenkins/plugin.pm | 2 +- centreon-plugins/apps/jive/sql/mode/etljobstatus.pm | 2 +- centreon-plugins/apps/kayako/api/mode/listdepartment.pm | 2 +- centreon-plugins/apps/kayako/api/mode/listpriority.pm | 2 +- centreon-plugins/apps/kayako/api/mode/liststaff.pm | 2 +- centreon-plugins/apps/kayako/api/mode/liststatus.pm | 2 +- centreon-plugins/apps/kayako/api/mode/ticketcount.pm | 2 +- centreon-plugins/apps/kayako/api/plugin.pm | 2 +- centreon-plugins/apps/kayako/sql/mode/listdepartment.pm | 2 +- centreon-plugins/apps/kayako/sql/mode/listpriority.pm | 2 +- centreon-plugins/apps/kayako/sql/mode/liststaff.pm | 2 +- centreon-plugins/apps/kayako/sql/mode/liststatus.pm | 2 +- centreon-plugins/apps/kayako/sql/mode/ticketcount.pm | 2 +- centreon-plugins/apps/lmsensors/mode/fan.pm | 2 +- centreon-plugins/apps/lmsensors/mode/misc.pm | 2 +- centreon-plugins/apps/lmsensors/mode/temperature.pm | 2 +- centreon-plugins/apps/lmsensors/mode/voltage.pm | 2 +- centreon-plugins/apps/lmsensors/plugin.pm | 2 +- centreon-plugins/apps/lotus/snmp/mode/mailstate.pm | 2 +- centreon-plugins/apps/lotus/snmp/mode/mailtime.pm | 2 +- centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm | 2 +- centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm | 2 +- centreon-plugins/apps/lotus/snmp/mode/usersessions.pm | 2 +- centreon-plugins/apps/lotus/snmp/plugin.pm | 2 +- centreon-plugins/apps/lync/mode/imsessions.pm | 2 +- centreon-plugins/apps/lync/mode/lyncusers.pm | 2 +- centreon-plugins/apps/lync/mode/remoteassistance.pm | 2 +- centreon-plugins/apps/lync/mode/sessionstype.pm | 2 +- centreon-plugins/apps/msmq/local/mode/listqueues.pm | 2 +- centreon-plugins/apps/msmq/local/plugin.pm | 2 +- centreon-plugins/apps/nginx/serverstatus/mode/connections.pm | 2 +- centreon-plugins/apps/nginx/serverstatus/mode/requests.pm | 2 +- centreon-plugins/apps/nginx/serverstatus/mode/responsetime.pm | 2 +- centreon-plugins/apps/nginx/serverstatus/plugin.pm | 2 +- centreon-plugins/apps/pacemaker/local/mode/crm.pm | 2 +- centreon-plugins/apps/pacemaker/local/plugin.pm | 2 +- centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm | 2 +- .../apps/pfsense/snmp/mode/memorydroppedpackets.pm | 2 +- centreon-plugins/apps/pfsense/snmp/mode/runtime.pm | 2 +- centreon-plugins/apps/pfsense/snmp/plugin.pm | 2 +- centreon-plugins/apps/php/apc/web/mode/filecache.pm | 2 +- centreon-plugins/apps/php/apc/web/mode/memory.pm | 2 +- centreon-plugins/apps/php/apc/web/plugin.pm | 2 +- centreon-plugins/apps/php/fpm/web/mode/usage.pm | 2 +- centreon-plugins/apps/php/fpm/web/plugin.pm | 2 +- centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm | 2 +- centreon-plugins/apps/protocols/bgp/4/plugin.pm | 2 +- centreon-plugins/apps/protocols/dhcp/mode/connection.pm | 2 +- centreon-plugins/apps/protocols/dhcp/plugin.pm | 2 +- centreon-plugins/apps/protocols/dns/lib/dns.pm | 2 +- centreon-plugins/apps/protocols/dns/mode/request.pm | 2 +- centreon-plugins/apps/protocols/dns/plugin.pm | 2 +- centreon-plugins/apps/protocols/ftp/lib/ftp.pm | 2 +- centreon-plugins/apps/protocols/ftp/mode/commands.pm | 2 +- centreon-plugins/apps/protocols/ftp/mode/date.pm | 2 +- centreon-plugins/apps/protocols/ftp/mode/filescount.pm | 2 +- centreon-plugins/apps/protocols/ftp/mode/login.pm | 2 +- centreon-plugins/apps/protocols/ftp/plugin.pm | 2 +- centreon-plugins/apps/protocols/http/mode/expectedcontent.pm | 2 +- centreon-plugins/apps/protocols/http/mode/jsoncontent.pm | 2 +- centreon-plugins/apps/protocols/http/mode/response.pm | 2 +- centreon-plugins/apps/protocols/http/mode/soapcontent.pm | 2 +- centreon-plugins/apps/protocols/http/plugin.pm | 2 +- centreon-plugins/apps/protocols/imap/lib/imap.pm | 2 +- centreon-plugins/apps/protocols/imap/mode/login.pm | 2 +- centreon-plugins/apps/protocols/imap/mode/searchmessage.pm | 2 +- centreon-plugins/apps/protocols/imap/plugin.pm | 2 +- centreon-plugins/apps/protocols/jmx/mode/listattributes.pm | 2 +- centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm | 2 +- centreon-plugins/apps/protocols/jmx/plugin.pm | 2 +- centreon-plugins/apps/protocols/ldap/lib/ldap.pm | 2 +- centreon-plugins/apps/protocols/ldap/mode/login.pm | 2 +- centreon-plugins/apps/protocols/ldap/mode/search.pm | 2 +- centreon-plugins/apps/protocols/ldap/plugin.pm | 2 +- centreon-plugins/apps/protocols/ntp/mode/offset.pm | 2 +- centreon-plugins/apps/protocols/ntp/mode/responsetime.pm | 2 +- centreon-plugins/apps/protocols/ntp/plugin.pm | 2 +- centreon-plugins/apps/protocols/radius/mode/login.pm | 2 +- centreon-plugins/apps/protocols/radius/plugin.pm | 2 +- centreon-plugins/apps/protocols/smtp/lib/smtp.pm | 2 +- centreon-plugins/apps/protocols/smtp/mode/login.pm | 2 +- centreon-plugins/apps/protocols/smtp/mode/message.pm | 2 +- centreon-plugins/apps/protocols/smtp/plugin.pm | 2 +- centreon-plugins/apps/protocols/tcp/mode/responsetime.pm | 2 +- centreon-plugins/apps/protocols/tcp/plugin.pm | 2 +- centreon-plugins/apps/protocols/udp/mode/connection.pm | 2 +- centreon-plugins/apps/protocols/udp/plugin.pm | 2 +- centreon-plugins/apps/protocols/x509/mode/validity.pm | 2 +- centreon-plugins/apps/protocols/x509/plugin.pm | 2 +- centreon-plugins/apps/rrdcached/mode/stats.pm | 2 +- centreon-plugins/apps/rrdcached/plugin.pm | 2 +- centreon-plugins/apps/selenium/mode/scenario.pm | 2 +- centreon-plugins/apps/selenium/plugin.pm | 2 +- centreon-plugins/apps/tomcat/jmx/plugin.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/applications.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/listapplication.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/memory.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/requestinfo.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/sessions.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/threads.pm | 2 +- centreon-plugins/apps/tomcat/web/mode/traffic.pm | 2 +- centreon-plugins/apps/tomcat/web/plugin.pm | 2 +- centreon-plugins/apps/varnish/local/mode/backend.pm | 2 +- centreon-plugins/apps/varnish/local/mode/bans.pm | 2 +- centreon-plugins/apps/varnish/local/mode/cache.pm | 2 +- centreon-plugins/apps/varnish/local/mode/connections.pm | 2 +- centreon-plugins/apps/varnish/local/mode/dns.pm | 2 +- centreon-plugins/apps/varnish/local/mode/esi.pm | 2 +- centreon-plugins/apps/varnish/local/mode/fetch.pm | 2 +- centreon-plugins/apps/varnish/local/mode/hcb.pm | 2 +- centreon-plugins/apps/varnish/local/mode/n.pm | 2 +- centreon-plugins/apps/varnish/local/mode/objects.pm | 2 +- centreon-plugins/apps/varnish/local/mode/sessions.pm | 2 +- centreon-plugins/apps/varnish/local/mode/shm.pm | 2 +- centreon-plugins/apps/varnish/local/mode/sms.pm | 2 +- centreon-plugins/apps/varnish/local/mode/totals.pm | 2 +- centreon-plugins/apps/varnish/local/mode/uptime.pm | 2 +- centreon-plugins/apps/varnish/local/mode/vcl.pm | 2 +- centreon-plugins/apps/varnish/local/mode/workers.pm | 2 +- centreon-plugins/apps/varnish/local/plugin.pm | 2 +- centreon-plugins/apps/vmware/connector/custom/connector.pm | 2 +- .../apps/vmware/connector/mode/alarmdatacenter.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/alarmhost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/countvmhost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/cpuhost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/cpuvm.pm | 2 +- .../apps/vmware/connector/mode/datastorecountvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/datastorehost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/datastoreio.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/datastoreiops.pm | 2 +- .../apps/vmware/connector/mode/datastoresnapshot.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/datastoreusage.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/datastorevm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/getmap.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/healthhost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/limitvm.pm | 2 +- .../apps/vmware/connector/mode/listdatacenters.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/listdatastores.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/listnichost.pm | 2 +- .../apps/vmware/connector/mode/maintenancehost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/memoryhost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/memoryvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/nethost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/servicehost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/snapshotvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/statconnectors.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/statushost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/statusvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/swaphost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/swapvm.pm | 2 +- .../apps/vmware/connector/mode/thinprovisioningvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/timehost.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/toolsvm.pm | 2 +- centreon-plugins/apps/vmware/connector/mode/uptimehost.pm | 2 +- .../apps/vmware/connector/mode/vmoperationcluster.pm | 2 +- centreon-plugins/apps/vmware/connector/plugin.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_card.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_computersystem.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_memory.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_numericsensor.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_processor.pm | 2 +- .../apps/vmware/wsman/mode/components/cim_recordlog.pm | 2 +- .../apps/vmware/wsman/mode/components/omc_discretesensor.pm | 2 +- centreon-plugins/apps/vmware/wsman/mode/components/omc_fan.pm | 2 +- centreon-plugins/apps/vmware/wsman/mode/components/omc_psu.pm | 2 +- .../apps/vmware/wsman/mode/components/resources.pm | 2 +- .../apps/vmware/wsman/mode/components/vmware_battery.pm | 2 +- .../apps/vmware/wsman/mode/components/vmware_controller.pm | 2 +- .../apps/vmware/wsman/mode/components/vmware_sassataport.pm | 2 +- .../apps/vmware/wsman/mode/components/vmware_storageextent.pm | 2 +- .../apps/vmware/wsman/mode/components/vmware_storagevolume.pm | 2 +- centreon-plugins/apps/vmware/wsman/mode/hardware.pm | 2 +- centreon-plugins/apps/vmware/wsman/plugin.pm | 2 +- centreon-plugins/apps/voip/asterisk/remote/lib/ami.pm | 2 +- .../apps/voip/asterisk/remote/mode/activecalls.pm | 2 +- .../apps/voip/asterisk/remote/mode/dahdistatus.pm | 2 +- .../apps/voip/asterisk/remote/mode/externalcalls.pm | 2 +- centreon-plugins/apps/voip/asterisk/remote/mode/showpeers.pm | 2 +- centreon-plugins/apps/voip/asterisk/remote/plugin.pm | 2 +- centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm | 2 +- .../apps/voip/asterisk/snmp/mode/externalcalls.pm | 2 +- centreon-plugins/apps/voip/asterisk/snmp/plugin.pm | 2 +- .../apps/voip/cisco/meetingplace/mode/audiolicenses.pm | 2 +- .../apps/voip/cisco/meetingplace/mode/audioports.pm | 2 +- .../apps/voip/cisco/meetingplace/mode/videolicenses.pm | 2 +- .../apps/voip/cisco/meetingplace/mode/videoports.pm | 2 +- centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm | 2 +- .../centreon/common/adic/tape/snmp/mode/components/global.pm | 2 +- .../common/adic/tape/snmp/mode/components/physicaldrive.pm | 2 +- .../common/adic/tape/snmp/mode/components/subsystem.pm | 2 +- .../centreon/common/adic/tape/snmp/mode/hardware.pm | 2 +- .../common/airespace/snmp/mode/apchannelinterference.pm | 2 +- .../centreon/common/airespace/snmp/mode/apchannelnoise.pm | 2 +- .../centreon/common/airespace/snmp/mode/apstatus.pm | 2 +- .../centreon/common/airespace/snmp/mode/apusers.pm | 2 +- .../centreon/common/airespace/snmp/mode/components/psu.pm | 2 +- centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm | 2 +- .../centreon/common/airespace/snmp/mode/hardware.pm | 2 +- .../centreon/common/airespace/snmp/mode/memory.pm | 2 +- .../centreon/common/aruba/snmp/mode/apconnections.pm | 2 +- centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm | 2 +- .../centreon/common/aruba/snmp/mode/components/fan.pm | 2 +- .../centreon/common/aruba/snmp/mode/components/module.pm | 2 +- .../centreon/common/aruba/snmp/mode/components/psu.pm | 2 +- centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm | 2 +- centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm | 2 +- centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm | 2 +- centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm | 2 +- .../common/cisco/smallbusiness/snmp/mode/components/fan.pm | 2 +- .../common/cisco/smallbusiness/snmp/mode/components/psu.pm | 2 +- .../centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm | 2 +- .../common/cisco/smallbusiness/snmp/mode/environment.pm | 2 +- .../common/cisco/standard/snmp/mode/components/fan.pm | 2 +- .../common/cisco/standard/snmp/mode/components/module.pm | 2 +- .../common/cisco/standard/snmp/mode/components/physical.pm | 2 +- .../common/cisco/standard/snmp/mode/components/psu.pm | 2 +- .../common/cisco/standard/snmp/mode/components/sensor.pm | 2 +- .../common/cisco/standard/snmp/mode/components/temperature.pm | 2 +- .../common/cisco/standard/snmp/mode/components/voltage.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/cpu.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/environment.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/hsrp.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/ipsla.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/memory.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/memoryflash.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/stack.pm | 2 +- .../common/dell/powerconnect3000/mode/globalstatus.pm | 2 +- .../centreon/common/emc/navisphere/custom/custom.pm | 2 +- centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm | 2 +- .../centreon/common/emc/navisphere/mode/controller.pm | 2 +- centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm | 2 +- .../centreon/common/emc/navisphere/mode/faults.pm | 2 +- .../centreon/common/emc/navisphere/mode/hbastate.pm | 2 +- .../centreon/common/emc/navisphere/mode/listluns.pm | 2 +- .../centreon/common/emc/navisphere/mode/portstate.pm | 2 +- centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm | 2 +- .../common/emc/navisphere/mode/spcomponents/battery.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/cable.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/cpu.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/fan.pm | 2 +- .../common/emc/navisphere/mode/spcomponents/iomodule.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/lcc.pm | 2 +- .../common/emc/navisphere/mode/spcomponents/memory.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/psu.pm | 2 +- .../centreon/common/emc/navisphere/mode/spcomponents/sp.pm | 2 +- .../centreon/common/emc/navisphere/mode/spinfo.pm | 2 +- centreon-plugins/centreon/common/fastpath/mode/cpu.pm | 2 +- centreon-plugins/centreon/common/fastpath/mode/environment.pm | 2 +- centreon-plugins/centreon/common/fastpath/mode/memory.pm | 2 +- .../centreon/common/force10/snmp/mode/components/fan.pm | 2 +- .../centreon/common/force10/snmp/mode/components/psu.pm | 2 +- .../common/force10/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/centreon/common/force10/snmp/mode/cpu.pm | 2 +- .../centreon/common/force10/snmp/mode/hardware.pm | 2 +- centreon-plugins/centreon/common/force10/snmp/mode/memory.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/clusterstatus.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/cpu.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/disk.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/hardware.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/ipsstats.pm | 2 +- .../common/fortinet/fortigate/mode/listvirtualdomains.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/memory.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/sessions.pm | 2 +- .../centreon/common/fortinet/fortigate/mode/virus.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/classcount.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/cpuload.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/fdusage.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/loadaverage.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/memory.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/memorydetailed.pm | 2 +- centreon-plugins/centreon/common/jvm/mode/threads.pm | 2 +- .../common/powershell/exchange/2010/activesyncmailbox.pm | 2 +- .../centreon/common/powershell/exchange/2010/databases.pm | 2 +- .../centreon/common/powershell/exchange/2010/imapmailbox.pm | 2 +- .../centreon/common/powershell/exchange/2010/listdatabases.pm | 2 +- .../centreon/common/powershell/exchange/2010/mapimailbox.pm | 2 +- .../common/powershell/exchange/2010/outlookwebservices.pm | 2 +- .../centreon/common/powershell/exchange/2010/owamailbox.pm | 2 +- .../centreon/common/powershell/exchange/2010/powershell.pm | 2 +- .../centreon/common/powershell/exchange/2010/queues.pm | 2 +- .../common/powershell/exchange/2010/replicationhealth.pm | 2 +- .../centreon/common/powershell/exchange/2010/services.pm | 2 +- .../centreon/common/protocols/jmx/custom/jolokia.pm | 2 +- .../centreon/common/protocols/sql/mode/connectiontime.pm | 2 +- centreon-plugins/centreon/common/protocols/sql/mode/sql.pm | 2 +- centreon-plugins/centreon/common/radlan/mode/cpu.pm | 2 +- centreon-plugins/centreon/common/radlan/mode/environment.pm | 2 +- centreon-plugins/centreon/common/smcli/custom/custom.pm | 2 +- centreon-plugins/centreon/common/smcli/mode/healthstatus.pm | 2 +- .../centreon/common/violin/snmp/mode/components/ca.pm | 2 +- .../centreon/common/violin/snmp/mode/components/fan.pm | 2 +- .../centreon/common/violin/snmp/mode/components/gfc.pm | 2 +- .../centreon/common/violin/snmp/mode/components/lfc.pm | 2 +- .../centreon/common/violin/snmp/mode/components/psu.pm | 2 +- .../common/violin/snmp/mode/components/temperature.pm | 2 +- .../centreon/common/violin/snmp/mode/components/vimm.pm | 2 +- centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm | 2 +- centreon-plugins/centreon/plugins/alternative/Getopt.pm | 2 +- centreon-plugins/centreon/plugins/dbi.pm | 2 +- centreon-plugins/centreon/plugins/http.pm | 2 +- centreon-plugins/centreon/plugins/misc.pm | 2 +- centreon-plugins/centreon/plugins/mode.pm | 2 +- centreon-plugins/centreon/plugins/options.pm | 2 +- centreon-plugins/centreon/plugins/output.pm | 2 +- centreon-plugins/centreon/plugins/perfdata.pm | 2 +- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/centreon/plugins/script_custom.pm | 2 +- centreon-plugins/centreon/plugins/script_simple.pm | 2 +- centreon-plugins/centreon/plugins/script_snmp.pm | 2 +- centreon-plugins/centreon/plugins/script_sql.pm | 2 +- centreon-plugins/centreon/plugins/script_wsman.pm | 2 +- centreon-plugins/centreon/plugins/snmp.pm | 2 +- centreon-plugins/centreon/plugins/statefile.pm | 2 +- centreon-plugins/centreon/plugins/templates/counter.pm | 2 +- centreon-plugins/centreon/plugins/templates/hardware.pm | 2 +- centreon-plugins/centreon/plugins/values.pm | 2 +- centreon-plugins/centreon/plugins/wsman.pm | 2 +- centreon-plugins/centreon_plugins.pl | 2 +- centreon-plugins/cloud/aws/custom/awscli.pm | 2 +- centreon-plugins/cloud/aws/mode/cloudwatch.pm | 2 +- centreon-plugins/cloud/aws/mode/instancestate.pm | 2 +- centreon-plugins/cloud/aws/mode/list.pm | 2 +- centreon-plugins/cloud/aws/mode/metrics/ec2instancecpu.pm | 2 +- .../cloud/aws/mode/metrics/ec2instancecpucreditbalance.pm | 2 +- .../cloud/aws/mode/metrics/ec2instancecpucreditusage.pm | 2 +- centreon-plugins/cloud/aws/mode/metrics/ec2instancenetwork.pm | 2 +- centreon-plugins/cloud/aws/mode/metrics/rdsinstancecpu.pm | 2 +- centreon-plugins/cloud/aws/mode/metrics/s3bucketsize.pm | 2 +- centreon-plugins/cloud/aws/plugin.pm | 2 +- centreon-plugins/cloud/docker/mode/blockio.pm | 2 +- centreon-plugins/cloud/docker/mode/containerstate.pm | 2 +- centreon-plugins/cloud/docker/mode/cpu.pm | 2 +- centreon-plugins/cloud/docker/mode/image.pm | 2 +- centreon-plugins/cloud/docker/mode/info.pm | 2 +- centreon-plugins/cloud/docker/mode/listcontainers.pm | 2 +- centreon-plugins/cloud/docker/mode/memory.pm | 2 +- centreon-plugins/cloud/docker/mode/traffic.pm | 2 +- centreon-plugins/cloud/docker/plugin.pm | 2 +- centreon-plugins/database/firebird/mode/longqueries.pm | 2 +- centreon-plugins/database/firebird/mode/memory.pm | 2 +- centreon-plugins/database/firebird/mode/pages.pm | 2 +- centreon-plugins/database/firebird/mode/queries.pm | 2 +- centreon-plugins/database/firebird/mode/users.pm | 2 +- centreon-plugins/database/firebird/plugin.pm | 2 +- centreon-plugins/database/informix/mode/archivelevel0.pm | 2 +- centreon-plugins/database/informix/mode/checkpoints.pm | 2 +- centreon-plugins/database/informix/mode/chunkstates.pm | 2 +- centreon-plugins/database/informix/mode/dbspacesusage.pm | 2 +- centreon-plugins/database/informix/mode/globalcache.pm | 2 +- centreon-plugins/database/informix/mode/listdatabases.pm | 2 +- centreon-plugins/database/informix/mode/listdbspaces.pm | 2 +- centreon-plugins/database/informix/mode/lockoverflow.pm | 2 +- centreon-plugins/database/informix/mode/logfilesusage.pm | 2 +- centreon-plugins/database/informix/mode/longtxs.pm | 2 +- centreon-plugins/database/informix/mode/sessions.pm | 2 +- centreon-plugins/database/informix/mode/tablelocks.pm | 2 +- centreon-plugins/database/informix/plugin.pm | 2 +- centreon-plugins/database/mssql/mode/backupage.pm | 2 +- centreon-plugins/database/mssql/mode/blockedprocesses.pm | 2 +- centreon-plugins/database/mssql/mode/cachehitratio.pm | 2 +- centreon-plugins/database/mssql/mode/connectedusers.pm | 2 +- centreon-plugins/database/mssql/mode/databasessize.pm | 2 +- centreon-plugins/database/mssql/mode/deadlocks.pm | 2 +- centreon-plugins/database/mssql/mode/failedjobs.pm | 2 +- centreon-plugins/database/mssql/mode/lockswaits.pm | 2 +- centreon-plugins/database/mssql/mode/transactions.pm | 2 +- centreon-plugins/database/mssql/plugin.pm | 2 +- centreon-plugins/database/mysql/mode/databasessize.pm | 2 +- .../database/mysql/mode/innodbbufferpoolhitrate.pm | 2 +- centreon-plugins/database/mysql/mode/longqueries.pm | 2 +- centreon-plugins/database/mysql/mode/myisamkeycachehitrate.pm | 2 +- centreon-plugins/database/mysql/mode/openfiles.pm | 2 +- centreon-plugins/database/mysql/mode/qcachehitrate.pm | 2 +- centreon-plugins/database/mysql/mode/queries.pm | 2 +- .../database/mysql/mode/replicationmastermaster.pm | 2 +- .../database/mysql/mode/replicationmasterslave.pm | 2 +- centreon-plugins/database/mysql/mode/slowqueries.pm | 2 +- centreon-plugins/database/mysql/mode/threadsconnected.pm | 2 +- centreon-plugins/database/mysql/mode/uptime.pm | 2 +- centreon-plugins/database/mysql/mysqlcmd.pm | 2 +- centreon-plugins/database/mysql/plugin.pm | 2 +- centreon-plugins/database/oracle/mode/asmdiskgroupusage.pm | 2 +- centreon-plugins/database/oracle/mode/connectedusers.pm | 2 +- centreon-plugins/database/oracle/mode/corruptedblocks.pm | 2 +- centreon-plugins/database/oracle/mode/datacachehitratio.pm | 2 +- centreon-plugins/database/oracle/mode/processusage.pm | 2 +- centreon-plugins/database/oracle/mode/rmanbackupage.pm | 2 +- centreon-plugins/database/oracle/mode/rmanbackupproblems.pm | 2 +- centreon-plugins/database/oracle/mode/rmanonlinebackupage.pm | 2 +- centreon-plugins/database/oracle/mode/sessionusage.pm | 2 +- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 2 +- centreon-plugins/database/oracle/mode/tnsping.pm | 2 +- centreon-plugins/database/oracle/plugin.pm | 2 +- centreon-plugins/database/postgres/mode/backends.pm | 2 +- centreon-plugins/database/postgres/mode/hitratio.pm | 2 +- centreon-plugins/database/postgres/mode/listdatabases.pm | 2 +- centreon-plugins/database/postgres/mode/locks.pm | 2 +- centreon-plugins/database/postgres/mode/querytime.pm | 2 +- centreon-plugins/database/postgres/mode/statistics.pm | 2 +- centreon-plugins/database/postgres/mode/tablespace.pm | 2 +- centreon-plugins/database/postgres/mode/timesync.pm | 2 +- centreon-plugins/database/postgres/mode/vacuum.pm | 2 +- centreon-plugins/database/postgres/plugin.pm | 2 +- centreon-plugins/database/postgres/psqlcmd.pm | 2 +- centreon-plugins/docs/en/developer/guide.rst | 4 ++-- centreon-plugins/docs/fr/developer/guide.rst | 4 ++-- centreon-plugins/example/custommode/simple.pm | 2 +- centreon-plugins/example/mode/getvalue.pm | 2 +- centreon-plugins/example/mode/launchcmd.pm | 2 +- centreon-plugins/example/mode/testcustom.pm | 2 +- centreon-plugins/example/plugin_command.pm | 2 +- centreon-plugins/example/plugin_custom.pm | 2 +- centreon-plugins/example/plugin_snmp.pm | 2 +- centreon-plugins/hardware/ats/apc/mode/entity.pm | 2 +- centreon-plugins/hardware/ats/apc/mode/input.pm | 2 +- centreon-plugins/hardware/ats/apc/mode/psu.pm | 2 +- centreon-plugins/hardware/ats/apc/mode/source.pm | 2 +- centreon-plugins/hardware/ats/apc/plugin.pm | 2 +- .../hardware/pdu/apc/snmp/mode/components/humidity.pm | 2 +- centreon-plugins/hardware/pdu/apc/snmp/mode/components/psu.pm | 2 +- .../hardware/pdu/apc/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/hardware/pdu/apc/snmp/mode/hardware.pm | 2 +- centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm | 2 +- centreon-plugins/hardware/pdu/apc/snmp/mode/outlet.pm | 2 +- centreon-plugins/hardware/pdu/apc/snmp/plugin.pm | 2 +- centreon-plugins/hardware/pdu/eaton/mode/group.pm | 2 +- centreon-plugins/hardware/pdu/eaton/mode/outlet.pm | 2 +- centreon-plugins/hardware/pdu/eaton/plugin.pm | 2 +- .../hardware/pdu/raritan/snmp/mode/components/resources.pm | 2 +- .../hardware/pdu/raritan/snmp/mode/components/sensor.pm | 2 +- .../hardware/pdu/raritan/snmp/mode/inletsensors.pm | 2 +- .../hardware/pdu/raritan/snmp/mode/ocprotsensors.pm | 2 +- .../hardware/pdu/raritan/snmp/mode/outletsensors.pm | 2 +- centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm | 2 +- .../hardware/printers/standard/rfc3805/mode/coverstatus.pm | 2 +- .../printers/standard/rfc3805/mode/markerimpression.pm | 2 +- .../hardware/printers/standard/rfc3805/mode/markersupply.pm | 2 +- .../hardware/printers/standard/rfc3805/mode/papertray.pm | 2 +- centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm | 2 +- centreon-plugins/hardware/sensors/hwgste/snmp/mode/sensors.pm | 2 +- centreon-plugins/hardware/sensors/hwgste/snmp/plugin.pm | 2 +- .../sensors/sensorip/snmp/mode/components/humidity.pm | 2 +- .../hardware/sensors/sensorip/snmp/mode/components/sp.pm | 2 +- .../hardware/sensors/sensorip/snmp/mode/components/switch.pm | 2 +- .../sensors/sensorip/snmp/mode/components/temperature.pm | 2 +- .../hardware/sensors/sensorip/snmp/mode/sensors.pm | 2 +- centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/mode/contact.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/mode/flood.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/mode/humidity.pm | 2 +- .../sensors/sensormetrix/em01/web/mode/illumination.pm | 2 +- .../sensors/sensormetrix/em01/web/mode/temperature.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/mode/thermistor.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/mode/voltage.pm | 2 +- .../hardware/sensors/sensormetrix/em01/web/plugin.pm | 2 +- .../sensorgateway/snmp/mode/components/sensors.pm | 2 +- .../sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm | 2 +- .../sensors/serverscheck/sensorgateway/snmp/plugin.pm | 2 +- centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/blade.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/chassis.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/cpu.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/fan.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/fex.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/iocard.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/localdisk.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/memory.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/psu.pm | 2 +- .../hardware/server/cisco/ucs/mode/components/resources.pm | 2 +- centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm | 2 +- centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm | 2 +- .../hardware/server/cisco/ucs/mode/serviceprofile.pm | 2 +- centreon-plugins/hardware/server/cisco/ucs/plugin.pm | 2 +- .../hardware/server/dell/cmc/snmp/mode/components/chassis.pm | 2 +- .../hardware/server/dell/cmc/snmp/mode/components/health.pm | 2 +- .../hardware/server/dell/cmc/snmp/mode/components/psu.pm | 2 +- .../server/dell/cmc/snmp/mode/components/temperature.pm | 2 +- .../hardware/server/dell/cmc/snmp/mode/hardware.pm | 2 +- centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm | 2 +- .../server/dell/idrac/snmp/mode/components/temperature.pm | 2 +- .../hardware/server/dell/idrac/snmp/mode/globalstatus.pm | 2 +- .../hardware/server/dell/idrac/snmp/mode/hardware.pm | 2 +- centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/battery.pm | 2 +- .../dell/openmanage/snmp/mode/components/cachebattery.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/connector.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/controller.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/cpu.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/esmlog.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/fan.pm | 2 +- .../dell/openmanage/snmp/mode/components/globalstatus.pm | 2 +- .../dell/openmanage/snmp/mode/components/logicaldrive.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/memory.pm | 2 +- .../dell/openmanage/snmp/mode/components/physicaldisk.pm | 2 +- .../server/dell/openmanage/snmp/mode/components/psu.pm | 2 +- .../dell/openmanage/snmp/mode/components/temperature.pm | 2 +- .../hardware/server/dell/openmanage/snmp/mode/hardware.pm | 2 +- .../hardware/server/dell/openmanage/snmp/plugin.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/blade.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/enclosure.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/fan.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/fuse.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/manager.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/network.pm | 2 +- .../server/hp/bladechassis/snmp/mode/components/psu.pm | 2 +- .../hp/bladechassis/snmp/mode/components/temperature.pm | 2 +- .../hardware/server/hp/bladechassis/snmp/mode/hardware.pm | 2 +- .../hardware/server/hp/bladechassis/snmp/plugin.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/cpu.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/daacc.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/dactl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/daldrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/dapdrive.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/fan.pm | 2 +- .../server/hp/proliant/snmp/mode/components/fcaexternalacc.pm | 2 +- .../server/hp/proliant/snmp/mode/components/fcaexternalctl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/fcahostctl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/fcaldrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/fcapdrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/idectl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/ideldrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/idepdrive.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/lnic.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/pc.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/pnic.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/components/psu.pm | 2 +- .../server/hp/proliant/snmp/mode/components/sasctl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/sasldrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/saspdrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/scsictl.pm | 2 +- .../server/hp/proliant/snmp/mode/components/scsildrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/scsipdrive.pm | 2 +- .../server/hp/proliant/snmp/mode/components/temperature.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/globalstatus.pm | 2 +- .../hardware/server/hp/proliant/snmp/mode/hardware.pm | 2 +- centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm | 2 +- .../server/ibm/bladecenter/snmp/mode/components/ambient.pm | 2 +- .../server/ibm/bladecenter/snmp/mode/components/blade.pm | 2 +- .../server/ibm/bladecenter/snmp/mode/components/blower.pm | 2 +- .../server/ibm/bladecenter/snmp/mode/components/chassisfan.pm | 2 +- .../ibm/bladecenter/snmp/mode/components/chassisstatus.pm | 2 +- .../server/ibm/bladecenter/snmp/mode/components/fanpack.pm | 2 +- .../ibm/bladecenter/snmp/mode/components/powermodule.pm | 2 +- .../ibm/bladecenter/snmp/mode/components/switchmodule.pm | 2 +- .../ibm/bladecenter/snmp/mode/components/systemhealth.pm | 2 +- .../hardware/server/ibm/bladecenter/snmp/mode/hardware.pm | 2 +- .../hardware/server/ibm/bladecenter/snmp/plugin.pm | 2 +- .../hardware/server/ibm/hmc/ssh/mode/hardwareerrors.pm | 2 +- centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm | 2 +- .../server/ibm/mgmt_cards/imm/snmp/mode/components/fan.pm | 2 +- .../ibm/mgmt_cards/imm/snmp/mode/components/globalstatus.pm | 2 +- .../ibm/mgmt_cards/imm/snmp/mode/components/temperature.pm | 2 +- .../server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm | 2 +- .../server/ibm/mgmt_cards/imm/snmp/mode/environment.pm | 2 +- .../hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm | 2 +- .../hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm | 2 +- .../server/sun/mgmt_cards/components/showenvironment/disk.pm | 2 +- .../server/sun/mgmt_cards/components/showenvironment/fan.pm | 2 +- .../server/sun/mgmt_cards/components/showenvironment/psu.pm | 2 +- .../sun/mgmt_cards/components/showenvironment/resources.pm | 2 +- .../sun/mgmt_cards/components/showenvironment/sensors.pm | 2 +- .../server/sun/mgmt_cards/components/showenvironment/si.pm | 2 +- .../sun/mgmt_cards/components/showenvironment/temperature.pm | 2 +- .../sun/mgmt_cards/components/showenvironment/voltage.pm | 2 +- centreon-plugins/hardware/server/sun/mgmt_cards/lib/telnet.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/environmentsf2xx.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/environmentv4xx.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/environmentv8xx.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/showboards.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/showenvironment.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/showfaults.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/showfaulty.pm | 2 +- .../hardware/server/sun/mgmt_cards/mode/showstatus.pm | 2 +- centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm | 2 +- centreon-plugins/hardware/server/sun/mseries/mode/domains.pm | 2 +- centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm | 2 +- centreon-plugins/hardware/server/sun/mseries/plugin.pm | 2 +- centreon-plugins/hardware/server/sun/sfxxk/mode/boards.pm | 2 +- .../hardware/server/sun/sfxxk/mode/environment.pm | 2 +- centreon-plugins/hardware/server/sun/sfxxk/mode/failover.pm | 2 +- centreon-plugins/hardware/server/sun/sfxxk/plugin.pm | 2 +- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm | 2 +- centreon-plugins/hardware/ups/mge/snmp/plugin.pm | 2 +- centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm | 2 +- .../hardware/ups/powerware/snmp/mode/batterystatus.pm | 2 +- .../hardware/ups/powerware/snmp/mode/environment.pm | 2 +- .../hardware/ups/powerware/snmp/mode/inputlines.pm | 2 +- .../hardware/ups/powerware/snmp/mode/outputlines.pm | 2 +- .../hardware/ups/powerware/snmp/mode/outputsource.pm | 2 +- centreon-plugins/hardware/ups/powerware/snmp/plugin.pm | 2 +- .../hardware/ups/standard/rfc1628/snmp/mode/alarms.pm | 2 +- .../hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm | 2 +- .../hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm | 2 +- .../hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm | 2 +- .../hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm | 2 +- centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm | 2 +- centreon-plugins/network/3com/snmp/mode/components/fan.pm | 2 +- centreon-plugins/network/3com/snmp/mode/components/psu.pm | 2 +- centreon-plugins/network/3com/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/3com/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/3com/snmp/mode/memory.pm | 2 +- centreon-plugins/network/3com/snmp/plugin.pm | 2 +- .../network/alcatel/common/mode/components/backplane.pm | 2 +- .../network/alcatel/common/mode/components/chassis.pm | 2 +- .../network/alcatel/common/mode/components/container.pm | 2 +- .../network/alcatel/common/mode/components/fan.pm | 2 +- .../network/alcatel/common/mode/components/module.pm | 2 +- .../network/alcatel/common/mode/components/other.pm | 2 +- .../network/alcatel/common/mode/components/port.pm | 2 +- .../network/alcatel/common/mode/components/powersupply.pm | 2 +- .../network/alcatel/common/mode/components/resources.pm | 2 +- .../network/alcatel/common/mode/components/sensor.pm | 2 +- .../network/alcatel/common/mode/components/stack.pm | 2 +- .../network/alcatel/common/mode/components/unknown.pm | 2 +- centreon-plugins/network/alcatel/common/mode/cpu.pm | 2 +- centreon-plugins/network/alcatel/common/mode/flashmemory.pm | 2 +- centreon-plugins/network/alcatel/common/mode/hardware.pm | 2 +- centreon-plugins/network/alcatel/common/mode/memory.pm | 2 +- .../network/alcatel/isam/snmp/mode/vlantraffic.pm | 2 +- centreon-plugins/network/alcatel/isam/snmp/plugin.pm | 2 +- centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm | 2 +- centreon-plugins/network/alcatel/oxe/snmp/mode/domainusage.pm | 2 +- centreon-plugins/network/alcatel/oxe/snmp/mode/pbxrole.pm | 2 +- centreon-plugins/network/alcatel/oxe/snmp/mode/pbxstate.pm | 2 +- centreon-plugins/network/alcatel/oxe/snmp/plugin.pm | 2 +- centreon-plugins/network/arkoon/plugin.pm | 2 +- centreon-plugins/network/aruba/standard/snmp/plugin.pm | 2 +- centreon-plugins/network/atrica/snmp/mode/connections.pm | 2 +- centreon-plugins/network/atrica/snmp/mode/listconnections.pm | 2 +- centreon-plugins/network/atrica/snmp/plugin.pm | 2 +- .../network/bluecoat/snmp/mode/clientconnections.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm | 2 +- .../network/bluecoat/snmp/mode/components/disk.pm | 2 +- .../network/bluecoat/snmp/mode/components/sensor.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/disk.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/bluecoat/snmp/mode/memory.pm | 2 +- .../network/bluecoat/snmp/mode/serverconnections.pm | 2 +- centreon-plugins/network/bluecoat/snmp/plugin.pm | 2 +- centreon-plugins/network/brocade/mode/cpu.pm | 2 +- centreon-plugins/network/brocade/mode/hardware.pm | 2 +- centreon-plugins/network/brocade/mode/memory.pm | 2 +- centreon-plugins/network/brocade/plugin.pm | 2 +- centreon-plugins/network/checkpoint/mode/components/fan.pm | 2 +- centreon-plugins/network/checkpoint/mode/components/psu.pm | 2 +- .../network/checkpoint/mode/components/temperature.pm | 2 +- .../network/checkpoint/mode/components/voltage.pm | 2 +- centreon-plugins/network/checkpoint/mode/connections.pm | 2 +- centreon-plugins/network/checkpoint/mode/cpu.pm | 2 +- centreon-plugins/network/checkpoint/mode/hardware.pm | 2 +- centreon-plugins/network/checkpoint/mode/hastate.pm | 2 +- centreon-plugins/network/checkpoint/mode/memory.pm | 2 +- centreon-plugins/network/checkpoint/plugin.pm | 2 +- centreon-plugins/network/cisco/WaaS/mode/sessions.pm | 2 +- centreon-plugins/network/cisco/WaaS/plugin.pm | 2 +- centreon-plugins/network/cisco/asa/mode/failover.pm | 2 +- centreon-plugins/network/cisco/asa/mode/sessions.pm | 2 +- centreon-plugins/network/cisco/asa/plugin.pm | 2 +- .../network/cisco/ironport/snmp/mode/components/fan.pm | 2 +- .../network/cisco/ironport/snmp/mode/components/psu.pm | 2 +- .../network/cisco/ironport/snmp/mode/components/raid.pm | 2 +- .../cisco/ironport/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm | 2 +- centreon-plugins/network/cisco/ironport/snmp/plugin.pm | 2 +- .../network/cisco/smallbusiness/standard/snmp/plugin.pm | 2 +- centreon-plugins/network/cisco/standard/snmp/plugin.pm | 2 +- centreon-plugins/network/cisco/wlc/snmp/plugin.pm | 2 +- .../citrix/netscaler/common/mode/certificatesexpire.pm | 2 +- .../network/citrix/netscaler/common/mode/connections.pm | 2 +- centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm | 2 +- .../network/citrix/netscaler/common/mode/hastate.pm | 2 +- .../network/citrix/netscaler/common/mode/health.pm | 2 +- .../network/citrix/netscaler/common/mode/listvservers.pm | 2 +- .../network/citrix/netscaler/common/mode/memory.pm | 2 +- .../network/citrix/netscaler/common/mode/storage.pm | 2 +- .../network/citrix/netscaler/common/mode/vserverstatus.pm | 2 +- centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm | 2 +- centreon-plugins/network/dell/6200/plugin.pm | 2 +- centreon-plugins/network/dell/n4000/plugin.pm | 2 +- centreon-plugins/network/dell/sseries/snmp/plugin.pm | 2 +- centreon-plugins/network/digi/portserverts/snmp/mode/cpu.pm | 2 +- .../network/digi/portserverts/snmp/mode/memory.pm | 2 +- centreon-plugins/network/digi/portserverts/snmp/plugin.pm | 2 +- .../network/dlink/dgs3100/snmp/mode/components/fan.pm | 2 +- .../network/dlink/dgs3100/snmp/mode/components/psu.pm | 2 +- centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm | 2 +- .../network/dlink/standard/snmp/mode/components/fan.pm | 2 +- .../network/dlink/standard/snmp/mode/components/psu.pm | 2 +- .../dlink/standard/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/dlink/standard/snmp/plugin.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/components/fan.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/components/poe.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/components/psu.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/components/slot.pm | 2 +- .../network/extreme/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/memory.pm | 2 +- centreon-plugins/network/extreme/snmp/mode/stack.pm | 2 +- centreon-plugins/network/extreme/snmp/plugin.pm | 2 +- centreon-plugins/network/f5/bigip/mode/components/fan.pm | 2 +- centreon-plugins/network/f5/bigip/mode/components/psu.pm | 2 +- .../network/f5/bigip/mode/components/temperature.pm | 2 +- centreon-plugins/network/f5/bigip/mode/connections.pm | 2 +- centreon-plugins/network/f5/bigip/mode/failover.pm | 2 +- centreon-plugins/network/f5/bigip/mode/hardware.pm | 2 +- centreon-plugins/network/f5/bigip/mode/listnodes.pm | 2 +- centreon-plugins/network/f5/bigip/mode/listpools.pm | 2 +- centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm | 2 +- centreon-plugins/network/f5/bigip/mode/nodestatus.pm | 2 +- centreon-plugins/network/f5/bigip/mode/poolstatus.pm | 2 +- centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm | 2 +- centreon-plugins/network/f5/bigip/plugin.pm | 2 +- centreon-plugins/network/fortinet/fortigate/plugin.pm | 2 +- centreon-plugins/network/fritzbox/mode/libgetdata.pm | 2 +- centreon-plugins/network/fritzbox/mode/traffic.pm | 2 +- centreon-plugins/network/fritzbox/mode/upstatus.pm | 2 +- centreon-plugins/network/fritzbox/plugin.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/components/default.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/components/fan.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/components/psu.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/components/sensor.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/h3c/snmp/mode/memory.pm | 2 +- centreon-plugins/network/h3c/snmp/plugin.pm | 2 +- .../network/hirschmann/standard/snmp/mode/components/fan.pm | 2 +- .../network/hirschmann/standard/snmp/mode/components/led.pm | 2 +- .../network/hirschmann/standard/snmp/mode/components/psu.pm | 2 +- .../hirschmann/standard/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm | 2 +- .../network/hirschmann/standard/snmp/mode/hardware.pm | 2 +- .../network/hirschmann/standard/snmp/mode/memory.pm | 2 +- .../network/hirschmann/standard/snmp/mode/processcount.pm | 2 +- centreon-plugins/network/hirschmann/standard/snmp/plugin.pm | 2 +- .../network/hp/procurve/mode/components/sensor.pm | 2 +- centreon-plugins/network/hp/procurve/mode/cpu.pm | 2 +- centreon-plugins/network/hp/procurve/mode/environment.pm | 2 +- centreon-plugins/network/hp/procurve/mode/memory.pm | 2 +- centreon-plugins/network/hp/procurve/plugin.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm | 2 +- .../network/hp/vc/snmp/mode/components/enclosure.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/components/module.pm | 2 +- .../network/hp/vc/snmp/mode/components/moduleport.pm | 2 +- .../network/hp/vc/snmp/mode/components/physicalserver.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/components/port.pm | 2 +- .../network/hp/vc/snmp/mode/components/profile.pm | 2 +- .../network/hp/vc/snmp/mode/components/resources.pm | 2 +- centreon-plugins/network/hp/vc/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/hp/vc/snmp/plugin.pm | 2 +- centreon-plugins/network/juniper/common/ive/mode/cpu.pm | 2 +- centreon-plugins/network/juniper/common/ive/mode/disk.pm | 2 +- centreon-plugins/network/juniper/common/ive/mode/logfile.pm | 2 +- centreon-plugins/network/juniper/common/ive/mode/users.pm | 2 +- .../network/juniper/common/junos/mode/components/fru.pm | 2 +- .../network/juniper/common/junos/mode/components/operating.pm | 2 +- .../network/juniper/common/junos/mode/cpsessions.pm | 2 +- .../network/juniper/common/junos/mode/cpuforwarding.pm | 2 +- .../network/juniper/common/junos/mode/cpurouting.pm | 2 +- .../network/juniper/common/junos/mode/flowsessions.pm | 2 +- .../network/juniper/common/junos/mode/hardware.pm | 2 +- .../network/juniper/common/junos/mode/memoryforwarding.pm | 2 +- .../network/juniper/common/junos/mode/memoryrouting.pm | 2 +- .../network/juniper/common/screenos/mode/components/fan.pm | 2 +- .../network/juniper/common/screenos/mode/components/module.pm | 2 +- .../network/juniper/common/screenos/mode/components/psu.pm | 2 +- .../juniper/common/screenos/mode/components/temperature.pm | 2 +- centreon-plugins/network/juniper/common/screenos/mode/cpu.pm | 2 +- .../network/juniper/common/screenos/mode/hardware.pm | 2 +- .../network/juniper/common/screenos/mode/memory.pm | 2 +- .../network/juniper/common/screenos/mode/sessions.pm | 2 +- centreon-plugins/network/juniper/ex/plugin.pm | 2 +- centreon-plugins/network/juniper/ggsn/mode/apnstats.pm | 2 +- centreon-plugins/network/juniper/ggsn/mode/globalstats.pm | 2 +- centreon-plugins/network/juniper/ggsn/plugin.pm | 2 +- centreon-plugins/network/juniper/mag/mode/bladetemperature.pm | 2 +- centreon-plugins/network/juniper/mag/plugin.pm | 2 +- centreon-plugins/network/juniper/mseries/plugin.pm | 2 +- centreon-plugins/network/juniper/sa/plugin.pm | 2 +- centreon-plugins/network/juniper/srx/plugin.pm | 2 +- centreon-plugins/network/juniper/ssg/plugin.pm | 2 +- centreon-plugins/network/netasq/snmp/mode/hastatus.pm | 2 +- centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm | 2 +- centreon-plugins/network/netasq/snmp/plugin.pm | 2 +- centreon-plugins/network/oneaccess/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/oneaccess/snmp/mode/memory.pm | 2 +- centreon-plugins/network/oneaccess/snmp/plugin.pm | 2 +- centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm | 2 +- centreon-plugins/network/paloalto/snmp/mode/panorama.pm | 2 +- centreon-plugins/network/paloalto/snmp/mode/sessions.pm | 2 +- centreon-plugins/network/paloalto/snmp/plugin.pm | 2 +- centreon-plugins/network/radware/alteon/5224/plugin.pm | 2 +- centreon-plugins/network/radware/alteon/common/mode/cpu.pm | 2 +- .../network/radware/alteon/common/mode/hardware.pm | 2 +- centreon-plugins/network/radware/alteon/common/mode/memory.pm | 2 +- centreon-plugins/network/redback/snmp/mode/components/disk.pm | 2 +- centreon-plugins/network/redback/snmp/mode/components/fan.pm | 2 +- centreon-plugins/network/redback/snmp/mode/components/psu.pm | 2 +- .../network/redback/snmp/mode/components/temperature.pm | 2 +- .../network/redback/snmp/mode/components/voltage.pm | 2 +- centreon-plugins/network/redback/snmp/mode/cpu.pm | 2 +- centreon-plugins/network/redback/snmp/mode/disk.pm | 2 +- centreon-plugins/network/redback/snmp/mode/hardware.pm | 2 +- centreon-plugins/network/redback/snmp/mode/memory.pm | 2 +- centreon-plugins/network/redback/snmp/plugin.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/bwoptimization.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/bwpassthrough.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/connections.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/diskutilization.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/health.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/loadaverage.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/servicestatus.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/serviceuptime.pm | 2 +- .../network/riverbed/steelhead/snmp/mode/temperature.pm | 2 +- centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm | 2 +- centreon-plugins/network/ruggedcom/mode/errors.pm | 2 +- centreon-plugins/network/ruggedcom/mode/hardware.pm | 2 +- centreon-plugins/network/ruggedcom/mode/memory.pm | 2 +- centreon-plugins/network/ruggedcom/mode/temperature.pm | 2 +- centreon-plugins/network/ruggedcom/plugin.pm | 2 +- centreon-plugins/network/securactive/mode/bca.pm | 2 +- centreon-plugins/network/securactive/mode/bcn.pm | 2 +- centreon-plugins/network/securactive/mode/listbca.pm | 2 +- centreon-plugins/network/securactive/mode/listbcn.pm | 2 +- centreon-plugins/network/securactive/plugin.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/connections.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/cpu.pm | 2 +- .../network/stonesoft/snmp/mode/droppedpackets.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/memory.pm | 2 +- .../network/stonesoft/snmp/mode/rejectedpackets.pm | 2 +- centreon-plugins/network/stonesoft/snmp/mode/storage.pm | 2 +- centreon-plugins/network/stonesoft/snmp/plugin.pm | 2 +- centreon-plugins/os/aix/local/mode/errpt.pm | 2 +- centreon-plugins/os/aix/local/mode/liststorages.pm | 2 +- centreon-plugins/os/aix/local/mode/lvsync.pm | 2 +- centreon-plugins/os/aix/local/mode/storage.pm | 2 +- centreon-plugins/os/aix/local/plugin.pm | 2 +- centreon-plugins/os/aix/snmp/mode/swap.pm | 2 +- centreon-plugins/os/aix/snmp/plugin.pm | 2 +- centreon-plugins/os/freebsd/snmp/plugin.pm | 2 +- centreon-plugins/os/linux/local/mode/cmdreturn.pm | 2 +- centreon-plugins/os/linux/local/mode/connections.pm | 2 +- centreon-plugins/os/linux/local/mode/cpu.pm | 2 +- centreon-plugins/os/linux/local/mode/cpudetailed.pm | 2 +- centreon-plugins/os/linux/local/mode/diskio.pm | 2 +- centreon-plugins/os/linux/local/mode/filesdate.pm | 2 +- centreon-plugins/os/linux/local/mode/filessize.pm | 2 +- centreon-plugins/os/linux/local/mode/inodes.pm | 2 +- centreon-plugins/os/linux/local/mode/listinterfaces.pm | 2 +- centreon-plugins/os/linux/local/mode/listpartitions.pm | 2 +- centreon-plugins/os/linux/local/mode/liststorages.pm | 2 +- centreon-plugins/os/linux/local/mode/loadaverage.pm | 2 +- centreon-plugins/os/linux/local/mode/memory.pm | 2 +- centreon-plugins/os/linux/local/mode/packeterrors.pm | 2 +- centreon-plugins/os/linux/local/mode/paging.pm | 2 +- centreon-plugins/os/linux/local/mode/process.pm | 2 +- centreon-plugins/os/linux/local/mode/storage.pm | 2 +- centreon-plugins/os/linux/local/mode/swap.pm | 2 +- centreon-plugins/os/linux/local/mode/traffic.pm | 2 +- centreon-plugins/os/linux/local/mode/uptime.pm | 2 +- centreon-plugins/os/linux/local/plugin.pm | 2 +- centreon-plugins/os/linux/snmp/plugin.pm | 2 +- centreon-plugins/os/solaris/local/mode/analyzedisks.pm | 2 +- centreon-plugins/os/solaris/local/mode/cpu.pm | 2 +- centreon-plugins/os/solaris/local/mode/fcconnected.pm | 2 +- centreon-plugins/os/solaris/local/mode/fmadm.pm | 2 +- centreon-plugins/os/solaris/local/mode/hwraidctl.pm | 2 +- centreon-plugins/os/solaris/local/mode/hwsas2ircu.pm | 2 +- centreon-plugins/os/solaris/local/mode/lomv120.pm | 2 +- .../os/solaris/local/mode/lomv120components/fan.pm | 2 +- .../os/solaris/local/mode/lomv120components/psu.pm | 2 +- .../os/solaris/local/mode/lomv120components/sf.pm | 2 +- .../os/solaris/local/mode/lomv120components/voltage.pm | 2 +- centreon-plugins/os/solaris/local/mode/lomv1280.pm | 2 +- centreon-plugins/os/solaris/local/mode/prtdiag.pm | 2 +- centreon-plugins/os/solaris/local/mode/svmdisks.pm | 2 +- centreon-plugins/os/solaris/local/mode/vxdisks.pm | 2 +- centreon-plugins/os/solaris/local/plugin.pm | 2 +- centreon-plugins/os/solaris/snmp/plugin.pm | 2 +- centreon-plugins/os/windows/local/mode/ntp.pm | 2 +- centreon-plugins/os/windows/local/mode/rdpsessions.pm | 2 +- centreon-plugins/os/windows/local/plugin.pm | 2 +- centreon-plugins/os/windows/snmp/mode/memory.pm | 2 +- centreon-plugins/os/windows/snmp/mode/service.pm | 2 +- centreon-plugins/os/windows/snmp/mode/swap.pm | 2 +- centreon-plugins/os/windows/snmp/plugin.pm | 2 +- centreon-plugins/os/windows/wsman/mode/listservices.pm | 2 +- centreon-plugins/os/windows/wsman/mode/service.pm | 2 +- centreon-plugins/os/windows/wsman/plugin.pm | 2 +- centreon-plugins/snmp_standard/mode/cpu.pm | 2 +- centreon-plugins/snmp_standard/mode/cpudetailed.pm | 2 +- centreon-plugins/snmp_standard/mode/diskio.pm | 2 +- centreon-plugins/snmp_standard/mode/diskusage.pm | 2 +- centreon-plugins/snmp_standard/mode/dynamiccommand.pm | 2 +- centreon-plugins/snmp_standard/mode/hardwaredevice.pm | 2 +- centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm | 2 +- centreon-plugins/snmp_standard/mode/inodes.pm | 2 +- centreon-plugins/snmp_standard/mode/interfaces.pm | 2 +- centreon-plugins/snmp_standard/mode/listdiskspath.pm | 2 +- centreon-plugins/snmp_standard/mode/listinterfaces.pm | 2 +- centreon-plugins/snmp_standard/mode/liststorages.pm | 2 +- centreon-plugins/snmp_standard/mode/loadaverage.pm | 2 +- centreon-plugins/snmp_standard/mode/memory.pm | 2 +- centreon-plugins/snmp_standard/mode/ntp.pm | 2 +- centreon-plugins/snmp_standard/mode/numericvalue.pm | 2 +- centreon-plugins/snmp_standard/mode/printererror.pm | 2 +- centreon-plugins/snmp_standard/mode/processcount.pm | 2 +- centreon-plugins/snmp_standard/mode/spanningtree.pm | 2 +- centreon-plugins/snmp_standard/mode/storage.pm | 2 +- centreon-plugins/snmp_standard/mode/stringvalue.pm | 2 +- centreon-plugins/snmp_standard/mode/swap.pm | 2 +- centreon-plugins/snmp_standard/mode/tcpcon.pm | 2 +- centreon-plugins/snmp_standard/mode/uptime.pm | 2 +- centreon-plugins/snmp_standard/plugin.pm | 2 +- centreon-plugins/storage/dell/MD3000/cli/plugin.pm | 2 +- centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm | 2 +- centreon-plugins/storage/dell/TL2000/plugin.pm | 2 +- .../storage/dell/equallogic/snmp/mode/arraystats.pm | 2 +- .../storage/dell/equallogic/snmp/mode/components/disk.pm | 2 +- .../storage/dell/equallogic/snmp/mode/components/fan.pm | 2 +- .../storage/dell/equallogic/snmp/mode/components/health.pm | 2 +- .../storage/dell/equallogic/snmp/mode/components/psu.pm | 2 +- .../storage/dell/equallogic/snmp/mode/components/raid.pm | 2 +- .../dell/equallogic/snmp/mode/components/temperature.pm | 2 +- .../storage/dell/equallogic/snmp/mode/diskusage.pm | 2 +- .../storage/dell/equallogic/snmp/mode/hardware.pm | 2 +- .../storage/dell/equallogic/snmp/mode/poolusage.pm | 2 +- centreon-plugins/storage/dell/equallogic/snmp/plugin.pm | 2 +- centreon-plugins/storage/dell/ml6000/snmp/plugin.pm | 2 +- centreon-plugins/storage/emc/DataDomain/lib/functions.pm | 2 +- .../storage/emc/DataDomain/mode/components/battery.pm | 2 +- .../storage/emc/DataDomain/mode/components/disk.pm | 2 +- .../storage/emc/DataDomain/mode/components/fan.pm | 2 +- .../storage/emc/DataDomain/mode/components/psu.pm | 2 +- .../storage/emc/DataDomain/mode/components/temperature.pm | 2 +- centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm | 2 +- centreon-plugins/storage/emc/DataDomain/mode/hardware.pm | 2 +- centreon-plugins/storage/emc/DataDomain/mode/replication.pm | 2 +- centreon-plugins/storage/emc/DataDomain/plugin.pm | 2 +- .../emc/celerra/local/mode/components/controlstation.pm | 2 +- .../storage/emc/celerra/local/mode/components/datamover.pm | 2 +- centreon-plugins/storage/emc/celerra/local/mode/getreason.pm | 2 +- centreon-plugins/storage/emc/celerra/local/plugin.pm | 2 +- centreon-plugins/storage/emc/clariion/plugin.pm | 2 +- .../storage/emc/recoverypoint/ssh/mode/monitoredparameters.pm | 2 +- .../storage/emc/recoverypoint/ssh/mode/systemstatus.pm | 2 +- centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm | 2 +- centreon-plugins/storage/emc/vplex/restapi/custom/vplexapi.pm | 2 +- .../storage/emc/vplex/restapi/mode/clustercommunication.pm | 2 +- .../storage/emc/vplex/restapi/mode/clusterdevices.pm | 2 +- centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm | 2 +- .../storage/emc/vplex/restapi/mode/distributeddevices.pm | 2 +- centreon-plugins/storage/emc/vplex/restapi/mode/fans.pm | 2 +- centreon-plugins/storage/emc/vplex/restapi/mode/psus.pm | 2 +- .../storage/emc/vplex/restapi/mode/storagevolumes.pm | 2 +- centreon-plugins/storage/emc/vplex/restapi/plugin.pm | 2 +- .../storage/emc/xtremio/restapi/custom/xtremioapi.pm | 2 +- .../storage/emc/xtremio/restapi/mode/clusterhealth.pm | 2 +- .../storage/emc/xtremio/restapi/mode/ssdendurance.pm | 2 +- centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm | 2 +- centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm | 2 +- .../storage/emc/xtremio/restapi/mode/xenvsstate.pm | 2 +- centreon-plugins/storage/emc/xtremio/restapi/plugin.pm | 2 +- centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm | 2 +- .../storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm | 2 +- .../storage/fujitsu/eternus/dx/ssh/mode/portstats.pm | 2 +- centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm | 2 +- .../storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm | 2 +- .../storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm | 2 +- centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/battery.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/cim.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/iscsi.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/node.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/physicaldisk.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/psu.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/storage.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/temperature.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/volume.pm | 2 +- centreon-plugins/storage/hp/3par/7000/mode/wsapi.pm | 2 +- centreon-plugins/storage/hp/3par/7000/plugin.pm | 2 +- .../storage/hp/lefthand/mode/components/device.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/components/fan.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/components/psu.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/components/rc.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/components/rcc.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/components/ro.pm | 2 +- .../storage/hp/lefthand/mode/components/temperature.pm | 2 +- .../storage/hp/lefthand/mode/components/voltage.pm | 2 +- centreon-plugins/storage/hp/lefthand/mode/hardware.pm | 2 +- centreon-plugins/storage/hp/lefthand/plugin.pm | 2 +- centreon-plugins/storage/hp/msa2000/snmp/plugin.pm | 2 +- centreon-plugins/storage/hp/msl/snmp/mode/status.pm | 2 +- centreon-plugins/storage/hp/msl/snmp/plugin.pm | 2 +- centreon-plugins/storage/hp/p2000/xmlapi/custom.pm | 2 +- .../storage/hp/p2000/xmlapi/mode/components/disk.pm | 2 +- .../storage/hp/p2000/xmlapi/mode/components/enclosure.pm | 2 +- .../storage/hp/p2000/xmlapi/mode/components/fru.pm | 2 +- .../storage/hp/p2000/xmlapi/mode/components/sensors.pm | 2 +- .../storage/hp/p2000/xmlapi/mode/components/vdisk.pm | 2 +- centreon-plugins/storage/hp/p2000/xmlapi/mode/health.pm | 2 +- centreon-plugins/storage/hp/p2000/xmlapi/mode/listvolumes.pm | 2 +- centreon-plugins/storage/hp/p2000/xmlapi/mode/volumesstats.pm | 2 +- centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm | 2 +- centreon-plugins/storage/ibm/DS3000/cli/plugin.pm | 2 +- centreon-plugins/storage/ibm/DS4000/cli/plugin.pm | 2 +- centreon-plugins/storage/ibm/DS5000/cli/plugin.pm | 2 +- centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm | 2 +- centreon-plugins/storage/ibm/TS3100/plugin.pm | 2 +- centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm | 2 +- centreon-plugins/storage/ibm/TS3200/plugin.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/cacheage.pm | 2 +- .../storage/netapp/snmp/mode/components/communication.pm | 2 +- .../storage/netapp/snmp/mode/components/electronics.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/components/fan.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/components/psu.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/components/raid.pm | 2 +- .../storage/netapp/snmp/mode/components/temperature.pm | 2 +- .../storage/netapp/snmp/mode/components/voltage.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/cpuload.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/fan.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/filesys.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/nvram.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/psu.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/shelf.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/temperature.pm | 2 +- centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm | 2 +- centreon-plugins/storage/netapp/snmp/plugin.pm | 2 +- centreon-plugins/storage/nimble/snmp/mode/globalstats.pm | 2 +- centreon-plugins/storage/nimble/snmp/mode/volumeusage.pm | 2 +- centreon-plugins/storage/nimble/snmp/plugin.pm | 2 +- centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm | 2 +- centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm | 2 +- centreon-plugins/storage/panzura/snmp/mode/memory.pm | 2 +- centreon-plugins/storage/panzura/snmp/mode/ratios.pm | 2 +- centreon-plugins/storage/panzura/snmp/plugin.pm | 2 +- centreon-plugins/storage/qnap/snmp/mode/components/disk.pm | 2 +- centreon-plugins/storage/qnap/snmp/mode/components/fan.pm | 2 +- .../storage/qnap/snmp/mode/components/temperature.pm | 2 +- centreon-plugins/storage/qnap/snmp/mode/hardware.pm | 2 +- centreon-plugins/storage/qnap/snmp/mode/memory.pm | 2 +- centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm | 2 +- centreon-plugins/storage/qnap/snmp/plugin.pm | 2 +- centreon-plugins/storage/synology/snmp/mode/components.pm | 2 +- centreon-plugins/storage/synology/snmp/mode/temperature.pm | 2 +- centreon-plugins/storage/synology/snmp/mode/ups.pm | 2 +- centreon-plugins/storage/synology/snmp/plugin.pm | 2 +- centreon-plugins/storage/violin/3000/snmp/plugin.pm | 2 +- 1159 files changed, 1161 insertions(+), 1161 deletions(-) diff --git a/centreon-plugins/apps/activedirectory/local/mode/dcdiag.pm b/centreon-plugins/apps/activedirectory/local/mode/dcdiag.pm index 284d7ea30..cf747ac3c 100644 --- a/centreon-plugins/apps/activedirectory/local/mode/dcdiag.pm +++ b/centreon-plugins/apps/activedirectory/local/mode/dcdiag.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/activedirectory/local/mode/netdom.pm b/centreon-plugins/apps/activedirectory/local/mode/netdom.pm index 07b5a48ab..5059eefd4 100644 --- a/centreon-plugins/apps/activedirectory/local/mode/netdom.pm +++ b/centreon-plugins/apps/activedirectory/local/mode/netdom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/activedirectory/local/plugin.pm b/centreon-plugins/apps/activedirectory/local/plugin.pm index 25c230928..918439a2e 100644 --- a/centreon-plugins/apps/activedirectory/local/plugin.pm +++ b/centreon-plugins/apps/activedirectory/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/activedirectory/wsman/mode/dcdiag.pm b/centreon-plugins/apps/activedirectory/wsman/mode/dcdiag.pm index 0c5cd43fd..3996d4fbc 100644 --- a/centreon-plugins/apps/activedirectory/wsman/mode/dcdiag.pm +++ b/centreon-plugins/apps/activedirectory/wsman/mode/dcdiag.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/activedirectory/wsman/plugin.pm b/centreon-plugins/apps/activedirectory/wsman/plugin.pm index f02336cf6..3e1b90591 100644 --- a/centreon-plugins/apps/activedirectory/wsman/plugin.pm +++ b/centreon-plugins/apps/activedirectory/wsman/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/mode/cpuload.pm b/centreon-plugins/apps/apache/serverstatus/mode/cpuload.pm index c17664b50..df0a4f44d 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/cpuload.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/cpuload.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/mode/requests.pm b/centreon-plugins/apps/apache/serverstatus/mode/requests.pm index b167b4d30..8ab2a2928 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/requests.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/requests.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/mode/responsetime.pm b/centreon-plugins/apps/apache/serverstatus/mode/responsetime.pm index 1cd608c45..72e44c706 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/responsetime.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/responsetime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm b/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm index 6e1cfa38c..c33c663fd 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/mode/workers.pm b/centreon-plugins/apps/apache/serverstatus/mode/workers.pm index 37e97675e..92625bd30 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/workers.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/workers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apache/serverstatus/plugin.pm b/centreon-plugins/apps/apache/serverstatus/plugin.pm index 76be02374..cbbf875fa 100644 --- a/centreon-plugins/apps/apache/serverstatus/plugin.pm +++ b/centreon-plugins/apps/apache/serverstatus/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/batterycharge.pm b/centreon-plugins/apps/apcupsd/local/mode/batterycharge.pm index 00604eff7..dc191ad87 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/batterycharge.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/batterycharge.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/batteryvoltage.pm b/centreon-plugins/apps/apcupsd/local/mode/batteryvoltage.pm index d43d99244..fe6afc5cc 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/batteryvoltage.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/batteryvoltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm index 2bd300877..f82e703b9 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/linefrequency.pm b/centreon-plugins/apps/apcupsd/local/mode/linefrequency.pm index 18e2ddcbd..e3d961a43 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/linefrequency.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/linefrequency.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/linevoltage.pm b/centreon-plugins/apps/apcupsd/local/mode/linevoltage.pm index 5c414cd1d..08fb59a4e 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/linevoltage.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/linevoltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/loadpercentage.pm b/centreon-plugins/apps/apcupsd/local/mode/loadpercentage.pm index 74081b806..c278ea011 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/loadpercentage.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/loadpercentage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/outputvoltage.pm b/centreon-plugins/apps/apcupsd/local/mode/outputvoltage.pm index b22a1622e..5ec59e5b6 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/outputvoltage.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/outputvoltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/temperature.pm b/centreon-plugins/apps/apcupsd/local/mode/temperature.pm index c591fe8c1..11aa4e54f 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/temperature.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/mode/timeleft.pm b/centreon-plugins/apps/apcupsd/local/mode/timeleft.pm index 97945f7ed..39789d43d 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/timeleft.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/timeleft.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/apcupsd/local/plugin.pm b/centreon-plugins/apps/apcupsd/local/plugin.pm index 920c68b42..e8694fa6d 100644 --- a/centreon-plugins/apps/apcupsd/local/plugin.pm +++ b/centreon-plugins/apps/apcupsd/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/biztalk/sql/mode/rlocationdisabled.pm b/centreon-plugins/apps/biztalk/sql/mode/rlocationdisabled.pm index 12d10e16a..657cd1710 100644 --- a/centreon-plugins/apps/biztalk/sql/mode/rlocationdisabled.pm +++ b/centreon-plugins/apps/biztalk/sql/mode/rlocationdisabled.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/bluemind/mode/incoming.pm b/centreon-plugins/apps/bluemind/mode/incoming.pm index 3e2c4de35..2ff258003 100644 --- a/centreon-plugins/apps/bluemind/mode/incoming.pm +++ b/centreon-plugins/apps/bluemind/mode/incoming.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/bluemind/plugin.pm b/centreon-plugins/apps/bluemind/plugin.pm index 1f6b2a843..0947ed956 100644 --- a/centreon-plugins/apps/bluemind/plugin.pm +++ b/centreon-plugins/apps/bluemind/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/local/mode/metaservice.pm b/centreon-plugins/apps/centreon/local/mode/metaservice.pm index f2b9ab8d9..d67614351 100644 --- a/centreon-plugins/apps/centreon/local/mode/metaservice.pm +++ b/centreon-plugins/apps/centreon/local/mode/metaservice.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/local/mode/retentionbroker.pm b/centreon-plugins/apps/centreon/local/mode/retentionbroker.pm index b8afd3a22..a5efc7640 100644 --- a/centreon-plugins/apps/centreon/local/mode/retentionbroker.pm +++ b/centreon-plugins/apps/centreon/local/mode/retentionbroker.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/local/plugin.pm b/centreon-plugins/apps/centreon/local/plugin.pm index e1de66801..d6fb0eef2 100644 --- a/centreon-plugins/apps/centreon/local/plugin.pm +++ b/centreon-plugins/apps/centreon/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/eventqueue.pm b/centreon-plugins/apps/centreon/map/jmx/mode/eventqueue.pm index 9cd6a8e00..cea2649df 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/eventqueue.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/eventqueue.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/eventstatistics.pm b/centreon-plugins/apps/centreon/map/jmx/mode/eventstatistics.pm index 494fb186d..b1b9b2a40 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/eventstatistics.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/eventstatistics.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm b/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm index 27d855c15..250bc2fe6 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm b/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm index 443bde899..6d8f9052c 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/map/jmx/plugin.pm b/centreon-plugins/apps/centreon/map/jmx/plugin.pm index 2fb2c9626..f9bca3abd 100644 --- a/centreon-plugins/apps/centreon/map/jmx/plugin.pm +++ b/centreon-plugins/apps/centreon/map/jmx/plugin.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/sql/mode/countnotifications.pm b/centreon-plugins/apps/centreon/sql/mode/countnotifications.pm index e3faf7f31..11cdb2757 100644 --- a/centreon-plugins/apps/centreon/sql/mode/countnotifications.pm +++ b/centreon-plugins/apps/centreon/sql/mode/countnotifications.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/sql/mode/countproblems.pm b/centreon-plugins/apps/centreon/sql/mode/countproblems.pm index 8a58ee593..4ecedb339 100644 --- a/centreon-plugins/apps/centreon/sql/mode/countproblems.pm +++ b/centreon-plugins/apps/centreon/sql/mode/countproblems.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/sql/mode/partitioning.pm b/centreon-plugins/apps/centreon/sql/mode/partitioning.pm index 2eeabf0eb..fdc02a942 100644 --- a/centreon-plugins/apps/centreon/sql/mode/partitioning.pm +++ b/centreon-plugins/apps/centreon/sql/mode/partitioning.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/centreon/sql/mode/pollerdelay.pm b/centreon-plugins/apps/centreon/sql/mode/pollerdelay.pm index 38652eb44..4429d4a99 100644 --- a/centreon-plugins/apps/centreon/sql/mode/pollerdelay.pm +++ b/centreon-plugins/apps/centreon/sql/mode/pollerdelay.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/checkmyws/mode/status.pm b/centreon-plugins/apps/checkmyws/mode/status.pm index 81b1aa75d..e6de45cc0 100644 --- a/centreon-plugins/apps/checkmyws/mode/status.pm +++ b/centreon-plugins/apps/checkmyws/mode/status.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/checkmyws/plugin.pm b/centreon-plugins/apps/checkmyws/plugin.pm index 41a5e0fc4..1de610a64 100644 --- a/centreon-plugins/apps/checkmyws/plugin.pm +++ b/centreon-plugins/apps/checkmyws/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/citrix/local/mode/folder.pm b/centreon-plugins/apps/citrix/local/mode/folder.pm index fa9efb418..7d9c486cb 100644 --- a/centreon-plugins/apps/citrix/local/mode/folder.pm +++ b/centreon-plugins/apps/citrix/local/mode/folder.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/citrix/local/mode/license.pm b/centreon-plugins/apps/citrix/local/mode/license.pm index ec5653f4a..09586dfb3 100644 --- a/centreon-plugins/apps/citrix/local/mode/license.pm +++ b/centreon-plugins/apps/citrix/local/mode/license.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/citrix/local/mode/session.pm b/centreon-plugins/apps/citrix/local/mode/session.pm index e0348f6ba..18eb512e6 100644 --- a/centreon-plugins/apps/citrix/local/mode/session.pm +++ b/centreon-plugins/apps/citrix/local/mode/session.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/citrix/local/mode/zone.pm b/centreon-plugins/apps/citrix/local/mode/zone.pm index e7f5c10c4..9c5c608d4 100644 --- a/centreon-plugins/apps/citrix/local/mode/zone.pm +++ b/centreon-plugins/apps/citrix/local/mode/zone.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/citrix/local/plugin.pm b/centreon-plugins/apps/citrix/local/plugin.pm index 044724cc2..3ac4781a1 100644 --- a/centreon-plugins/apps/citrix/local/plugin.pm +++ b/centreon-plugins/apps/citrix/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/elasticsearch/mode/cluster.pm b/centreon-plugins/apps/elasticsearch/mode/cluster.pm index b11d9b85e..891150ae2 100644 --- a/centreon-plugins/apps/elasticsearch/mode/cluster.pm +++ b/centreon-plugins/apps/elasticsearch/mode/cluster.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/elasticsearch/mode/indices.pm b/centreon-plugins/apps/elasticsearch/mode/indices.pm index 0d510a2a1..34ddfa63e 100644 --- a/centreon-plugins/apps/elasticsearch/mode/indices.pm +++ b/centreon-plugins/apps/elasticsearch/mode/indices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/elasticsearch/mode/nodescount.pm b/centreon-plugins/apps/elasticsearch/mode/nodescount.pm index 1babb409a..c46eef4cd 100644 --- a/centreon-plugins/apps/elasticsearch/mode/nodescount.pm +++ b/centreon-plugins/apps/elasticsearch/mode/nodescount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/elasticsearch/plugin.pm b/centreon-plugins/apps/elasticsearch/plugin.pm index 24e90cda2..945302278 100644 --- a/centreon-plugins/apps/elasticsearch/plugin.pm +++ b/centreon-plugins/apps/elasticsearch/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/activesyncmailbox.pm b/centreon-plugins/apps/exchange/2010/local/mode/activesyncmailbox.pm index a74a6e40f..47c89fa6b 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/activesyncmailbox.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/activesyncmailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/databases.pm b/centreon-plugins/apps/exchange/2010/local/mode/databases.pm index 5e1f27bfc..bff0bc11a 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/databases.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/databases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/imapmailbox.pm b/centreon-plugins/apps/exchange/2010/local/mode/imapmailbox.pm index e1e186cd5..18dd1cbd9 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/imapmailbox.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/imapmailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/listdatabases.pm b/centreon-plugins/apps/exchange/2010/local/mode/listdatabases.pm index 068e21094..90fb1dd7d 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/listdatabases.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/listdatabases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/mapimailbox.pm b/centreon-plugins/apps/exchange/2010/local/mode/mapimailbox.pm index 1b8c93fc4..c78d1e640 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/mapimailbox.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/mapimailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/outlookwebservices.pm b/centreon-plugins/apps/exchange/2010/local/mode/outlookwebservices.pm index f8e558ef3..00feff54a 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/outlookwebservices.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/outlookwebservices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/owamailbox.pm b/centreon-plugins/apps/exchange/2010/local/mode/owamailbox.pm index 98c027094..747e74663 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/owamailbox.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/owamailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/queues.pm b/centreon-plugins/apps/exchange/2010/local/mode/queues.pm index 8e9c88437..ca8f0af0d 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/queues.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/queues.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/replicationhealth.pm b/centreon-plugins/apps/exchange/2010/local/mode/replicationhealth.pm index c0533ca1b..546b4818c 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/replicationhealth.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/replicationhealth.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/mode/services.pm b/centreon-plugins/apps/exchange/2010/local/mode/services.pm index 6aa384657..a43d36741 100644 --- a/centreon-plugins/apps/exchange/2010/local/mode/services.pm +++ b/centreon-plugins/apps/exchange/2010/local/mode/services.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/exchange/2010/local/plugin.pm b/centreon-plugins/apps/exchange/2010/local/plugin.pm index 344967426..ca9c805e4 100644 --- a/centreon-plugins/apps/exchange/2010/local/plugin.pm +++ b/centreon-plugins/apps/exchange/2010/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/mode/commits.pm b/centreon-plugins/apps/github/mode/commits.pm index 015db74ba..4972f0f81 100644 --- a/centreon-plugins/apps/github/mode/commits.pm +++ b/centreon-plugins/apps/github/mode/commits.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/mode/issues.pm b/centreon-plugins/apps/github/mode/issues.pm index f2c2f7f2f..353c52b63 100644 --- a/centreon-plugins/apps/github/mode/issues.pm +++ b/centreon-plugins/apps/github/mode/issues.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/mode/pullrequests.pm b/centreon-plugins/apps/github/mode/pullrequests.pm index edfb7c1c1..c37033a55 100644 --- a/centreon-plugins/apps/github/mode/pullrequests.pm +++ b/centreon-plugins/apps/github/mode/pullrequests.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/mode/stats.pm b/centreon-plugins/apps/github/mode/stats.pm index 957a06a14..071e362b6 100644 --- a/centreon-plugins/apps/github/mode/stats.pm +++ b/centreon-plugins/apps/github/mode/stats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/mode/status.pm b/centreon-plugins/apps/github/mode/status.pm index 5058e80db..73cdfea3d 100644 --- a/centreon-plugins/apps/github/mode/status.pm +++ b/centreon-plugins/apps/github/mode/status.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/github/plugin.pm b/centreon-plugins/apps/github/plugin.pm index 748e1973d..0e5f8b7b8 100644 --- a/centreon-plugins/apps/github/plugin.pm +++ b/centreon-plugins/apps/github/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/hddtemp/local/mode/temperature.pm b/centreon-plugins/apps/hddtemp/local/mode/temperature.pm index fc4a4d2db..fbfc2fd00 100644 --- a/centreon-plugins/apps/hddtemp/local/mode/temperature.pm +++ b/centreon-plugins/apps/hddtemp/local/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/hddtemp/local/plugin.pm b/centreon-plugins/apps/hddtemp/local/plugin.pm index f0033bc30..55bc83f8f 100644 --- a/centreon-plugins/apps/hddtemp/local/plugin.pm +++ b/centreon-plugins/apps/hddtemp/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/hddtemp/remote/mode/listdrives.pm b/centreon-plugins/apps/hddtemp/remote/mode/listdrives.pm index d79719787..1a9d1e85c 100644 --- a/centreon-plugins/apps/hddtemp/remote/mode/listdrives.pm +++ b/centreon-plugins/apps/hddtemp/remote/mode/listdrives.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/hddtemp/remote/mode/temperature.pm b/centreon-plugins/apps/hddtemp/remote/mode/temperature.pm index 4bcaa1771..e1cff58c0 100644 --- a/centreon-plugins/apps/hddtemp/remote/mode/temperature.pm +++ b/centreon-plugins/apps/hddtemp/remote/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/hddtemp/remote/plugin.pm b/centreon-plugins/apps/hddtemp/remote/plugin.pm index 2b9d910f7..cc01c55e5 100644 --- a/centreon-plugins/apps/hddtemp/remote/plugin.pm +++ b/centreon-plugins/apps/hddtemp/remote/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/local/mode/applicationpoolstate.pm b/centreon-plugins/apps/iis/local/mode/applicationpoolstate.pm index 5146997e1..1df35b22e 100644 --- a/centreon-plugins/apps/iis/local/mode/applicationpoolstate.pm +++ b/centreon-plugins/apps/iis/local/mode/applicationpoolstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/local/mode/listapplicationpools.pm b/centreon-plugins/apps/iis/local/mode/listapplicationpools.pm index 337f32f04..5368a51d9 100644 --- a/centreon-plugins/apps/iis/local/mode/listapplicationpools.pm +++ b/centreon-plugins/apps/iis/local/mode/listapplicationpools.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/local/mode/listsites.pm b/centreon-plugins/apps/iis/local/mode/listsites.pm index abca20404..608443a50 100644 --- a/centreon-plugins/apps/iis/local/mode/listsites.pm +++ b/centreon-plugins/apps/iis/local/mode/listsites.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/local/mode/webservicestatistics.pm b/centreon-plugins/apps/iis/local/mode/webservicestatistics.pm index e89233c9a..d6eb6becf 100644 --- a/centreon-plugins/apps/iis/local/mode/webservicestatistics.pm +++ b/centreon-plugins/apps/iis/local/mode/webservicestatistics.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/local/plugin.pm b/centreon-plugins/apps/iis/local/plugin.pm index f5ebf3adc..f8ce8235d 100644 --- a/centreon-plugins/apps/iis/local/plugin.pm +++ b/centreon-plugins/apps/iis/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/wsman/mode/applicationpoolstate.pm b/centreon-plugins/apps/iis/wsman/mode/applicationpoolstate.pm index 7f6e4d879..05285b39f 100644 --- a/centreon-plugins/apps/iis/wsman/mode/applicationpoolstate.pm +++ b/centreon-plugins/apps/iis/wsman/mode/applicationpoolstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/wsman/mode/listapplicationpools.pm b/centreon-plugins/apps/iis/wsman/mode/listapplicationpools.pm index bc72aaee3..5ff2b5f3f 100644 --- a/centreon-plugins/apps/iis/wsman/mode/listapplicationpools.pm +++ b/centreon-plugins/apps/iis/wsman/mode/listapplicationpools.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/iis/wsman/plugin.pm b/centreon-plugins/apps/iis/wsman/plugin.pm index 83e1503b3..c0a9c51a8 100644 --- a/centreon-plugins/apps/iis/wsman/plugin.pm +++ b/centreon-plugins/apps/iis/wsman/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/java/peoplesoft/jmx/mode/queuelength.pm b/centreon-plugins/apps/java/peoplesoft/jmx/mode/queuelength.pm index 60b78bd56..500fc2be9 100644 --- a/centreon-plugins/apps/java/peoplesoft/jmx/mode/queuelength.pm +++ b/centreon-plugins/apps/java/peoplesoft/jmx/mode/queuelength.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/java/peoplesoft/jmx/mode/sessions.pm b/centreon-plugins/apps/java/peoplesoft/jmx/mode/sessions.pm index 1c89017ea..cd49efdfc 100644 --- a/centreon-plugins/apps/java/peoplesoft/jmx/mode/sessions.pm +++ b/centreon-plugins/apps/java/peoplesoft/jmx/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm b/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm index c50d9807e..cbd6d348d 100644 --- a/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm +++ b/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/java/weblogic/jmx/mode/workmanager.pm b/centreon-plugins/apps/java/weblogic/jmx/mode/workmanager.pm index 30bdbab45..5c06eca0c 100644 --- a/centreon-plugins/apps/java/weblogic/jmx/mode/workmanager.pm +++ b/centreon-plugins/apps/java/weblogic/jmx/mode/workmanager.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/java/weblogic/jmx/plugin.pm b/centreon-plugins/apps/java/weblogic/jmx/plugin.pm index 7c227b9f7..122b9d8fe 100644 --- a/centreon-plugins/apps/java/weblogic/jmx/plugin.pm +++ b/centreon-plugins/apps/java/weblogic/jmx/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/jenkins/mode/jobstate.pm b/centreon-plugins/apps/jenkins/mode/jobstate.pm index 34c80a98a..88fbaab76 100644 --- a/centreon-plugins/apps/jenkins/mode/jobstate.pm +++ b/centreon-plugins/apps/jenkins/mode/jobstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/jenkins/plugin.pm b/centreon-plugins/apps/jenkins/plugin.pm index 38551eb2e..f7cc92343 100644 --- a/centreon-plugins/apps/jenkins/plugin.pm +++ b/centreon-plugins/apps/jenkins/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/jive/sql/mode/etljobstatus.pm b/centreon-plugins/apps/jive/sql/mode/etljobstatus.pm index 6e234d595..a6c675b86 100644 --- a/centreon-plugins/apps/jive/sql/mode/etljobstatus.pm +++ b/centreon-plugins/apps/jive/sql/mode/etljobstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/mode/listdepartment.pm b/centreon-plugins/apps/kayako/api/mode/listdepartment.pm index 353e5df33..4c0a85664 100644 --- a/centreon-plugins/apps/kayako/api/mode/listdepartment.pm +++ b/centreon-plugins/apps/kayako/api/mode/listdepartment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/mode/listpriority.pm b/centreon-plugins/apps/kayako/api/mode/listpriority.pm index 2917a8848..76caff8d9 100644 --- a/centreon-plugins/apps/kayako/api/mode/listpriority.pm +++ b/centreon-plugins/apps/kayako/api/mode/listpriority.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/mode/liststaff.pm b/centreon-plugins/apps/kayako/api/mode/liststaff.pm index d28c6503b..1cedebfeb 100644 --- a/centreon-plugins/apps/kayako/api/mode/liststaff.pm +++ b/centreon-plugins/apps/kayako/api/mode/liststaff.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/mode/liststatus.pm b/centreon-plugins/apps/kayako/api/mode/liststatus.pm index 822e45aad..52ca12f78 100644 --- a/centreon-plugins/apps/kayako/api/mode/liststatus.pm +++ b/centreon-plugins/apps/kayako/api/mode/liststatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/mode/ticketcount.pm b/centreon-plugins/apps/kayako/api/mode/ticketcount.pm index 15ba28222..f8008d84a 100644 --- a/centreon-plugins/apps/kayako/api/mode/ticketcount.pm +++ b/centreon-plugins/apps/kayako/api/mode/ticketcount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/api/plugin.pm b/centreon-plugins/apps/kayako/api/plugin.pm index 9357c410d..a8c0abcde 100644 --- a/centreon-plugins/apps/kayako/api/plugin.pm +++ b/centreon-plugins/apps/kayako/api/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/sql/mode/listdepartment.pm b/centreon-plugins/apps/kayako/sql/mode/listdepartment.pm index b50c01cfe..b376bbb57 100644 --- a/centreon-plugins/apps/kayako/sql/mode/listdepartment.pm +++ b/centreon-plugins/apps/kayako/sql/mode/listdepartment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/sql/mode/listpriority.pm b/centreon-plugins/apps/kayako/sql/mode/listpriority.pm index 533d6763b..3ababda75 100644 --- a/centreon-plugins/apps/kayako/sql/mode/listpriority.pm +++ b/centreon-plugins/apps/kayako/sql/mode/listpriority.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/sql/mode/liststaff.pm b/centreon-plugins/apps/kayako/sql/mode/liststaff.pm index 90d7aa34e..91fe605a6 100644 --- a/centreon-plugins/apps/kayako/sql/mode/liststaff.pm +++ b/centreon-plugins/apps/kayako/sql/mode/liststaff.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/sql/mode/liststatus.pm b/centreon-plugins/apps/kayako/sql/mode/liststatus.pm index f30adab93..4a9377472 100644 --- a/centreon-plugins/apps/kayako/sql/mode/liststatus.pm +++ b/centreon-plugins/apps/kayako/sql/mode/liststatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/kayako/sql/mode/ticketcount.pm b/centreon-plugins/apps/kayako/sql/mode/ticketcount.pm index 567e1fdfd..c29f52c6b 100644 --- a/centreon-plugins/apps/kayako/sql/mode/ticketcount.pm +++ b/centreon-plugins/apps/kayako/sql/mode/ticketcount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lmsensors/mode/fan.pm b/centreon-plugins/apps/lmsensors/mode/fan.pm index 44f7ca72c..c18df7c63 100644 --- a/centreon-plugins/apps/lmsensors/mode/fan.pm +++ b/centreon-plugins/apps/lmsensors/mode/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lmsensors/mode/misc.pm b/centreon-plugins/apps/lmsensors/mode/misc.pm index 0cf6f9379..34d3c4c11 100644 --- a/centreon-plugins/apps/lmsensors/mode/misc.pm +++ b/centreon-plugins/apps/lmsensors/mode/misc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lmsensors/mode/temperature.pm b/centreon-plugins/apps/lmsensors/mode/temperature.pm index 84b9d57af..71d51b19d 100644 --- a/centreon-plugins/apps/lmsensors/mode/temperature.pm +++ b/centreon-plugins/apps/lmsensors/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lmsensors/mode/voltage.pm b/centreon-plugins/apps/lmsensors/mode/voltage.pm index 0c3479252..3a5e5a6ac 100644 --- a/centreon-plugins/apps/lmsensors/mode/voltage.pm +++ b/centreon-plugins/apps/lmsensors/mode/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lmsensors/plugin.pm b/centreon-plugins/apps/lmsensors/plugin.pm index 8044216aa..624752644 100644 --- a/centreon-plugins/apps/lmsensors/plugin.pm +++ b/centreon-plugins/apps/lmsensors/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm b/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm index f3493aa0c..0a7c23d3e 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm b/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm index 8eaf78f97..b6fe57131 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm b/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm index 08927110a..8434c54f1 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm b/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm index 5af785422..49392dc9f 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm b/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm index 81cbec9b7..cabc676d6 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lotus/snmp/plugin.pm b/centreon-plugins/apps/lotus/snmp/plugin.pm index 8d40ab21a..70a99d8ea 100644 --- a/centreon-plugins/apps/lotus/snmp/plugin.pm +++ b/centreon-plugins/apps/lotus/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lync/mode/imsessions.pm b/centreon-plugins/apps/lync/mode/imsessions.pm index 269b07e5c..fd941d27c 100644 --- a/centreon-plugins/apps/lync/mode/imsessions.pm +++ b/centreon-plugins/apps/lync/mode/imsessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lync/mode/lyncusers.pm b/centreon-plugins/apps/lync/mode/lyncusers.pm index 68d8a02dc..55613a909 100644 --- a/centreon-plugins/apps/lync/mode/lyncusers.pm +++ b/centreon-plugins/apps/lync/mode/lyncusers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lync/mode/remoteassistance.pm b/centreon-plugins/apps/lync/mode/remoteassistance.pm index e0a5defe2..8814abca9 100644 --- a/centreon-plugins/apps/lync/mode/remoteassistance.pm +++ b/centreon-plugins/apps/lync/mode/remoteassistance.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/lync/mode/sessionstype.pm b/centreon-plugins/apps/lync/mode/sessionstype.pm index e2b9404fe..67f8a5cb0 100644 --- a/centreon-plugins/apps/lync/mode/sessionstype.pm +++ b/centreon-plugins/apps/lync/mode/sessionstype.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/msmq/local/mode/listqueues.pm b/centreon-plugins/apps/msmq/local/mode/listqueues.pm index 4b85259b7..83ede43ac 100644 --- a/centreon-plugins/apps/msmq/local/mode/listqueues.pm +++ b/centreon-plugins/apps/msmq/local/mode/listqueues.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/msmq/local/plugin.pm b/centreon-plugins/apps/msmq/local/plugin.pm index 4206bf544..28694c710 100644 --- a/centreon-plugins/apps/msmq/local/plugin.pm +++ b/centreon-plugins/apps/msmq/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/nginx/serverstatus/mode/connections.pm b/centreon-plugins/apps/nginx/serverstatus/mode/connections.pm index 3d3816837..592cff24f 100644 --- a/centreon-plugins/apps/nginx/serverstatus/mode/connections.pm +++ b/centreon-plugins/apps/nginx/serverstatus/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/nginx/serverstatus/mode/requests.pm b/centreon-plugins/apps/nginx/serverstatus/mode/requests.pm index 790cb1705..c8732c56d 100644 --- a/centreon-plugins/apps/nginx/serverstatus/mode/requests.pm +++ b/centreon-plugins/apps/nginx/serverstatus/mode/requests.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/nginx/serverstatus/mode/responsetime.pm b/centreon-plugins/apps/nginx/serverstatus/mode/responsetime.pm index 9e1693e4e..019875505 100644 --- a/centreon-plugins/apps/nginx/serverstatus/mode/responsetime.pm +++ b/centreon-plugins/apps/nginx/serverstatus/mode/responsetime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/nginx/serverstatus/plugin.pm b/centreon-plugins/apps/nginx/serverstatus/plugin.pm index 7ffe12b03..74dbeda13 100644 --- a/centreon-plugins/apps/nginx/serverstatus/plugin.pm +++ b/centreon-plugins/apps/nginx/serverstatus/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pacemaker/local/mode/crm.pm b/centreon-plugins/apps/pacemaker/local/mode/crm.pm index a1348a2ce..01f2b910f 100644 --- a/centreon-plugins/apps/pacemaker/local/mode/crm.pm +++ b/centreon-plugins/apps/pacemaker/local/mode/crm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pacemaker/local/plugin.pm b/centreon-plugins/apps/pacemaker/local/plugin.pm index 9838f7a35..960c15d3b 100644 --- a/centreon-plugins/apps/pacemaker/local/plugin.pm +++ b/centreon-plugins/apps/pacemaker/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm b/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm index 287bab9ca..d2621b55b 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm b/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm index ca53fe386..4e10746fa 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm b/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm index cb278a66b..031ae09ba 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/pfsense/snmp/plugin.pm b/centreon-plugins/apps/pfsense/snmp/plugin.pm index 6c1b5b9f6..03a0dd757 100644 --- a/centreon-plugins/apps/pfsense/snmp/plugin.pm +++ b/centreon-plugins/apps/pfsense/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/php/apc/web/mode/filecache.pm b/centreon-plugins/apps/php/apc/web/mode/filecache.pm index aa83f8253..a99a42019 100644 --- a/centreon-plugins/apps/php/apc/web/mode/filecache.pm +++ b/centreon-plugins/apps/php/apc/web/mode/filecache.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/php/apc/web/mode/memory.pm b/centreon-plugins/apps/php/apc/web/mode/memory.pm index 6a5fee586..b3f901530 100644 --- a/centreon-plugins/apps/php/apc/web/mode/memory.pm +++ b/centreon-plugins/apps/php/apc/web/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/php/apc/web/plugin.pm b/centreon-plugins/apps/php/apc/web/plugin.pm index 6e240bf96..c15bb19a3 100644 --- a/centreon-plugins/apps/php/apc/web/plugin.pm +++ b/centreon-plugins/apps/php/apc/web/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/php/fpm/web/mode/usage.pm b/centreon-plugins/apps/php/fpm/web/mode/usage.pm index fd149d20a..b3089376f 100644 --- a/centreon-plugins/apps/php/fpm/web/mode/usage.pm +++ b/centreon-plugins/apps/php/fpm/web/mode/usage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/php/fpm/web/plugin.pm b/centreon-plugins/apps/php/fpm/web/plugin.pm index 73e76f92f..55b82dd99 100644 --- a/centreon-plugins/apps/php/fpm/web/plugin.pm +++ b/centreon-plugins/apps/php/fpm/web/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm index 1cbbe37ec..d9daa844e 100644 --- a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm +++ b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/bgp/4/plugin.pm b/centreon-plugins/apps/protocols/bgp/4/plugin.pm index 1f4415bd8..9f403eb40 100644 --- a/centreon-plugins/apps/protocols/bgp/4/plugin.pm +++ b/centreon-plugins/apps/protocols/bgp/4/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/dhcp/mode/connection.pm b/centreon-plugins/apps/protocols/dhcp/mode/connection.pm index 8c5233df7..d0b1d2a6b 100644 --- a/centreon-plugins/apps/protocols/dhcp/mode/connection.pm +++ b/centreon-plugins/apps/protocols/dhcp/mode/connection.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/dhcp/plugin.pm b/centreon-plugins/apps/protocols/dhcp/plugin.pm index d1b76a7c6..eb4bc0ec4 100644 --- a/centreon-plugins/apps/protocols/dhcp/plugin.pm +++ b/centreon-plugins/apps/protocols/dhcp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/dns/lib/dns.pm b/centreon-plugins/apps/protocols/dns/lib/dns.pm index 6ad5e258c..14b2e85c6 100644 --- a/centreon-plugins/apps/protocols/dns/lib/dns.pm +++ b/centreon-plugins/apps/protocols/dns/lib/dns.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/dns/mode/request.pm b/centreon-plugins/apps/protocols/dns/mode/request.pm index 5bc8f4c35..ef27ffad9 100644 --- a/centreon-plugins/apps/protocols/dns/mode/request.pm +++ b/centreon-plugins/apps/protocols/dns/mode/request.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/dns/plugin.pm b/centreon-plugins/apps/protocols/dns/plugin.pm index aea448f5d..6b7dd0a40 100644 --- a/centreon-plugins/apps/protocols/dns/plugin.pm +++ b/centreon-plugins/apps/protocols/dns/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/lib/ftp.pm b/centreon-plugins/apps/protocols/ftp/lib/ftp.pm index 8552a8230..6d0bbe676 100644 --- a/centreon-plugins/apps/protocols/ftp/lib/ftp.pm +++ b/centreon-plugins/apps/protocols/ftp/lib/ftp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/mode/commands.pm b/centreon-plugins/apps/protocols/ftp/mode/commands.pm index e0181779c..32abc484d 100644 --- a/centreon-plugins/apps/protocols/ftp/mode/commands.pm +++ b/centreon-plugins/apps/protocols/ftp/mode/commands.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/mode/date.pm b/centreon-plugins/apps/protocols/ftp/mode/date.pm index 4b9bf30d1..e9ebf46a3 100644 --- a/centreon-plugins/apps/protocols/ftp/mode/date.pm +++ b/centreon-plugins/apps/protocols/ftp/mode/date.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/mode/filescount.pm b/centreon-plugins/apps/protocols/ftp/mode/filescount.pm index 78ea6bdfd..bb9dd1a5d 100644 --- a/centreon-plugins/apps/protocols/ftp/mode/filescount.pm +++ b/centreon-plugins/apps/protocols/ftp/mode/filescount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/mode/login.pm b/centreon-plugins/apps/protocols/ftp/mode/login.pm index ba965d2aa..e4118c057 100644 --- a/centreon-plugins/apps/protocols/ftp/mode/login.pm +++ b/centreon-plugins/apps/protocols/ftp/mode/login.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ftp/plugin.pm b/centreon-plugins/apps/protocols/ftp/plugin.pm index e8c43db69..11515bb1d 100644 --- a/centreon-plugins/apps/protocols/ftp/plugin.pm +++ b/centreon-plugins/apps/protocols/ftp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/http/mode/expectedcontent.pm b/centreon-plugins/apps/protocols/http/mode/expectedcontent.pm index 1f547221c..dc745d280 100644 --- a/centreon-plugins/apps/protocols/http/mode/expectedcontent.pm +++ b/centreon-plugins/apps/protocols/http/mode/expectedcontent.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm b/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm index 372082276..46e73c952 100644 --- a/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm +++ b/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/http/mode/response.pm b/centreon-plugins/apps/protocols/http/mode/response.pm index 3616e37f3..c0305dca4 100644 --- a/centreon-plugins/apps/protocols/http/mode/response.pm +++ b/centreon-plugins/apps/protocols/http/mode/response.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/http/mode/soapcontent.pm b/centreon-plugins/apps/protocols/http/mode/soapcontent.pm index 068c2b216..ee124246d 100644 --- a/centreon-plugins/apps/protocols/http/mode/soapcontent.pm +++ b/centreon-plugins/apps/protocols/http/mode/soapcontent.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/http/plugin.pm b/centreon-plugins/apps/protocols/http/plugin.pm index a9cd1079d..9d6c1f8f0 100644 --- a/centreon-plugins/apps/protocols/http/plugin.pm +++ b/centreon-plugins/apps/protocols/http/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/imap/lib/imap.pm b/centreon-plugins/apps/protocols/imap/lib/imap.pm index 7454d6604..135b87fa1 100644 --- a/centreon-plugins/apps/protocols/imap/lib/imap.pm +++ b/centreon-plugins/apps/protocols/imap/lib/imap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/imap/mode/login.pm b/centreon-plugins/apps/protocols/imap/mode/login.pm index 2c78c8704..dadfd4ff3 100644 --- a/centreon-plugins/apps/protocols/imap/mode/login.pm +++ b/centreon-plugins/apps/protocols/imap/mode/login.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/imap/mode/searchmessage.pm b/centreon-plugins/apps/protocols/imap/mode/searchmessage.pm index 18b3e21c8..f022d3407 100644 --- a/centreon-plugins/apps/protocols/imap/mode/searchmessage.pm +++ b/centreon-plugins/apps/protocols/imap/mode/searchmessage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/imap/plugin.pm b/centreon-plugins/apps/protocols/imap/plugin.pm index 8c7240c6b..d8180d099 100644 --- a/centreon-plugins/apps/protocols/imap/plugin.pm +++ b/centreon-plugins/apps/protocols/imap/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/jmx/mode/listattributes.pm b/centreon-plugins/apps/protocols/jmx/mode/listattributes.pm index ff55dcf5b..846a43ee7 100644 --- a/centreon-plugins/apps/protocols/jmx/mode/listattributes.pm +++ b/centreon-plugins/apps/protocols/jmx/mode/listattributes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm index a91d6630d..6eb9e3ae0 100644 --- a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm +++ b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/jmx/plugin.pm b/centreon-plugins/apps/protocols/jmx/plugin.pm index 375d79d97..1925b8156 100644 --- a/centreon-plugins/apps/protocols/jmx/plugin.pm +++ b/centreon-plugins/apps/protocols/jmx/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ldap/lib/ldap.pm b/centreon-plugins/apps/protocols/ldap/lib/ldap.pm index 0eca07b12..4a1705623 100644 --- a/centreon-plugins/apps/protocols/ldap/lib/ldap.pm +++ b/centreon-plugins/apps/protocols/ldap/lib/ldap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ldap/mode/login.pm b/centreon-plugins/apps/protocols/ldap/mode/login.pm index 01edec7cf..37a5e548e 100644 --- a/centreon-plugins/apps/protocols/ldap/mode/login.pm +++ b/centreon-plugins/apps/protocols/ldap/mode/login.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ldap/mode/search.pm b/centreon-plugins/apps/protocols/ldap/mode/search.pm index fbbcc94b7..0932d11e8 100644 --- a/centreon-plugins/apps/protocols/ldap/mode/search.pm +++ b/centreon-plugins/apps/protocols/ldap/mode/search.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ldap/plugin.pm b/centreon-plugins/apps/protocols/ldap/plugin.pm index 3c680279a..7a2c457e3 100644 --- a/centreon-plugins/apps/protocols/ldap/plugin.pm +++ b/centreon-plugins/apps/protocols/ldap/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ntp/mode/offset.pm b/centreon-plugins/apps/protocols/ntp/mode/offset.pm index 6314e96b2..370cdb53f 100644 --- a/centreon-plugins/apps/protocols/ntp/mode/offset.pm +++ b/centreon-plugins/apps/protocols/ntp/mode/offset.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ntp/mode/responsetime.pm b/centreon-plugins/apps/protocols/ntp/mode/responsetime.pm index c36572aff..070532408 100644 --- a/centreon-plugins/apps/protocols/ntp/mode/responsetime.pm +++ b/centreon-plugins/apps/protocols/ntp/mode/responsetime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/ntp/plugin.pm b/centreon-plugins/apps/protocols/ntp/plugin.pm index 650aff220..5ae6e11a5 100644 --- a/centreon-plugins/apps/protocols/ntp/plugin.pm +++ b/centreon-plugins/apps/protocols/ntp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/radius/mode/login.pm b/centreon-plugins/apps/protocols/radius/mode/login.pm index 6b57b81bd..ee6887096 100644 --- a/centreon-plugins/apps/protocols/radius/mode/login.pm +++ b/centreon-plugins/apps/protocols/radius/mode/login.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/radius/plugin.pm b/centreon-plugins/apps/protocols/radius/plugin.pm index 6b742cee1..99d1d9801 100644 --- a/centreon-plugins/apps/protocols/radius/plugin.pm +++ b/centreon-plugins/apps/protocols/radius/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/smtp/lib/smtp.pm b/centreon-plugins/apps/protocols/smtp/lib/smtp.pm index e427069c5..0e4984332 100644 --- a/centreon-plugins/apps/protocols/smtp/lib/smtp.pm +++ b/centreon-plugins/apps/protocols/smtp/lib/smtp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/smtp/mode/login.pm b/centreon-plugins/apps/protocols/smtp/mode/login.pm index 8f76e8f0c..ef0281369 100644 --- a/centreon-plugins/apps/protocols/smtp/mode/login.pm +++ b/centreon-plugins/apps/protocols/smtp/mode/login.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/smtp/mode/message.pm b/centreon-plugins/apps/protocols/smtp/mode/message.pm index 930c14565..41665455b 100644 --- a/centreon-plugins/apps/protocols/smtp/mode/message.pm +++ b/centreon-plugins/apps/protocols/smtp/mode/message.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/smtp/plugin.pm b/centreon-plugins/apps/protocols/smtp/plugin.pm index a034302cb..bb1758635 100644 --- a/centreon-plugins/apps/protocols/smtp/plugin.pm +++ b/centreon-plugins/apps/protocols/smtp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/tcp/mode/responsetime.pm b/centreon-plugins/apps/protocols/tcp/mode/responsetime.pm index e4194dde5..9bee17d11 100644 --- a/centreon-plugins/apps/protocols/tcp/mode/responsetime.pm +++ b/centreon-plugins/apps/protocols/tcp/mode/responsetime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/tcp/plugin.pm b/centreon-plugins/apps/protocols/tcp/plugin.pm index e03a46273..1a3939b73 100644 --- a/centreon-plugins/apps/protocols/tcp/plugin.pm +++ b/centreon-plugins/apps/protocols/tcp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/udp/mode/connection.pm b/centreon-plugins/apps/protocols/udp/mode/connection.pm index 2228a8243..2c12f81da 100644 --- a/centreon-plugins/apps/protocols/udp/mode/connection.pm +++ b/centreon-plugins/apps/protocols/udp/mode/connection.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/udp/plugin.pm b/centreon-plugins/apps/protocols/udp/plugin.pm index 946ef6133..54e1a91a4 100644 --- a/centreon-plugins/apps/protocols/udp/plugin.pm +++ b/centreon-plugins/apps/protocols/udp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index f08b8756f..30639a39d 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/protocols/x509/plugin.pm b/centreon-plugins/apps/protocols/x509/plugin.pm index 559b351b7..b972e0898 100644 --- a/centreon-plugins/apps/protocols/x509/plugin.pm +++ b/centreon-plugins/apps/protocols/x509/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/rrdcached/mode/stats.pm b/centreon-plugins/apps/rrdcached/mode/stats.pm index b9224ad84..cae7b34bf 100644 --- a/centreon-plugins/apps/rrdcached/mode/stats.pm +++ b/centreon-plugins/apps/rrdcached/mode/stats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/rrdcached/plugin.pm b/centreon-plugins/apps/rrdcached/plugin.pm index c32da88fb..d589ce29f 100644 --- a/centreon-plugins/apps/rrdcached/plugin.pm +++ b/centreon-plugins/apps/rrdcached/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/selenium/mode/scenario.pm b/centreon-plugins/apps/selenium/mode/scenario.pm index 27ead607b..df5f90a2f 100644 --- a/centreon-plugins/apps/selenium/mode/scenario.pm +++ b/centreon-plugins/apps/selenium/mode/scenario.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/selenium/plugin.pm b/centreon-plugins/apps/selenium/plugin.pm index 499fc4630..f0d299f1d 100644 --- a/centreon-plugins/apps/selenium/plugin.pm +++ b/centreon-plugins/apps/selenium/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/jmx/plugin.pm b/centreon-plugins/apps/tomcat/jmx/plugin.pm index 07bf9bcc5..7f85c5da1 100644 --- a/centreon-plugins/apps/tomcat/jmx/plugin.pm +++ b/centreon-plugins/apps/tomcat/jmx/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/applications.pm b/centreon-plugins/apps/tomcat/web/mode/applications.pm index d6aafb2fb..7056a985a 100644 --- a/centreon-plugins/apps/tomcat/web/mode/applications.pm +++ b/centreon-plugins/apps/tomcat/web/mode/applications.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/listapplication.pm b/centreon-plugins/apps/tomcat/web/mode/listapplication.pm index da7a45b36..64ddd53e8 100644 --- a/centreon-plugins/apps/tomcat/web/mode/listapplication.pm +++ b/centreon-plugins/apps/tomcat/web/mode/listapplication.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/memory.pm b/centreon-plugins/apps/tomcat/web/mode/memory.pm index 1a53a8189..59629286d 100644 --- a/centreon-plugins/apps/tomcat/web/mode/memory.pm +++ b/centreon-plugins/apps/tomcat/web/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/requestinfo.pm b/centreon-plugins/apps/tomcat/web/mode/requestinfo.pm index ca2a7f689..10fa3ecbe 100644 --- a/centreon-plugins/apps/tomcat/web/mode/requestinfo.pm +++ b/centreon-plugins/apps/tomcat/web/mode/requestinfo.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/sessions.pm b/centreon-plugins/apps/tomcat/web/mode/sessions.pm index e990e0063..d4edc59ad 100644 --- a/centreon-plugins/apps/tomcat/web/mode/sessions.pm +++ b/centreon-plugins/apps/tomcat/web/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/threads.pm b/centreon-plugins/apps/tomcat/web/mode/threads.pm index e9d6e1462..2b147db55 100644 --- a/centreon-plugins/apps/tomcat/web/mode/threads.pm +++ b/centreon-plugins/apps/tomcat/web/mode/threads.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/mode/traffic.pm b/centreon-plugins/apps/tomcat/web/mode/traffic.pm index 219286a7a..dff575cfa 100644 --- a/centreon-plugins/apps/tomcat/web/mode/traffic.pm +++ b/centreon-plugins/apps/tomcat/web/mode/traffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/tomcat/web/plugin.pm b/centreon-plugins/apps/tomcat/web/plugin.pm index c720937db..4c711e729 100644 --- a/centreon-plugins/apps/tomcat/web/plugin.pm +++ b/centreon-plugins/apps/tomcat/web/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/backend.pm b/centreon-plugins/apps/varnish/local/mode/backend.pm index 3dd639466..9cfbd889c 100644 --- a/centreon-plugins/apps/varnish/local/mode/backend.pm +++ b/centreon-plugins/apps/varnish/local/mode/backend.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/bans.pm b/centreon-plugins/apps/varnish/local/mode/bans.pm index 0f7762359..04772ebb7 100644 --- a/centreon-plugins/apps/varnish/local/mode/bans.pm +++ b/centreon-plugins/apps/varnish/local/mode/bans.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/cache.pm b/centreon-plugins/apps/varnish/local/mode/cache.pm index 487c6d5b6..c2d6f1859 100644 --- a/centreon-plugins/apps/varnish/local/mode/cache.pm +++ b/centreon-plugins/apps/varnish/local/mode/cache.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/connections.pm b/centreon-plugins/apps/varnish/local/mode/connections.pm index 338b58034..0aae615cd 100644 --- a/centreon-plugins/apps/varnish/local/mode/connections.pm +++ b/centreon-plugins/apps/varnish/local/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/dns.pm b/centreon-plugins/apps/varnish/local/mode/dns.pm index f6067f7bc..79449164b 100644 --- a/centreon-plugins/apps/varnish/local/mode/dns.pm +++ b/centreon-plugins/apps/varnish/local/mode/dns.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/esi.pm b/centreon-plugins/apps/varnish/local/mode/esi.pm index ca5a1d9f1..8c16a2812 100644 --- a/centreon-plugins/apps/varnish/local/mode/esi.pm +++ b/centreon-plugins/apps/varnish/local/mode/esi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/fetch.pm b/centreon-plugins/apps/varnish/local/mode/fetch.pm index fe25ddc81..6d7b1e94b 100644 --- a/centreon-plugins/apps/varnish/local/mode/fetch.pm +++ b/centreon-plugins/apps/varnish/local/mode/fetch.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/hcb.pm b/centreon-plugins/apps/varnish/local/mode/hcb.pm index ed812f0e8..2c9f85231 100644 --- a/centreon-plugins/apps/varnish/local/mode/hcb.pm +++ b/centreon-plugins/apps/varnish/local/mode/hcb.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/n.pm b/centreon-plugins/apps/varnish/local/mode/n.pm index 0d94a6deb..065420b3a 100644 --- a/centreon-plugins/apps/varnish/local/mode/n.pm +++ b/centreon-plugins/apps/varnish/local/mode/n.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/objects.pm b/centreon-plugins/apps/varnish/local/mode/objects.pm index 76e4dd5c0..7d518cad6 100644 --- a/centreon-plugins/apps/varnish/local/mode/objects.pm +++ b/centreon-plugins/apps/varnish/local/mode/objects.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/sessions.pm b/centreon-plugins/apps/varnish/local/mode/sessions.pm index 0960a811f..9cb7fb78e 100644 --- a/centreon-plugins/apps/varnish/local/mode/sessions.pm +++ b/centreon-plugins/apps/varnish/local/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/shm.pm b/centreon-plugins/apps/varnish/local/mode/shm.pm index b0ccedcd4..a16511855 100644 --- a/centreon-plugins/apps/varnish/local/mode/shm.pm +++ b/centreon-plugins/apps/varnish/local/mode/shm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/sms.pm b/centreon-plugins/apps/varnish/local/mode/sms.pm index fcbbb9544..62c13c8f3 100644 --- a/centreon-plugins/apps/varnish/local/mode/sms.pm +++ b/centreon-plugins/apps/varnish/local/mode/sms.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/totals.pm b/centreon-plugins/apps/varnish/local/mode/totals.pm index b91c623d1..979835d7a 100644 --- a/centreon-plugins/apps/varnish/local/mode/totals.pm +++ b/centreon-plugins/apps/varnish/local/mode/totals.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/uptime.pm b/centreon-plugins/apps/varnish/local/mode/uptime.pm index 47e810662..288d17423 100644 --- a/centreon-plugins/apps/varnish/local/mode/uptime.pm +++ b/centreon-plugins/apps/varnish/local/mode/uptime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/vcl.pm b/centreon-plugins/apps/varnish/local/mode/vcl.pm index 1eff737d1..f248f7db2 100644 --- a/centreon-plugins/apps/varnish/local/mode/vcl.pm +++ b/centreon-plugins/apps/varnish/local/mode/vcl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/mode/workers.pm b/centreon-plugins/apps/varnish/local/mode/workers.pm index a41a848d4..1508f6cf7 100644 --- a/centreon-plugins/apps/varnish/local/mode/workers.pm +++ b/centreon-plugins/apps/varnish/local/mode/workers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/varnish/local/plugin.pm b/centreon-plugins/apps/varnish/local/plugin.pm index 1d2206017..ac30a5e17 100644 --- a/centreon-plugins/apps/varnish/local/plugin.pm +++ b/centreon-plugins/apps/varnish/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/custom/connector.pm b/centreon-plugins/apps/vmware/connector/custom/connector.pm index fb9dde9d2..aaae66180 100644 --- a/centreon-plugins/apps/vmware/connector/custom/connector.pm +++ b/centreon-plugins/apps/vmware/connector/custom/connector.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/alarmdatacenter.pm b/centreon-plugins/apps/vmware/connector/mode/alarmdatacenter.pm index d20de2db0..1df2dc068 100644 --- a/centreon-plugins/apps/vmware/connector/mode/alarmdatacenter.pm +++ b/centreon-plugins/apps/vmware/connector/mode/alarmdatacenter.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/alarmhost.pm b/centreon-plugins/apps/vmware/connector/mode/alarmhost.pm index 727e3acee..f965f44fd 100644 --- a/centreon-plugins/apps/vmware/connector/mode/alarmhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/alarmhost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/countvmhost.pm b/centreon-plugins/apps/vmware/connector/mode/countvmhost.pm index 5083524c2..046d2b022 100644 --- a/centreon-plugins/apps/vmware/connector/mode/countvmhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/countvmhost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/cpuhost.pm b/centreon-plugins/apps/vmware/connector/mode/cpuhost.pm index ee92743ab..26961e56b 100644 --- a/centreon-plugins/apps/vmware/connector/mode/cpuhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/cpuhost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/cpuvm.pm b/centreon-plugins/apps/vmware/connector/mode/cpuvm.pm index 5ce6b2a83..ce6ec637a 100644 --- a/centreon-plugins/apps/vmware/connector/mode/cpuvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/cpuvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastorecountvm.pm b/centreon-plugins/apps/vmware/connector/mode/datastorecountvm.pm index 37ed14893..bacd304b3 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastorecountvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastorecountvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastorehost.pm b/centreon-plugins/apps/vmware/connector/mode/datastorehost.pm index 337a90f84..3c6673164 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastorehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastorehost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastoreio.pm b/centreon-plugins/apps/vmware/connector/mode/datastoreio.pm index 0ebbffd57..d83a243e5 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastoreio.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastoreio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastoreiops.pm b/centreon-plugins/apps/vmware/connector/mode/datastoreiops.pm index 2940f5992..928f8414a 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastoreiops.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastoreiops.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastoresnapshot.pm b/centreon-plugins/apps/vmware/connector/mode/datastoresnapshot.pm index bde781c44..d8d2af24e 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastoresnapshot.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastoresnapshot.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastoreusage.pm b/centreon-plugins/apps/vmware/connector/mode/datastoreusage.pm index e25d45f6a..2109b7279 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastoreusage.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastoreusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm b/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm index ca20b23cd..e9db8667b 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/getmap.pm b/centreon-plugins/apps/vmware/connector/mode/getmap.pm index 2eb25db92..aaa242c35 100644 --- a/centreon-plugins/apps/vmware/connector/mode/getmap.pm +++ b/centreon-plugins/apps/vmware/connector/mode/getmap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/healthhost.pm b/centreon-plugins/apps/vmware/connector/mode/healthhost.pm index 9800f0718..c6b42a8fd 100644 --- a/centreon-plugins/apps/vmware/connector/mode/healthhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/healthhost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/limitvm.pm b/centreon-plugins/apps/vmware/connector/mode/limitvm.pm index 0c5abe882..11b0343e8 100644 --- a/centreon-plugins/apps/vmware/connector/mode/limitvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/limitvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/listdatacenters.pm b/centreon-plugins/apps/vmware/connector/mode/listdatacenters.pm index 20f1661ea..c4a0669b8 100644 --- a/centreon-plugins/apps/vmware/connector/mode/listdatacenters.pm +++ b/centreon-plugins/apps/vmware/connector/mode/listdatacenters.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/listdatastores.pm b/centreon-plugins/apps/vmware/connector/mode/listdatastores.pm index 93c00ca5e..21b0d71c0 100644 --- a/centreon-plugins/apps/vmware/connector/mode/listdatastores.pm +++ b/centreon-plugins/apps/vmware/connector/mode/listdatastores.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/listnichost.pm b/centreon-plugins/apps/vmware/connector/mode/listnichost.pm index cf6c8aff4..0229f6c43 100644 --- a/centreon-plugins/apps/vmware/connector/mode/listnichost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/listnichost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/maintenancehost.pm b/centreon-plugins/apps/vmware/connector/mode/maintenancehost.pm index cdb6b6cf8..aa56d085f 100644 --- a/centreon-plugins/apps/vmware/connector/mode/maintenancehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/maintenancehost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm b/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm index d2dc17cc5..9c6919010 100644 --- a/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/memoryvm.pm b/centreon-plugins/apps/vmware/connector/mode/memoryvm.pm index 50567b87d..86805ccf0 100644 --- a/centreon-plugins/apps/vmware/connector/mode/memoryvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/memoryvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/nethost.pm b/centreon-plugins/apps/vmware/connector/mode/nethost.pm index ee8bfbf85..84498c001 100644 --- a/centreon-plugins/apps/vmware/connector/mode/nethost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/nethost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/servicehost.pm b/centreon-plugins/apps/vmware/connector/mode/servicehost.pm index 6e9ee4a86..05cff7c79 100644 --- a/centreon-plugins/apps/vmware/connector/mode/servicehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/servicehost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/snapshotvm.pm b/centreon-plugins/apps/vmware/connector/mode/snapshotvm.pm index 1f89efbfe..cb9147bd3 100644 --- a/centreon-plugins/apps/vmware/connector/mode/snapshotvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/snapshotvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/statconnectors.pm b/centreon-plugins/apps/vmware/connector/mode/statconnectors.pm index e3cd0b1a2..186be8fce 100644 --- a/centreon-plugins/apps/vmware/connector/mode/statconnectors.pm +++ b/centreon-plugins/apps/vmware/connector/mode/statconnectors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/statushost.pm b/centreon-plugins/apps/vmware/connector/mode/statushost.pm index 0596c5005..88d1fd01b 100644 --- a/centreon-plugins/apps/vmware/connector/mode/statushost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/statushost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/statusvm.pm b/centreon-plugins/apps/vmware/connector/mode/statusvm.pm index 30b7d58f2..1dfe69102 100644 --- a/centreon-plugins/apps/vmware/connector/mode/statusvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/statusvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/swaphost.pm b/centreon-plugins/apps/vmware/connector/mode/swaphost.pm index e62846f18..d7fec9e09 100644 --- a/centreon-plugins/apps/vmware/connector/mode/swaphost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/swaphost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/swapvm.pm b/centreon-plugins/apps/vmware/connector/mode/swapvm.pm index 8411fdcd9..f24b04696 100644 --- a/centreon-plugins/apps/vmware/connector/mode/swapvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/swapvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/thinprovisioningvm.pm b/centreon-plugins/apps/vmware/connector/mode/thinprovisioningvm.pm index 5f17ff609..e3cfb383e 100644 --- a/centreon-plugins/apps/vmware/connector/mode/thinprovisioningvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/thinprovisioningvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/timehost.pm b/centreon-plugins/apps/vmware/connector/mode/timehost.pm index 1f479ef66..d16c02cfe 100644 --- a/centreon-plugins/apps/vmware/connector/mode/timehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/timehost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/toolsvm.pm b/centreon-plugins/apps/vmware/connector/mode/toolsvm.pm index 563fba0e0..1ca302f32 100644 --- a/centreon-plugins/apps/vmware/connector/mode/toolsvm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/toolsvm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/uptimehost.pm b/centreon-plugins/apps/vmware/connector/mode/uptimehost.pm index 7c54bede4..cebe13380 100644 --- a/centreon-plugins/apps/vmware/connector/mode/uptimehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/uptimehost.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/mode/vmoperationcluster.pm b/centreon-plugins/apps/vmware/connector/mode/vmoperationcluster.pm index e92509736..a86967c9b 100644 --- a/centreon-plugins/apps/vmware/connector/mode/vmoperationcluster.pm +++ b/centreon-plugins/apps/vmware/connector/mode/vmoperationcluster.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/connector/plugin.pm b/centreon-plugins/apps/vmware/connector/plugin.pm index f7196b9fc..2791ffa03 100644 --- a/centreon-plugins/apps/vmware/connector/plugin.pm +++ b/centreon-plugins/apps/vmware/connector/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_card.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_card.pm index de4df27ca..d1cfefef1 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_card.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_card.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_computersystem.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_computersystem.pm index 8b02cfbc5..4586b8340 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_computersystem.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_computersystem.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_memory.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_memory.pm index 9994b2a21..fcbb0f477 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_memory.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_numericsensor.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_numericsensor.pm index c0f8d0325..dab17caf7 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_numericsensor.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_numericsensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_processor.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_processor.pm index e2b6f7785..a80d6e4b6 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_processor.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_processor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/cim_recordlog.pm b/centreon-plugins/apps/vmware/wsman/mode/components/cim_recordlog.pm index 24f279fff..dbc5fb1b1 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/cim_recordlog.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/cim_recordlog.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/omc_discretesensor.pm b/centreon-plugins/apps/vmware/wsman/mode/components/omc_discretesensor.pm index 524735c6a..97f0cafc8 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/omc_discretesensor.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/omc_discretesensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/omc_fan.pm b/centreon-plugins/apps/vmware/wsman/mode/components/omc_fan.pm index 55a034b4d..ee3922da0 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/omc_fan.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/omc_fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/omc_psu.pm b/centreon-plugins/apps/vmware/wsman/mode/components/omc_psu.pm index b720a66d5..ea48ddd22 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/omc_psu.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/omc_psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/resources.pm b/centreon-plugins/apps/vmware/wsman/mode/components/resources.pm index 706877fb9..02e98f853 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/resources.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_battery.pm b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_battery.pm index bd69cc7ce..254a5c231 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_battery.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_battery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_controller.pm b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_controller.pm index f254f5790..bd3ac5478 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_controller.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_controller.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_sassataport.pm b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_sassataport.pm index a95dc3069..2fe5c0bfe 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_sassataport.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_sassataport.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storageextent.pm b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storageextent.pm index 5d4acee7c..c78359b77 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storageextent.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storageextent.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storagevolume.pm b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storagevolume.pm index 1a2e741ce..bcfeed42e 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storagevolume.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/components/vmware_storagevolume.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/mode/hardware.pm b/centreon-plugins/apps/vmware/wsman/mode/hardware.pm index bcac00b63..f4b4f247e 100644 --- a/centreon-plugins/apps/vmware/wsman/mode/hardware.pm +++ b/centreon-plugins/apps/vmware/wsman/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/vmware/wsman/plugin.pm b/centreon-plugins/apps/vmware/wsman/plugin.pm index f29127443..7207d6af8 100644 --- a/centreon-plugins/apps/vmware/wsman/plugin.pm +++ b/centreon-plugins/apps/vmware/wsman/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/lib/ami.pm b/centreon-plugins/apps/voip/asterisk/remote/lib/ami.pm index bf3990991..87efb753c 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/lib/ami.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/lib/ami.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/mode/activecalls.pm b/centreon-plugins/apps/voip/asterisk/remote/mode/activecalls.pm index 18a6273eb..4cf3828ec 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/mode/activecalls.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/mode/activecalls.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/mode/dahdistatus.pm b/centreon-plugins/apps/voip/asterisk/remote/mode/dahdistatus.pm index 0abf5cb83..e165c4d15 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/mode/dahdistatus.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/mode/dahdistatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/mode/externalcalls.pm b/centreon-plugins/apps/voip/asterisk/remote/mode/externalcalls.pm index c1be48bba..2d699bd24 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/mode/externalcalls.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/mode/externalcalls.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/mode/showpeers.pm b/centreon-plugins/apps/voip/asterisk/remote/mode/showpeers.pm index e661cfbe1..92c5d7959 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/mode/showpeers.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/mode/showpeers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/remote/plugin.pm b/centreon-plugins/apps/voip/asterisk/remote/plugin.pm index 423a65761..e7294c2b8 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/plugin.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm b/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm index f0e473de3..0109fcd48 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm b/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm index 3e06cd4a6..056987d10 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm b/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm index 25df7f59c..86aa0a944 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm index 85f1ffbf9..f643671de 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm index 7285994c0..32d858469 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm index 7b4b60c32..b3361a63e 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm index bd72f09cf..022c947b6 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm b/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm index e00141893..6bbf9f658 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm index e12a12ba1..cbc31f51c 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm index ae1b78b8b..f839dd943 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm index d9cb54327..d46098ce8 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/subsystem.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm index 8042c52d2..9a1ae3f0d 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelinterference.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelinterference.pm index ee3b1d882..0a38851eb 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelinterference.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelinterference.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelnoise.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelnoise.pm index 2dbce5b9d..1aba195ad 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelnoise.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apchannelnoise.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm index 9fe95a357..109ec3f6f 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm index cc11527a1..4608c274d 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/components/psu.pm index 2700763f0..e8d5b0eeb 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm index b387f7fde..ded1c4e09 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm index a9818172b..3bbecadb1 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm index d3820d238..fc494246d 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm index ebb58bb18..fc41e32cd 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm index d3ad95c87..29bb881e2 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm index 8a573f3f6..b3b61b493 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm index 8f3174630..35b0f7aba 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/module.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm index bd031a919..b826fa4e4 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm index ec144d9be..401db23ff 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm index 2bfeff3d3..3b91dffde 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm index 7bb1991d0..18b577f6e 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm index 9ad7b306c..109574fbf 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm index 5d2166c4e..7f8ad5fd1 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm index e24a05483..4e97ac9db 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm index 6864bb882..842d7e81d 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm index e53c92eb7..0332fffa0 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm index 89e2ef1d7..d34d81215 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm index 51bf40fec..ba77b43c2 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm index 2f48c0f48..605779c82 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm index 04f9845a4..9903a4a54 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm index 3db0d6353..4aa241d87 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/temperature.pm index 11c143960..b9d045787 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm index 99647b622..9124f5e61 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm index a4870c11c..2d39da097 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm index adb98425e..9c04cdb08 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm index eb9d585dd..df8119165 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm index 64dc72264..0f49960f9 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm index 0ccc32a73..03e72cfbd 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm index cdd693dc6..612e81fbc 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm index 52ef846bb..360bc549b 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm b/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm index 7791172b5..b5ddb43b5 100644 --- a/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm +++ b/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/custom/custom.pm b/centreon-plugins/centreon/common/emc/navisphere/custom/custom.pm index 2fe2e1997..17e40e06c 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/custom/custom.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/custom/custom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm index eb7d06386..6714a0fce 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/controller.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/controller.pm index 639e291c7..b0aa0a81a 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/controller.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/controller.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index 267694f6d..62bfd9baa 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/faults.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/faults.pm index 82c26452f..0f569c903 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/faults.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/faults.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm index fa3fce133..3870a8cf3 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/listluns.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/listluns.pm index cb9981502..088d12428 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/listluns.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/listluns.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm index 8842c6aaa..517f3c340 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm index 0699b360b..778d4aaff 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm index 87d98fc7b..aade7195f 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm index 7d8905973..e67ffebac 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm index bbde4a76a..52083daf2 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm index 3b9ada42a..5070bdcee 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm index b06f69e10..2590978bb 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm index c0beaeda5..1d114955c 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm index 9cb489a5f..03af85d65 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm index 26ee9d0e1..86d13d2d4 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm index 446afa5eb..70a0d4f75 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spinfo.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spinfo.pm index 66e36925d..518b80f4e 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spinfo.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spinfo.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fastpath/mode/cpu.pm b/centreon-plugins/centreon/common/fastpath/mode/cpu.pm index 63fa7207f..bb22bba21 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/cpu.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fastpath/mode/environment.pm b/centreon-plugins/centreon/common/fastpath/mode/environment.pm index bebab34b8..ff20bc743 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/environment.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fastpath/mode/memory.pm b/centreon-plugins/centreon/common/fastpath/mode/memory.pm index e8527fab0..b550e274d 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/memory.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm index f3717d8d1..a2e3f7377 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm index 4d754f55e..15c098a06 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm index 9dfa727f6..e549b3e35 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/force10/snmp/mode/cpu.pm index e308a6a56..9db4b06f4 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm index 3f93c85b0..f2bbfc618 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/force10/snmp/mode/memory.pm b/centreon-plugins/centreon/common/force10/snmp/mode/memory.pm index 9843d1429..7153def46 100644 --- a/centreon-plugins/centreon/common/force10/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/force10/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm index bb3055681..f8549a0bd 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm index dfced7a4f..5eed9649f 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm index 4abfbe481..4f8f902db 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm index 2afebd3b6..a3b80a363 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm index f9a71d36f..e0d90f0ce 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm index cdb28a49f..9ecb34e83 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm index 92958e8a5..6435bce0d 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm index 1c6d2c140..fb2ce5dae 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm index 297e63dd2..9ff41dda1 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/classcount.pm b/centreon-plugins/centreon/common/jvm/mode/classcount.pm index 8ae442e1d..5511a8356 100644 --- a/centreon-plugins/centreon/common/jvm/mode/classcount.pm +++ b/centreon-plugins/centreon/common/jvm/mode/classcount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/cpuload.pm b/centreon-plugins/centreon/common/jvm/mode/cpuload.pm index c21dbe295..f94eef8b8 100644 --- a/centreon-plugins/centreon/common/jvm/mode/cpuload.pm +++ b/centreon-plugins/centreon/common/jvm/mode/cpuload.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/fdusage.pm b/centreon-plugins/centreon/common/jvm/mode/fdusage.pm index 72ceabb19..e3f3c2f5c 100644 --- a/centreon-plugins/centreon/common/jvm/mode/fdusage.pm +++ b/centreon-plugins/centreon/common/jvm/mode/fdusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/loadaverage.pm b/centreon-plugins/centreon/common/jvm/mode/loadaverage.pm index 0f948f91d..37b11ee8a 100644 --- a/centreon-plugins/centreon/common/jvm/mode/loadaverage.pm +++ b/centreon-plugins/centreon/common/jvm/mode/loadaverage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/memory.pm b/centreon-plugins/centreon/common/jvm/mode/memory.pm index ce9df77de..190a3d125 100644 --- a/centreon-plugins/centreon/common/jvm/mode/memory.pm +++ b/centreon-plugins/centreon/common/jvm/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/memorydetailed.pm b/centreon-plugins/centreon/common/jvm/mode/memorydetailed.pm index 55564e4df..927e93ec3 100644 --- a/centreon-plugins/centreon/common/jvm/mode/memorydetailed.pm +++ b/centreon-plugins/centreon/common/jvm/mode/memorydetailed.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/jvm/mode/threads.pm b/centreon-plugins/centreon/common/jvm/mode/threads.pm index 0edc8ba23..2502a0ce6 100644 --- a/centreon-plugins/centreon/common/jvm/mode/threads.pm +++ b/centreon-plugins/centreon/common/jvm/mode/threads.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/activesyncmailbox.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/activesyncmailbox.pm index 90a64cdf1..60c85682e 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/activesyncmailbox.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/activesyncmailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/databases.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/databases.pm index 0f589833c..e4a842564 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/databases.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/databases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/imapmailbox.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/imapmailbox.pm index 0bb2f6bac..2b90af5e8 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/imapmailbox.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/imapmailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/listdatabases.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/listdatabases.pm index 448acf0aa..c50015f81 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/listdatabases.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/listdatabases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/mapimailbox.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/mapimailbox.pm index 17b5fd514..761c08143 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/mapimailbox.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/mapimailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/outlookwebservices.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/outlookwebservices.pm index eeda8ab4a..a8b1956a2 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/outlookwebservices.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/outlookwebservices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/owamailbox.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/owamailbox.pm index 74df5c949..17567819e 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/owamailbox.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/owamailbox.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/powershell.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/powershell.pm index 9433a061c..48ce78767 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/powershell.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/powershell.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm index ab7a2badc..ddae7acc4 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/queues.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm index 5d16a6195..fe436d15c 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/services.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/services.pm index 4ba740476..dc90505ab 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/services.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/services.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/protocols/jmx/custom/jolokia.pm b/centreon-plugins/centreon/common/protocols/jmx/custom/jolokia.pm index 9667328f5..e3fe7077c 100644 --- a/centreon-plugins/centreon/common/protocols/jmx/custom/jolokia.pm +++ b/centreon-plugins/centreon/common/protocols/jmx/custom/jolokia.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/protocols/sql/mode/connectiontime.pm b/centreon-plugins/centreon/common/protocols/sql/mode/connectiontime.pm index e431636e6..b2680dfe5 100644 --- a/centreon-plugins/centreon/common/protocols/sql/mode/connectiontime.pm +++ b/centreon-plugins/centreon/common/protocols/sql/mode/connectiontime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/protocols/sql/mode/sql.pm b/centreon-plugins/centreon/common/protocols/sql/mode/sql.pm index 3f7fe246a..a8e0df4e3 100644 --- a/centreon-plugins/centreon/common/protocols/sql/mode/sql.pm +++ b/centreon-plugins/centreon/common/protocols/sql/mode/sql.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/radlan/mode/cpu.pm b/centreon-plugins/centreon/common/radlan/mode/cpu.pm index e25d7e4a1..05d7b20e5 100644 --- a/centreon-plugins/centreon/common/radlan/mode/cpu.pm +++ b/centreon-plugins/centreon/common/radlan/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/radlan/mode/environment.pm b/centreon-plugins/centreon/common/radlan/mode/environment.pm index 5e7978150..98fe0d118 100644 --- a/centreon-plugins/centreon/common/radlan/mode/environment.pm +++ b/centreon-plugins/centreon/common/radlan/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/smcli/custom/custom.pm b/centreon-plugins/centreon/common/smcli/custom/custom.pm index ca63dc34a..791645476 100644 --- a/centreon-plugins/centreon/common/smcli/custom/custom.pm +++ b/centreon-plugins/centreon/common/smcli/custom/custom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/smcli/mode/healthstatus.pm b/centreon-plugins/centreon/common/smcli/mode/healthstatus.pm index a17978492..c6f7129ee 100644 --- a/centreon-plugins/centreon/common/smcli/mode/healthstatus.pm +++ b/centreon-plugins/centreon/common/smcli/mode/healthstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm index cb91c747a..f2074a401 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/ca.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm index e08d5c627..3e1a85c07 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm index 1293a7f56..61fd5e653 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/gfc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm index 8bf9c5ec6..db333c315 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/lfc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm index 082ad10f2..3197922a9 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm index daf330b81..f1662f663 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm b/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm index 63c36042e..724dcafab 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/components/vimm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm index 1200df760..46537288b 100644 --- a/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/violin/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/alternative/Getopt.pm b/centreon-plugins/centreon/plugins/alternative/Getopt.pm index 62ede9f01..6d920a1a9 100644 --- a/centreon-plugins/centreon/plugins/alternative/Getopt.pm +++ b/centreon-plugins/centreon/plugins/alternative/Getopt.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/dbi.pm b/centreon-plugins/centreon/plugins/dbi.pm index 1fd4ddc7a..b8bfc90b0 100644 --- a/centreon-plugins/centreon/plugins/dbi.pm +++ b/centreon-plugins/centreon/plugins/dbi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/http.pm b/centreon-plugins/centreon/plugins/http.pm index 452f765bd..de399a190 100644 --- a/centreon-plugins/centreon/plugins/http.pm +++ b/centreon-plugins/centreon/plugins/http.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/misc.pm b/centreon-plugins/centreon/plugins/misc.pm index 463a95ddc..863114257 100644 --- a/centreon-plugins/centreon/plugins/misc.pm +++ b/centreon-plugins/centreon/plugins/misc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/mode.pm b/centreon-plugins/centreon/plugins/mode.pm index c2b5dcba4..6a12b565c 100644 --- a/centreon-plugins/centreon/plugins/mode.pm +++ b/centreon-plugins/centreon/plugins/mode.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/options.pm b/centreon-plugins/centreon/plugins/options.pm index 557e2f412..33e8ce3ce 100644 --- a/centreon-plugins/centreon/plugins/options.pm +++ b/centreon-plugins/centreon/plugins/options.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/output.pm b/centreon-plugins/centreon/plugins/output.pm index 37964541c..1243cb1ff 100644 --- a/centreon-plugins/centreon/plugins/output.pm +++ b/centreon-plugins/centreon/plugins/output.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/perfdata.pm b/centreon-plugins/centreon/plugins/perfdata.pm index a1cf3f046..c857737fb 100644 --- a/centreon-plugins/centreon/plugins/perfdata.pm +++ b/centreon-plugins/centreon/plugins/perfdata.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index bba0658ab..cd3d1c684 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script_custom.pm b/centreon-plugins/centreon/plugins/script_custom.pm index 38650e334..b7b122acf 100644 --- a/centreon-plugins/centreon/plugins/script_custom.pm +++ b/centreon-plugins/centreon/plugins/script_custom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script_simple.pm b/centreon-plugins/centreon/plugins/script_simple.pm index 5a6a994e8..7d0b4c23b 100644 --- a/centreon-plugins/centreon/plugins/script_simple.pm +++ b/centreon-plugins/centreon/plugins/script_simple.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script_snmp.pm b/centreon-plugins/centreon/plugins/script_snmp.pm index 2a4567629..d07470a0e 100644 --- a/centreon-plugins/centreon/plugins/script_snmp.pm +++ b/centreon-plugins/centreon/plugins/script_snmp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script_sql.pm b/centreon-plugins/centreon/plugins/script_sql.pm index c82cf1778..57bd0522e 100644 --- a/centreon-plugins/centreon/plugins/script_sql.pm +++ b/centreon-plugins/centreon/plugins/script_sql.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/script_wsman.pm b/centreon-plugins/centreon/plugins/script_wsman.pm index 789747149..5d6697fe8 100644 --- a/centreon-plugins/centreon/plugins/script_wsman.pm +++ b/centreon-plugins/centreon/plugins/script_wsman.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/snmp.pm b/centreon-plugins/centreon/plugins/snmp.pm index 4bcf9f7b1..0219b1023 100644 --- a/centreon-plugins/centreon/plugins/snmp.pm +++ b/centreon-plugins/centreon/plugins/snmp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/statefile.pm b/centreon-plugins/centreon/plugins/statefile.pm index bd5b14350..8d4b50296 100644 --- a/centreon-plugins/centreon/plugins/statefile.pm +++ b/centreon-plugins/centreon/plugins/statefile.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/templates/counter.pm b/centreon-plugins/centreon/plugins/templates/counter.pm index a239541e8..12bbf74b0 100644 --- a/centreon-plugins/centreon/plugins/templates/counter.pm +++ b/centreon-plugins/centreon/plugins/templates/counter.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/templates/hardware.pm b/centreon-plugins/centreon/plugins/templates/hardware.pm index b060cc067..0c16369fe 100644 --- a/centreon-plugins/centreon/plugins/templates/hardware.pm +++ b/centreon-plugins/centreon/plugins/templates/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/values.pm b/centreon-plugins/centreon/plugins/values.pm index e94c10b59..4c9283815 100644 --- a/centreon-plugins/centreon/plugins/values.pm +++ b/centreon-plugins/centreon/plugins/values.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon/plugins/wsman.pm b/centreon-plugins/centreon/plugins/wsman.pm index 791874c00..911e7cfa5 100644 --- a/centreon-plugins/centreon/plugins/wsman.pm +++ b/centreon-plugins/centreon/plugins/wsman.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/centreon_plugins.pl b/centreon-plugins/centreon_plugins.pl index b0184ea71..95ae52cc0 100644 --- a/centreon-plugins/centreon_plugins.pl +++ b/centreon-plugins/centreon_plugins.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/custom/awscli.pm b/centreon-plugins/cloud/aws/custom/awscli.pm index 4ed939bbe..44e1ec131 100644 --- a/centreon-plugins/cloud/aws/custom/awscli.pm +++ b/centreon-plugins/cloud/aws/custom/awscli.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/cloudwatch.pm b/centreon-plugins/cloud/aws/mode/cloudwatch.pm index e0cd03634..56d8d2ddc 100644 --- a/centreon-plugins/cloud/aws/mode/cloudwatch.pm +++ b/centreon-plugins/cloud/aws/mode/cloudwatch.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/instancestate.pm b/centreon-plugins/cloud/aws/mode/instancestate.pm index 966d68565..90565688a 100644 --- a/centreon-plugins/cloud/aws/mode/instancestate.pm +++ b/centreon-plugins/cloud/aws/mode/instancestate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/list.pm b/centreon-plugins/cloud/aws/mode/list.pm index a732bee56..d86374b34 100644 --- a/centreon-plugins/cloud/aws/mode/list.pm +++ b/centreon-plugins/cloud/aws/mode/list.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpu.pm b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpu.pm index 221427073..a42df116f 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpu.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditbalance.pm b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditbalance.pm index 4158f2dc8..54b46514f 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditbalance.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditbalance.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditusage.pm b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditusage.pm index 7b41e2696..f08ed5d7f 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditusage.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/ec2instancecpucreditusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/ec2instancenetwork.pm b/centreon-plugins/cloud/aws/mode/metrics/ec2instancenetwork.pm index 3eea9ef7f..414bdb09d 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/ec2instancenetwork.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/ec2instancenetwork.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/rdsinstancecpu.pm b/centreon-plugins/cloud/aws/mode/metrics/rdsinstancecpu.pm index 48b8f88ec..286a0387a 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/rdsinstancecpu.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/rdsinstancecpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/mode/metrics/s3bucketsize.pm b/centreon-plugins/cloud/aws/mode/metrics/s3bucketsize.pm index 799ff2f41..238779af3 100644 --- a/centreon-plugins/cloud/aws/mode/metrics/s3bucketsize.pm +++ b/centreon-plugins/cloud/aws/mode/metrics/s3bucketsize.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/aws/plugin.pm b/centreon-plugins/cloud/aws/plugin.pm index 30eafebb6..08127019f 100644 --- a/centreon-plugins/cloud/aws/plugin.pm +++ b/centreon-plugins/cloud/aws/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/blockio.pm b/centreon-plugins/cloud/docker/mode/blockio.pm index 553908a83..b21a6446f 100644 --- a/centreon-plugins/cloud/docker/mode/blockio.pm +++ b/centreon-plugins/cloud/docker/mode/blockio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/containerstate.pm b/centreon-plugins/cloud/docker/mode/containerstate.pm index 301c46bfd..1ffea8639 100644 --- a/centreon-plugins/cloud/docker/mode/containerstate.pm +++ b/centreon-plugins/cloud/docker/mode/containerstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/cpu.pm b/centreon-plugins/cloud/docker/mode/cpu.pm index 74a0506ae..b0f3d1f9e 100644 --- a/centreon-plugins/cloud/docker/mode/cpu.pm +++ b/centreon-plugins/cloud/docker/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/image.pm b/centreon-plugins/cloud/docker/mode/image.pm index 5ad1c22fd..0c257213e 100644 --- a/centreon-plugins/cloud/docker/mode/image.pm +++ b/centreon-plugins/cloud/docker/mode/image.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/info.pm b/centreon-plugins/cloud/docker/mode/info.pm index 40a164058..16d84779e 100644 --- a/centreon-plugins/cloud/docker/mode/info.pm +++ b/centreon-plugins/cloud/docker/mode/info.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/listcontainers.pm b/centreon-plugins/cloud/docker/mode/listcontainers.pm index 2db673617..e96baaf62 100644 --- a/centreon-plugins/cloud/docker/mode/listcontainers.pm +++ b/centreon-plugins/cloud/docker/mode/listcontainers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/memory.pm b/centreon-plugins/cloud/docker/mode/memory.pm index 8222a8d53..f4300210a 100644 --- a/centreon-plugins/cloud/docker/mode/memory.pm +++ b/centreon-plugins/cloud/docker/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/mode/traffic.pm b/centreon-plugins/cloud/docker/mode/traffic.pm index a869e3b46..1318c6a5e 100644 --- a/centreon-plugins/cloud/docker/mode/traffic.pm +++ b/centreon-plugins/cloud/docker/mode/traffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/cloud/docker/plugin.pm b/centreon-plugins/cloud/docker/plugin.pm index ebb582a4c..c30bd8bc7 100644 --- a/centreon-plugins/cloud/docker/plugin.pm +++ b/centreon-plugins/cloud/docker/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/mode/longqueries.pm b/centreon-plugins/database/firebird/mode/longqueries.pm index 99d639474..24b63c5df 100644 --- a/centreon-plugins/database/firebird/mode/longqueries.pm +++ b/centreon-plugins/database/firebird/mode/longqueries.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/mode/memory.pm b/centreon-plugins/database/firebird/mode/memory.pm index e97fddb60..910a82d36 100644 --- a/centreon-plugins/database/firebird/mode/memory.pm +++ b/centreon-plugins/database/firebird/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/mode/pages.pm b/centreon-plugins/database/firebird/mode/pages.pm index e81927743..ab7ab2c80 100644 --- a/centreon-plugins/database/firebird/mode/pages.pm +++ b/centreon-plugins/database/firebird/mode/pages.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/mode/queries.pm b/centreon-plugins/database/firebird/mode/queries.pm index 21ac8b928..4bb0034d6 100644 --- a/centreon-plugins/database/firebird/mode/queries.pm +++ b/centreon-plugins/database/firebird/mode/queries.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/mode/users.pm b/centreon-plugins/database/firebird/mode/users.pm index 3b7a3b18b..88a693aae 100644 --- a/centreon-plugins/database/firebird/mode/users.pm +++ b/centreon-plugins/database/firebird/mode/users.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/firebird/plugin.pm b/centreon-plugins/database/firebird/plugin.pm index b49f6728a..213943690 100644 --- a/centreon-plugins/database/firebird/plugin.pm +++ b/centreon-plugins/database/firebird/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/archivelevel0.pm b/centreon-plugins/database/informix/mode/archivelevel0.pm index e1b13196d..ac35c0fc1 100644 --- a/centreon-plugins/database/informix/mode/archivelevel0.pm +++ b/centreon-plugins/database/informix/mode/archivelevel0.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/checkpoints.pm b/centreon-plugins/database/informix/mode/checkpoints.pm index 3ce2e12f9..9377032e7 100644 --- a/centreon-plugins/database/informix/mode/checkpoints.pm +++ b/centreon-plugins/database/informix/mode/checkpoints.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/chunkstates.pm b/centreon-plugins/database/informix/mode/chunkstates.pm index 9b6d0ebca..9c898c748 100644 --- a/centreon-plugins/database/informix/mode/chunkstates.pm +++ b/centreon-plugins/database/informix/mode/chunkstates.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/dbspacesusage.pm b/centreon-plugins/database/informix/mode/dbspacesusage.pm index 1553cf8d8..c89a23685 100644 --- a/centreon-plugins/database/informix/mode/dbspacesusage.pm +++ b/centreon-plugins/database/informix/mode/dbspacesusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/globalcache.pm b/centreon-plugins/database/informix/mode/globalcache.pm index 413981219..119c8f403 100644 --- a/centreon-plugins/database/informix/mode/globalcache.pm +++ b/centreon-plugins/database/informix/mode/globalcache.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/listdatabases.pm b/centreon-plugins/database/informix/mode/listdatabases.pm index 55b07720c..6ffe03d42 100644 --- a/centreon-plugins/database/informix/mode/listdatabases.pm +++ b/centreon-plugins/database/informix/mode/listdatabases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/listdbspaces.pm b/centreon-plugins/database/informix/mode/listdbspaces.pm index 6e8938ae3..d20ecb216 100644 --- a/centreon-plugins/database/informix/mode/listdbspaces.pm +++ b/centreon-plugins/database/informix/mode/listdbspaces.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/lockoverflow.pm b/centreon-plugins/database/informix/mode/lockoverflow.pm index 98122ec63..a5ff74643 100644 --- a/centreon-plugins/database/informix/mode/lockoverflow.pm +++ b/centreon-plugins/database/informix/mode/lockoverflow.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/logfilesusage.pm b/centreon-plugins/database/informix/mode/logfilesusage.pm index dd68da06b..f560b12a4 100644 --- a/centreon-plugins/database/informix/mode/logfilesusage.pm +++ b/centreon-plugins/database/informix/mode/logfilesusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/longtxs.pm b/centreon-plugins/database/informix/mode/longtxs.pm index 1e6febfcb..5921151fa 100644 --- a/centreon-plugins/database/informix/mode/longtxs.pm +++ b/centreon-plugins/database/informix/mode/longtxs.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/sessions.pm b/centreon-plugins/database/informix/mode/sessions.pm index 7dc4a12df..d95c7233c 100644 --- a/centreon-plugins/database/informix/mode/sessions.pm +++ b/centreon-plugins/database/informix/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/mode/tablelocks.pm b/centreon-plugins/database/informix/mode/tablelocks.pm index f30eb9051..a80c0730d 100644 --- a/centreon-plugins/database/informix/mode/tablelocks.pm +++ b/centreon-plugins/database/informix/mode/tablelocks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/informix/plugin.pm b/centreon-plugins/database/informix/plugin.pm index e571239d7..a78c1f03b 100644 --- a/centreon-plugins/database/informix/plugin.pm +++ b/centreon-plugins/database/informix/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/backupage.pm b/centreon-plugins/database/mssql/mode/backupage.pm index 1157c4bba..958655ad0 100644 --- a/centreon-plugins/database/mssql/mode/backupage.pm +++ b/centreon-plugins/database/mssql/mode/backupage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/blockedprocesses.pm b/centreon-plugins/database/mssql/mode/blockedprocesses.pm index 61ee349b1..7db96af45 100644 --- a/centreon-plugins/database/mssql/mode/blockedprocesses.pm +++ b/centreon-plugins/database/mssql/mode/blockedprocesses.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/cachehitratio.pm b/centreon-plugins/database/mssql/mode/cachehitratio.pm index ed32969db..69348e39b 100644 --- a/centreon-plugins/database/mssql/mode/cachehitratio.pm +++ b/centreon-plugins/database/mssql/mode/cachehitratio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/connectedusers.pm b/centreon-plugins/database/mssql/mode/connectedusers.pm index 887906682..95949106d 100644 --- a/centreon-plugins/database/mssql/mode/connectedusers.pm +++ b/centreon-plugins/database/mssql/mode/connectedusers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/databasessize.pm b/centreon-plugins/database/mssql/mode/databasessize.pm index ecfcac5f5..6e37a6627 100644 --- a/centreon-plugins/database/mssql/mode/databasessize.pm +++ b/centreon-plugins/database/mssql/mode/databasessize.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/deadlocks.pm b/centreon-plugins/database/mssql/mode/deadlocks.pm index 8a629dcac..466e4555e 100644 --- a/centreon-plugins/database/mssql/mode/deadlocks.pm +++ b/centreon-plugins/database/mssql/mode/deadlocks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/failedjobs.pm b/centreon-plugins/database/mssql/mode/failedjobs.pm index f58b566bd..37e5740a6 100644 --- a/centreon-plugins/database/mssql/mode/failedjobs.pm +++ b/centreon-plugins/database/mssql/mode/failedjobs.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/lockswaits.pm b/centreon-plugins/database/mssql/mode/lockswaits.pm index 2604f5d3e..e3932b3da 100644 --- a/centreon-plugins/database/mssql/mode/lockswaits.pm +++ b/centreon-plugins/database/mssql/mode/lockswaits.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/mode/transactions.pm b/centreon-plugins/database/mssql/mode/transactions.pm index dfc6d4140..729595dda 100644 --- a/centreon-plugins/database/mssql/mode/transactions.pm +++ b/centreon-plugins/database/mssql/mode/transactions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mssql/plugin.pm b/centreon-plugins/database/mssql/plugin.pm index 4c816ae0c..f36250f06 100644 --- a/centreon-plugins/database/mssql/plugin.pm +++ b/centreon-plugins/database/mssql/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/databasessize.pm b/centreon-plugins/database/mysql/mode/databasessize.pm index 06e4dcc8f..35dd8d555 100644 --- a/centreon-plugins/database/mysql/mode/databasessize.pm +++ b/centreon-plugins/database/mysql/mode/databasessize.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/innodbbufferpoolhitrate.pm b/centreon-plugins/database/mysql/mode/innodbbufferpoolhitrate.pm index 1fc7dbfac..5b2df3703 100644 --- a/centreon-plugins/database/mysql/mode/innodbbufferpoolhitrate.pm +++ b/centreon-plugins/database/mysql/mode/innodbbufferpoolhitrate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/longqueries.pm b/centreon-plugins/database/mysql/mode/longqueries.pm index 062d28277..acbb587b1 100644 --- a/centreon-plugins/database/mysql/mode/longqueries.pm +++ b/centreon-plugins/database/mysql/mode/longqueries.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/myisamkeycachehitrate.pm b/centreon-plugins/database/mysql/mode/myisamkeycachehitrate.pm index f2f5177ef..13c92e10e 100644 --- a/centreon-plugins/database/mysql/mode/myisamkeycachehitrate.pm +++ b/centreon-plugins/database/mysql/mode/myisamkeycachehitrate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/openfiles.pm b/centreon-plugins/database/mysql/mode/openfiles.pm index 8c5e0504a..c58b94174 100644 --- a/centreon-plugins/database/mysql/mode/openfiles.pm +++ b/centreon-plugins/database/mysql/mode/openfiles.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/qcachehitrate.pm b/centreon-plugins/database/mysql/mode/qcachehitrate.pm index e9efe77e0..af625825f 100644 --- a/centreon-plugins/database/mysql/mode/qcachehitrate.pm +++ b/centreon-plugins/database/mysql/mode/qcachehitrate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/queries.pm b/centreon-plugins/database/mysql/mode/queries.pm index 2e2f27c34..3773bfff0 100644 --- a/centreon-plugins/database/mysql/mode/queries.pm +++ b/centreon-plugins/database/mysql/mode/queries.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/replicationmastermaster.pm b/centreon-plugins/database/mysql/mode/replicationmastermaster.pm index a68fe7cc5..7b10e6777 100644 --- a/centreon-plugins/database/mysql/mode/replicationmastermaster.pm +++ b/centreon-plugins/database/mysql/mode/replicationmastermaster.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/replicationmasterslave.pm b/centreon-plugins/database/mysql/mode/replicationmasterslave.pm index 94f4e59ba..516e253d6 100644 --- a/centreon-plugins/database/mysql/mode/replicationmasterslave.pm +++ b/centreon-plugins/database/mysql/mode/replicationmasterslave.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/slowqueries.pm b/centreon-plugins/database/mysql/mode/slowqueries.pm index 757152826..ce4f308d7 100644 --- a/centreon-plugins/database/mysql/mode/slowqueries.pm +++ b/centreon-plugins/database/mysql/mode/slowqueries.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/threadsconnected.pm b/centreon-plugins/database/mysql/mode/threadsconnected.pm index 1444272e9..46c4e8e79 100644 --- a/centreon-plugins/database/mysql/mode/threadsconnected.pm +++ b/centreon-plugins/database/mysql/mode/threadsconnected.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mode/uptime.pm b/centreon-plugins/database/mysql/mode/uptime.pm index ac64a4998..5adc32ce3 100644 --- a/centreon-plugins/database/mysql/mode/uptime.pm +++ b/centreon-plugins/database/mysql/mode/uptime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/mysqlcmd.pm b/centreon-plugins/database/mysql/mysqlcmd.pm index eb6567bb3..8f1eeadcd 100644 --- a/centreon-plugins/database/mysql/mysqlcmd.pm +++ b/centreon-plugins/database/mysql/mysqlcmd.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/mysql/plugin.pm b/centreon-plugins/database/mysql/plugin.pm index d21516ec7..5ae0b6c5c 100644 --- a/centreon-plugins/database/mysql/plugin.pm +++ b/centreon-plugins/database/mysql/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/asmdiskgroupusage.pm b/centreon-plugins/database/oracle/mode/asmdiskgroupusage.pm index b9ecbdbea..39404c9ff 100644 --- a/centreon-plugins/database/oracle/mode/asmdiskgroupusage.pm +++ b/centreon-plugins/database/oracle/mode/asmdiskgroupusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/connectedusers.pm b/centreon-plugins/database/oracle/mode/connectedusers.pm index f469fbbf3..aa298eb81 100644 --- a/centreon-plugins/database/oracle/mode/connectedusers.pm +++ b/centreon-plugins/database/oracle/mode/connectedusers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/corruptedblocks.pm b/centreon-plugins/database/oracle/mode/corruptedblocks.pm index 8cccbc539..4b9bc2795 100644 --- a/centreon-plugins/database/oracle/mode/corruptedblocks.pm +++ b/centreon-plugins/database/oracle/mode/corruptedblocks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/datacachehitratio.pm b/centreon-plugins/database/oracle/mode/datacachehitratio.pm index d9dcb8e22..c65661775 100644 --- a/centreon-plugins/database/oracle/mode/datacachehitratio.pm +++ b/centreon-plugins/database/oracle/mode/datacachehitratio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/processusage.pm b/centreon-plugins/database/oracle/mode/processusage.pm index c6b9bf9b1..33bbefc9b 100644 --- a/centreon-plugins/database/oracle/mode/processusage.pm +++ b/centreon-plugins/database/oracle/mode/processusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/rmanbackupage.pm b/centreon-plugins/database/oracle/mode/rmanbackupage.pm index fef424a8f..c01fc3634 100644 --- a/centreon-plugins/database/oracle/mode/rmanbackupage.pm +++ b/centreon-plugins/database/oracle/mode/rmanbackupage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/rmanbackupproblems.pm b/centreon-plugins/database/oracle/mode/rmanbackupproblems.pm index c80c6cd2c..a08284501 100644 --- a/centreon-plugins/database/oracle/mode/rmanbackupproblems.pm +++ b/centreon-plugins/database/oracle/mode/rmanbackupproblems.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/rmanonlinebackupage.pm b/centreon-plugins/database/oracle/mode/rmanonlinebackupage.pm index fa59c52dc..f8826b4ea 100644 --- a/centreon-plugins/database/oracle/mode/rmanonlinebackupage.pm +++ b/centreon-plugins/database/oracle/mode/rmanonlinebackupage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/sessionusage.pm b/centreon-plugins/database/oracle/mode/sessionusage.pm index 11fd8220a..3758ac315 100644 --- a/centreon-plugins/database/oracle/mode/sessionusage.pm +++ b/centreon-plugins/database/oracle/mode/sessionusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index e0df54b48..a60016bdc 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/mode/tnsping.pm b/centreon-plugins/database/oracle/mode/tnsping.pm index 11db3b138..2f23da672 100644 --- a/centreon-plugins/database/oracle/mode/tnsping.pm +++ b/centreon-plugins/database/oracle/mode/tnsping.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/oracle/plugin.pm b/centreon-plugins/database/oracle/plugin.pm index 677b74910..ff665ab2a 100644 --- a/centreon-plugins/database/oracle/plugin.pm +++ b/centreon-plugins/database/oracle/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/backends.pm b/centreon-plugins/database/postgres/mode/backends.pm index df8664f6b..dae77678e 100644 --- a/centreon-plugins/database/postgres/mode/backends.pm +++ b/centreon-plugins/database/postgres/mode/backends.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/hitratio.pm b/centreon-plugins/database/postgres/mode/hitratio.pm index 7264fd07c..c9b3e482b 100644 --- a/centreon-plugins/database/postgres/mode/hitratio.pm +++ b/centreon-plugins/database/postgres/mode/hitratio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/listdatabases.pm b/centreon-plugins/database/postgres/mode/listdatabases.pm index 5599bdbc7..48d908aeb 100644 --- a/centreon-plugins/database/postgres/mode/listdatabases.pm +++ b/centreon-plugins/database/postgres/mode/listdatabases.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/locks.pm b/centreon-plugins/database/postgres/mode/locks.pm index cf6101e7a..f89ebddce 100644 --- a/centreon-plugins/database/postgres/mode/locks.pm +++ b/centreon-plugins/database/postgres/mode/locks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/querytime.pm b/centreon-plugins/database/postgres/mode/querytime.pm index 9b010f046..780ffc99d 100644 --- a/centreon-plugins/database/postgres/mode/querytime.pm +++ b/centreon-plugins/database/postgres/mode/querytime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/statistics.pm b/centreon-plugins/database/postgres/mode/statistics.pm index e213c0df9..a8a72e6b5 100644 --- a/centreon-plugins/database/postgres/mode/statistics.pm +++ b/centreon-plugins/database/postgres/mode/statistics.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/tablespace.pm b/centreon-plugins/database/postgres/mode/tablespace.pm index 7a9235c7b..dd2c58e68 100644 --- a/centreon-plugins/database/postgres/mode/tablespace.pm +++ b/centreon-plugins/database/postgres/mode/tablespace.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/timesync.pm b/centreon-plugins/database/postgres/mode/timesync.pm index 9fa87b9bf..2da789d90 100644 --- a/centreon-plugins/database/postgres/mode/timesync.pm +++ b/centreon-plugins/database/postgres/mode/timesync.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/mode/vacuum.pm b/centreon-plugins/database/postgres/mode/vacuum.pm index 811158941..752b86bc4 100644 --- a/centreon-plugins/database/postgres/mode/vacuum.pm +++ b/centreon-plugins/database/postgres/mode/vacuum.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/plugin.pm b/centreon-plugins/database/postgres/plugin.pm index 58f2d08cb..c72fa27d5 100644 --- a/centreon-plugins/database/postgres/plugin.pm +++ b/centreon-plugins/database/postgres/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/database/postgres/psqlcmd.pm b/centreon-plugins/database/postgres/psqlcmd.pm index d2f66d240..5261205dd 100644 --- a/centreon-plugins/database/postgres/psqlcmd.pm +++ b/centreon-plugins/database/postgres/psqlcmd.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/docs/en/developer/guide.rst b/centreon-plugins/docs/en/developer/guide.rst index 8718d6c75..b52ada7da 100644 --- a/centreon-plugins/docs/en/developer/guide.rst +++ b/centreon-plugins/docs/en/developer/guide.rst @@ -1479,7 +1479,7 @@ Then, edit **plugin.pm** and add the following lines: .. code-block:: perl # - # Copyright 2015 Centreon (http://www.centreon.com/) + # Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for @@ -1569,7 +1569,7 @@ Edit **memorydroppedpackets.pm** and add the following lines: .. code-block:: perl # - # Copyright 2015 Centreon (http://www.centreon.com/) + # Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/docs/fr/developer/guide.rst b/centreon-plugins/docs/fr/developer/guide.rst index b60071ab1..294e1dbd1 100644 --- a/centreon-plugins/docs/fr/developer/guide.rst +++ b/centreon-plugins/docs/fr/developer/guide.rst @@ -1469,7 +1469,7 @@ Ensuite, éditer le fichier **plugin.pm** et ajouter les lignes suivantes : .. code-block:: perl # - # Copyright 2015 Centreon (http://www.centreon.com/) + # Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for @@ -1559,7 +1559,7 @@ Editer le fichier **memorydroppedpackets.pm** et ajouter les lignes suivantes : .. code-block:: perl # - # Copyright 2015 Centreon (http://www.centreon.com/) + # Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/custommode/simple.pm b/centreon-plugins/example/custommode/simple.pm index 134047f2a..b60dbf009 100644 --- a/centreon-plugins/example/custommode/simple.pm +++ b/centreon-plugins/example/custommode/simple.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/mode/getvalue.pm b/centreon-plugins/example/mode/getvalue.pm index 392650816..8757fdb35 100644 --- a/centreon-plugins/example/mode/getvalue.pm +++ b/centreon-plugins/example/mode/getvalue.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/mode/launchcmd.pm b/centreon-plugins/example/mode/launchcmd.pm index 82d788de5..2dfedc748 100644 --- a/centreon-plugins/example/mode/launchcmd.pm +++ b/centreon-plugins/example/mode/launchcmd.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/mode/testcustom.pm b/centreon-plugins/example/mode/testcustom.pm index cd2f7b243..678001c2d 100644 --- a/centreon-plugins/example/mode/testcustom.pm +++ b/centreon-plugins/example/mode/testcustom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/plugin_command.pm b/centreon-plugins/example/plugin_command.pm index 1a1f0b342..75470b367 100644 --- a/centreon-plugins/example/plugin_command.pm +++ b/centreon-plugins/example/plugin_command.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/plugin_custom.pm b/centreon-plugins/example/plugin_custom.pm index ce06d65c7..47d862cb0 100644 --- a/centreon-plugins/example/plugin_custom.pm +++ b/centreon-plugins/example/plugin_custom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/example/plugin_snmp.pm b/centreon-plugins/example/plugin_snmp.pm index 4e1e6fab0..dee41721c 100644 --- a/centreon-plugins/example/plugin_snmp.pm +++ b/centreon-plugins/example/plugin_snmp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ats/apc/mode/entity.pm b/centreon-plugins/hardware/ats/apc/mode/entity.pm index 5ef5deb4e..298e71f55 100644 --- a/centreon-plugins/hardware/ats/apc/mode/entity.pm +++ b/centreon-plugins/hardware/ats/apc/mode/entity.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ats/apc/mode/input.pm b/centreon-plugins/hardware/ats/apc/mode/input.pm index a9928e892..72cafe03e 100644 --- a/centreon-plugins/hardware/ats/apc/mode/input.pm +++ b/centreon-plugins/hardware/ats/apc/mode/input.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ats/apc/mode/psu.pm b/centreon-plugins/hardware/ats/apc/mode/psu.pm index 8606dd635..c6bf55936 100644 --- a/centreon-plugins/hardware/ats/apc/mode/psu.pm +++ b/centreon-plugins/hardware/ats/apc/mode/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ats/apc/mode/source.pm b/centreon-plugins/hardware/ats/apc/mode/source.pm index 5b2ac0607..63048f31b 100644 --- a/centreon-plugins/hardware/ats/apc/mode/source.pm +++ b/centreon-plugins/hardware/ats/apc/mode/source.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ats/apc/plugin.pm b/centreon-plugins/hardware/ats/apc/plugin.pm index 8aab31562..515a3ff64 100644 --- a/centreon-plugins/hardware/ats/apc/plugin.pm +++ b/centreon-plugins/hardware/ats/apc/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/humidity.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/humidity.pm index 5783d8741..aa1225fa8 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/humidity.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/humidity.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/psu.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/psu.pm index c62359606..f2557482c 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/temperature.pm index f7b1af648..9e7ed5b5a 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/hardware.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/hardware.pm index a494e6368..b4150cd3b 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm index 0818bf90a..78665cb87 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/outlet.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/outlet.pm index 30d000113..347aafcb7 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/outlet.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/outlet.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm b/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm index 33f4f6de7..f211d46ec 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/eaton/mode/group.pm b/centreon-plugins/hardware/pdu/eaton/mode/group.pm index 4ac8b54c3..fce3e5528 100644 --- a/centreon-plugins/hardware/pdu/eaton/mode/group.pm +++ b/centreon-plugins/hardware/pdu/eaton/mode/group.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm b/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm index 4c2073de8..e1272927f 100644 --- a/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm +++ b/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/eaton/plugin.pm b/centreon-plugins/hardware/pdu/eaton/plugin.pm index e6eb62b61..e8aeee083 100644 --- a/centreon-plugins/hardware/pdu/eaton/plugin.pm +++ b/centreon-plugins/hardware/pdu/eaton/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm index 6f545d14d..9483bee88 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm index b9032d28e..c4aa2c28b 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm index 5c057f615..b6dae4dcb 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/inletsensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm index 8bfdf2949..f516d18df 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm index 56b380224..aee7b4456 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/outletsensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm index cef7dfaf8..1539faf23 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm index c91b505e7..09e41ba0a 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm index 3a65646b2..b7dfc75f0 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm index bae428ad9..289e7101d 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm index 66ece27b0..d53d4580b 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm b/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm index e33fcd0d2..2d7316b4b 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/hwgste/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/hwgste/snmp/mode/sensors.pm index 305621907..87a05108c 100644 --- a/centreon-plugins/hardware/sensors/hwgste/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/hwgste/snmp/mode/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/hwgste/snmp/plugin.pm b/centreon-plugins/hardware/sensors/hwgste/snmp/plugin.pm index 3c08e97f7..96b39e8cc 100644 --- a/centreon-plugins/hardware/sensors/hwgste/snmp/plugin.pm +++ b/centreon-plugins/hardware/sensors/hwgste/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/humidity.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/humidity.pm index 24e6224a6..9aebe168a 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/humidity.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/humidity.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/sp.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/sp.pm index 9481c3cf1..835239bdf 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/sp.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/sp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/switch.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/switch.pm index fd52733ea..fd39f4188 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/switch.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/switch.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/temperature.pm index bf2ea7fd3..af6cec712 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm index 7bbd87fa3..a2e3d7fd4 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm index 5e1d427ed..56d2338ec 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/contact.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/contact.pm index 14cfbc495..b67ac1477 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/contact.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/contact.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/flood.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/flood.pm index dcf881b31..322b023f4 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/flood.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/flood.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/humidity.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/humidity.pm index 1314f296e..c6f3e3ccc 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/humidity.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/humidity.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/illumination.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/illumination.pm index ac6d982dd..e678dcabc 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/illumination.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/illumination.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/temperature.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/temperature.pm index 12b1f56b8..c9618d322 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/temperature.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/thermistor.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/thermistor.pm index 96225fc42..a0c28ce30 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/thermistor.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/thermistor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/voltage.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/voltage.pm index 1f3a2a2b1..e0debdb11 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/voltage.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/mode/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm index dc259c937..f3ac631a0 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/components/sensors.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/components/sensors.pm index 31793eca3..7fd62269b 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/components/sensors.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/components/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm index 040134c48..11118a30c 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm index 5eb49e8b6..79c559701 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm index 716f4b22d..0bb5553aa 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm index e928ddf72..03ec3b9d0 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/blade.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm index b1413df31..ece6e0b51 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/chassis.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm index c49b1c074..0b622c9f5 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm index 169341beb..bf6102d32 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm index a6845cc79..c27ef32f3 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/fex.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm index f22c86b5d..4bac57dbd 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/iocard.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm index 35f7c8306..c8d3dd399 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/localdisk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm index d79451b60..4b8902126 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm index 5180e6ae7..9727a1eaf 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/components/resources.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/components/resources.pm index d8beeb34a..57ed70b8c 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/components/resources.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/components/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm index fbd837d37..9bbb29a11 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/equipment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm index 12c116552..19e445fd9 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm index 6efa7a54c..3621b286f 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/cisco/ucs/plugin.pm b/centreon-plugins/hardware/server/cisco/ucs/plugin.pm index 5abe8583b..b9e1c8dc0 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/plugin.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/chassis.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/chassis.pm index cd287a6a5..1eb78f5f9 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/chassis.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/chassis.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/health.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/health.pm index 7269cdc01..48791fca0 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/health.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/health.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/psu.pm index aaa1a1f10..976767c14 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/temperature.pm index 38ac2c213..768036564 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm index a7fd26e5c..c4e75a5fe 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm index c5de2d59d..d4a27e773 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm index d3c8a9a2f..68fe2a743 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index 10bf944fb..8f533d660 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm index f91ff3754..57e57e7f0 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm index 7a3cc5e1d..187f1b98d 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/battery.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/battery.pm index f9f4443c9..96170f3f9 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/battery.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/battery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm index a453fda48..70348c467 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cachebattery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm index 34eede51f..9ede88f80 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/connector.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/controller.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/controller.pm index f05e37e83..a2876cf1c 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/controller.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/controller.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm index 28dc2eb23..c51909502 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/esmlog.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/esmlog.pm index da6ff2475..4a8a4ed9b 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/esmlog.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/esmlog.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/fan.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/fan.pm index e29d6bf4f..1a2d4e71b 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/globalstatus.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/globalstatus.pm index aee0ebb5d..c3cdd8455 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/globalstatus.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/logicaldrive.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/logicaldrive.pm index 81bb675ad..2559bc33b 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/logicaldrive.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/logicaldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/memory.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/memory.pm index 120e2017f..09a46c6f9 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/memory.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm index f5a812909..4a65860e0 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/physicaldisk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm index 18aaf5856..17ca56240 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/temperature.pm index 0a3fd9de5..f5289e6c8 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm index 4f2b6055b..764db5c06 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm index bf8a1dbda..69431071e 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/blade.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/blade.pm index 78b16990c..ea3ae4fae 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/blade.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/enclosure.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/enclosure.pm index 4dfd012dd..8b5322288 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/enclosure.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/enclosure.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fan.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fan.pm index 1f9621173..80603e445 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fuse.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fuse.pm index d313e8669..45b3413ba 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fuse.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/fuse.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/manager.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/manager.pm index 9003bc53c..c06bd9fec 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/manager.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/manager.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/network.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/network.pm index a493b4a1c..d03945333 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/network.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/network.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/psu.pm index 47c15cea9..b79b43a0c 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/temperature.pm index a6f52a41c..3e679d740 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm index 2d0ce726d..c0d709e3d 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm index ca07c5ae2..54404f6e3 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/cpu.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/cpu.pm index 10a7f87b4..8207baa0e 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/cpu.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daacc.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daacc.pm index 647df7eb2..c3b60c6b8 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daacc.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daacc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dactl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dactl.pm index 39c56d7a6..488589be8 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dactl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dactl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daldrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daldrive.pm index 9aa55aa76..08b8c0d2d 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daldrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/daldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dapdrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dapdrive.pm index e83460b1f..4cfe535c4 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dapdrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/dapdrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fan.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fan.pm index 3c7841b95..29bfe845a 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalacc.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalacc.pm index 6ceece824..1eca01e41 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalacc.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalacc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalctl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalctl.pm index d27610e56..f21cb36fc 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalctl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaexternalctl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcahostctl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcahostctl.pm index 727521b4f..def3ab6d3 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcahostctl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcahostctl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaldrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaldrive.pm index 6e67816d8..e01302d36 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaldrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcaldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcapdrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcapdrive.pm index ffee76a7a..ef13fbbb0 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcapdrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/fcapdrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idectl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idectl.pm index ea2fcc542..900c3c31a 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idectl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idectl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ideldrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ideldrive.pm index fea39b477..765cc1778 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ideldrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ideldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idepdrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idepdrive.pm index 14fca2c83..6a385b4fd 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idepdrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/idepdrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/lnic.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/lnic.pm index 8806ffe5c..5d6cd0235 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/lnic.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/lnic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pc.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pc.pm index 891cd3790..95f0c4c9b 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pc.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pnic.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pnic.pm index 9e126c5b8..ec0637ed5 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pnic.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/pnic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/psu.pm index a4e4d205b..5e6a68167 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/psu.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasctl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasctl.pm index b07433ee0..7d75de032 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasctl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasctl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasldrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasldrive.pm index 41583a516..990fc2ddf 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasldrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/sasldrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/saspdrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/saspdrive.pm index 9fe04a97f..94ae8210d 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/saspdrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/saspdrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsictl.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsictl.pm index 12c9144dc..163c180c9 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsictl.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsictl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsildrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsildrive.pm index ad69e83b0..260e3d5a4 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsildrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsildrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsipdrive.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsipdrive.pm index 8e2af967b..6787b744a 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsipdrive.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/scsipdrive.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/temperature.pm index f89b9a52c..3d413efbe 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm index e4994779b..cd75aaf34 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm index 34bff9347..ffae6eaf4 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm index 85d1097e9..ce1264c83 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm index 88361c9ff..8388847eb 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/ambient.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm index dd9918b7d..c48e4007b 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm index 022cb698b..8f0eb1581 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blower.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm index f3648f55c..6136e4c72 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisfan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm index f4a315fdb..2c806e1b1 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/chassisstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm index 7f9a067f2..971ba0a45 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/fanpack.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm index 27e6d8a5d..72c5998ce 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/powermodule.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm index 95e2517d2..64b1251b1 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/switchmodule.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm index 18c5e49b0..db1b381e4 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/systemhealth.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm index 7be62e343..70b1cfab2 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm index 0842efad6..b8a858d16 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/hmc/ssh/mode/hardwareerrors.pm b/centreon-plugins/hardware/server/ibm/hmc/ssh/mode/hardwareerrors.pm index e8ca810e5..557ebe4a0 100644 --- a/centreon-plugins/hardware/server/ibm/hmc/ssh/mode/hardwareerrors.pm +++ b/centreon-plugins/hardware/server/ibm/hmc/ssh/mode/hardwareerrors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm b/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm index 6708a48ed..cbb38f588 100644 --- a/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/fan.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/fan.pm index 7e1451c0d..eea058f0c 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/fan.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/globalstatus.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/globalstatus.pm index e823506a2..b6d27bdb9 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/globalstatus.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/temperature.pm index 843f1a6d6..e3cd3a535 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm index 0a4c16300..21dc6ad5b 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm index a7b616e69..dfa5c2f1c 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm index b52c57680..c4eca0396 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm index 9978e241e..f8c9be29d 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/disk.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/disk.pm index b87a889ee..ce8e8c80c 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/disk.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/fan.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/fan.pm index 0f7269a1f..953879388 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/fan.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/psu.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/psu.pm index 19ca73346..f4b696b96 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/psu.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/resources.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/resources.pm index 55ea093f1..cff03c05d 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/resources.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/sensors.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/sensors.pm index fb639041f..b5523027c 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/sensors.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/si.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/si.pm index 8247712d1..9551de36d 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/si.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/si.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/temperature.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/temperature.pm index c21ddbf2c..e19b64d26 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/temperature.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/voltage.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/voltage.pm index d97a84d5a..67f852afc 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/voltage.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/components/showenvironment/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/lib/telnet.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/lib/telnet.pm index 13d4ade92..c1bae8d37 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/lib/telnet.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/lib/telnet.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentsf2xx.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentsf2xx.pm index 68ea4a0cf..5b4032742 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentsf2xx.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentsf2xx.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv4xx.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv4xx.pm index 078833ce2..3d95160e7 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv4xx.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv4xx.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv8xx.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv8xx.pm index 8afbfefbf..47bfe4709 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv8xx.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/environmentv8xx.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showboards.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showboards.pm index 268bd6774..a5164c789 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showboards.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showboards.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm index f60cd8273..33f3f43f7 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaults.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaults.pm index d0799bf82..54871f9a4 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaults.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaults.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaulty.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaulty.pm index 377d31e9b..daf996f9b 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaulty.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showfaulty.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm index 22f00c78f..997fc6ca5 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm index 53879d413..290df3408 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm b/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm index f0d19f6fa..7e387adaa 100644 --- a/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm +++ b/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm b/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm index d23931459..cf8dfb388 100644 --- a/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm +++ b/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/mseries/plugin.pm b/centreon-plugins/hardware/server/sun/mseries/plugin.pm index a2b417ede..ba0baa911 100644 --- a/centreon-plugins/hardware/server/sun/mseries/plugin.pm +++ b/centreon-plugins/hardware/server/sun/mseries/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/sfxxk/mode/boards.pm b/centreon-plugins/hardware/server/sun/sfxxk/mode/boards.pm index 80b1136f5..76d4f8584 100644 --- a/centreon-plugins/hardware/server/sun/sfxxk/mode/boards.pm +++ b/centreon-plugins/hardware/server/sun/sfxxk/mode/boards.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/sfxxk/mode/environment.pm b/centreon-plugins/hardware/server/sun/sfxxk/mode/environment.pm index a02bc988b..a4b5ea468 100644 --- a/centreon-plugins/hardware/server/sun/sfxxk/mode/environment.pm +++ b/centreon-plugins/hardware/server/sun/sfxxk/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/sfxxk/mode/failover.pm b/centreon-plugins/hardware/server/sun/sfxxk/mode/failover.pm index 1e5587d2d..6023329e2 100644 --- a/centreon-plugins/hardware/server/sun/sfxxk/mode/failover.pm +++ b/centreon-plugins/hardware/server/sun/sfxxk/mode/failover.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm b/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm index 6b499dff7..6529033bb 100644 --- a/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm +++ b/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index 67ecb1aad..a3379d136 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm index 93f5416b4..105b7ae32 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm index 48b70b4b3..50c3da145 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm index 6d823b6fa..dcf6cd0f1 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm index e35f099d1..6c7d41269 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm index e1d1db114..245829593 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/mge/snmp/plugin.pm b/centreon-plugins/hardware/ups/mge/snmp/plugin.pm index 698331f89..faea24cb3 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm index f6b1b1fd0..d3d5afca6 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm index e7def40a2..d8261c8ef 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm index ba5a550fa..30331b1dc 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm index b516f101b..fbb1b99f1 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm index 46e970478..72820204a 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm index 9e4e4c665..9f12397ee 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm b/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm index cbce7cf9c..89027ba99 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm index 2aaad3e4d..b0cebe98e 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm index 3c4ecc8e9..5ee5dc174 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm index c32268205..2407632f6 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm index d1efb86c4..a9e4c5ea8 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm index c56fea38f..41669e631 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm index 9afa4fcea..113fca649 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/mode/components/fan.pm b/centreon-plugins/network/3com/snmp/mode/components/fan.pm index 0c91df2cf..5c8939566 100644 --- a/centreon-plugins/network/3com/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/3com/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/mode/components/psu.pm b/centreon-plugins/network/3com/snmp/mode/components/psu.pm index 9fda71e7b..99a4093bc 100644 --- a/centreon-plugins/network/3com/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/3com/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/mode/cpu.pm b/centreon-plugins/network/3com/snmp/mode/cpu.pm index af8b72602..8191a5234 100644 --- a/centreon-plugins/network/3com/snmp/mode/cpu.pm +++ b/centreon-plugins/network/3com/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/mode/hardware.pm b/centreon-plugins/network/3com/snmp/mode/hardware.pm index a4bb080b3..e8c1ff33a 100644 --- a/centreon-plugins/network/3com/snmp/mode/hardware.pm +++ b/centreon-plugins/network/3com/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/mode/memory.pm b/centreon-plugins/network/3com/snmp/mode/memory.pm index c54fdd0d5..f2ddf4ab4 100644 --- a/centreon-plugins/network/3com/snmp/mode/memory.pm +++ b/centreon-plugins/network/3com/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/3com/snmp/plugin.pm b/centreon-plugins/network/3com/snmp/plugin.pm index 132c0a2ff..53e48b2d6 100644 --- a/centreon-plugins/network/3com/snmp/plugin.pm +++ b/centreon-plugins/network/3com/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/backplane.pm b/centreon-plugins/network/alcatel/common/mode/components/backplane.pm index 805f01b89..86bbddbd5 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/backplane.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/backplane.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/chassis.pm b/centreon-plugins/network/alcatel/common/mode/components/chassis.pm index eb6119884..13104cd9d 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/chassis.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/chassis.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/container.pm b/centreon-plugins/network/alcatel/common/mode/components/container.pm index 3ad399a0d..e4b0e561c 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/container.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/container.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/fan.pm b/centreon-plugins/network/alcatel/common/mode/components/fan.pm index 94e71a221..72ed84b52 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/fan.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/module.pm b/centreon-plugins/network/alcatel/common/mode/components/module.pm index 802e61a43..a6a1ac992 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/module.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/module.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/other.pm b/centreon-plugins/network/alcatel/common/mode/components/other.pm index 3c4fb24be..52f07d024 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/other.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/other.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/port.pm b/centreon-plugins/network/alcatel/common/mode/components/port.pm index 352791bf0..3d8a638d9 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/port.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/port.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm b/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm index 3d215e61b..22902766c 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/resources.pm b/centreon-plugins/network/alcatel/common/mode/components/resources.pm index 99686e066..f8032e6fd 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/resources.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/sensor.pm b/centreon-plugins/network/alcatel/common/mode/components/sensor.pm index c33efa030..77c627711 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/sensor.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/stack.pm b/centreon-plugins/network/alcatel/common/mode/components/stack.pm index d388fca0c..2ec77518d 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/stack.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/stack.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/components/unknown.pm b/centreon-plugins/network/alcatel/common/mode/components/unknown.pm index c3fed10aa..ae3e3fcd8 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/unknown.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/unknown.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/cpu.pm b/centreon-plugins/network/alcatel/common/mode/cpu.pm index fd5127dea..2a55d0d45 100644 --- a/centreon-plugins/network/alcatel/common/mode/cpu.pm +++ b/centreon-plugins/network/alcatel/common/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/flashmemory.pm b/centreon-plugins/network/alcatel/common/mode/flashmemory.pm index 0c299fcf9..4b880533c 100644 --- a/centreon-plugins/network/alcatel/common/mode/flashmemory.pm +++ b/centreon-plugins/network/alcatel/common/mode/flashmemory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/hardware.pm b/centreon-plugins/network/alcatel/common/mode/hardware.pm index 182c0794e..bc39c6f88 100644 --- a/centreon-plugins/network/alcatel/common/mode/hardware.pm +++ b/centreon-plugins/network/alcatel/common/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/common/mode/memory.pm b/centreon-plugins/network/alcatel/common/mode/memory.pm index b7e6e76be..9a931b45a 100644 --- a/centreon-plugins/network/alcatel/common/mode/memory.pm +++ b/centreon-plugins/network/alcatel/common/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/isam/snmp/mode/vlantraffic.pm b/centreon-plugins/network/alcatel/isam/snmp/mode/vlantraffic.pm index 5eed96cf3..ef326e8e1 100644 --- a/centreon-plugins/network/alcatel/isam/snmp/mode/vlantraffic.pm +++ b/centreon-plugins/network/alcatel/isam/snmp/mode/vlantraffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/isam/snmp/plugin.pm b/centreon-plugins/network/alcatel/isam/snmp/plugin.pm index a61fb8ce8..0b6dc033c 100644 --- a/centreon-plugins/network/alcatel/isam/snmp/plugin.pm +++ b/centreon-plugins/network/alcatel/isam/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm b/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm index 356ead358..c8189f4ac 100644 --- a/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm +++ b/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/oxe/snmp/mode/domainusage.pm b/centreon-plugins/network/alcatel/oxe/snmp/mode/domainusage.pm index 72bc90ec7..16c57e5bc 100644 --- a/centreon-plugins/network/alcatel/oxe/snmp/mode/domainusage.pm +++ b/centreon-plugins/network/alcatel/oxe/snmp/mode/domainusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxrole.pm b/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxrole.pm index e44caafdd..feb0e3e6c 100644 --- a/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxrole.pm +++ b/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxrole.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxstate.pm b/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxstate.pm index 42ed5eca0..c7007d96b 100644 --- a/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxstate.pm +++ b/centreon-plugins/network/alcatel/oxe/snmp/mode/pbxstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/alcatel/oxe/snmp/plugin.pm b/centreon-plugins/network/alcatel/oxe/snmp/plugin.pm index 9628ab4b8..cad635675 100644 --- a/centreon-plugins/network/alcatel/oxe/snmp/plugin.pm +++ b/centreon-plugins/network/alcatel/oxe/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/arkoon/plugin.pm b/centreon-plugins/network/arkoon/plugin.pm index 2cda06cba..88ca4f939 100644 --- a/centreon-plugins/network/arkoon/plugin.pm +++ b/centreon-plugins/network/arkoon/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/aruba/standard/snmp/plugin.pm b/centreon-plugins/network/aruba/standard/snmp/plugin.pm index eb7d82c95..02972f050 100644 --- a/centreon-plugins/network/aruba/standard/snmp/plugin.pm +++ b/centreon-plugins/network/aruba/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/atrica/snmp/mode/connections.pm b/centreon-plugins/network/atrica/snmp/mode/connections.pm index 05283c40a..667d3e69a 100644 --- a/centreon-plugins/network/atrica/snmp/mode/connections.pm +++ b/centreon-plugins/network/atrica/snmp/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/atrica/snmp/mode/listconnections.pm b/centreon-plugins/network/atrica/snmp/mode/listconnections.pm index 3798d233d..0576c6ba6 100644 --- a/centreon-plugins/network/atrica/snmp/mode/listconnections.pm +++ b/centreon-plugins/network/atrica/snmp/mode/listconnections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/atrica/snmp/plugin.pm b/centreon-plugins/network/atrica/snmp/plugin.pm index ffdf9064f..45104bdd0 100644 --- a/centreon-plugins/network/atrica/snmp/plugin.pm +++ b/centreon-plugins/network/atrica/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm b/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm index e96fdb85c..8c25063c0 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm b/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm index 77a38ddf0..fb2e1b0cc 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm b/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm index 857d3fa6a..46eb4bf47 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm b/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm index cb078d198..27926b54f 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm b/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm index 940ab82e6..cc257cfd4 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm b/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm index 5fe803d9d..89564cb74 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/disk.pm b/centreon-plugins/network/bluecoat/snmp/mode/disk.pm index 061e815e1..8c7fc67eb 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/disk.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm index 9f9123069..9ec141824 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/memory.pm b/centreon-plugins/network/bluecoat/snmp/mode/memory.pm index 02b419830..d4724b2b1 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/memory.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm b/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm index 2c98aab3c..266b7b03b 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/bluecoat/snmp/plugin.pm b/centreon-plugins/network/bluecoat/snmp/plugin.pm index d7b2e119f..c397621b2 100644 --- a/centreon-plugins/network/bluecoat/snmp/plugin.pm +++ b/centreon-plugins/network/bluecoat/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/brocade/mode/cpu.pm b/centreon-plugins/network/brocade/mode/cpu.pm index f9ab98863..fa013426d 100644 --- a/centreon-plugins/network/brocade/mode/cpu.pm +++ b/centreon-plugins/network/brocade/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/brocade/mode/hardware.pm b/centreon-plugins/network/brocade/mode/hardware.pm index 1a87364fe..f80fe20ea 100644 --- a/centreon-plugins/network/brocade/mode/hardware.pm +++ b/centreon-plugins/network/brocade/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/brocade/mode/memory.pm b/centreon-plugins/network/brocade/mode/memory.pm index 2d2bff50b..e420d9fa0 100644 --- a/centreon-plugins/network/brocade/mode/memory.pm +++ b/centreon-plugins/network/brocade/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/brocade/plugin.pm b/centreon-plugins/network/brocade/plugin.pm index 0a1743275..5e345875f 100644 --- a/centreon-plugins/network/brocade/plugin.pm +++ b/centreon-plugins/network/brocade/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/components/fan.pm b/centreon-plugins/network/checkpoint/mode/components/fan.pm index 97d3400f0..3ff663400 100644 --- a/centreon-plugins/network/checkpoint/mode/components/fan.pm +++ b/centreon-plugins/network/checkpoint/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/components/psu.pm b/centreon-plugins/network/checkpoint/mode/components/psu.pm index e987a2623..480c83303 100644 --- a/centreon-plugins/network/checkpoint/mode/components/psu.pm +++ b/centreon-plugins/network/checkpoint/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/components/temperature.pm b/centreon-plugins/network/checkpoint/mode/components/temperature.pm index 9dac9032a..2e4431951 100644 --- a/centreon-plugins/network/checkpoint/mode/components/temperature.pm +++ b/centreon-plugins/network/checkpoint/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/components/voltage.pm b/centreon-plugins/network/checkpoint/mode/components/voltage.pm index b4d49bd5a..da1d9158d 100644 --- a/centreon-plugins/network/checkpoint/mode/components/voltage.pm +++ b/centreon-plugins/network/checkpoint/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/connections.pm b/centreon-plugins/network/checkpoint/mode/connections.pm index ee1b19ed6..dd283bb73 100644 --- a/centreon-plugins/network/checkpoint/mode/connections.pm +++ b/centreon-plugins/network/checkpoint/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/cpu.pm b/centreon-plugins/network/checkpoint/mode/cpu.pm index a2b47c221..8416e15a3 100644 --- a/centreon-plugins/network/checkpoint/mode/cpu.pm +++ b/centreon-plugins/network/checkpoint/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/hardware.pm b/centreon-plugins/network/checkpoint/mode/hardware.pm index 4225386b6..5bd361789 100644 --- a/centreon-plugins/network/checkpoint/mode/hardware.pm +++ b/centreon-plugins/network/checkpoint/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/hastate.pm b/centreon-plugins/network/checkpoint/mode/hastate.pm index 11bda359d..b5bdec42a 100644 --- a/centreon-plugins/network/checkpoint/mode/hastate.pm +++ b/centreon-plugins/network/checkpoint/mode/hastate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/mode/memory.pm b/centreon-plugins/network/checkpoint/mode/memory.pm index 4d400434c..817e34b4b 100644 --- a/centreon-plugins/network/checkpoint/mode/memory.pm +++ b/centreon-plugins/network/checkpoint/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/checkpoint/plugin.pm b/centreon-plugins/network/checkpoint/plugin.pm index 267b065fd..5360d0014 100644 --- a/centreon-plugins/network/checkpoint/plugin.pm +++ b/centreon-plugins/network/checkpoint/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/WaaS/mode/sessions.pm b/centreon-plugins/network/cisco/WaaS/mode/sessions.pm index 800fe6459..6e0c04a14 100644 --- a/centreon-plugins/network/cisco/WaaS/mode/sessions.pm +++ b/centreon-plugins/network/cisco/WaaS/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/WaaS/plugin.pm b/centreon-plugins/network/cisco/WaaS/plugin.pm index 1f0c2c879..6181be111 100644 --- a/centreon-plugins/network/cisco/WaaS/plugin.pm +++ b/centreon-plugins/network/cisco/WaaS/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/asa/mode/failover.pm b/centreon-plugins/network/cisco/asa/mode/failover.pm index e76d5fb4e..b9dd36012 100644 --- a/centreon-plugins/network/cisco/asa/mode/failover.pm +++ b/centreon-plugins/network/cisco/asa/mode/failover.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/asa/mode/sessions.pm b/centreon-plugins/network/cisco/asa/mode/sessions.pm index 0ecf7a794..a82602f0d 100644 --- a/centreon-plugins/network/cisco/asa/mode/sessions.pm +++ b/centreon-plugins/network/cisco/asa/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/asa/plugin.pm b/centreon-plugins/network/cisco/asa/plugin.pm index 2aa3c2e11..d87fbb019 100644 --- a/centreon-plugins/network/cisco/asa/plugin.pm +++ b/centreon-plugins/network/cisco/asa/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm index 708b6e310..a8be0e5fb 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm index 7e4343418..8e7398dc1 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm index d57bb01e6..89640cf3d 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/raid.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm index f58ccc5ad..1164e2dc1 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm index d0c80ae3b..78c3887e8 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm index d1f10ff00..0204ea5bb 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm index 4dd189203..b838fb1d7 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/ironport/snmp/plugin.pm b/centreon-plugins/network/cisco/ironport/snmp/plugin.pm index 7cfce585a..3b5e4eda2 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm b/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm index d86c42f5f..c2258ee1a 100644 --- a/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/standard/snmp/plugin.pm b/centreon-plugins/network/cisco/standard/snmp/plugin.pm index f2795c5b3..45d1a067c 100644 --- a/centreon-plugins/network/cisco/standard/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/cisco/wlc/snmp/plugin.pm b/centreon-plugins/network/cisco/wlc/snmp/plugin.pm index c76e60fc5..13a7b43c6 100644 --- a/centreon-plugins/network/cisco/wlc/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/wlc/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm b/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm index aa0772f98..30592ef0e 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/connections.pm b/centreon-plugins/network/citrix/netscaler/common/mode/connections.pm index 91e250130..acad80cc4 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/connections.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm b/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm index 97e0c6eb4..3921cbe88 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm index 17093d3d9..cd02c96de 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm index ea22f4531..647423f16 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm b/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm index 17a178648..7790aa8ff 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm b/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm index 2d3ab6416..5fe11ae7f 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm b/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm index ad7e7b132..d2d174fec 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm index 8ee0b7fe1..be3e857bb 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm b/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm index 4cb21ae51..e305ce568 100644 --- a/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm +++ b/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dell/6200/plugin.pm b/centreon-plugins/network/dell/6200/plugin.pm index 3e76e88a5..5dafd1f26 100644 --- a/centreon-plugins/network/dell/6200/plugin.pm +++ b/centreon-plugins/network/dell/6200/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dell/n4000/plugin.pm b/centreon-plugins/network/dell/n4000/plugin.pm index de13e704c..de182deeb 100644 --- a/centreon-plugins/network/dell/n4000/plugin.pm +++ b/centreon-plugins/network/dell/n4000/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dell/sseries/snmp/plugin.pm b/centreon-plugins/network/dell/sseries/snmp/plugin.pm index a2deb5533..5af2bd23c 100644 --- a/centreon-plugins/network/dell/sseries/snmp/plugin.pm +++ b/centreon-plugins/network/dell/sseries/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/digi/portserverts/snmp/mode/cpu.pm b/centreon-plugins/network/digi/portserverts/snmp/mode/cpu.pm index 00929cd18..346a95044 100644 --- a/centreon-plugins/network/digi/portserverts/snmp/mode/cpu.pm +++ b/centreon-plugins/network/digi/portserverts/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/digi/portserverts/snmp/mode/memory.pm b/centreon-plugins/network/digi/portserverts/snmp/mode/memory.pm index d5933ff4a..5df388c59 100644 --- a/centreon-plugins/network/digi/portserverts/snmp/mode/memory.pm +++ b/centreon-plugins/network/digi/portserverts/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/digi/portserverts/snmp/plugin.pm b/centreon-plugins/network/digi/portserverts/snmp/plugin.pm index bb2442365..c5a856304 100644 --- a/centreon-plugins/network/digi/portserverts/snmp/plugin.pm +++ b/centreon-plugins/network/digi/portserverts/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm index 6b056206c..0fc39e625 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm index 642cfb0bb..a46cc7aa4 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm index cc964bf0c..e5062d63f 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm index ff20f4981..5b0db57b7 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm b/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm index cc4836f62..d63e9acf2 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm index deb12ab4d..393dd6949 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm index fba713ac0..7ad60cc90 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm b/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm index 463c51b49..c20515337 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm b/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm index a94a2d833..2da549008 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm b/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm index dad5c3d63..9a70c79cc 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/dlink/standard/snmp/plugin.pm b/centreon-plugins/network/dlink/standard/snmp/plugin.pm index ade75917d..8b9bb85c0 100644 --- a/centreon-plugins/network/dlink/standard/snmp/plugin.pm +++ b/centreon-plugins/network/dlink/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/components/fan.pm b/centreon-plugins/network/extreme/snmp/mode/components/fan.pm index ba18742a3..295e21c11 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/components/poe.pm b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm index e6c78ea90..e5e616290 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/poe.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/poe.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/components/psu.pm b/centreon-plugins/network/extreme/snmp/mode/components/psu.pm index 6ec457893..cdd40ae1f 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/components/slot.pm b/centreon-plugins/network/extreme/snmp/mode/components/slot.pm index 138d7a879..77fcd4a3d 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/slot.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/slot.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/components/temperature.pm b/centreon-plugins/network/extreme/snmp/mode/components/temperature.pm index 4afff714a..9641a9402 100644 --- a/centreon-plugins/network/extreme/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/extreme/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/cpu.pm b/centreon-plugins/network/extreme/snmp/mode/cpu.pm index cd045a7c3..eff61fe4e 100644 --- a/centreon-plugins/network/extreme/snmp/mode/cpu.pm +++ b/centreon-plugins/network/extreme/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/hardware.pm b/centreon-plugins/network/extreme/snmp/mode/hardware.pm index 2dc321f44..1068f59fc 100644 --- a/centreon-plugins/network/extreme/snmp/mode/hardware.pm +++ b/centreon-plugins/network/extreme/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/memory.pm b/centreon-plugins/network/extreme/snmp/mode/memory.pm index 5444bb1ef..66cbd6749 100644 --- a/centreon-plugins/network/extreme/snmp/mode/memory.pm +++ b/centreon-plugins/network/extreme/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/mode/stack.pm b/centreon-plugins/network/extreme/snmp/mode/stack.pm index 706342e7d..b9a211688 100644 --- a/centreon-plugins/network/extreme/snmp/mode/stack.pm +++ b/centreon-plugins/network/extreme/snmp/mode/stack.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/extreme/snmp/plugin.pm b/centreon-plugins/network/extreme/snmp/plugin.pm index 4c2441ef5..498dfd1c6 100644 --- a/centreon-plugins/network/extreme/snmp/plugin.pm +++ b/centreon-plugins/network/extreme/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/components/fan.pm b/centreon-plugins/network/f5/bigip/mode/components/fan.pm index 912d701e8..f9f702686 100644 --- a/centreon-plugins/network/f5/bigip/mode/components/fan.pm +++ b/centreon-plugins/network/f5/bigip/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/components/psu.pm b/centreon-plugins/network/f5/bigip/mode/components/psu.pm index 705fa73bf..bc369e223 100644 --- a/centreon-plugins/network/f5/bigip/mode/components/psu.pm +++ b/centreon-plugins/network/f5/bigip/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/components/temperature.pm b/centreon-plugins/network/f5/bigip/mode/components/temperature.pm index c2b5fe378..baef300c9 100644 --- a/centreon-plugins/network/f5/bigip/mode/components/temperature.pm +++ b/centreon-plugins/network/f5/bigip/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/connections.pm b/centreon-plugins/network/f5/bigip/mode/connections.pm index 863e30138..69ff84b4d 100644 --- a/centreon-plugins/network/f5/bigip/mode/connections.pm +++ b/centreon-plugins/network/f5/bigip/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/failover.pm b/centreon-plugins/network/f5/bigip/mode/failover.pm index 355407b7e..73d79533e 100644 --- a/centreon-plugins/network/f5/bigip/mode/failover.pm +++ b/centreon-plugins/network/f5/bigip/mode/failover.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/hardware.pm b/centreon-plugins/network/f5/bigip/mode/hardware.pm index 624e1c469..d8b4b3aa5 100644 --- a/centreon-plugins/network/f5/bigip/mode/hardware.pm +++ b/centreon-plugins/network/f5/bigip/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/listnodes.pm b/centreon-plugins/network/f5/bigip/mode/listnodes.pm index a0a2f93de..e8644fb17 100644 --- a/centreon-plugins/network/f5/bigip/mode/listnodes.pm +++ b/centreon-plugins/network/f5/bigip/mode/listnodes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/listpools.pm b/centreon-plugins/network/f5/bigip/mode/listpools.pm index b7e7ce9c5..f21064bee 100644 --- a/centreon-plugins/network/f5/bigip/mode/listpools.pm +++ b/centreon-plugins/network/f5/bigip/mode/listpools.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm b/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm index 7f7ee7cbc..d6b69c5ba 100644 --- a/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm +++ b/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/nodestatus.pm b/centreon-plugins/network/f5/bigip/mode/nodestatus.pm index 05cd16fb9..bacbd7330 100644 --- a/centreon-plugins/network/f5/bigip/mode/nodestatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/nodestatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/poolstatus.pm b/centreon-plugins/network/f5/bigip/mode/poolstatus.pm index f184244d2..389c57829 100644 --- a/centreon-plugins/network/f5/bigip/mode/poolstatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/poolstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm index 3075a70bc..416f40ed9 100644 --- a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/f5/bigip/plugin.pm b/centreon-plugins/network/f5/bigip/plugin.pm index 05d5e0437..fd4a370e5 100644 --- a/centreon-plugins/network/f5/bigip/plugin.pm +++ b/centreon-plugins/network/f5/bigip/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/fortinet/fortigate/plugin.pm b/centreon-plugins/network/fortinet/fortigate/plugin.pm index ec7970c82..7139cf0a6 100644 --- a/centreon-plugins/network/fortinet/fortigate/plugin.pm +++ b/centreon-plugins/network/fortinet/fortigate/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/fritzbox/mode/libgetdata.pm b/centreon-plugins/network/fritzbox/mode/libgetdata.pm index cf0c4700c..07e460967 100644 --- a/centreon-plugins/network/fritzbox/mode/libgetdata.pm +++ b/centreon-plugins/network/fritzbox/mode/libgetdata.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/fritzbox/mode/traffic.pm b/centreon-plugins/network/fritzbox/mode/traffic.pm index 6a50214d6..3bd755c7e 100644 --- a/centreon-plugins/network/fritzbox/mode/traffic.pm +++ b/centreon-plugins/network/fritzbox/mode/traffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/fritzbox/mode/upstatus.pm b/centreon-plugins/network/fritzbox/mode/upstatus.pm index b0ab72a7b..883d7bfd7 100644 --- a/centreon-plugins/network/fritzbox/mode/upstatus.pm +++ b/centreon-plugins/network/fritzbox/mode/upstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/fritzbox/plugin.pm b/centreon-plugins/network/fritzbox/plugin.pm index 6ae1a252f..eaf2762de 100644 --- a/centreon-plugins/network/fritzbox/plugin.pm +++ b/centreon-plugins/network/fritzbox/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/components/default.pm b/centreon-plugins/network/h3c/snmp/mode/components/default.pm index 712f28b5f..b35da93a1 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/default.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/default.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/components/fan.pm b/centreon-plugins/network/h3c/snmp/mode/components/fan.pm index 1d6d79511..fceaeae16 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/components/psu.pm b/centreon-plugins/network/h3c/snmp/mode/components/psu.pm index 39c553251..a3f5be68b 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm index b8953d033..099ccbe85 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/cpu.pm b/centreon-plugins/network/h3c/snmp/mode/cpu.pm index 8cb795723..ff5a2ee23 100644 --- a/centreon-plugins/network/h3c/snmp/mode/cpu.pm +++ b/centreon-plugins/network/h3c/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/hardware.pm b/centreon-plugins/network/h3c/snmp/mode/hardware.pm index 8bcf36691..8e1903c03 100644 --- a/centreon-plugins/network/h3c/snmp/mode/hardware.pm +++ b/centreon-plugins/network/h3c/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/mode/memory.pm b/centreon-plugins/network/h3c/snmp/mode/memory.pm index 36be86cc2..7279b6596 100644 --- a/centreon-plugins/network/h3c/snmp/mode/memory.pm +++ b/centreon-plugins/network/h3c/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/h3c/snmp/plugin.pm b/centreon-plugins/network/h3c/snmp/plugin.pm index 9c9fcd65b..b50f55d4c 100644 --- a/centreon-plugins/network/h3c/snmp/plugin.pm +++ b/centreon-plugins/network/h3c/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm index be913512e..896a56c6b 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm index 92ea47020..9508e90e1 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/led.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm index 66abdf17f..2502fa7e5 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm index 158bbe7ad..5587ec105 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm index 495f01699..09fdc0e49 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm index f3310e394..7203b21e0 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm index 43cd65945..a34f50d08 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm index 580285cc1..1523e1192 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm b/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm index 6a35b8220..73dc2148a 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/procurve/mode/components/sensor.pm b/centreon-plugins/network/hp/procurve/mode/components/sensor.pm index 8d4ba0fe1..018782694 100644 --- a/centreon-plugins/network/hp/procurve/mode/components/sensor.pm +++ b/centreon-plugins/network/hp/procurve/mode/components/sensor.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/procurve/mode/cpu.pm b/centreon-plugins/network/hp/procurve/mode/cpu.pm index b6abb066e..9edc6ac86 100644 --- a/centreon-plugins/network/hp/procurve/mode/cpu.pm +++ b/centreon-plugins/network/hp/procurve/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/procurve/mode/environment.pm b/centreon-plugins/network/hp/procurve/mode/environment.pm index 807578994..dc2b0d9a9 100644 --- a/centreon-plugins/network/hp/procurve/mode/environment.pm +++ b/centreon-plugins/network/hp/procurve/mode/environment.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/procurve/mode/memory.pm b/centreon-plugins/network/hp/procurve/mode/memory.pm index 1f6abb32a..9f1866cf0 100644 --- a/centreon-plugins/network/hp/procurve/mode/memory.pm +++ b/centreon-plugins/network/hp/procurve/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/procurve/plugin.pm b/centreon-plugins/network/hp/procurve/plugin.pm index c8f4132eb..6fadf6ce6 100644 --- a/centreon-plugins/network/hp/procurve/plugin.pm +++ b/centreon-plugins/network/hp/procurve/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm index 4a20275a9..61be91892 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/domain.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm index d78508fc1..326d63518 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/enclosure.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm index c2646072e..2514ee9a2 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/enet.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm index 990d13996..38c2881dd 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/fc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm index 89654a38e..d6117dcdd 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/module.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm index 845184d05..2c10b824a 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/moduleport.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm index 04912d30a..931c78cfc 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/physicalserver.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm index 47a886e7b..601107ea7 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/port.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm index 8322f2af5..9c02b1889 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/profile.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm index a08ffb466..abc987d62 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/components/resources.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm index 6a45a36b4..800c45409 100644 --- a/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hp/vc/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/hp/vc/snmp/plugin.pm b/centreon-plugins/network/hp/vc/snmp/plugin.pm index cc0253480..30492d560 100644 --- a/centreon-plugins/network/hp/vc/snmp/plugin.pm +++ b/centreon-plugins/network/hp/vc/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/ive/mode/cpu.pm b/centreon-plugins/network/juniper/common/ive/mode/cpu.pm index fa7f476b0..1bb94eec5 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/cpu.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/ive/mode/disk.pm b/centreon-plugins/network/juniper/common/ive/mode/disk.pm index 9a09f4b07..d0d06d28e 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/disk.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/ive/mode/logfile.pm b/centreon-plugins/network/juniper/common/ive/mode/logfile.pm index 88f3d825b..602adad7f 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/logfile.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/logfile.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/ive/mode/users.pm b/centreon-plugins/network/juniper/common/ive/mode/users.pm index 22c066f5a..f6ca96244 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/users.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/users.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm b/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm index c45c8f059..306c94f0c 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/components/fru.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm b/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm index f6be53c42..1e388ea34 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/components/operating.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm b/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm index 942e719f8..e7e575090 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm b/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm index 934fe4ab2..2d5b621fd 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm b/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm index db1a51755..1d3c2dd89 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm b/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm index 923d44bc0..e292e6d72 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/hardware.pm b/centreon-plugins/network/juniper/common/junos/mode/hardware.pm index 3c3eadde5..1dec0789b 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/hardware.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm b/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm index 50746d617..df096bdcc 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm b/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm index f4ccf8bb9..de2274407 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm index 7da0b128f..c755bb528 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm index a589fab14..8ebd656d8 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/module.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm index 4b88ae158..434cfd9a6 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm b/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm index 047667e4f..632345478 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm b/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm index 66b9cf974..06c5f3053 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm b/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm index c4a808cb7..abb37945b 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/memory.pm b/centreon-plugins/network/juniper/common/screenos/mode/memory.pm index 17c2decb0..2413cfc3a 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/memory.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm b/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm index 05531164e..e9c98152c 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/ex/plugin.pm b/centreon-plugins/network/juniper/ex/plugin.pm index 83887f372..717b68cea 100644 --- a/centreon-plugins/network/juniper/ex/plugin.pm +++ b/centreon-plugins/network/juniper/ex/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm b/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm index 13122b9ec..d6db069a2 100644 --- a/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm +++ b/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm b/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm index a70478c51..5c5e93f6a 100644 --- a/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm +++ b/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/ggsn/plugin.pm b/centreon-plugins/network/juniper/ggsn/plugin.pm index cd62dd8b9..fdca6fb75 100644 --- a/centreon-plugins/network/juniper/ggsn/plugin.pm +++ b/centreon-plugins/network/juniper/ggsn/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm b/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm index d54442ed2..b4f017fb0 100644 --- a/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm +++ b/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/mag/plugin.pm b/centreon-plugins/network/juniper/mag/plugin.pm index afefe878e..a1b5e0083 100644 --- a/centreon-plugins/network/juniper/mag/plugin.pm +++ b/centreon-plugins/network/juniper/mag/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/mseries/plugin.pm b/centreon-plugins/network/juniper/mseries/plugin.pm index a45395f36..28411f177 100644 --- a/centreon-plugins/network/juniper/mseries/plugin.pm +++ b/centreon-plugins/network/juniper/mseries/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/sa/plugin.pm b/centreon-plugins/network/juniper/sa/plugin.pm index 5cbd1cb6b..0d51783ae 100644 --- a/centreon-plugins/network/juniper/sa/plugin.pm +++ b/centreon-plugins/network/juniper/sa/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/srx/plugin.pm b/centreon-plugins/network/juniper/srx/plugin.pm index 4b6eb3b09..81c3970c5 100644 --- a/centreon-plugins/network/juniper/srx/plugin.pm +++ b/centreon-plugins/network/juniper/srx/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/juniper/ssg/plugin.pm b/centreon-plugins/network/juniper/ssg/plugin.pm index bd4f9f759..e25d6b7cf 100644 --- a/centreon-plugins/network/juniper/ssg/plugin.pm +++ b/centreon-plugins/network/juniper/ssg/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/netasq/snmp/mode/hastatus.pm b/centreon-plugins/network/netasq/snmp/mode/hastatus.pm index 6e6c8d109..41eb97e6b 100644 --- a/centreon-plugins/network/netasq/snmp/mode/hastatus.pm +++ b/centreon-plugins/network/netasq/snmp/mode/hastatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm b/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm index 244b034df..99d98dd33 100644 --- a/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm +++ b/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index e79cbd440..773b0f4e7 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm b/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm index 5826b3133..eeb3191a4 100644 --- a/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm +++ b/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/oneaccess/snmp/mode/memory.pm b/centreon-plugins/network/oneaccess/snmp/mode/memory.pm index bd090a02d..52acb6369 100644 --- a/centreon-plugins/network/oneaccess/snmp/mode/memory.pm +++ b/centreon-plugins/network/oneaccess/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/oneaccess/snmp/plugin.pm b/centreon-plugins/network/oneaccess/snmp/plugin.pm index 23d0a2ee5..76a4ad438 100644 --- a/centreon-plugins/network/oneaccess/snmp/plugin.pm +++ b/centreon-plugins/network/oneaccess/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm index be8dfaa89..005217b1e 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm index 5a5976b67..670b3817d 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/paloalto/snmp/mode/sessions.pm b/centreon-plugins/network/paloalto/snmp/mode/sessions.pm index 7d88179db..db7c4e23e 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/sessions.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/sessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/paloalto/snmp/plugin.pm b/centreon-plugins/network/paloalto/snmp/plugin.pm index 9b0365d2d..86a8ba02a 100644 --- a/centreon-plugins/network/paloalto/snmp/plugin.pm +++ b/centreon-plugins/network/paloalto/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/radware/alteon/5224/plugin.pm b/centreon-plugins/network/radware/alteon/5224/plugin.pm index 0b7efe22b..7b49ccf85 100644 --- a/centreon-plugins/network/radware/alteon/5224/plugin.pm +++ b/centreon-plugins/network/radware/alteon/5224/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/radware/alteon/common/mode/cpu.pm b/centreon-plugins/network/radware/alteon/common/mode/cpu.pm index ca10e8ab4..8e7a565cb 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/cpu.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/radware/alteon/common/mode/hardware.pm b/centreon-plugins/network/radware/alteon/common/mode/hardware.pm index 924264464..3312cb132 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/hardware.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/radware/alteon/common/mode/memory.pm b/centreon-plugins/network/radware/alteon/common/mode/memory.pm index df6da5ac4..08cf5f135 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/memory.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/components/disk.pm b/centreon-plugins/network/redback/snmp/mode/components/disk.pm index 209063263..6ae0e208f 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/disk.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/components/fan.pm b/centreon-plugins/network/redback/snmp/mode/components/fan.pm index dcfedab8c..602a328ce 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/fan.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/components/psu.pm b/centreon-plugins/network/redback/snmp/mode/components/psu.pm index 6bea8f2d6..da38d42fa 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/psu.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/components/temperature.pm b/centreon-plugins/network/redback/snmp/mode/components/temperature.pm index 4d712a1b7..9b5481ef2 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/temperature.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/components/voltage.pm b/centreon-plugins/network/redback/snmp/mode/components/voltage.pm index 6ae69e7de..5befd5879 100644 --- a/centreon-plugins/network/redback/snmp/mode/components/voltage.pm +++ b/centreon-plugins/network/redback/snmp/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/cpu.pm b/centreon-plugins/network/redback/snmp/mode/cpu.pm index bd4c834b6..c80a19015 100644 --- a/centreon-plugins/network/redback/snmp/mode/cpu.pm +++ b/centreon-plugins/network/redback/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/disk.pm b/centreon-plugins/network/redback/snmp/mode/disk.pm index f1432ad4e..62a4eda7c 100644 --- a/centreon-plugins/network/redback/snmp/mode/disk.pm +++ b/centreon-plugins/network/redback/snmp/mode/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/hardware.pm b/centreon-plugins/network/redback/snmp/mode/hardware.pm index 586330438..4421f31ce 100644 --- a/centreon-plugins/network/redback/snmp/mode/hardware.pm +++ b/centreon-plugins/network/redback/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/mode/memory.pm b/centreon-plugins/network/redback/snmp/mode/memory.pm index ed9dd24b3..23aa61d3c 100644 --- a/centreon-plugins/network/redback/snmp/mode/memory.pm +++ b/centreon-plugins/network/redback/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/redback/snmp/plugin.pm b/centreon-plugins/network/redback/snmp/plugin.pm index bde6e4636..897850d1a 100644 --- a/centreon-plugins/network/redback/snmp/plugin.pm +++ b/centreon-plugins/network/redback/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm index 531d0775e..32ccea1b8 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm index 88bdc933c..5277c5360 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm index 2c4783202..4486dd2e0 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm index e4373a28e..17b669090 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm index df79fd1aa..8a918c074 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm index 495191382..042fe88fc 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm index 134b5dc71..6bf5e80c0 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm index eba96d801..e4ee22d8d 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm index 344bbc012..d1c457449 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm b/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm index fb78bb894..c128c63cc 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/ruggedcom/mode/errors.pm b/centreon-plugins/network/ruggedcom/mode/errors.pm index 1e06364f2..fb7ab3b56 100644 --- a/centreon-plugins/network/ruggedcom/mode/errors.pm +++ b/centreon-plugins/network/ruggedcom/mode/errors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/ruggedcom/mode/hardware.pm b/centreon-plugins/network/ruggedcom/mode/hardware.pm index 12059aa47..ce920cd10 100644 --- a/centreon-plugins/network/ruggedcom/mode/hardware.pm +++ b/centreon-plugins/network/ruggedcom/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/ruggedcom/mode/memory.pm b/centreon-plugins/network/ruggedcom/mode/memory.pm index e413b8355..4c9498fc5 100644 --- a/centreon-plugins/network/ruggedcom/mode/memory.pm +++ b/centreon-plugins/network/ruggedcom/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/ruggedcom/mode/temperature.pm b/centreon-plugins/network/ruggedcom/mode/temperature.pm index 912cd6d9d..d526bfc62 100644 --- a/centreon-plugins/network/ruggedcom/mode/temperature.pm +++ b/centreon-plugins/network/ruggedcom/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/ruggedcom/plugin.pm b/centreon-plugins/network/ruggedcom/plugin.pm index d387ef2d4..9ec45e9d8 100644 --- a/centreon-plugins/network/ruggedcom/plugin.pm +++ b/centreon-plugins/network/ruggedcom/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/securactive/mode/bca.pm b/centreon-plugins/network/securactive/mode/bca.pm index 4070a46d9..895c0e386 100644 --- a/centreon-plugins/network/securactive/mode/bca.pm +++ b/centreon-plugins/network/securactive/mode/bca.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/securactive/mode/bcn.pm b/centreon-plugins/network/securactive/mode/bcn.pm index 185748847..2f48b46cb 100644 --- a/centreon-plugins/network/securactive/mode/bcn.pm +++ b/centreon-plugins/network/securactive/mode/bcn.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/securactive/mode/listbca.pm b/centreon-plugins/network/securactive/mode/listbca.pm index bb52cce90..4d2bc7d0b 100644 --- a/centreon-plugins/network/securactive/mode/listbca.pm +++ b/centreon-plugins/network/securactive/mode/listbca.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/securactive/mode/listbcn.pm b/centreon-plugins/network/securactive/mode/listbcn.pm index 940d31ee4..61a374929 100644 --- a/centreon-plugins/network/securactive/mode/listbcn.pm +++ b/centreon-plugins/network/securactive/mode/listbcn.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/securactive/plugin.pm b/centreon-plugins/network/securactive/plugin.pm index 93ed999c5..cb74dce6a 100644 --- a/centreon-plugins/network/securactive/plugin.pm +++ b/centreon-plugins/network/securactive/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm b/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm index cf72d05d5..d02028aa9 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm b/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm index 848d14966..4c59829e2 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/connections.pm b/centreon-plugins/network/stonesoft/snmp/mode/connections.pm index 938fc7bc4..38eb0df01 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/connections.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm b/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm index 801007c8c..52d6b50cd 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm b/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm index 7d5672bd3..618b169f4 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/memory.pm b/centreon-plugins/network/stonesoft/snmp/mode/memory.pm index 03556e12d..d4ed35afc 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/memory.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm b/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm index 5373f63ef..b6fa26e9c 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/mode/storage.pm b/centreon-plugins/network/stonesoft/snmp/mode/storage.pm index be5d120b0..0c25bec82 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/storage.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/network/stonesoft/snmp/plugin.pm b/centreon-plugins/network/stonesoft/snmp/plugin.pm index 7a1458a7f..ffc2821c0 100644 --- a/centreon-plugins/network/stonesoft/snmp/plugin.pm +++ b/centreon-plugins/network/stonesoft/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/local/mode/errpt.pm b/centreon-plugins/os/aix/local/mode/errpt.pm index 12b4e7be6..90bec32e8 100644 --- a/centreon-plugins/os/aix/local/mode/errpt.pm +++ b/centreon-plugins/os/aix/local/mode/errpt.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/local/mode/liststorages.pm b/centreon-plugins/os/aix/local/mode/liststorages.pm index b277753c1..111e2ccde 100644 --- a/centreon-plugins/os/aix/local/mode/liststorages.pm +++ b/centreon-plugins/os/aix/local/mode/liststorages.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/local/mode/lvsync.pm b/centreon-plugins/os/aix/local/mode/lvsync.pm index 38e258e7a..73e10b9d4 100644 --- a/centreon-plugins/os/aix/local/mode/lvsync.pm +++ b/centreon-plugins/os/aix/local/mode/lvsync.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/local/mode/storage.pm b/centreon-plugins/os/aix/local/mode/storage.pm index d0ead0e34..5b28ee127 100644 --- a/centreon-plugins/os/aix/local/mode/storage.pm +++ b/centreon-plugins/os/aix/local/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/local/plugin.pm b/centreon-plugins/os/aix/local/plugin.pm index be2b54963..adf8ddf5a 100644 --- a/centreon-plugins/os/aix/local/plugin.pm +++ b/centreon-plugins/os/aix/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/snmp/mode/swap.pm b/centreon-plugins/os/aix/snmp/mode/swap.pm index 6282e41ea..62fafdc63 100644 --- a/centreon-plugins/os/aix/snmp/mode/swap.pm +++ b/centreon-plugins/os/aix/snmp/mode/swap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/aix/snmp/plugin.pm b/centreon-plugins/os/aix/snmp/plugin.pm index a1895b17d..c420672ab 100644 --- a/centreon-plugins/os/aix/snmp/plugin.pm +++ b/centreon-plugins/os/aix/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/freebsd/snmp/plugin.pm b/centreon-plugins/os/freebsd/snmp/plugin.pm index 1ec8e033d..1b0ac9867 100644 --- a/centreon-plugins/os/freebsd/snmp/plugin.pm +++ b/centreon-plugins/os/freebsd/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/cmdreturn.pm b/centreon-plugins/os/linux/local/mode/cmdreturn.pm index bff8517c7..b565ef10e 100644 --- a/centreon-plugins/os/linux/local/mode/cmdreturn.pm +++ b/centreon-plugins/os/linux/local/mode/cmdreturn.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/connections.pm b/centreon-plugins/os/linux/local/mode/connections.pm index afd891816..ae28a3783 100644 --- a/centreon-plugins/os/linux/local/mode/connections.pm +++ b/centreon-plugins/os/linux/local/mode/connections.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/cpu.pm b/centreon-plugins/os/linux/local/mode/cpu.pm index ff42d926e..ccfe7d615 100644 --- a/centreon-plugins/os/linux/local/mode/cpu.pm +++ b/centreon-plugins/os/linux/local/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/cpudetailed.pm b/centreon-plugins/os/linux/local/mode/cpudetailed.pm index d3c1f54c1..77c13320e 100644 --- a/centreon-plugins/os/linux/local/mode/cpudetailed.pm +++ b/centreon-plugins/os/linux/local/mode/cpudetailed.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/diskio.pm b/centreon-plugins/os/linux/local/mode/diskio.pm index ddaa61114..acdf11ce4 100644 --- a/centreon-plugins/os/linux/local/mode/diskio.pm +++ b/centreon-plugins/os/linux/local/mode/diskio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/filesdate.pm b/centreon-plugins/os/linux/local/mode/filesdate.pm index 9c8209e95..58a8a8a6b 100644 --- a/centreon-plugins/os/linux/local/mode/filesdate.pm +++ b/centreon-plugins/os/linux/local/mode/filesdate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/filessize.pm b/centreon-plugins/os/linux/local/mode/filessize.pm index 9c48d3df5..0b094874c 100644 --- a/centreon-plugins/os/linux/local/mode/filessize.pm +++ b/centreon-plugins/os/linux/local/mode/filessize.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/inodes.pm b/centreon-plugins/os/linux/local/mode/inodes.pm index ad78e8b5f..c7bfef017 100644 --- a/centreon-plugins/os/linux/local/mode/inodes.pm +++ b/centreon-plugins/os/linux/local/mode/inodes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/listinterfaces.pm b/centreon-plugins/os/linux/local/mode/listinterfaces.pm index aec606f90..170b6a181 100644 --- a/centreon-plugins/os/linux/local/mode/listinterfaces.pm +++ b/centreon-plugins/os/linux/local/mode/listinterfaces.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/listpartitions.pm b/centreon-plugins/os/linux/local/mode/listpartitions.pm index 33948997e..147a15218 100644 --- a/centreon-plugins/os/linux/local/mode/listpartitions.pm +++ b/centreon-plugins/os/linux/local/mode/listpartitions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/liststorages.pm b/centreon-plugins/os/linux/local/mode/liststorages.pm index c9ae2fe95..b129aee1e 100644 --- a/centreon-plugins/os/linux/local/mode/liststorages.pm +++ b/centreon-plugins/os/linux/local/mode/liststorages.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/loadaverage.pm b/centreon-plugins/os/linux/local/mode/loadaverage.pm index 6646f7b76..cd7fc4ac2 100644 --- a/centreon-plugins/os/linux/local/mode/loadaverage.pm +++ b/centreon-plugins/os/linux/local/mode/loadaverage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/memory.pm b/centreon-plugins/os/linux/local/mode/memory.pm index 86c8d57c0..85a4b1dc3 100644 --- a/centreon-plugins/os/linux/local/mode/memory.pm +++ b/centreon-plugins/os/linux/local/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/packeterrors.pm b/centreon-plugins/os/linux/local/mode/packeterrors.pm index ebdba48d5..b60d4826d 100644 --- a/centreon-plugins/os/linux/local/mode/packeterrors.pm +++ b/centreon-plugins/os/linux/local/mode/packeterrors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/paging.pm b/centreon-plugins/os/linux/local/mode/paging.pm index 3e44c5c5b..e98b382e4 100644 --- a/centreon-plugins/os/linux/local/mode/paging.pm +++ b/centreon-plugins/os/linux/local/mode/paging.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/process.pm b/centreon-plugins/os/linux/local/mode/process.pm index 5c734308b..20aca4680 100644 --- a/centreon-plugins/os/linux/local/mode/process.pm +++ b/centreon-plugins/os/linux/local/mode/process.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/storage.pm b/centreon-plugins/os/linux/local/mode/storage.pm index 06a73601c..8fac41838 100644 --- a/centreon-plugins/os/linux/local/mode/storage.pm +++ b/centreon-plugins/os/linux/local/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/swap.pm b/centreon-plugins/os/linux/local/mode/swap.pm index 8f1a904b0..01540f629 100644 --- a/centreon-plugins/os/linux/local/mode/swap.pm +++ b/centreon-plugins/os/linux/local/mode/swap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/traffic.pm b/centreon-plugins/os/linux/local/mode/traffic.pm index 9a3d47bfd..908b6c5df 100644 --- a/centreon-plugins/os/linux/local/mode/traffic.pm +++ b/centreon-plugins/os/linux/local/mode/traffic.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/mode/uptime.pm b/centreon-plugins/os/linux/local/mode/uptime.pm index 13103d8ee..efd7fdd15 100644 --- a/centreon-plugins/os/linux/local/mode/uptime.pm +++ b/centreon-plugins/os/linux/local/mode/uptime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/local/plugin.pm b/centreon-plugins/os/linux/local/plugin.pm index 96ae37925..e1d9b849d 100644 --- a/centreon-plugins/os/linux/local/plugin.pm +++ b/centreon-plugins/os/linux/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/linux/snmp/plugin.pm b/centreon-plugins/os/linux/snmp/plugin.pm index 14d619403..dc4e05b39 100644 --- a/centreon-plugins/os/linux/snmp/plugin.pm +++ b/centreon-plugins/os/linux/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/analyzedisks.pm b/centreon-plugins/os/solaris/local/mode/analyzedisks.pm index ff8b77c22..1e05a8b30 100644 --- a/centreon-plugins/os/solaris/local/mode/analyzedisks.pm +++ b/centreon-plugins/os/solaris/local/mode/analyzedisks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/cpu.pm b/centreon-plugins/os/solaris/local/mode/cpu.pm index 02b9faf99..2bd7d6dfe 100644 --- a/centreon-plugins/os/solaris/local/mode/cpu.pm +++ b/centreon-plugins/os/solaris/local/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/fcconnected.pm b/centreon-plugins/os/solaris/local/mode/fcconnected.pm index 8f75b0867..fc79a092f 100644 --- a/centreon-plugins/os/solaris/local/mode/fcconnected.pm +++ b/centreon-plugins/os/solaris/local/mode/fcconnected.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/fmadm.pm b/centreon-plugins/os/solaris/local/mode/fmadm.pm index 970247834..020fe90e4 100644 --- a/centreon-plugins/os/solaris/local/mode/fmadm.pm +++ b/centreon-plugins/os/solaris/local/mode/fmadm.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/hwraidctl.pm b/centreon-plugins/os/solaris/local/mode/hwraidctl.pm index 3f693ae36..5e0c3d561 100644 --- a/centreon-plugins/os/solaris/local/mode/hwraidctl.pm +++ b/centreon-plugins/os/solaris/local/mode/hwraidctl.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/hwsas2ircu.pm b/centreon-plugins/os/solaris/local/mode/hwsas2ircu.pm index c89c78495..b128c04fc 100644 --- a/centreon-plugins/os/solaris/local/mode/hwsas2ircu.pm +++ b/centreon-plugins/os/solaris/local/mode/hwsas2ircu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv120.pm b/centreon-plugins/os/solaris/local/mode/lomv120.pm index 1b66ce4b3..82648e04b 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv120.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv120.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv120components/fan.pm b/centreon-plugins/os/solaris/local/mode/lomv120components/fan.pm index 9478eba4b..564acd04d 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv120components/fan.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv120components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv120components/psu.pm b/centreon-plugins/os/solaris/local/mode/lomv120components/psu.pm index 04bfad4fb..5ee592009 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv120components/psu.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv120components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv120components/sf.pm b/centreon-plugins/os/solaris/local/mode/lomv120components/sf.pm index 9c05a5a8e..6682690a6 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv120components/sf.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv120components/sf.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv120components/voltage.pm b/centreon-plugins/os/solaris/local/mode/lomv120components/voltage.pm index ae1c8b5be..7888e340d 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv120components/voltage.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv120components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/lomv1280.pm b/centreon-plugins/os/solaris/local/mode/lomv1280.pm index c9dc5a96c..1528fc036 100644 --- a/centreon-plugins/os/solaris/local/mode/lomv1280.pm +++ b/centreon-plugins/os/solaris/local/mode/lomv1280.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/prtdiag.pm b/centreon-plugins/os/solaris/local/mode/prtdiag.pm index 6a77ea0fb..aadf9517a 100644 --- a/centreon-plugins/os/solaris/local/mode/prtdiag.pm +++ b/centreon-plugins/os/solaris/local/mode/prtdiag.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/svmdisks.pm b/centreon-plugins/os/solaris/local/mode/svmdisks.pm index 73845df10..b453110aa 100644 --- a/centreon-plugins/os/solaris/local/mode/svmdisks.pm +++ b/centreon-plugins/os/solaris/local/mode/svmdisks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/mode/vxdisks.pm b/centreon-plugins/os/solaris/local/mode/vxdisks.pm index f3af2be7b..4e8ad4de0 100644 --- a/centreon-plugins/os/solaris/local/mode/vxdisks.pm +++ b/centreon-plugins/os/solaris/local/mode/vxdisks.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/local/plugin.pm b/centreon-plugins/os/solaris/local/plugin.pm index 9908c97cc..3535e3f15 100644 --- a/centreon-plugins/os/solaris/local/plugin.pm +++ b/centreon-plugins/os/solaris/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/solaris/snmp/plugin.pm b/centreon-plugins/os/solaris/snmp/plugin.pm index b01ba6b1c..b9d4bc45b 100644 --- a/centreon-plugins/os/solaris/snmp/plugin.pm +++ b/centreon-plugins/os/solaris/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/local/mode/ntp.pm b/centreon-plugins/os/windows/local/mode/ntp.pm index 2931426f9..fcb4697da 100644 --- a/centreon-plugins/os/windows/local/mode/ntp.pm +++ b/centreon-plugins/os/windows/local/mode/ntp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/local/mode/rdpsessions.pm b/centreon-plugins/os/windows/local/mode/rdpsessions.pm index c532eb836..a8a084f48 100644 --- a/centreon-plugins/os/windows/local/mode/rdpsessions.pm +++ b/centreon-plugins/os/windows/local/mode/rdpsessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/local/plugin.pm b/centreon-plugins/os/windows/local/plugin.pm index 5744558c4..452e7b994 100644 --- a/centreon-plugins/os/windows/local/plugin.pm +++ b/centreon-plugins/os/windows/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/snmp/mode/memory.pm b/centreon-plugins/os/windows/snmp/mode/memory.pm index 9a080eebf..815e570d9 100644 --- a/centreon-plugins/os/windows/snmp/mode/memory.pm +++ b/centreon-plugins/os/windows/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/snmp/mode/service.pm b/centreon-plugins/os/windows/snmp/mode/service.pm index cef3116b0..610908371 100644 --- a/centreon-plugins/os/windows/snmp/mode/service.pm +++ b/centreon-plugins/os/windows/snmp/mode/service.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/snmp/mode/swap.pm b/centreon-plugins/os/windows/snmp/mode/swap.pm index 263ba8379..8cb773c77 100644 --- a/centreon-plugins/os/windows/snmp/mode/swap.pm +++ b/centreon-plugins/os/windows/snmp/mode/swap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/snmp/plugin.pm b/centreon-plugins/os/windows/snmp/plugin.pm index 820182370..0275918cd 100644 --- a/centreon-plugins/os/windows/snmp/plugin.pm +++ b/centreon-plugins/os/windows/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/wsman/mode/listservices.pm b/centreon-plugins/os/windows/wsman/mode/listservices.pm index 4b5a710b0..d00a298a9 100644 --- a/centreon-plugins/os/windows/wsman/mode/listservices.pm +++ b/centreon-plugins/os/windows/wsman/mode/listservices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/wsman/mode/service.pm b/centreon-plugins/os/windows/wsman/mode/service.pm index e8e40c407..ab7fb667e 100644 --- a/centreon-plugins/os/windows/wsman/mode/service.pm +++ b/centreon-plugins/os/windows/wsman/mode/service.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/os/windows/wsman/plugin.pm b/centreon-plugins/os/windows/wsman/plugin.pm index 5a2634a29..92a2324c4 100644 --- a/centreon-plugins/os/windows/wsman/plugin.pm +++ b/centreon-plugins/os/windows/wsman/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/cpu.pm b/centreon-plugins/snmp_standard/mode/cpu.pm index 668e64db8..f07047098 100644 --- a/centreon-plugins/snmp_standard/mode/cpu.pm +++ b/centreon-plugins/snmp_standard/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/cpudetailed.pm b/centreon-plugins/snmp_standard/mode/cpudetailed.pm index 17e203126..7ef1eeda7 100644 --- a/centreon-plugins/snmp_standard/mode/cpudetailed.pm +++ b/centreon-plugins/snmp_standard/mode/cpudetailed.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/diskio.pm b/centreon-plugins/snmp_standard/mode/diskio.pm index ed26dea82..b1f86a38c 100644 --- a/centreon-plugins/snmp_standard/mode/diskio.pm +++ b/centreon-plugins/snmp_standard/mode/diskio.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/diskusage.pm b/centreon-plugins/snmp_standard/mode/diskusage.pm index 46179ce59..943a9ca62 100644 --- a/centreon-plugins/snmp_standard/mode/diskusage.pm +++ b/centreon-plugins/snmp_standard/mode/diskusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/dynamiccommand.pm b/centreon-plugins/snmp_standard/mode/dynamiccommand.pm index b3b3ad550..da5297202 100644 --- a/centreon-plugins/snmp_standard/mode/dynamiccommand.pm +++ b/centreon-plugins/snmp_standard/mode/dynamiccommand.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/hardwaredevice.pm b/centreon-plugins/snmp_standard/mode/hardwaredevice.pm index 48253fc34..8b38cb61e 100644 --- a/centreon-plugins/snmp_standard/mode/hardwaredevice.pm +++ b/centreon-plugins/snmp_standard/mode/hardwaredevice.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm index 139464ffb..b330fa66f 100644 --- a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm +++ b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/inodes.pm b/centreon-plugins/snmp_standard/mode/inodes.pm index 6f61e8058..40430f3fe 100644 --- a/centreon-plugins/snmp_standard/mode/inodes.pm +++ b/centreon-plugins/snmp_standard/mode/inodes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/interfaces.pm b/centreon-plugins/snmp_standard/mode/interfaces.pm index e681dd0e5..3e15f731e 100644 --- a/centreon-plugins/snmp_standard/mode/interfaces.pm +++ b/centreon-plugins/snmp_standard/mode/interfaces.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/listdiskspath.pm b/centreon-plugins/snmp_standard/mode/listdiskspath.pm index 567768134..80182fc02 100644 --- a/centreon-plugins/snmp_standard/mode/listdiskspath.pm +++ b/centreon-plugins/snmp_standard/mode/listdiskspath.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index 5c0c9e52d..511af60c2 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/liststorages.pm b/centreon-plugins/snmp_standard/mode/liststorages.pm index 83e4ca775..62f3f5b0e 100644 --- a/centreon-plugins/snmp_standard/mode/liststorages.pm +++ b/centreon-plugins/snmp_standard/mode/liststorages.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/loadaverage.pm b/centreon-plugins/snmp_standard/mode/loadaverage.pm index dc26c4bcc..d4cc8a0ae 100644 --- a/centreon-plugins/snmp_standard/mode/loadaverage.pm +++ b/centreon-plugins/snmp_standard/mode/loadaverage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/memory.pm b/centreon-plugins/snmp_standard/mode/memory.pm index cf86277aa..ea88d86ce 100644 --- a/centreon-plugins/snmp_standard/mode/memory.pm +++ b/centreon-plugins/snmp_standard/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/ntp.pm b/centreon-plugins/snmp_standard/mode/ntp.pm index d7708a54c..441592568 100644 --- a/centreon-plugins/snmp_standard/mode/ntp.pm +++ b/centreon-plugins/snmp_standard/mode/ntp.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/numericvalue.pm b/centreon-plugins/snmp_standard/mode/numericvalue.pm index 7b9fbd736..d7f37984c 100644 --- a/centreon-plugins/snmp_standard/mode/numericvalue.pm +++ b/centreon-plugins/snmp_standard/mode/numericvalue.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/printererror.pm b/centreon-plugins/snmp_standard/mode/printererror.pm index d130d5217..7432ac6c5 100644 --- a/centreon-plugins/snmp_standard/mode/printererror.pm +++ b/centreon-plugins/snmp_standard/mode/printererror.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/processcount.pm b/centreon-plugins/snmp_standard/mode/processcount.pm index e4c8c7d42..774a7ac0b 100644 --- a/centreon-plugins/snmp_standard/mode/processcount.pm +++ b/centreon-plugins/snmp_standard/mode/processcount.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/spanningtree.pm b/centreon-plugins/snmp_standard/mode/spanningtree.pm index 9e83b5475..abb5b2652 100644 --- a/centreon-plugins/snmp_standard/mode/spanningtree.pm +++ b/centreon-plugins/snmp_standard/mode/spanningtree.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/storage.pm b/centreon-plugins/snmp_standard/mode/storage.pm index 4908fe6ba..b469b442e 100644 --- a/centreon-plugins/snmp_standard/mode/storage.pm +++ b/centreon-plugins/snmp_standard/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/stringvalue.pm b/centreon-plugins/snmp_standard/mode/stringvalue.pm index 12c278c21..52cfbae7a 100644 --- a/centreon-plugins/snmp_standard/mode/stringvalue.pm +++ b/centreon-plugins/snmp_standard/mode/stringvalue.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/swap.pm b/centreon-plugins/snmp_standard/mode/swap.pm index a490677b2..2935dc161 100644 --- a/centreon-plugins/snmp_standard/mode/swap.pm +++ b/centreon-plugins/snmp_standard/mode/swap.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/tcpcon.pm b/centreon-plugins/snmp_standard/mode/tcpcon.pm index dfe5b541d..5b38eff1b 100644 --- a/centreon-plugins/snmp_standard/mode/tcpcon.pm +++ b/centreon-plugins/snmp_standard/mode/tcpcon.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/mode/uptime.pm b/centreon-plugins/snmp_standard/mode/uptime.pm index 152486839..debe77f5b 100644 --- a/centreon-plugins/snmp_standard/mode/uptime.pm +++ b/centreon-plugins/snmp_standard/mode/uptime.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/snmp_standard/plugin.pm b/centreon-plugins/snmp_standard/plugin.pm index ea21277bf..0a9e92569 100644 --- a/centreon-plugins/snmp_standard/plugin.pm +++ b/centreon-plugins/snmp_standard/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/MD3000/cli/plugin.pm b/centreon-plugins/storage/dell/MD3000/cli/plugin.pm index f8784f728..c50f5318a 100644 --- a/centreon-plugins/storage/dell/MD3000/cli/plugin.pm +++ b/centreon-plugins/storage/dell/MD3000/cli/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm index c16545263..c9fdcaa71 100644 --- a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm +++ b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/TL2000/plugin.pm b/centreon-plugins/storage/dell/TL2000/plugin.pm index 226e3ecae..1549d1290 100644 --- a/centreon-plugins/storage/dell/TL2000/plugin.pm +++ b/centreon-plugins/storage/dell/TL2000/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm index 6c30b783a..329b5fa25 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/disk.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/disk.pm index 02c458c34..d4b7e0581 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/disk.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/fan.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/fan.pm index 58f6aae4e..7145f95fb 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/fan.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/health.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/health.pm index b1c3638b7..8eb5f372b 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/health.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/health.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/psu.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/psu.pm index 20ecc167e..538130c3a 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/psu.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/raid.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/raid.pm index c9e539052..2c7be1655 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/raid.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/raid.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/temperature.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/temperature.pm index 0712fb070..9478523c0 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm index c84f4b4d0..27206f5ae 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm index f4b2bd01d..3fe8a7ef8 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm index 5a0e44154..1d1d3f278 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm b/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm index ee4b3ee21..54764b8e1 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm index b053f3500..0803e660e 100644 --- a/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm +++ b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/lib/functions.pm b/centreon-plugins/storage/emc/DataDomain/lib/functions.pm index 136dc8a42..d42cb9c72 100644 --- a/centreon-plugins/storage/emc/DataDomain/lib/functions.pm +++ b/centreon-plugins/storage/emc/DataDomain/lib/functions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm index df53f1060..a8e07b8e1 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/battery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm index 02d8a330d..71247a6f7 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm index afa602edc..d6a711407 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm index 84a8fcd08..5b0225983 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm b/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm index 182e4517a..b1c556246 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm index 521e25d1b..44d427aa8 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm index 99261289f..a2cde981d 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm index 9a9131792..ca306b66e 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/DataDomain/plugin.pm b/centreon-plugins/storage/emc/DataDomain/plugin.pm index 91a9a413c..0c185ecaa 100644 --- a/centreon-plugins/storage/emc/DataDomain/plugin.pm +++ b/centreon-plugins/storage/emc/DataDomain/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/celerra/local/mode/components/controlstation.pm b/centreon-plugins/storage/emc/celerra/local/mode/components/controlstation.pm index f33c82e24..8cac90baf 100644 --- a/centreon-plugins/storage/emc/celerra/local/mode/components/controlstation.pm +++ b/centreon-plugins/storage/emc/celerra/local/mode/components/controlstation.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/celerra/local/mode/components/datamover.pm b/centreon-plugins/storage/emc/celerra/local/mode/components/datamover.pm index 687436693..29bc1f912 100644 --- a/centreon-plugins/storage/emc/celerra/local/mode/components/datamover.pm +++ b/centreon-plugins/storage/emc/celerra/local/mode/components/datamover.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm b/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm index 0c016dd02..478ba2836 100644 --- a/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm +++ b/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/celerra/local/plugin.pm b/centreon-plugins/storage/emc/celerra/local/plugin.pm index 3a31fd6a2..2cf5bbe73 100644 --- a/centreon-plugins/storage/emc/celerra/local/plugin.pm +++ b/centreon-plugins/storage/emc/celerra/local/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/clariion/plugin.pm b/centreon-plugins/storage/emc/clariion/plugin.pm index e50a2ae01..061146d5d 100644 --- a/centreon-plugins/storage/emc/clariion/plugin.pm +++ b/centreon-plugins/storage/emc/clariion/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/recoverypoint/ssh/mode/monitoredparameters.pm b/centreon-plugins/storage/emc/recoverypoint/ssh/mode/monitoredparameters.pm index db9060f3b..263391f17 100644 --- a/centreon-plugins/storage/emc/recoverypoint/ssh/mode/monitoredparameters.pm +++ b/centreon-plugins/storage/emc/recoverypoint/ssh/mode/monitoredparameters.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/recoverypoint/ssh/mode/systemstatus.pm b/centreon-plugins/storage/emc/recoverypoint/ssh/mode/systemstatus.pm index 8ef653b13..39a3f3e95 100644 --- a/centreon-plugins/storage/emc/recoverypoint/ssh/mode/systemstatus.pm +++ b/centreon-plugins/storage/emc/recoverypoint/ssh/mode/systemstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm b/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm index f3f436ff0..8ebeb8501 100644 --- a/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm +++ b/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/custom/vplexapi.pm b/centreon-plugins/storage/emc/vplex/restapi/custom/vplexapi.pm index 3a38b4653..d3499b8f8 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/custom/vplexapi.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/custom/vplexapi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/clustercommunication.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/clustercommunication.pm index b1f768268..279d8fa1e 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/clustercommunication.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/clustercommunication.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/clusterdevices.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/clusterdevices.pm index 4ccdfae3c..c338aaaab 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/clusterdevices.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/clusterdevices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm index c713f64e8..76f1e7899 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/directors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/distributeddevices.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/distributeddevices.pm index c82583c9d..3e8b562db 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/distributeddevices.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/distributeddevices.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/fans.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/fans.pm index 650fe96a4..56f6f0bb0 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/fans.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/fans.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/psus.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/psus.pm index 7cb12fa7f..0b5f15897 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/psus.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/psus.pm @@ -1,4 +1,4 @@ -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm index fd6a0f01a..6f691a562 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm index 40e3e3ab9..ea589aab6 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/custom/xtremioapi.pm b/centreon-plugins/storage/emc/xtremio/restapi/custom/xtremioapi.pm index b766cb827..d993a9296 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/custom/xtremioapi.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/custom/xtremioapi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm index c9bceb96a..0e349e8c1 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm index 1e1680a28..a1432b7fd 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm index 2096ffd0c..8edd9e6f7 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm index 2ead76f0d..8c8336ff5 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm index 2e9a959d4..f4afe1e04 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm b/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm index 55e37a12a..e3a829b1f 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm index 605ec01d7..47ca30fae 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm index 2123e2c5d..7d37f9994 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm index c171dd872..528a78c33 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm index ee49f1400..40923136f 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm index 665ddb156..fd84c38b3 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm index efd8a4eaa..f0a638e40 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm index 5fa5c22f8..45eeaaab1 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/battery.pm b/centreon-plugins/storage/hp/3par/7000/mode/battery.pm index 8d26ffa3a..250545729 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/battery.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/battery.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/cim.pm b/centreon-plugins/storage/hp/3par/7000/mode/cim.pm index 97ff6e092..b075930a6 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/cim.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/cim.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/iscsi.pm b/centreon-plugins/storage/hp/3par/7000/mode/iscsi.pm index 6302add0d..3dd4c1d10 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/iscsi.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/iscsi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/node.pm b/centreon-plugins/storage/hp/3par/7000/mode/node.pm index 9ab552ffc..bb844743f 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/node.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/node.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/physicaldisk.pm b/centreon-plugins/storage/hp/3par/7000/mode/physicaldisk.pm index 22e1e1ccc..7e3edfb11 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/physicaldisk.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/physicaldisk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/psu.pm b/centreon-plugins/storage/hp/3par/7000/mode/psu.pm index 643968db1..6b615a425 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/psu.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/storage.pm b/centreon-plugins/storage/hp/3par/7000/mode/storage.pm index 2dc2dc837..33120dbf1 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/storage.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/storage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/temperature.pm b/centreon-plugins/storage/hp/3par/7000/mode/temperature.pm index 204c3d26c..0d85e2bf9 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/temperature.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/volume.pm b/centreon-plugins/storage/hp/3par/7000/mode/volume.pm index f691f9387..69876b73d 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/volume.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/volume.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/mode/wsapi.pm b/centreon-plugins/storage/hp/3par/7000/mode/wsapi.pm index b84e7c84b..cf58bfb85 100644 --- a/centreon-plugins/storage/hp/3par/7000/mode/wsapi.pm +++ b/centreon-plugins/storage/hp/3par/7000/mode/wsapi.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/3par/7000/plugin.pm b/centreon-plugins/storage/hp/3par/7000/plugin.pm index 68336b015..57f877647 100644 --- a/centreon-plugins/storage/hp/3par/7000/plugin.pm +++ b/centreon-plugins/storage/hp/3par/7000/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/device.pm b/centreon-plugins/storage/hp/lefthand/mode/components/device.pm index f549b6c59..de2a844fa 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/device.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/device.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/fan.pm b/centreon-plugins/storage/hp/lefthand/mode/components/fan.pm index dbb18f5f9..694dafaa8 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/fan.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/psu.pm b/centreon-plugins/storage/hp/lefthand/mode/components/psu.pm index 2dcdcc69a..a165f1eff 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/psu.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/rc.pm b/centreon-plugins/storage/hp/lefthand/mode/components/rc.pm index bed3e321a..aafdc61a7 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/rc.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/rc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/rcc.pm b/centreon-plugins/storage/hp/lefthand/mode/components/rcc.pm index c834f04ab..75bcedd70 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/rcc.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/rcc.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/ro.pm b/centreon-plugins/storage/hp/lefthand/mode/components/ro.pm index d5e117fbd..333eb2814 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/ro.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/ro.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/temperature.pm b/centreon-plugins/storage/hp/lefthand/mode/components/temperature.pm index e8ab40068..6d65c6f59 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/temperature.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/components/voltage.pm b/centreon-plugins/storage/hp/lefthand/mode/components/voltage.pm index c4ae83ef0..bb4764663 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/components/voltage.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/mode/hardware.pm b/centreon-plugins/storage/hp/lefthand/mode/hardware.pm index bd5f0842f..437ede8d3 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/hardware.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/lefthand/plugin.pm b/centreon-plugins/storage/hp/lefthand/plugin.pm index 94f926865..6281dfe1e 100644 --- a/centreon-plugins/storage/hp/lefthand/plugin.pm +++ b/centreon-plugins/storage/hp/lefthand/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm b/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm index ab9ae08f9..1df84e6dd 100644 --- a/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm +++ b/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm index 7e6c972b7..d33d487d7 100644 --- a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm +++ b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/msl/snmp/plugin.pm b/centreon-plugins/storage/hp/msl/snmp/plugin.pm index b8d5fdccd..38cb5c45c 100644 --- a/centreon-plugins/storage/hp/msl/snmp/plugin.pm +++ b/centreon-plugins/storage/hp/msl/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/custom.pm b/centreon-plugins/storage/hp/p2000/xmlapi/custom.pm index dfe430abd..2b5e1308e 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/custom.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/custom.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/disk.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/disk.pm index b2db95bf5..92735ebd0 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/disk.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/enclosure.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/enclosure.pm index 9f01b161e..93ac96877 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/enclosure.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/enclosure.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/fru.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/fru.pm index 577c4c68f..c7805ff84 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/fru.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/fru.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/sensors.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/sensors.pm index 3ba3b8db0..a6c90fa9b 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/sensors.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/sensors.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/vdisk.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/vdisk.pm index a44f2495c..d179207a5 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/vdisk.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/components/vdisk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/health.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/health.pm index 5737c345e..817fe5cfe 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/health.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/health.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/listvolumes.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/listvolumes.pm index 7fd3f2f67..929fc78db 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/listvolumes.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/listvolumes.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/mode/volumesstats.pm b/centreon-plugins/storage/hp/p2000/xmlapi/mode/volumesstats.pm index ac8fe0b10..6ef4c6ed4 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/mode/volumesstats.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/mode/volumesstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm b/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm index 22f850885..df83a3c0c 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm index 9a3df4d78..8d956d994 100644 --- a/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm index 9410c813b..106e3fe21 100644 --- a/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm index ba78dc956..c446e47a4 100644 --- a/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm index a56a6d665..e338bd617 100644 --- a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/TS3100/plugin.pm b/centreon-plugins/storage/ibm/TS3100/plugin.pm index 629474cc7..ac764f694 100644 --- a/centreon-plugins/storage/ibm/TS3100/plugin.pm +++ b/centreon-plugins/storage/ibm/TS3100/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm index 1f4a916d8..5d0cb48d6 100644 --- a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/ibm/TS3200/plugin.pm b/centreon-plugins/storage/ibm/TS3200/plugin.pm index 7e4d372a0..5827e7e5d 100644 --- a/centreon-plugins/storage/ibm/TS3200/plugin.pm +++ b/centreon-plugins/storage/ibm/TS3200/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm b/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm index 8e5e09f88..b6a934a14 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm index cc134adeb..604711be2 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm b/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm index 76d259daa..c8a79299f 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/communication.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm b/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm index d34b5046d..d5ce43f7a 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/electronics.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm b/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm index 3f2e6d3d6..6f4f2428b 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm b/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm index 6905fbc20..2b44753bb 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm b/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm index adb9c9530..7a2c1af5f 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/raid.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm index 48d131bb6..a2829f392 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm index fa6f6cb39..273474ee5 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/voltage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm b/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm index 77ea71e0c..36ff93368 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm b/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm index e9f0f98d8..c8dfe96ad 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm b/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm index eeec10a25..cc2123ec3 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/fan.pm b/centreon-plugins/storage/netapp/snmp/mode/fan.pm index 0f2fe0d4b..cd32ff61c 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/fan.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/filesys.pm b/centreon-plugins/storage/netapp/snmp/mode/filesys.pm index 27f2ace05..50c4baa2f 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/filesys.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/filesys.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm b/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm index 0ebc77f72..4c692ce40 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm b/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm index 519470b80..ce146af37 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm b/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm index 3e2847d2c..f744f5fd6 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/nvram.pm b/centreon-plugins/storage/netapp/snmp/mode/nvram.pm index a7044d207..56f8395a2 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/nvram.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/nvram.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm b/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm index 676bbab10..aa01dca13 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/psu.pm b/centreon-plugins/storage/netapp/snmp/mode/psu.pm index 8f9768fbf..eeba442d4 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/psu.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/psu.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm b/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm index 4ad5787a3..35f6a2f1b 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm b/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm index b1b212326..de4a71180 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/shelf.pm b/centreon-plugins/storage/netapp/snmp/mode/shelf.pm index e08b0df2b..861dbb27b 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/shelf.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/shelf.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm b/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm index 791999cf6..12d4aa8fb 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm b/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm index fe4cb1bcb..e12772744 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/temperature.pm index 2011885ba..fcd95f6b4 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm b/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm index 14bfd8a04..a32e873ef 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/netapp/snmp/plugin.pm b/centreon-plugins/storage/netapp/snmp/plugin.pm index 1ec2233b1..c1703ea81 100644 --- a/centreon-plugins/storage/netapp/snmp/plugin.pm +++ b/centreon-plugins/storage/netapp/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/nimble/snmp/mode/globalstats.pm b/centreon-plugins/storage/nimble/snmp/mode/globalstats.pm index 636013b7f..fe1a8a1c0 100644 --- a/centreon-plugins/storage/nimble/snmp/mode/globalstats.pm +++ b/centreon-plugins/storage/nimble/snmp/mode/globalstats.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/nimble/snmp/mode/volumeusage.pm b/centreon-plugins/storage/nimble/snmp/mode/volumeusage.pm index d2f59bbad..de45cf794 100644 --- a/centreon-plugins/storage/nimble/snmp/mode/volumeusage.pm +++ b/centreon-plugins/storage/nimble/snmp/mode/volumeusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/nimble/snmp/plugin.pm b/centreon-plugins/storage/nimble/snmp/plugin.pm index 1d7d9bfd3..74b8c1770 100644 --- a/centreon-plugins/storage/nimble/snmp/plugin.pm +++ b/centreon-plugins/storage/nimble/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm b/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm index 1d9d7a3b2..dbe1c3ecb 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm b/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm index 629dd0fc2..991e332e0 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/panzura/snmp/mode/memory.pm b/centreon-plugins/storage/panzura/snmp/mode/memory.pm index c02c1c8d7..8a2743ca8 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/memory.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/panzura/snmp/mode/ratios.pm b/centreon-plugins/storage/panzura/snmp/mode/ratios.pm index 9feaad36a..972212c27 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/ratios.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/ratios.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/panzura/snmp/plugin.pm b/centreon-plugins/storage/panzura/snmp/plugin.pm index 849b66464..787bbecad 100644 --- a/centreon-plugins/storage/panzura/snmp/plugin.pm +++ b/centreon-plugins/storage/panzura/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm b/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm index ad054a31a..ebb5eaaeb 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/disk.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm b/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm index c5ddab573..6de0e134c 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/fan.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm b/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm index 7b5202174..2b51667d4 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/components/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm index ca6bdf4d5..7bc227cea 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/memory.pm b/centreon-plugins/storage/qnap/snmp/mode/memory.pm index d41985e99..0d64ad67d 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/memory.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/memory.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm b/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm index de83180d1..7aaa895a7 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/qnap/snmp/plugin.pm b/centreon-plugins/storage/qnap/snmp/plugin.pm index 47d4bc1e6..5d8fab070 100644 --- a/centreon-plugins/storage/qnap/snmp/plugin.pm +++ b/centreon-plugins/storage/qnap/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/synology/snmp/mode/components.pm b/centreon-plugins/storage/synology/snmp/mode/components.pm index 44fdf1776..aba195b8d 100644 --- a/centreon-plugins/storage/synology/snmp/mode/components.pm +++ b/centreon-plugins/storage/synology/snmp/mode/components.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/synology/snmp/mode/temperature.pm b/centreon-plugins/storage/synology/snmp/mode/temperature.pm index bf0dc879c..c50e15679 100644 --- a/centreon-plugins/storage/synology/snmp/mode/temperature.pm +++ b/centreon-plugins/storage/synology/snmp/mode/temperature.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/synology/snmp/mode/ups.pm b/centreon-plugins/storage/synology/snmp/mode/ups.pm index 8d6984778..6972339dc 100644 --- a/centreon-plugins/storage/synology/snmp/mode/ups.pm +++ b/centreon-plugins/storage/synology/snmp/mode/ups.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/synology/snmp/plugin.pm b/centreon-plugins/storage/synology/snmp/plugin.pm index dc118f5c5..c8a9aea1d 100644 --- a/centreon-plugins/storage/synology/snmp/plugin.pm +++ b/centreon-plugins/storage/synology/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for diff --git a/centreon-plugins/storage/violin/3000/snmp/plugin.pm b/centreon-plugins/storage/violin/3000/snmp/plugin.pm index 91b381701..656cd7a59 100644 --- a/centreon-plugins/storage/violin/3000/snmp/plugin.pm +++ b/centreon-plugins/storage/violin/3000/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2015 Centreon (http://www.centreon.com/) +# Copyright 2016 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for From 34fac68830b1c8e6ee080524220d27be7a2f1990 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 09:29:15 +0100 Subject: [PATCH 048/346] +add plugin.pm (juniper/trapeze) --- .../network/juniper/trapeze/snmp/plugin.pm | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 centreon-plugins/network/juniper/trapeze/snmp/plugin.pm diff --git a/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm b/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm new file mode 100644 index 000000000..46ec7ada3 --- /dev/null +++ b/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm @@ -0,0 +1,52 @@ +# +# Copyright 2015 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::juniper::trapeze::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; + # $options->{options} = options object + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'cpu' => 'network::juniper::trapeze::snmp::mode::cpu', + 'memory' => 'network::juniper::trapeze::snmp::mode::memory', + 'ap-status' => 'network::juniper::trapeze::snmp::mode::apstatus', + 'ap-users' => 'network::juniper::trapeze::snmp::mode::apusers', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Trapeze Network (Juniper) Wifi LAN Controller through SNMP + +=cut From 30da01a6061147d3815a92ffea5634ac0def7c01 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 09:32:23 +0100 Subject: [PATCH 049/346] + add cpu.pm (juniper/trapeze) --- .../network/juniper/trapeze/snmp/mode/cpu.pm | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm new file mode 100644 index 000000000..15320fce6 --- /dev/null +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm @@ -0,0 +1,141 @@ +# +# Copyright 2015 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::juniper::trapeze::snmp::mode::cpu; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'cpu', type => 0, cb_prefix_output => 'prefix_cpu_output' } + ]; + + $self->{maps_counters}->{cpu} = [ + { label => 'average', set => { + key_values => [ { name => 'trpzSysCpuAverageLoad' } ], + output_template => 'average : %.2f %%', + perfdatas => [ + { label => 'cpu_average', value => 'trpzSysCpuAverageLoad_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => '1m', set => { + key_values => [ { name => 'trpzSysCpuLastMinuteLoad' } ], + output_template => '1 minute : %.2f %%', + perfdatas => [ + { label => 'cpu_1m', value => 'trpzSysCpuLastMinuteLoad_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => '5m', set => { + key_values => [ { name => 'trpzSysCpuLast5MinutesLoad' } ], + output_template => '5 minutes : %.2f %%', + perfdatas => [ + { label => 'cpu_5m', value => 'trpzSysCpuLast5MinutesLoad_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => '1h', set => { + key_values => [ { name => ' trpzSysCpuLastHourLoad' } ], + output_template => '1 hour : %.2f %%', + perfdatas => [ + { label => 'cpu_1h', value => ' trpzSysCpuLastHourLoad_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + ]; +} + +sub prefix_cpu_output { + my ($self, %options) = @_; + + return "CPU Usage "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + # TRAPEZE-NETWORKS-SYSTEM-MIB + my $oid_trpzSysCpuAverageLoad = '.1.3.6.1.4.1.14525.4.8.1.1.5.0'; + my $oid_trpzSysCpuLastMinuteLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.2.0'; + my $oid_trpzSysCpuLast5MinutesLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.3.0'; + my $oid_trpzSysCpuLastHourLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.4.0'; + + my $results = $options{snmp}->get_leef(oids => [$oid_trpzSysCpuAverageLoad, $oid_trpzSysCpuLastMinuteLoad, + $oid_trpzSysCpuLast5MinutesLoad, $oid_trpzSysCpuLastHourLoad ], + nothing_quit => 1); + + $self->{cpu} = { trpzSysCpuAverageLoad => $results->{$oid_trpzSysCpuAverageLoad}, + trpzSysCpuLastMinuteLoad => $results->{$oid_trpzSysCpuLastMinuteLoad}, + trpzSysCpuLast5MinutesLoad => $results->{$oid_trpzSysCpuLast5MinutesLoad}, + trpzSysCpuLastHourLoad => $results->{$oid_trpzSysCpuLastHourLoad}, + }; +} + +1; + +__END__ + +=head1 MODE + +Check CPU usage + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^(1m|5m)$' + +=item B<--warning-*> + +Threshold warning. +Can be: '1m', '5m', '1h, 'average' + +=item B<--critical-*> + +Threshold critical. +Can be: '1m', '5m', '1h', 'average' + +=back + +=cut From e89c93dd1a9633574ddfd8adce64319551be6611 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 09:34:52 +0100 Subject: [PATCH 050/346] + add memory.pm (juniper/trapeze) --- .../juniper/trapeze/snmp/mode/memory.pm | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm new file mode 100644 index 000000000..c49da0578 --- /dev/null +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm @@ -0,0 +1,176 @@ +# +# Copyright 2015 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::juniper::trapeze::snmp::mode::memory; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total_absolute}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used_absolute}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free_absolute}); + + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used_absolute}, + $total_free_value . " " . $total_free_unit, 100 - $self->{result_values}->{prct_used_absolute}); + return $msg; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'memory', type => 0, cb_prefix_output => 'prefix_memory_output' }, + { name => 'flash', type => 0, cb_prefix_output => 'prefix_flash_output' } + ]; + + $self->{maps_counters}->{memory} = [ + { label => 'memory', set => { + key_values => [ { name => 'prct_used'}, { name => 'used' }, { name => 'free' }, { name => 'total' } ], + closure_custom_output => $self->can('custom_usage_output'), + threshold_use => 'prct_used_absolute', + perfdatas => [ + { label => 'memory', value => 'used_absolute', template => '%.2f', threshold_total => 'total_absolute', cast_int => 1, + min => 0, max => 'total_absolute', unit => 'B' }, + ], + } + }, + ]; + $self->{maps_counters}->{flash} = [ + { label => 'flash', set => { + key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'total' } ], + closure_custom_output => $self->can('custom_usage_output'), + threshold_use => 'prct_used_absolute', + perfdatas => [ + { label => 'flash', value => 'used_absolute', template => '%.2f', threshold_total => 'total_absolute', cast_int => 1, + min => 0, max => 'total_absolute', unit => 'B' }, + ], + } + }, + ]; +} + +sub prefix_memory_output { + my ($self, %options) = @_; + + return "Memory "; +} + +sub prefix_flash_output { + my ($self, %options) = @_; + + return "Flash "; +} + + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $total_bytes; + my $used_bytes; + my $free_bytes; + + # TRAPEZE-NETWORKS-SYSTEM-MIB + my $oid_trpzSysFlashMemoryUsedBytes = '.1.3.6.1.4.1.14525.4.8.1.1.3.0'; + my $oid_trpzSysFlashMemoryTotalBytes = '.1.3.6.1.4.1.14525.4.8.1.1.4.0'; + my $oid_trpzSysCpuMemoryInstantUsage = '.1.3.6.1.4.1.14525.4.8.1.1.12.1.0'; + my $oid_trpzSysCpuMemoryUsedBytes = '.1.3.6.1.4.1.14525.4.8.1.1.1.0'; + my $oid_trpzSysCpuMemoryTotalBytes = '.1.3.6.1.4.1.14525.4.8.1.1.2.0'; + my $oid_trpzSysCpuMemorySize = '.1.3.6.1.4.1.14525.4.8.1.1.6.0'; + + my $results = $options{snmp}->get_leef(oids => [$oid_trpzSysFlashMemoryUsedBytes, $oid_trpzSysFlashMemoryTotalBytes, $oid_trpzSysCpuMemoryUsedBytes, + $oid_trpzSysCpuMemoryInstantUsage, $oid_trpzSysCpuMemorySize, $oid_trpzSysCpuMemoryTotalBytes ], + nothing_quit => 1); + + if (defined($results->{$oid_trpzSysCpuMemorySize}) || $results->{$oid_trpzSysCpuMemorySize} != 0) { + $total_bytes = $results->{$oid_trpzSysCpuMemorySize} * 1024; + $used_bytes = $results->{$oid_trpzSysCpuMemoryInstantUsage} * 1024; + $free_bytes = $total_bytes - $used_bytes; + } else { + $total_bytes = $results->{$oid_trpzSysCpuMemoryTotalBytes}; + $used_bytes = $results->{$oid_trpzSysCpuMemoryUsedBytes}; + $free_bytes = $total_bytes - $used_bytes; + } + + my $free_bytes_flash = $results->{$oid_trpzSysFlashMemoryTotalBytes} - $results->{$oid_trpzSysFlashMemoryUsedBytes}; + + $self->{memory} = {display => 'memory', + prct_used => $used_bytes * 100 / $total_bytes, + used => $used_bytes, + free => $free_bytes, + total => $total_bytes, + }; + + $self->{flash} = {display => 'flash', + prct_used => $results->{$oid_trpzSysFlashMemoryUsedBytes} * 100 / $results->{$oid_trpzSysFlashMemoryTotalBytes}, + used => $results->{$oid_trpzSysFlashMemoryUsedBytes}, + free => $free_bytes_flash, + total => $results->{$oid_trpzSysFlashMemoryTotalBytes}, + }; + +} + +1; + +__END__ + +=head1 MODE + +Check memory usage + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^(1m|5m)$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'memory', 'flash' + +=item B<--critical-*> + +Threshold critical. +Can be: 'memory', 'flash' + +=back + +=cut From 7e9acb76642f662dde52d7b9410b3630821dd90a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 22 Jan 2016 10:01:06 +0100 Subject: [PATCH 051/346] + Fix #294 --- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index a3379d136..bc506f479 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -203,7 +203,9 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0'); my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0'); - + + $result2->{upsAdvBatteryRunTimeRemaining} = $result2->{upsAdvBatteryRunTimeRemaining} / 100 / 60 if (defined($result2->{upsAdvBatteryRunTimeRemaining})); + foreach my $name (keys %{$mapping}) { $self->{global}->{$name} = $result->{$name}; } From d866d07acf8e4267a3b9887903d22cfb5d83d2d9 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 10:05:50 +0100 Subject: [PATCH 052/346] + add apusers.pm (juniper/trapeze) --- .../juniper/trapeze/snmp/mode/apusers.pm | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm new file mode 100644 index 000000000..f371e26a4 --- /dev/null +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm @@ -0,0 +1,191 @@ +# +# Copyright 2015 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::juniper::trapeze::snmp::mode::apusers; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'ssid', type => 1, cb_prefix_output => 'prefix_ssid_output', message_multiple => 'All users by SSID are ok' }, + { name => 'ap', type => 1, cb_prefix_output => 'prefix_ap_output', message_multiple => 'All users by AP are ok' }, + ]; + + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total Users : %s', + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + unit => 'users', min => 0 }, + ], + } + }, + ]; + + $self->{maps_counters}->{ssid} = [ + { label => 'ssid', set => { + key_values => [ { name => 'total' }, { name => 'display' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ssid', value => 'total_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; + + $self->{maps_counters}->{ap} = [ + { label => 'ap', set => { + key_values => [ { name => 'total' }, { name => 'display' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ap', value => 'total_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; + +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-ssid:s" => { name => 'filter_ssid' }, + "filter-ap:s" => { name => 'filter_ap' }, + }); + + return $self; +} + +sub prefix_ssid_output { + my ($self, %options) = @_; + + return "SSID '" . $options{instance_value}->{display} . "' "; +} + +sub prefix_ap_output { + my ($self, %options) = @_; + + return "AP '" . $options{instance_value}->{display} . "' "; +} + +my $mapping = { + trpzClSessClientSessApSerialNum => { oid => '.1.3.6.1.4.1.14525.4.4.1.1.1.1.7' }, +}; + +my $mapping1 = { + trpzClSessClientSessSsid => { oid => '.1.3.6.1.4.1.14525.4.4.1.1.1.1.15' }, +}; + + +sub manage_selection { + my ($self, %options) = @_; + + my $oid_trpzApStatApStatusApName = '.1.3.6.1.4.1.14525.4.5.1.1.2.1.8'; + $self->{global} = { total => 0}; + $self->{ssid} = {}; + $self->{ap} = {}; + + $self->{results} = $options{snmp}->get_multiple_table(oids => [{ oid => $oid_trpzApStatApStatusApName }, { oid => $mapping->{trpzClSessClientSessApSerialNum}->{oid} }, + { oid => $mapping1->{trpzClSessClientSessSsid}->{oid} }], + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}->{ $mapping->{trpzClSessClientSessApSerialNum}->{oid} }}) { + $oid =~ /^$mapping->{trpzClSessClientSessApSerialNum}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{ $mapping->{trpzClSessClientSessApSerialNum}->{oid} }, instance => $instance); + my $result1 = $options{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{ $mapping1->{trpzClSessClientSessSsid}->{oid} }, instance => $instance); + my @chars = split(//,$result->{trpzClSessClientSessApSerialNum}); + my $ap_oid = '12'; + foreach my $char (@chars) { + $ap_oid .= '.'.ord($char); + } + my $ap_name = $self->{results}->{$oid_trpzApStatApStatusApName}->{$oid_trpzApStatApStatusApName . '.' . $ap_oid}; + if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && + $ap_name !~ /$self->{option_results}->{filter_ap}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $ap_name . "': no matching filter.", debug => 1); + next; + } + if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && + $result1->{trpzClSessClientSessSsid} !~ /$self->{option_results}->{filter_ssid}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $result1->{trpzClSessClientSessSsid} . "': no matching filter.", debug => 1); + next; + } + + $self->{global}->{total}++; + $self->{ap}->{$ap_name} = { total => 0, display => $ap_name } if (!defined($self->{ap}->{$ap_name})); + $self->{ap}->{$ap_name}->{total}++; + $self->{ssid}->{$result1->{trpzClSessClientSessSsid}} = { total => 0, display => $result1->{trpzClSessClientSessSsid} } if (!defined($self->{ssid}->{$result1->{trpzClSessClientSessSsid}})); + $self->{ssid}->{$result1->{trpzClSessClientSessSsid}}->{total}++ + + } + + if (scalar(keys %{$self->{ap}}) <= 0 && scalar(keys %{$self->{ssid}}) <= 0) { + $self->{output}->output_add(severity => 'OK', + short_msg => 'No AP nor SSID finded, check your filter or maybe we are on a slave controller ? '); + } +} + +1; + +__END__ + +=head1 MODE + +Check AP status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--filter-ap> + +Filter AP name (can be a regexp). + +=item B<--filter-ssid> + +Filter SSID name (can be a regexp). + +=item B<--warning-*> + +Set warning threshold for number of user. Can be : 'total', 'ssid', 'ap' . + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'total', 'ssid', 'ap' . + +=back + +=cut From 2fd66f1ad39b7350dee42554b1590a33007c04b1 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 10:09:17 +0100 Subject: [PATCH 053/346] Create apstatus.pm --- .../juniper/trapeze/snmp/mode/apstatus.pm | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm new file mode 100644 index 000000000..126960788 --- /dev/null +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm @@ -0,0 +1,228 @@ +# +# Copyright 2015 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::juniper::trapeze::snmp::mode::apstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg; + + if ($self->{result_values}->{opstatus} eq 'disabled') { + $msg = ' is disabled'; + } else { + $msg = 'Status : ' . $self->{result_values}->{opstatus}; + } + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{opstatus} = $options{new_datas}->{$self->{instance} . '_opstatus'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, cb_init => 'skip_global', }, + { name => 'ap', type => 1, cb_prefix_output => 'prefix_ap_output', message_multiple => 'All AP status are ok' } + ]; + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total ap : %s', + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + min => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{ap} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'opstatus' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{opstatus} !~ /init|redundant|operationnal/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub skip_global { + my ($self, %options) = @_; + + scalar(keys %{$self->{ap}}) > 1 ? return(0) : return(1); +} + +sub prefix_ap_output { + my ($self, %options) = @_; + + return "AP '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_ap_status = ( + 1 => 'cleared', + 2 => 'init', + 3 => 'bootStarted', + 4 => 'imageDownloaded', + 5 => 'connectFailed', + 6 => 'configuring', + 7 => 'operationnal', + 10 => 'redundant', + 20 => 'connOutage', +); + +my $mapping_name_oid = { + trpzApStatApStatusApName => { oid => '.1.3.6.1.4.1.14525.4.5.1.1.2.1.8' }, +}; +my $mapping_state_oid = { + trpzApStatApStatusApState => { oid => '.1.3.6.1.4.1.14525.4.5.1.1.2.1.5', map => \%map_ap_status }, +}; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{ap} = {}; + $self->{global} = { total => 0}; + $self->{results} = $options{snmp}->get_multiple_table(oids => [{ oid => $mapping_name_oid->{trpzApStatApStatusApName}->{oid} }, + { oid => $mapping_state_oid->{trpzApStatApStatusApState}->{oid} }, + ], + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}->{ $mapping_name_oid->{trpzApStatApStatusApName}->{oid} }}) { + $oid =~ /^$mapping_name_oid->{trpzApStatApStatusApName}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping_name_oid, results => $self->{results}->{ $mapping_name_oid->{trpzApStatApStatusApName}->{oid} }, instance => $instance); + my $result2 = $options{snmp}->map_instance(mapping => $mapping_state_oid, results => $self->{results}->{ $mapping_state_oid->{trpzApStatApStatusApState}->{oid} }, instance => $instance); + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{trpzApStatApStatusApName} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $result->{trpzApStatApStatusApName} . "': no matching filter.", debug => 1); + next; + } + + $self->{global}->{total}++; + $self->{ap}->{$instance} = { display => $result->{trpzApStatApStatusApName}, + opstatus => $result2->{trpzApStatApStatusApState}}; + } + + if (scalar(keys %{$self->{ap}}) <= 0) { + $self->{output}->output_add(severity => 'OK', + short_msg => 'No AP associated, check your filter ? '); + } +} + +1; + +__END__ + +=head1 MODE + +Check AP status. + +=over 8 + +=item B<--filter-name> + +Filter AP name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{opstatus}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{opstatus} !~ /init|redundant|operationnal/'). +Can used special variables like: %{opstatus}, %{display} + + +=back + +=cut From 7aa810dab25bf0a063d380435ea31203af45b02e Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 22 Jan 2016 10:11:23 +0100 Subject: [PATCH 054/346] + add apstatus.pm (juniper/trapeze) --- .../network/juniper/trapeze/snmp/mode/apstatus.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm index 126960788..b4a5b2d2a 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm @@ -222,6 +222,13 @@ Can used special variables like: %{opstatus}, %{display} Set critical threshold for status (Default: '%{opstatus} !~ /init|redundant|operationnal/'). Can used special variables like: %{opstatus}, %{display} +=item B<--warning-total> + +Set warning threshold for number of AP linked to the WLC + +=item B<--critical-total> + +Set critical threshold for number of AP linked to the WLC =back From 6e1f781c73f93e385f63ce1c22771c4b88748a19 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 22 Jan 2016 10:32:42 +0100 Subject: [PATCH 055/346] + indentation fix --- .../juniper/trapeze/snmp/mode/apstatus.pm | 22 ++++++------- .../juniper/trapeze/snmp/mode/apusers.pm | 26 +++++++-------- .../network/juniper/trapeze/snmp/mode/cpu.pm | 4 +-- .../juniper/trapeze/snmp/mode/memory.pm | 32 ++++++++----------- 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm index b4a5b2d2a..b18d1693d 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm @@ -148,19 +148,19 @@ sub change_macros { } my %map_ap_status = ( - 1 => 'cleared', - 2 => 'init', - 3 => 'bootStarted', - 4 => 'imageDownloaded', - 5 => 'connectFailed', - 6 => 'configuring', - 7 => 'operationnal', - 10 => 'redundant', - 20 => 'connOutage', + 1 => 'cleared', + 2 => 'init', + 3 => 'bootStarted', + 4 => 'imageDownloaded', + 5 => 'connectFailed', + 6 => 'configuring', + 7 => 'operationnal', + 10 => 'redundant', + 20 => 'connOutage', ); my $mapping_name_oid = { - trpzApStatApStatusApName => { oid => '.1.3.6.1.4.1.14525.4.5.1.1.2.1.8' }, + trpzApStatApStatusApName => { oid => '.1.3.6.1.4.1.14525.4.5.1.1.2.1.8' }, }; my $mapping_state_oid = { trpzApStatApStatusApState => { oid => '.1.3.6.1.4.1.14525.4.5.1.1.2.1.5', map => \%map_ap_status }, @@ -175,7 +175,7 @@ sub manage_selection { { oid => $mapping_state_oid->{trpzApStatApStatusApState}->{oid} }, ], nothing_quit => 1); - + foreach my $oid (keys %{$self->{results}->{ $mapping_name_oid->{trpzApStatApStatusApName}->{oid} }}) { $oid =~ /^$mapping_name_oid->{trpzApStatApStatusApName}->{oid}\.(.*)$/; my $instance = $1; diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm index f371e26a4..274efdd52 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm @@ -100,14 +100,13 @@ sub prefix_ap_output { } my $mapping = { - trpzClSessClientSessApSerialNum => { oid => '.1.3.6.1.4.1.14525.4.4.1.1.1.1.7' }, + trpzClSessClientSessApSerialNum => { oid => '.1.3.6.1.4.1.14525.4.4.1.1.1.1.7' }, }; my $mapping1 = { trpzClSessClientSessSsid => { oid => '.1.3.6.1.4.1.14525.4.4.1.1.1.1.15' }, }; - sub manage_selection { my ($self, %options) = @_; @@ -119,18 +118,18 @@ sub manage_selection { $self->{results} = $options{snmp}->get_multiple_table(oids => [{ oid => $oid_trpzApStatApStatusApName }, { oid => $mapping->{trpzClSessClientSessApSerialNum}->{oid} }, { oid => $mapping1->{trpzClSessClientSessSsid}->{oid} }], nothing_quit => 1); - + foreach my $oid (keys %{$self->{results}->{ $mapping->{trpzClSessClientSessApSerialNum}->{oid} }}) { $oid =~ /^$mapping->{trpzClSessClientSessApSerialNum}->{oid}\.(.*)$/; my $instance = $1; my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{ $mapping->{trpzClSessClientSessApSerialNum}->{oid} }, instance => $instance); my $result1 = $options{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{ $mapping1->{trpzClSessClientSessSsid}->{oid} }, instance => $instance); - my @chars = split(//,$result->{trpzClSessClientSessApSerialNum}); - my $ap_oid = '12'; - foreach my $char (@chars) { - $ap_oid .= '.'.ord($char); - } - my $ap_name = $self->{results}->{$oid_trpzApStatApStatusApName}->{$oid_trpzApStatApStatusApName . '.' . $ap_oid}; + my @chars = split(//,$result->{trpzClSessClientSessApSerialNum}); + my $ap_oid = '12'; + foreach my $char (@chars) { + $ap_oid .= '.'.ord($char); + } + my $ap_name = $self->{results}->{$oid_trpzApStatApStatusApName}->{$oid_trpzApStatApStatusApName . '.' . $ap_oid}; if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && $ap_name !~ /$self->{option_results}->{filter_ap}/) { $self->{output}->output_add(long_msg => "Skipping '" . $ap_name . "': no matching filter.", debug => 1); @@ -142,12 +141,11 @@ sub manage_selection { next; } - $self->{global}->{total}++; - $self->{ap}->{$ap_name} = { total => 0, display => $ap_name } if (!defined($self->{ap}->{$ap_name})); + $self->{global}->{total}++; + $self->{ap}->{$ap_name} = { total => 0, display => $ap_name } if (!defined($self->{ap}->{$ap_name})); $self->{ap}->{$ap_name}->{total}++; - $self->{ssid}->{$result1->{trpzClSessClientSessSsid}} = { total => 0, display => $result1->{trpzClSessClientSessSsid} } if (!defined($self->{ssid}->{$result1->{trpzClSessClientSessSsid}})); - $self->{ssid}->{$result1->{trpzClSessClientSessSsid}}->{total}++ - + $self->{ssid}->{$result1->{trpzClSessClientSessSsid}} = { total => 0, display => $result1->{trpzClSessClientSessSsid} } if (!defined($self->{ssid}->{$result1->{trpzClSessClientSessSsid}})); + $self->{ssid}->{$result1->{trpzClSessClientSessSsid}}->{total}++; } if (scalar(keys %{$self->{ap}}) <= 0 && scalar(keys %{$self->{ssid}}) <= 0) { diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm index 15320fce6..c28e6f3e9 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/cpu.pm @@ -33,7 +33,7 @@ sub set_counters { ]; $self->{maps_counters}->{cpu} = [ - { label => 'average', set => { + { label => 'average', set => { key_values => [ { name => 'trpzSysCpuAverageLoad' } ], output_template => 'average : %.2f %%', perfdatas => [ @@ -99,7 +99,7 @@ sub manage_selection { my $oid_trpzSysCpuLastMinuteLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.2.0'; my $oid_trpzSysCpuLast5MinutesLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.3.0'; my $oid_trpzSysCpuLastHourLoad = '.1.3.6.1.4.1.14525.4.8.1.1.11.4.0'; - + my $results = $options{snmp}->get_leef(oids => [$oid_trpzSysCpuAverageLoad, $oid_trpzSysCpuLastMinuteLoad, $oid_trpzSysCpuLast5MinutesLoad, $oid_trpzSysCpuLastHourLoad ], nothing_quit => 1); diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm index c49da0578..f0e82d023 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm @@ -70,7 +70,7 @@ sub set_counters { ], } }, - ]; + ]; } sub prefix_memory_output { @@ -85,7 +85,6 @@ sub prefix_flash_output { return "Flash "; } - sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -102,10 +101,8 @@ sub new { sub manage_selection { my ($self, %options) = @_; - my $total_bytes; - my $used_bytes; - my $free_bytes; - + my ($total_bytes, $used_bytes, $free_bytes); + # TRAPEZE-NETWORKS-SYSTEM-MIB my $oid_trpzSysFlashMemoryUsedBytes = '.1.3.6.1.4.1.14525.4.8.1.1.3.0'; my $oid_trpzSysFlashMemoryTotalBytes = '.1.3.6.1.4.1.14525.4.8.1.1.4.0'; @@ -131,19 +128,18 @@ sub manage_selection { my $free_bytes_flash = $results->{$oid_trpzSysFlashMemoryTotalBytes} - $results->{$oid_trpzSysFlashMemoryUsedBytes}; $self->{memory} = {display => 'memory', - prct_used => $used_bytes * 100 / $total_bytes, - used => $used_bytes, - free => $free_bytes, - total => $total_bytes, - }; - + prct_used => $used_bytes * 100 / $total_bytes, + used => $used_bytes, + free => $free_bytes, + total => $total_bytes, + }; + $self->{flash} = {display => 'flash', - prct_used => $results->{$oid_trpzSysFlashMemoryUsedBytes} * 100 / $results->{$oid_trpzSysFlashMemoryTotalBytes}, - used => $results->{$oid_trpzSysFlashMemoryUsedBytes}, - free => $free_bytes_flash, - total => $results->{$oid_trpzSysFlashMemoryTotalBytes}, - }; - + prct_used => $results->{$oid_trpzSysFlashMemoryUsedBytes} * 100 / $results->{$oid_trpzSysFlashMemoryTotalBytes}, + used => $results->{$oid_trpzSysFlashMemoryUsedBytes}, + free => $free_bytes_flash, + total => $results->{$oid_trpzSysFlashMemoryTotalBytes}, + }; } 1; From 04d795218a83522ff2a1135cf3bb2a8244ab0497 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 22 Jan 2016 10:33:55 +0100 Subject: [PATCH 056/346] + version tag --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 29 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index cd3d1c684..61f97788c 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -31,7 +31,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20151218; +my $global_version = 20160122; sub new { my $class = shift; diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index 3c577a6f2..64f50d1de 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,32 @@ +2016-01-22 Quentin Garnier + * Plugin added: Add a plugin to check Juniper Trapeze in SNMP + * Plugin added: Add a plugin to check Dell ML6000 in SNMP + * Plugin added: Add a plugin to check UPS APC in SNMP + * Plugin added: Add a plugin to check HP VC in SNMP + * Major fix on sanity mechanism for options + * Add option '--filter-uom' in core library (#220) + * Add some new classes for code refactoring + * Add 'get_header' method in http library + * Fix 'proxypac' in http library (#263) + * Mode added: [github] 'stats' + * Mode added: [netapp] 'cache-age' + * Mode added: [datadomain] 'replication' + * Enhancement: [cisco standard]{ipsla} hardened code + * Enhancement: [github]{issues} change api call method (#257) + * Enhancement: [selenium]{scenario} add echo command (#258) + * Enhancement: [protocol x509]{validity} add SNI support (#241) + * Enhancement: [snmp_standard]{interfaces} add option '--force-counters32' (#213) + * Enhancement: [protocol x509]{validity} add support for alternative subject names (#277) + * Enhancement: [juniper sa]{users} add filter (#192) + * Enhancement: [cisco wlc]{ap-users} add users by ssid (#227) + * Enhancement: [juniper ssg]{sessions} better counters (#233) + * Enhancement: [vmware connector]{time-host} new options + * Enhancement: [extreme]{hardware} add poe status + * Enhancement: [vplex]{directors} hardened code + * Fix: [bluecoat]{hardware} problem with sensor + * Fix: [cisco ucs]{equipment} fix severity for iocard (#283) + * Fix: [exchange 2010]{queues} perdata infinity not raising anymore + 2015-12-18 Quentin Garnier * Plugin added: Add a plugin to check VMWare ESX with WSMAN * Configuration: centreon-plugins don't use GetOptions anymore (custom library instead) From 63efd895baa05dc17beb6fd5b434301d3d8e82e5 Mon Sep 17 00:00:00 2001 From: Florian Asche Date: Fri, 22 Jan 2016 21:42:16 +0100 Subject: [PATCH 057/346] Added new apcupsd format --- centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm index f82e703b9..0d9f3d4e1 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm @@ -41,7 +41,7 @@ sub getdata { my ($value); #print $stdout; foreach (split(/\n/, $stdout)) { - if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C|F Internal)/i) { + if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C|F Internal|C|F)/i) { $valueok = "1"; $value = $1; #print $value; From 5b06c3ef5dd8db7bedca26c7933cacf387d0565b Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sat, 23 Jan 2016 14:40:16 +0100 Subject: [PATCH 058/346] + add tables-size mode to plugin.pm --- centreon-plugins/database/mysql/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/database/mysql/plugin.pm b/centreon-plugins/database/mysql/plugin.pm index 5ae0b6c5c..916f9f133 100644 --- a/centreon-plugins/database/mysql/plugin.pm +++ b/centreon-plugins/database/mysql/plugin.pm @@ -47,6 +47,7 @@ sub new { 'sql' => 'centreon::common::protocols::sql::mode::sql', 'threads-connected' => 'database::mysql::mode::threadsconnected', 'uptime' => 'database::mysql::mode::uptime', + 'tables-size' => 'database::mysql::mode::tablessize', ); $self->{sql_modes}{mysqlcmd} = 'database::mysql::mysqlcmd'; From 9e19d2b7ce2d856bcd64033b23b0cdf8a815389c Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sat, 23 Jan 2016 14:43:06 +0100 Subject: [PATCH 059/346] + add tablessize.pm mode enhancement: https://github.com/centreon/centreon-plugins/issues/293 --- .../database/mysql/mode/tablessize.pm | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 centreon-plugins/database/mysql/mode/tablessize.pm diff --git a/centreon-plugins/database/mysql/mode/tablessize.pm b/centreon-plugins/database/mysql/mode/tablessize.pm new file mode 100644 index 000000000..71541766d --- /dev/null +++ b/centreon-plugins/database/mysql/mode/tablessize.pm @@ -0,0 +1,137 @@ +# +# Copyright 2016 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 database::mysql::mode::tablessize; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning', }, + "critical:s" => { name => 'critical', }, + "db-table:s" => { name => 'db_table', }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{db_table}) || $self->{option_results}->{db_table} !~ /\./) { + $self->{output}->add_option_msg(short_msg => "Check --db-table option (mandatory) formatting"); + $self->{output}->option_exit(); + } + + ($self->{db}, $self->{table}) = split(/\./, $self->{option_results}->{db_table}) if (defined ($self->{option_results}->{db_table})); + +} + +sub run { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + my $multiple = 0; + my $query = "SELECT table_name AS NAME, ROUND(data_length+index_length) + FROM information_schema.TABLES + WHERE table_schema = '" . $self->{db}. "' AND table_name LIKE '" . $self->{table} . "'"; + + $self->{sql}->query(query => $query); + my $result = $self->{sql}->fetchall_arrayref(); + + if (!($self->{sql}->is_version_minimum(version => '5'))) { + $self->{output}->add_option_msg(short_msg => "MySQL version '" . $self->{sql}->{version} . "' is not supported."); + $self->{output}->option_exit(); + } + + if (scalar (@$result) > 1) { + $self->{output}->output_add(severity => 'OK', + short_msg => "All tables are ok."); + $multiple = 1; + } + + foreach my $row (@$result) { + my $exit_code = $self->{perfdata}->threshold_check(value => $$row[1], threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my ($value, $value_unit) = $self->{perfdata}->change_bytes(value => $$row[1]); + $self->{output}->output_add(long_msg => sprintf("Table '" . $$row[0] . "' size: %s%s", $value, $value_unit)); + if ($multiple == 0 || !$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit_code, + short_msg => sprintf("Table '%s' size is '%i%s'", $$row[0], $value, $value_unit)); + } + $self->{output}->perfdata_add(label => $$row[0] . '_size', unit => 'B', + value => $$row[1], + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + } + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Didn't find table '%s' in '%s' database !", $self->{table}, $self->{db})) if (scalar(@$result) == 0); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check MySQL tables size. + +=over 8 + +=item B<--warning> + +Threshold warning in bytes. + +=item B<--critical> + +Threshold critical in bytes. + +=item B<--db-table> + +Filter database and table to check [use '%' wildcard with caution!] +e.g unique : --db-table database.table_name +e.g multiple : --db-table database.table_% + +=back + +=cut From 183e34e375091937c903265ca1b4ff674e3cf4b6 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sat, 23 Jan 2016 20:05:10 +0100 Subject: [PATCH 060/346] + update tablessize.pm after PR comment see https://github.com/centreon/centreon-plugins/pull/299 --- .../database/mysql/mode/tablessize.pm | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/centreon-plugins/database/mysql/mode/tablessize.pm b/centreon-plugins/database/mysql/mode/tablessize.pm index 71541766d..3a93c93a1 100644 --- a/centreon-plugins/database/mysql/mode/tablessize.pm +++ b/centreon-plugins/database/mysql/mode/tablessize.pm @@ -35,7 +35,7 @@ sub new { { "warning:s" => { name => 'warning', }, "critical:s" => { name => 'critical', }, - "db-table:s" => { name => 'db_table', }, + "db-table:s@" => { name => 'db_table', }, }); return $self; @@ -53,13 +53,18 @@ sub check_options { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); } - if (!defined($self->{option_results}->{db_table}) || $self->{option_results}->{db_table} !~ /\./) { - $self->{output}->add_option_msg(short_msg => "Check --db-table option (mandatory) formatting"); + if (!defined(@{$self->{option_results}->{db_table}})) { + $self->{output}->add_option_msg(short_msg => "Please define --db-table option"); $self->{output}->option_exit(); } - - ($self->{db}, $self->{table}) = split(/\./, $self->{option_results}->{db_table}) if (defined ($self->{option_results}->{db_table})); - + foreach (@{$self->{option_results}->{db_table}}) { + my ($db, $table) = split /\./; + if (!defined($db) || !defined($table)) { + $self->{output}->add_option_msg(short_msg => "Check --db-table option formatting : '" . $_ . "'"); + $self->{output}->option_exit(); + } + $self->{filter}->{$db.$table} = 1; + } } sub run { @@ -67,13 +72,9 @@ sub run { # $options{sql} = sqlmode object $self->{sql} = $options{sql}; $self->{sql}->connect(); - - my $multiple = 0; - my $query = "SELECT table_name AS NAME, ROUND(data_length+index_length) - FROM information_schema.TABLES - WHERE table_schema = '" . $self->{db}. "' AND table_name LIKE '" . $self->{table} . "'"; - - $self->{sql}->query(query => $query); + $self->{sql}->query(query => "SELECT table_schema AS DB, table_name AS NAME, ROUND(data_length + index_length) + FROM information_schema.TABLES"); + my $result = $self->{sql}->fetchall_arrayref(); if (!($self->{sql}->is_version_minimum(version => '5'))) { @@ -81,28 +82,24 @@ sub run { $self->{output}->option_exit(); } - if (scalar (@$result) > 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => "All tables are ok."); - $multiple = 1; - } + $self->{output}->output_add(severity => 'OK', + short_msg => "All tables are ok."); foreach my $row (@$result) { - my $exit_code = $self->{perfdata}->threshold_check(value => $$row[1], threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - my ($value, $value_unit) = $self->{perfdata}->change_bytes(value => $$row[1]); - $self->{output}->output_add(long_msg => sprintf("Table '" . $$row[0] . "' size: %s%s", $value, $value_unit)); - if ($multiple == 0 || !$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { + next if (!defined($self->{filter}->{$$row[0].$$row[1]}) || !defined($$row[2])); + my $exit_code = $self->{perfdata}->threshold_check(value => $$row[2], threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my ($value, $value_unit) = $self->{perfdata}->change_bytes(value => $$row[2]); + $self->{output}->output_add(long_msg => sprintf("Database: '%s' Table: '%s' Size: '%s%s'", $$row[0], $$row[1], $value, $value_unit)); + if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("Table '%s' size is '%i%s'", $$row[0], $value, $value_unit)); + short_msg => sprintf("Table '%s' size in db '%s' is '%i%s'", $$row[0], $$row[1], $value, $value_unit)); } - $self->{output}->perfdata_add(label => $$row[0] . '_size', unit => 'B', - value => $$row[1], + $self->{output}->perfdata_add(label => $$row[0] . '_' . $$row[1] . '_size', unit => 'B', + value => $$row[2], warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), min => 0); } - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Didn't find table '%s' in '%s' database !", $self->{table}, $self->{db})) if (scalar(@$result) == 0); $self->{output}->display(); $self->{output}->exit(); @@ -128,9 +125,7 @@ Threshold critical in bytes. =item B<--db-table> -Filter database and table to check [use '%' wildcard with caution!] -e.g unique : --db-table database.table_name -e.g multiple : --db-table database.table_% +Filter database and table to check (multiple: eg: --db-table centreon_storage.data_bin --db-table centreon_storage.logs) =back From 682b74dc27b76d235eb47c1ee255c01c86411f84 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sun, 24 Jan 2016 11:58:05 +0100 Subject: [PATCH 061/346] + init filter for greater clarity --- centreon-plugins/database/mysql/mode/tablessize.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/database/mysql/mode/tablessize.pm b/centreon-plugins/database/mysql/mode/tablessize.pm index 3a93c93a1..4fe8f75ab 100644 --- a/centreon-plugins/database/mysql/mode/tablessize.pm +++ b/centreon-plugins/database/mysql/mode/tablessize.pm @@ -37,7 +37,7 @@ sub new { "critical:s" => { name => 'critical', }, "db-table:s@" => { name => 'db_table', }, }); - + $self->{filter} = {}; return $self; } From 1a814f850f6374f41ebb9fd643b94f9d20730a65 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sun, 24 Jan 2016 21:13:10 +0100 Subject: [PATCH 062/346] + refactor tablessize.pm with new template --- .../database/mysql/mode/tablessize.pm | 123 ++++++++++-------- 1 file changed, 70 insertions(+), 53 deletions(-) diff --git a/centreon-plugins/database/mysql/mode/tablessize.pm b/centreon-plugins/database/mysql/mode/tablessize.pm index 4fe8f75ab..1bc21020b 100644 --- a/centreon-plugins/database/mysql/mode/tablessize.pm +++ b/centreon-plugins/database/mysql/mode/tablessize.pm @@ -20,11 +20,45 @@ package database::mysql::mode::tablessize; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'table', type => 1, cb_prefix_output => 'prefix_table_output', message_multiple => 'All tables sizes are ok' }, + ]; + + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total Size : %s%s', + output_change_bytes => 1, + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + unit => 'B', min => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{table} = [ + { label => 'table', set => { + key_values => [ { name => 'size' }, { name => 'display' } ], + output_template => 'size : %s%s', + output_change_bytes => 1, + perfdatas => [ + { label => 'table', value => 'size_absolute', template => '%s', + unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -33,48 +67,26 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - "db-table:s@" => { name => 'db_table', }, + "filter-db:s" => { name => 'filter_db' }, + "filter-table:s" => { name => 'filter_table' }, }); - $self->{filter} = {}; return $self; } -sub check_options { +sub prefix_table_output { my ($self, %options) = @_; - $self->SUPER::init(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } - if (!defined(@{$self->{option_results}->{db_table}})) { - $self->{output}->add_option_msg(short_msg => "Please define --db-table option"); - $self->{output}->option_exit(); - } - foreach (@{$self->{option_results}->{db_table}}) { - my ($db, $table) = split /\./; - if (!defined($db) || !defined($table)) { - $self->{output}->add_option_msg(short_msg => "Check --db-table option formatting : '" . $_ . "'"); - $self->{output}->option_exit(); - } - $self->{filter}->{$db.$table} = 1; - } + return "Table '" . $options{instance_value}->{display} . "' "; } -sub run { +sub manage_selection { my ($self, %options) = @_; # $options{sql} = sqlmode object $self->{sql} = $options{sql}; $self->{sql}->connect(); + $self->{sql}->query(query => "SELECT table_schema AS DB, table_name AS NAME, ROUND(data_length + index_length) FROM information_schema.TABLES"); - my $result = $self->{sql}->fetchall_arrayref(); if (!($self->{sql}->is_version_minimum(version => '5'))) { @@ -82,27 +94,24 @@ sub run { $self->{output}->option_exit(); } - $self->{output}->output_add(severity => 'OK', - short_msg => "All tables are ok."); + $self->{global} = { total => 0 }; + $self->{table} = {}; foreach my $row (@$result) { - next if (!defined($self->{filter}->{$$row[0].$$row[1]}) || !defined($$row[2])); - my $exit_code = $self->{perfdata}->threshold_check(value => $$row[2], threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - my ($value, $value_unit) = $self->{perfdata}->change_bytes(value => $$row[2]); - $self->{output}->output_add(long_msg => sprintf("Database: '%s' Table: '%s' Size: '%s%s'", $$row[0], $$row[1], $value, $value_unit)); - if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("Table '%s' size in db '%s' is '%i%s'", $$row[0], $$row[1], $value, $value_unit)); + next if (!defined($$row[2])); + if (defined($self->{option_results}->{filter_table}) && $self->{option_results}->{filter_table} ne '' && + $$row[1] !~ /$self->{option_results}->{filter_table}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $$row[0].'.'.$$row[1] . "': no matching filter.", debug => 1); + next; } - $self->{output}->perfdata_add(label => $$row[0] . '_' . $$row[1] . '_size', unit => 'B', - value => $$row[2], - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0); + if (defined($self->{option_results}->{filter_db}) && $self->{option_results}->{filter_db} ne '' && + $$row[0] !~ /$self->{option_results}->{filter_db}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $$row[0].'.'.$$row[1] . "': no matching filter.", debug => 1); + next + } + $self->{table}->{$$row[0].'.'.$$row[1]} = { size => $$row[2], display => $$row[0].'.'.$$row[1] }; + $self->{global}->{total} += $$row[2] if defined($self->{table}->{$$row[0].'.'.$$row[1]}); } - - $self->{output}->display(); - $self->{output}->exit(); } 1; @@ -111,21 +120,29 @@ __END__ =head1 MODE -Check MySQL tables size. +Check AP status. =over 8 -=item B<--warning> +=item B<--filter-counters> -Threshold warning in bytes. +Only display some counters (regexp can be used). -=item B<--critical> +=item B<--filter-db> -Threshold critical in bytes. +Filter DB name (can be a regexp). -=item B<--db-table> +=item B<--filter-table> -Filter database and table to check (multiple: eg: --db-table centreon_storage.data_bin --db-table centreon_storage.logs) +Filter table name (can be a regexp). + +=item B<--warning-*> + +Set warning threshold for number of user. Can be : 'total', 'table' + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'total', 'table' =back From 5cf7bc5d59101f5f1dbb32b8383272f4a54e88e6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 24 Jan 2016 21:30:54 +0100 Subject: [PATCH 063/346] + enhance output --- centreon-plugins/centreon/plugins/templates/counter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/templates/counter.pm b/centreon-plugins/centreon/plugins/templates/counter.pm index 12bbf74b0..9ccd0394f 100644 --- a/centreon-plugins/centreon/plugins/templates/counter.pm +++ b/centreon-plugins/centreon/plugins/templates/counter.pm @@ -181,7 +181,7 @@ sub run_global { short_msg => "${prefix_output}${short_msg}${suffix_output}" ); } else { - $self->{output}->output_add(short_msg => "${prefix_output}${long_msg}${suffix_output}"); + $self->{output}->output_add(short_msg => "${prefix_output}${long_msg}${suffix_output}") if ($long_msg ne ''); } } From 7bb2aabc07585418ad77bf01d9f6a0af7cb24f81 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Sun, 24 Jan 2016 21:46:51 +0100 Subject: [PATCH 064/346] + fix help mode description --- centreon-plugins/database/mysql/mode/tablessize.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/database/mysql/mode/tablessize.pm b/centreon-plugins/database/mysql/mode/tablessize.pm index 1bc21020b..da2699bd9 100644 --- a/centreon-plugins/database/mysql/mode/tablessize.pm +++ b/centreon-plugins/database/mysql/mode/tablessize.pm @@ -120,7 +120,7 @@ __END__ =head1 MODE -Check AP status. +Check size of one (or more) table from one (or more) databases =over 8 From caa31d76dde31af711536ebe51a81731b4d5633c Mon Sep 17 00:00:00 2001 From: Yann Beulque Date: Mon, 25 Jan 2016 16:36:27 +0100 Subject: [PATCH 065/346] Update tablespaceusage.pm Add a spesific sql request for Oracle >= 11 The new sql request used Oracle View DBA_TABLESPACE_USAGE_METRICS Reduces the time of the request by the 20 large database --- .../database/oracle/mode/tablespaceusage.pm | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index a60016bdc..610381c06 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -29,10 +29,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $self->{version} = '1.0'; $options{options}->add_options(arguments => - { + { "warning:s" => { name => 'warning', }, "critical:s" => { name => 'critical', }, "filter:s" => { name => 'filter', }, @@ -67,7 +67,24 @@ sub run { $self->{sql}->connect(); my $query; - if ($self->{sql}->is_version_minimum(version => '9')) { + if ($self->{sql}->is_version_minimum(version => '11')) { + $query = q{ + SELECT + tum.tablespace_name "Tablespace", + t.status "Status", + t.contents "Type", + t.extent_management "Extent Mgmt", + tum.used_space*t.block_size bytes, + tum.tablespace_size*t.block_size bytes_max + FROM + DBA_TABLESPACE_USAGE_METRICS tum + INNER JOIN + dba_tablespaces t on tum.tablespace_name=t.tablespace_name + WHERE + t.contents<>'UNDO' + OR (t.contents='UNDO' AND t.tablespace_name =(SELECT value FROM v$parameter WHERE name='undo_tablespace')) + }; + } elsif ($self->{sql}->is_version_minimum(version => '9')) { $query = q{ SELECT a.tablespace_name "Tablespace", @@ -263,18 +280,24 @@ sub run { my ($name, $status, $type, $extentmgmt, $bytes, $bytes_max, $bytes_free) = @$row; next if (defined($self->{option_results}->{filter}) && $name !~ /$self->{option_results}->{filter}/); next if (defined($self->{option_results}->{skip}) && $status =~ /offline/i); - + if (!defined($bytes)) { # seems corrupted, cannot get value $self->{output}->output_add(severity => 'UNKNOWN', short_msg => sprintf("tbs '%s' cannot get data", $name)); next; } - + $status = lc $status; $type = lc $type; my ($percent_used, $percent_free, $used, $free, $size); - if ((!defined($bytes_max)) || ($bytes_max == 0)) { + if ($self->{sql}->is_version_minimum(version => '11')) { + $percent_used = $bytes / $bytes_max * 100; + $size = $bytes_max; + $free = $bytes_max - $bytes; + $used = $bytes; + } + elsif ((!defined($bytes_max)) || ($bytes_max == 0)) { $percent_used = ($bytes - $bytes_free) / $bytes * 100; $size = $bytes; $free = $bytes_free; @@ -306,7 +329,7 @@ sub run { min => 0, max => $size); } else { - my $exit_code = $self->{perfdata}->threshold_check(value => $percent_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my $exit_code = $self->{perfdata}->threshold_check(value => $percent_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit_code, short_msg => sprintf("tbs '%s' Used: %.2f%s (%.2f%%) Size: %.2f%s", $name, $used_value, $used_unit, $percent_used, $size_value, $size_unit)); From 552707add90ddf9f55ae5f00de9f5c49f7761d93 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 25 Jan 2016 17:02:53 +0100 Subject: [PATCH 066/346] + FIx indent --- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index 610381c06..14976bcd8 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -296,8 +296,7 @@ sub run { $size = $bytes_max; $free = $bytes_max - $bytes; $used = $bytes; - } - elsif ((!defined($bytes_max)) || ($bytes_max == 0)) { + } elsif ((!defined($bytes_max)) || ($bytes_max == 0)) { $percent_used = ($bytes - $bytes_free) / $bytes * 100; $size = $bytes; $free = $bytes_free; From 33fa104f9af077d51fba5ddcf8c07f1fabdf58b1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 27 Jan 2016 10:17:53 +0100 Subject: [PATCH 067/346] + Fix EMC navisphere disk mode: check last disk --- centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index 62bfd9baa..9bd8cbada 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -264,6 +264,9 @@ sub run { #Busy Ticks: 462350 #Idle Ticks: 388743630 #Raid Group ID: 0 + + # Add a "\n" for the end. + $response .= "\n"; while ($response =~ /^Bus\s+(\S+)\s+Enclosure\s+(\S+)\s+Disk\s+(\S+)(.*?)\n\n/msgi) { my $disk_instance = "$1_$2_$3"; my $values = $4; @@ -319,7 +322,6 @@ sub run { $critical = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'critical'); } - $self->{output}->output_add(long_msg => "Disk '$disk_instance':$long_msg"); $self->{output}->perfdata_add(label => $_ . '_' . $disk_instance, unit => $maps_counters->{$_}->{unit}, value => sprintf($maps_counters->{$_}->{perfdata}, $value_check), warning => $warning, @@ -327,6 +329,7 @@ sub run { min => 0); } + $self->{output}->output_add(long_msg => "Disk '$disk_instance':$long_msg"); $exit = $self->{output}->get_most_critical(status => [ @exits ]); if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { $self->{output}->output_add(severity => $exit, From 47c88194b33faca4510e765c0be6c51f8c795105 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 27 Jan 2016 10:39:23 +0100 Subject: [PATCH 068/346] + fix typo in error message --- .../common/powershell/exchange/2010/replicationhealth.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm b/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm index fe436d15c..2188505c1 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/2010/replicationhealth.pm @@ -89,7 +89,7 @@ sub check { } if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $status, - short_msg => sprintf("Replicatin test '%s' status on '%s' is '%s' [error: %s]", + short_msg => sprintf("Replication test '%s' status on '%s' is '%s' [error: %s]", $self->{data}->{check}, $self->{data}->{server}, $self->{data}->{result}, $self->{data}->{error})); } } @@ -108,4 +108,4 @@ __END__ Method to check Exchange 2010 queues. -=cut \ No newline at end of file +=cut From 3252ba28affabf0046a52abbe8aa79cac5ee1e66 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Jan 2016 13:26:44 +0100 Subject: [PATCH 069/346] + Fix #306 --- .../common/cisco/standard/snmp/mode/ipsla.pm | 697 ++++++++---------- .../centreon/plugins/templates/counter.pm | 3 +- 2 files changed, 304 insertions(+), 396 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm index 0f49960f9..8bcb53c07 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm @@ -20,286 +20,292 @@ package centreon::common::cisco::standard::snmp::mode::ipsla; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::statefile; -use centreon::plugins::values; use Digest::MD5 qw(md5_hex); use Math::Complex; -my $maps_counters = { - '000_status' => { class => 'centreon::plugins::values', obj => undef, threshold => 0, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, - { name => 'rttMonCtrlAdminTag' }, - { name => 'rttMonCtrlAdminRttType' }, - { name => 'rttMonCtrlAdminThreshold' }, - { name => 'rttMonEchoAdminPrecision' }, - { name => 'rttMonLatestRttOperCompletionTime' }, - { name => 'rttMonLatestRttOperSense' }, - { name => 'rttMonLatestRttOperApplSpecificSense' }, - ], - closure_custom_calc => \&custom_status_calc, - closure_custom_output => \&custom_status_output, - closure_custom_perfdata => \&custom_status_perfdata, - closure_custom_threshold_check => \&custom_status_threshold, - } - }, - '001_NumberOverThresholds' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'OverThresholds_1' }, { name => 'OverThresholds_2' }, { name => 'OverThresholds_times' }, - ], - closure_custom_calc => \&custom_NumberOverThresholds_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Number Over Thresholds : %s', - threshold_use => 'value', - perfdatas => [ - { label => 'number_over_thresholds', value => 'value', template => '%s', - label_extra_instance => 1 }, - ], - } - }, - '002_AverageDelaySD' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' }, - { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, - ], - closure_custom_calc => \&custom_AverageDelaySD_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Average Delay SD : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'average_delay_sd', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '003_AverageDelayDS' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' }, - { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, - ], - closure_custom_calc => \&custom_AverageDelayDS_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Average Delay DS : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'average_delay_ds', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '004_PacketLossRatio' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'PacketLossDS_1' }, { name => 'PacketLossDS_2' }, { name => 'PacketLossDS_times' }, - { name => 'PacketLossSD_1' }, { name => 'PacketLossSD_2' }, { name => 'PacketLossSD_times' }, - { name => 'PacketMIA_1' }, { name => 'PacketMIA_2' }, { name => 'PacketMIA_times' }, - { name => 'PacketLateArrival_1' }, { name => 'PacketLateArrival_2' }, { name => 'PacketLateArrival_times' }, - { name => 'PacketOutOfSequence_1' }, { name => 'PacketOutOfSequence_2' }, { name => 'PacketOutOfSequence_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - ], - closure_custom_calc => \&custom_PacketLossRatio_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Packet Loss Ratio : %.2f %%', - threshold_use => 'value', - perfdatas => [ - { label => 'packet_loss_ratio', value => 'value', template => '%.2f', unit => '%', - label_extra_instance => 1, min => 0, max => 100 }, - ], - } - }, - '005_PercentagePacketsPositiveJitter' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - ], - closure_custom_calc => \&custom_PercentagePacketsPositiveJitter_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Percentage of Packets that had Positive Jitter : %.2f', - threshold_use => 'value', - perfdatas => [ - { label => 'prct_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f', - label_extra_instance => 1, }, - ], - } - }, - '006_AverageJitterPerPacketPositiveJitter' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - ], - closure_custom_calc => \&custom_AverageJitterPerPacketPositiveJitter_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Average Jitter per Packet that had Positive Jitter : %.2f', - threshold_use => 'value', - perfdatas => [ - { label => 'average_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f', - label_extra_instance => 1 }, - ], - } - }, - '007_PercentagePacketsNegativeJitter' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - ], - closure_custom_calc => \&custom_PercentagePacketsNegativeJitter_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Percentage of Packets that had Negative Jitter : %.2f', - threshold_use => 'value', - perfdatas => [ - { label => 'prct_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f', - label_extra_instance => 1, }, - ], - } - }, - '008_AverageJitterPerPacketNegativeJitter' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - ], - closure_custom_calc => \&custom_AverageJitterPerPacketNegativeJitter_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Average Jitter per Packet that had Negative Jitter : %.2f', - threshold_use => 'value', - perfdatas => [ - { label => 'average_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f', - label_extra_instance => 1 }, - ], - } - }, - '009_AverageJitter' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' }, - { name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' }, - { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, - { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, - { name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' }, - { name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' }, - { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, - { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, - ], - closure_custom_calc => \&custom_AverageJitter_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Average Jitter : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'average_jitter', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '010_RTTStandardDeviation' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'RTTSum2High_1' }, { name => 'RTTSum2High_2' }, { name => 'RTTSum2High_times' }, - { name => 'RTTSum2Low_1' }, { name => 'RTTSum2Low_2' }, { name => 'RTTSum2Low_times' }, - { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, - { name => 'RTTSum_1' }, { name => 'RTTSum_2' }, { name => 'RTTSum_times' }, - ], - closure_custom_calc => \&custom_RTTStandardDeviation_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'Round-Trip Time Standard Deviation : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'rtt_standard_deviation', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '011_DelaySource2DestinationStandardDeviation' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'OWSum2SDHigh_1' }, { name => 'OWSum2SDHigh_2' }, { name => 'OWSum2SDHigh_times' }, - { name => 'OWSum2SDLow_1' }, { name => 'OWSum2SDLow_2' }, { name => 'OWSum2SDLow_times' }, - { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, - { name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' }, - ], - closure_custom_calc => \&custom_DelaySource2DestinationStandardDeviation_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'One-Way Delay Source to Destination Standard Deviation : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'delay_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - - '012_DelayDestination2SourceStandardDeviation' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'OWSum2DSHigh_1' }, { name => 'OWSum2DSHigh_2' }, { name => 'OWSum2DSHigh_times' }, - { name => 'OWSum2DSLow_1' }, { name => 'OWSum2DSLow_2' }, { name => 'OWSum2DSLow_times' }, - { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, - { name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' }, - ], - closure_custom_calc => \&custom_DelayDestination2SourceStandardDeviation_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'One-Way Delay Destination to Source Standard Deviation : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'delay_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '013_JitterSource2DestinationStandardDeviation' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'Sum2PositivesSDHigh_1' }, { name => 'Sum2PositivesSDHigh_2' }, { name => 'Sum2PositivesSDHigh_times' }, - { name => 'Sum2PositivesSDLow_1' }, { name => 'Sum2PositivesSDLow_2' }, { name => 'Sum2PositivesSDLow_times' }, - { name => 'Sum2NegativesSDHigh_1' }, { name => 'Sum2NegativesSDHigh_2' }, { name => 'Sum2NegativesSDHigh_times' }, - { name => 'Sum2NegativesSDLow_1' }, { name => 'Sum2NegativesSDLow_2' }, { name => 'Sum2NegativesSDLow_times' }, - { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, - { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, - { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, - { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, - ], - closure_custom_calc => \&custom_JitterSource2DestinationStandardDeviation_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'One-Way Jitter Source to Destination Standard Deviation : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'jitter_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, - '014_JitterDestination2SourceStandardDeviation' => { class => 'centreon::plugins::values', obj => undef, - set => { - key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, - { name => 'Sum2PositivesDSHigh_1' }, { name => 'Sum2PositivesDSHigh_2' }, { name => 'Sum2PositivesDSHigh_times' }, - { name => 'Sum2PositivesDSLow_1' }, { name => 'Sum2PositivesDSLow_2' }, { name => 'Sum2PositivesDSLow_times' }, - { name => 'Sum2NegativesDSHigh_1' }, { name => 'Sum2NegativesDSHigh_2' }, { name => 'Sum2NegativesDSHigh_times' }, - { name => 'Sum2NegativesDSLow_1' }, { name => 'Sum2NegativesDSLow_2' }, { name => 'Sum2NegativesDSLow_times' }, - { name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' }, - { name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' }, - { name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' }, - { name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' }, - ], - closure_custom_calc => \&custom_JitterDestination2SourceStandardDeviation_calc, - closure_custom_output => \&custom_generic_output, - output_template => 'One-Way Jitter Destination to Source Standard Deviation : %.2f ms', - threshold_use => 'value', - perfdatas => [ - { label => 'jitter_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms', - label_extra_instance => 1 }, - ], - } - }, -}; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'tag', type => 1, cb_prefix_output => 'prefix_tag_output', message_multiple => 'All RTT controls are ok', + skipped_code => { -2 => 1 } } + ]; + $self->{maps_counters}->{tag} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, + { name => 'rttMonCtrlAdminTag' }, + { name => 'rttMonCtrlAdminRttType' }, + { name => 'rttMonCtrlAdminThreshold' }, + { name => 'rttMonEchoAdminPrecision' }, + { name => 'rttMonLatestRttOperCompletionTime' }, + { name => 'rttMonLatestRttOperSense' }, + { name => 'rttMonLatestRttOperApplSpecificSense' }, + ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'CompletionTime', set => { + key_values => [ { name => 'rttMonLatestRttOperCompletionTime' }, { name => 'rttMonEchoAdminPrecision' }, { name => 'rttMonCtrlAdminTag' } + ], + output_template => 'Completion Time : %s', + perfdatas => [ + { label => 'completion_time', value => 'rttMonLatestRttOperCompletionTime_absolute', template => '%s', + min => 0, label_extra_instance => 1 }, + ], + } + }, + { label => 'NumberOverThresholds', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'OverThresholds_1' }, { name => 'OverThresholds_2' }, { name => 'OverThresholds_times' }, + ], + closure_custom_calc => $self->can('custom_NumberOverThresholds_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Number Over Thresholds : %s', + threshold_use => 'value', + perfdatas => [ + { label => 'number_over_thresholds', value => 'value', template => '%s', + label_extra_instance => 1 }, + ], + } + }, + { label => 'AverageDelaySD', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' }, + { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, + ], + closure_custom_calc => $self->can('custom_AverageDelaySD_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Average Delay SD : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'average_delay_sd', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'AverageDelayDS', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' }, + { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, + ], + closure_custom_calc => $self->can('custom_AverageDelayDS_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Average Delay DS : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'average_delay_ds', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'PacketLossRatio', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'PacketLossDS_1' }, { name => 'PacketLossDS_2' }, { name => 'PacketLossDS_times' }, + { name => 'PacketLossSD_1' }, { name => 'PacketLossSD_2' }, { name => 'PacketLossSD_times' }, + { name => 'PacketMIA_1' }, { name => 'PacketMIA_2' }, { name => 'PacketMIA_times' }, + { name => 'PacketLateArrival_1' }, { name => 'PacketLateArrival_2' }, { name => 'PacketLateArrival_times' }, + { name => 'PacketOutOfSequence_1' }, { name => 'PacketOutOfSequence_2' }, { name => 'PacketOutOfSequence_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + ], + closure_custom_calc => $self->can('custom_PacketLossRatio_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Packet Loss Ratio : %.2f %%', + threshold_use => 'value', + perfdatas => [ + { label => 'packet_loss_ratio', value => 'value', template => '%.2f', unit => '%', + label_extra_instance => 1, min => 0, max => 100 }, + ], + } + }, + { label => 'PercentagePacketsPositiveJitter', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + ], + closure_custom_calc => $self->can('custom_PercentagePacketsPositiveJitter_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Percentage of Packets that had Positive Jitter : %.2f', + threshold_use => 'value', + perfdatas => [ + { label => 'prct_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f', + label_extra_instance => 1, }, + ], + } + }, + { label => 'AverageJitterPerPacketPositiveJitter', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + ], + closure_custom_calc => $self->can('custom_AverageJitterPerPacketPositiveJitter_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Average Jitter per Packet that had Positive Jitter : %.2f', + threshold_use => 'value', + perfdatas => [ + { label => 'average_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f', + label_extra_instance => 1 }, + ], + } + }, + { label => 'PercentagePacketsNegativeJitter', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + ], + closure_custom_calc => $self->can('custom_PercentagePacketsNegativeJitter_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Percentage of Packets that had Negative Jitter : %.2f', + threshold_use => 'value', + perfdatas => [ + { label => 'prct_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f', + label_extra_instance => 1, }, + ], + } + }, + { label => 'AverageJitterPerPacketNegativeJitter', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + ], + closure_custom_calc => $self->can('custom_AverageJitterPerPacketNegativeJitter_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Average Jitter per Packet that had Negative Jitter : %.2f', + threshold_use => 'value', + perfdatas => [ + { label => 'average_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f', + label_extra_instance => 1 }, + ], + } + }, + { label => 'AverageJitter', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' }, + { name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' }, + { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, + { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, + { name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' }, + { name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' }, + { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, + { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, + ], + closure_custom_calc => $self->can('custom_AverageJitter_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Average Jitter : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'average_jitter', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'RTTStandardDeviation', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'RTTSum2High_1' }, { name => 'RTTSum2High_2' }, { name => 'RTTSum2High_times' }, + { name => 'RTTSum2Low_1' }, { name => 'RTTSum2Low_2' }, { name => 'RTTSum2Low_times' }, + { name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' }, + { name => 'RTTSum_1' }, { name => 'RTTSum_2' }, { name => 'RTTSum_times' }, + ], + closure_custom_calc => $self->can('custom_RTTStandardDeviation_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'Round-Trip Time Standard Deviation : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'rtt_standard_deviation', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'DelaySource2DestinationStandardDeviation', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'OWSum2SDHigh_1' }, { name => 'OWSum2SDHigh_2' }, { name => 'OWSum2SDHigh_times' }, + { name => 'OWSum2SDLow_1' }, { name => 'OWSum2SDLow_2' }, { name => 'OWSum2SDLow_times' }, + { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, + { name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' }, + ], + closure_custom_calc => $self->can('custom_DelaySource2DestinationStandardDeviation_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'One-Way Delay Source to Destination Standard Deviation : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'delay_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'DelayDestination2SourceStandardDeviation', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'OWSum2DSHigh_1' }, { name => 'OWSum2DSHigh_2' }, { name => 'OWSum2DSHigh_times' }, + { name => 'OWSum2DSLow_1' }, { name => 'OWSum2DSLow_2' }, { name => 'OWSum2DSLow_times' }, + { name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' }, + { name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' }, + ], + closure_custom_calc => $self->can('custom_DelayDestination2SourceStandardDeviation_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'One-Way Delay Destination to Source Standard Deviation : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'delay_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'JitterSource2DestinationStandardDeviation', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'Sum2PositivesSDHigh_1' }, { name => 'Sum2PositivesSDHigh_2' }, { name => 'Sum2PositivesSDHigh_times' }, + { name => 'Sum2PositivesSDLow_1' }, { name => 'Sum2PositivesSDLow_2' }, { name => 'Sum2PositivesSDLow_times' }, + { name => 'Sum2NegativesSDHigh_1' }, { name => 'Sum2NegativesSDHigh_2' }, { name => 'Sum2NegativesSDHigh_times' }, + { name => 'Sum2NegativesSDLow_1' }, { name => 'Sum2NegativesSDLow_2' }, { name => 'Sum2NegativesSDLow_times' }, + { name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' }, + { name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' }, + { name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' }, + { name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' }, + ], + closure_custom_calc => $self->can('custom_JitterSource2DestinationStandardDeviation_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'One-Way Jitter Source to Destination Standard Deviation : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'jitter_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + { label => 'JitterDestination2SourceStandardDeviation', set => { + key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' }, + { name => 'Sum2PositivesDSHigh_1' }, { name => 'Sum2PositivesDSHigh_2' }, { name => 'Sum2PositivesDSHigh_times' }, + { name => 'Sum2PositivesDSLow_1' }, { name => 'Sum2PositivesDSLow_2' }, { name => 'Sum2PositivesDSLow_times' }, + { name => 'Sum2NegativesDSHigh_1' }, { name => 'Sum2NegativesDSHigh_2' }, { name => 'Sum2NegativesDSHigh_times' }, + { name => 'Sum2NegativesDSLow_1' }, { name => 'Sum2NegativesDSLow_2' }, { name => 'Sum2NegativesDSLow_times' }, + { name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' }, + { name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' }, + { name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' }, + { name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' }, + ], + closure_custom_calc => $self->can('custom_JitterDestination2SourceStandardDeviation_calc'), + closure_custom_output => $self->can('custom_generic_output'), + output_template => 'One-Way Jitter Destination to Source Standard Deviation : %.2f ms', + threshold_use => 'value', + perfdatas => [ + { label => 'jitter_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms', + label_extra_instance => 1 }, + ], + } + }, + ]; +} + +sub prefix_tag_output { + my ($self, %options) = @_; + + return "RTT '" . $options{instance_value}->{rttMonCtrlAdminTag} . "' "; +} my $ipsla; my $thresholds = { @@ -348,18 +354,6 @@ sub check_buffer_creation { ###### STATUS ###### -sub custom_status_perfdata { - my ($self, %options) = @_; - - my $extra_label = ''; - if (!defined($options{extra_instance}) || $options{extra_instance} != 0) { - $extra_label .= '_' . $self->{result_values}->{rttMonCtrlAdminTag}; - } - $self->{output}->perfdata_add(label => 'completion_time' . $extra_label, unit => $self->{result_values}->{rttMonEchoAdminPrecision}, - value => $self->{result_values}->{rttMonLatestRttOperCompletionTime}, - min => 0); -} - sub custom_status_threshold { my ($self, %options) = @_; my $status = 'ok'; @@ -803,31 +797,16 @@ my $mapping3 = { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "filter-tag:s" => { name => 'filter_tag', default => '.*' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, + "filter-tag:s" => { name => 'filter_tag', default => '.*' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, }); - $self->{statefile_value} = centreon::plugins::statefile->new(%options); - foreach (keys %{$maps_counters}) { - my ($id, $name) = split /_/; - if (!defined($maps_counters->{$_}->{threshold}) || $maps_counters->{$_}->{threshold} != 0) { - $options{options}->add_options(arguments => { - 'warning-' . $name . ':s' => { name => 'warning-' . $name }, - 'critical-' . $name . ':s' => { name => 'critical-' . $name }, - }); - } - my $class = $maps_counters->{$_}->{class}; - $maps_counters->{$_}->{obj} = $class->new(statefile => $self->{statefile_value}, - output => $self->{output}, perfdata => $self->{perfdata}, - label => $name); - $maps_counters->{$_}->{obj}->set(%{$maps_counters->{$_}->{set}}); - } return $self; } @@ -835,10 +814,6 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - foreach (keys %{$maps_counters}) { - next if (defined($maps_counters->{$_}->{threshold}) && $maps_counters->{$_}->{threshold} == 0); - $maps_counters->{$_}->{obj}->init(option_results => $self->{option_results}); - } $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { @@ -854,94 +829,26 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } - $self->{statefile_value}->check_options(%options); # to be used on custom function $ipsla = $self; } -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - $self->{hostname} = $self->{snmp}->get_hostname(); - $self->{snmp_port} = $self->{snmp}->get_port(); - - $self->manage_selection(); - - $self->{new_datas} = {}; - $self->{statefile_value}->read(statefile => "cache_cisco_" . $self->{hostname} . '_' . $self->{snmp_port} . '_' . $self->{mode} . '_' . - (defined($self->{option_results}->{filter_tag}) ? md5_hex($self->{option_results}->{filter_tag}) : md5_hex('all'))); - $self->{new_datas}->{last_timestamp} = time(); - - my $multiple = 1; - if (scalar(keys %{$self->{datas}}) == 1) { - $multiple = 0; - } - - if ($multiple == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'All RTT controls are ok'); - } - - foreach my $id (sort keys %{$self->{datas}}) { - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits; - foreach (sort keys %{$maps_counters}) { - $maps_counters->{$_}->{obj}->set(instance => $id); - - my ($value_check) = $maps_counters->{$_}->{obj}->execute(values => $self->{datas}->{$id}, - new_datas => $self->{new_datas}); - next if ($value_check == -2); - if ($value_check != 0) { - $long_msg .= $long_msg_append . $maps_counters->{$_}->{obj}->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $maps_counters->{$_}->{obj}->threshold_check(); - push @exits, $exit2; - - my $output = $maps_counters->{$_}->{obj}->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $maps_counters->{$_}->{obj}->perfdata(extra_instance => $multiple); - } - - $self->{output}->output_add(long_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $long_msg"); - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $short_msg" - ); - } - - if ($multiple == 0) { - $self->{output}->output_add(short_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $long_msg"); - } - } - - $self->{statefile_value}->write(data => $self->{new_datas}); - $self->{output}->display(); - $self->{output}->exit(); -} - sub manage_selection { my ($self, %options) = @_; - $self->{results} = $self->{snmp}->get_multiple_table(oids => [ { oid => $oid_rttMonCtrlAdminEntry }, + $self->{cache_name} = "cache_cisco_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_tag}) ? md5_hex($self->{option_results}->{filter_tag}) : md5_hex('all')) . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_rttMonCtrlAdminEntry }, { oid => $oid_rttMonEchoAdminPrecision }, { oid => $oid_rttMonLatestRttOperEntry }, { oid => $oid_rttMonJitterStatsEntry }, ], - nothing_quit => 1); + nothing_quit => 1); - $self->{datas} = {}; - foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonCtrlAdminEntry}})) { + $self->{tag} = {}; + foreach my $oid ($options{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonCtrlAdminEntry}})) { next if ($oid !~ /^$mapping->{rttMonCtrlAdminTag}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rttMonCtrlAdminEntry}, instance => $instance); @@ -950,7 +857,7 @@ sub manage_selection { $self->{output}->output_add(long_msg => "skipping: please set a tag name"); next; } - if (defined($self->{datas}->{$tag_name})) { + if (defined($self->{tag}->{$tag_name})) { $self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': duplicate (please change the tag name)."); next; } @@ -959,29 +866,29 @@ sub manage_selection { $self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': no matching filter."); next; } - $self->{datas}->{$tag_name} = { %{$result} }; + $self->{tag}->{$tag_name} = { %{$result} }; $result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_rttMonEchoAdminPrecision}, instance => $instance); - $self->{datas}->{$tag_name} = { %{$result}, %{$self->{datas}->{$tag_name}} }; + $self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} }; $result = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_rttMonLatestRttOperEntry}, instance => $instance); - $self->{datas}->{$tag_name} = { %{$result}, %{$self->{datas}->{$tag_name}} }; + $self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} }; # there are two entries with rotation: 1 -> last hour, 2 -> current hour. foreach my $key (keys %{$oids_jitter_stats}) { - $self->{datas}->{$tag_name}->{$key . '_1'} = 0; - $self->{datas}->{$tag_name}->{$key . '_2'} = 0; + $self->{tag}->{$tag_name}->{$key . '_1'} = 0; + $self->{tag}->{$tag_name}->{$key . '_2'} = 0; my $i = 1; my $instances = []; foreach my $oid2 ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonJitterStatsEntry}})) { next if ($oid2 !~ /^$oids_jitter_stats->{$key}\.$instance.(\d+)/); push @{$instances}, $1; - $self->{datas}->{$tag_name}->{$key . '_' . $i} = $self->{results}->{$oid_rttMonJitterStatsEntry}->{$oid2}; + $self->{tag}->{$tag_name}->{$key . '_' . $i} = $self->{results}->{$oid_rttMonJitterStatsEntry}->{$oid2}; $i++; } - $self->{datas}->{$tag_name}->{$key . '_times'} = join('_', @{$instances}); + $self->{tag}->{$tag_name}->{$key . '_times'} = join('_', @{$instances}); } } - if (scalar(keys %{$self->{datas}}) <= 0) { + if (scalar(keys %{$self->{tag}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No entry found."); $self->{output}->option_exit(); } @@ -1032,7 +939,7 @@ Example: --threshold-overload='opersense,CRITICAL,^(?!(ok)$)' =item B<--warning-*> Threshold warning. -Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio', +Can be: 'CompletionTime', 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio', 'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter', 'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation', 'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'. @@ -1040,7 +947,7 @@ Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossR =item B<--critical-*> Threshold critical. -Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio', +Can be: 'CompletionTime', 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio', 'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter', 'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation', 'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'. diff --git a/centreon-plugins/centreon/plugins/templates/counter.pm b/centreon-plugins/centreon/plugins/templates/counter.pm index 9ccd0394f..dff402983 100644 --- a/centreon-plugins/centreon/plugins/templates/counter.pm +++ b/centreon-plugins/centreon/plugins/templates/counter.pm @@ -146,6 +146,7 @@ sub run_global { my ($value_check) = $obj->execute(new_datas => $self->{new_datas}, values => $self->{$options{config}->{name}}); + next if (defined($options{config}->{skipped_code}) && defined($options{config}->{skipped_code}->{$value_check})); if ($value_check != 0) { $long_msg .= $long_msg_append . $obj->output_error(); $long_msg_append = $message_separator; @@ -215,7 +216,7 @@ sub run_instances { my ($value_check) = $obj->execute(new_datas => $self->{new_datas}, values => $self->{$options{config}->{name}}->{$id}); - + next if (defined($options{config}->{skipped_code}) && defined($options{config}->{skipped_code}->{$value_check})); if ($value_check != 0) { $long_msg .= $long_msg_append . $obj->output_error(); $long_msg_append = $message_separator; From f9f8ad0b97c7980a5f6568fb9070820d1253ef71 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 29 Jan 2016 14:05:08 +0100 Subject: [PATCH 070/346] + add video qoe mode for lync --- .../apps/lync/2013/mssql/mode/videoqoe.pm | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/videoqoe.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/videoqoe.pm b/centreon-plugins/apps/lync/2013/mssql/mode/videoqoe.pm new file mode 100644 index 000000000..96cc688ac --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/videoqoe.pm @@ -0,0 +1,152 @@ +package apps::lync::2013::mssql::mode::videoqoe; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'video_post_fecplr', type => 0 }, + { name => 'video_local_frame_loss_prct_avg', type => 0 }, + { name => 'recv_frame_rate_avg', type => 0 }, + { name => 'video_packet_loss_rate', type => 0 }, + { name => 'inbound_video_frame_rate_avg', type => 0 }, + { name => 'outbound_video_frame_rate_avg', type => 0 }, + ]; + + $self->{maps_counters}->{video_post_fecplr} = [ + { label => 'post-fecplr', set => { + key_values => [ { name => 'value' } ], + output_template => 'VideoPostFECPLR : %d', + perfdatas => [ + { label => 'video_post_fecplr', value => 'value_absolute', template => '%d', + unit => '', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{video_local_frame_loss_prct_avg} = [ + { label => 'local-frame-loss', set => { + key_values => [ { name => 'value' } ], + output_template => 'VideoLocalFrameLossPercentageAvg : %d', + perfdatas => [ + { label => 'video_frame_loss_prct_avg', value => 'value_absolute', template => '%d', + unit => '', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{recv_frame_rate_avg} = [ + { label => 'recv-frame', set => { + key_values => [ { name => 'value' } ], + output_template => 'RecvFrameRateAverage : %d', + perfdatas => [ + { label => 'rcv_frame_rate_avg', value => 'value_absolute', template => '%d', + unit => '', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{video_packet_loss_rate} = [ + { label => 'packet-loss', set => { + key_values => [ { name => 'value' } ], + output_template => 'video_packet_loss_rate : %.2f%%', + perfdatas => [ + { label => 'video_pckt_loss_rate', value => 'value_absolute', template => '%.2f', + unit => '%', min => 0, max => 100, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{inbound_video_frame_rate_avg} = [ + { label => 'inbound-frame', set => { + key_values => [ { name => 'value' } ], + output_template => 'inbound_video_frame_rate_avg : %.2f%%', + perfdatas => [ + { label => 'inbound_video_frame_rate_avg', value => 'value_absolute', template => '%.2f', + unit => '%', min => 0, max => 100, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{outbound_video_frame_rate_avg} = [ + { label => 'outbound-frame', set => { + key_values => [ { name => 'value' } ], + output_template => 'outbound_video_frame_rate_avg : %.2f%%', + perfdatas => [ + { label => 'outbound_video_frame_rate_avg', value => 'value_absolute', template => '%.2f', + unit => '%', min => 0, max => 100, label_extra_instance => 0 }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + $self->{sql}->query(query => q{select avg(VideoPostFECPLR) + ,avg(VideoLocalFrameLossPercentageAvg) + ,avg(RecvFrameRateAverage) + ,avg(VideoPacketLossRate) + ,avg(InboundVideoFrameRateAvg) + ,avg(OutboundVideoFrameRateAvg) + from [QoEMetrics].[dbo].VideoStream + } + ); + + my ($video_post_fecplr, $video_local_frame_loss_prct_avg, $recv_frame_rate_avg, + $video_packet_loss_rate, $inbound_video_frame_rate_avg, $outbound_video_frame_rate_avg) = $self->{sql}->fetchrow_array(); + + $self->{video_post_fecplr} = { value => $video_post_fecplr }; + $self->{video_local_frame_loss_prct_avg} = { value => $video_local_frame_loss_prct_avg }; + $self->{recv_frame_rate_avg} = { value => $recv_frame_rate_avg }; + $self->{video_packet_loss_rate} = { value => $video_packet_loss_rate }; + $self->{inbound_video_frame_rate_avg} = { value => $inbound_video_frame_rate_avg }; + $self->{outbound_video_frame_rate_avg} = { value => $outbound_video_frame_rate_avg }; + +} + +1; + +__END__ + +=head1 MODE + +Check video metrics QoE from SQL Server Lync Database [QoEMetrics].[dbo].VideoStream + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--warning-*> + +Set warning threshold for QoE metrics. Can be : 'recv-frame', 'local-frame-loss', 'post-fecplr', ''packet-loss', 'inboud-frame', 'outbound-frame' + +=item B<--critical-*> + +Set critical threshold for QoE. Can be : 'recv-frame', 'local-frame-loss', 'post-fecplr', ''packet-loss', 'inboud-frame', 'outbound-frame' + +=back + +=cut From c1769dfdf31b91682d75febbc1aea1f54e5e78a8 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 29 Jan 2016 14:06:54 +0100 Subject: [PATCH 071/346] + add sessionstypes.pm mode for lync check number of sessions (video,audio,instant messaging...) --- .../lync/2013/mssql/mode/sessionstypes.pm | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/sessionstypes.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/sessionstypes.pm b/centreon-plugins/apps/lync/2013/mssql/mode/sessionstypes.pm new file mode 100644 index 000000000..8ad9703d2 --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/sessionstypes.pm @@ -0,0 +1,181 @@ +# +# Copyright 2016 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 apps::lync::2013::mssql::mode::sessionstypes; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'instant_messaging', type => 0 }, + { name => 'file_transfer', type => 0 }, + { name => 'remote_assistance', type => 0 }, + { name => 'app_sharing', type => 0 }, + { name => 'audio', type => 0 }, + { name => 'video', type => 0 }, + { name => 'app_invite', type => 0 }, + ]; + + $self->{maps_counters}->{instant_messaging} = [ + { label => 'instant-messaging', set => { + key_values => [ { name => 'value' } ], + output_template => 'Instant Messaging : %d', + perfdatas => [ + { label => 'instant_messaging', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{file_transfer} = [ + { label => 'file-transfer', set => { + key_values => [ { name => 'value' } ], + output_template => 'File transfer : %d', + perfdatas => [ + { label => 'file_transfer', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{remote_assistance} = [ + { label => 'remote-assistance', set => { + key_values => [ { name => 'value' } ], + output_template => 'Remote assistance : %d', + perfdatas => [ + { label => 'remote_assistance', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{app_sharing} = [ + { label => 'app-sharing', set => { + key_values => [ { name => 'value' } ], + output_template => 'App Sharing : %d', + perfdatas => [ + { label => 'app_sharing', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{audio} = [ + { label => 'audio', set => { + key_values => [ { name => 'value' } ], + output_template => 'Audio : %d', + perfdatas => [ + { label => 'audio', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{video} = [ + { label => 'video', set => { + key_values => [ { name => 'value' } ], + output_template => 'Video : %d', + perfdatas => [ + { label => 'video', value => 'value_absolute', template => '%d', + unit => 'sessions', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + 'lookback:s' => { name => 'lookback', default => '5' }, + }); + return $self; +} + +my %mapping_types = ( + 1 => 'instant_messaging', + 2 => 'file_transfer', + 4 => 'remote_assistance', + 8 => 'app_sharing', + 16 => 'audio', + 32 => 'video', + 64 => 'app_invite', +); + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + foreach my $bit (keys %mapping_types) { + my $query = "SELECT count(*) + FROM [LcsCDR].[dbo].[SessionDetails] s + left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId + WHERE MediaTypes=".$bit." + AND s.SessionIdTime>=dateadd(minute,-".$self->{option_results}->{lookback}.",getdate())"; + + $self->{sql}->query(query => $query); + my $value = $self->{sql}->fetchrow_array(); + $self->{$mapping_types{$bit}} = { value => $value }; + } + +} + +1; + +__END__ + +=head1 MODE + +Check number of sessions ordered by type during last X minutes + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--lookback> + +Minutes to lookback (From you to UTC) + +=item B<--warning-*> + +Set warning threshold Can be : 'instant-messaging', 'app-sharing', 'audio', 'video', 'app-invite', 'remote-assistance' + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'instant-messaging', 'app-sharing', 'audio', 'video', 'app-invite', 'remote-assistance' + +=back + +=cut From 693b5f42bac0cdee894c79d55b94af41a5a31008 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 29 Jan 2016 14:09:18 +0100 Subject: [PATCH 072/346] + add audioqoe.pm mode --- .../apps/lync/2013/mssql/mode/audioqoe.pm | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/audioqoe.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/audioqoe.pm b/centreon-plugins/apps/lync/2013/mssql/mode/audioqoe.pm new file mode 100644 index 000000000..2e8f9895b --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/audioqoe.pm @@ -0,0 +1,172 @@ +# +# Copyright 2016 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 apps::lync::2013::mssql::mode::audioqoe; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'jittermin', type => 0 }, + { name => 'jittermax', type => 0 }, + { name => 'jitteravg', type => 0 }, + { name => 'pcktlossmin', type => 0 }, + { name => 'pcktlossmax', type => 0 }, + { name => 'pcktlossavg', type => 0 }, + ]; + + $self->{maps_counters}->{jittermin} = [ + { label => 'jitter-min', set => { + key_values => [ { name => 'min' } ], + output_template => 'Jitter(Min) : %d ms', + perfdatas => [ + { label => 'jitter_min', value => 'min_absolute', template => '%d', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{jittermax} = [ + { label => 'jitter-max', set => { + key_values => [ { name => 'max' } ], + output_template => 'Jitter(Max) : %d ms', + perfdatas => [ + { label => 'jitter_max', value => 'max_absolute', template => '%d', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{jitteravg} = [ + { label => 'jitter-avg', set => { + key_values => [ { name => 'avg' } ], + output_template => 'Jitter(Avg) : %d ms', + perfdatas => [ + { label => 'jitter_avg', value => 'avg_absolute', template => '%d', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{pcktlossmin} = [ + { label => 'loss-min', set => { + key_values => [ { name => 'min' } ], + output_template => 'Packet-loss(Min) : %.2f%%', + perfdatas => [ + { label => 'pckt_loss_min', value => 'min_absolute', template => '%.2f', + unit => '%', min => 0, max => 100, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{pcktlossmax} = [ + { label => 'loss-max', set => { + key_values => [ { name => 'max' } ], + output_template => 'Packet-loss(Max) : %.2f%%', + perfdatas => [ + { label => 'pckt_loss_max', value => 'max_absolute', template => '%.2f', + unit => '%', min => 0, max => 100 }, + ], + } + }, + ]; + $self->{maps_counters}->{pcktlossavg} = [ + { label => 'loss-avg', set => { + key_values => [ { name => 'avg' } ], + output_template => 'Packet-loss(Avg) : %.2f%%', + perfdatas => [ + { label => 'pckt_loss_avg', value => 'avg_absolute', template => '%.2f', + unit => '%', min => 0, max => 100, label_extra_instance => 0 }, + ], + } + }, + ]; + +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + $self->{sql}->query(query => q{select min(cast(JitterInterArrival as bigint)) as JitterMin, + max(cast(JitterInterArrival as bigint)) as JitterMax, + avg(cast(JitterInterArrival as bigint)) as JitterAvg, + min(PacketLossRate) as PacketLossMin, + max(PacketLossRate) as PacketLossMax, + avg(PacketLossRate) as PacketLossRateAvg + from [QoEMetrics].[dbo].AudioStream + } + ); + + my ($jittermin, $jittermax, $jitteravg, $pcktlossmin, $pcktlossmax, $pcktlossavg) = $self->{sql}->fetchrow_array(); + + $self->{jittermin} = { min => $jittermin }; + $self->{jittermax} = { max => $jittermax }; + $self->{jitteravg} = { avg => $jitteravg }; + $self->{pcktlossmin} = { min => $pcktlossmin }; + $self->{pcktlossmax} = { max => $pcktlossmax }; + $self->{pcktlossavg} = { avg => $pcktlossavg }; + +} + +1; + +__END__ + +=head1 MODE + +Check audio metrics QoE from SQL Server Lync Database [QoEMetrics].[dbo].AudioStream + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--warning-*> + +Set warning threshold for number of user. Can be : 'jitter-min', 'jitter-max', 'jitter-avg', 'loss-min', 'loss-max', 'loss-avg' + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'jitter-min', 'jitter-max', 'jitter-avg', 'loss-min', 'loss-max', 'loss-avg' + +=back + +=cut From 331bc1a3caf50bbebdc5d7d475c0a74332da1cfc Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 29 Jan 2016 14:10:37 +0100 Subject: [PATCH 073/346] + add appsharingqoe.pm mode for lync --- .../lync/2013/mssql/mode/appsharingqoe.pm | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/appsharingqoe.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/appsharingqoe.pm b/centreon-plugins/apps/lync/2013/mssql/mode/appsharingqoe.pm new file mode 100644 index 000000000..87e15beea --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/appsharingqoe.pm @@ -0,0 +1,134 @@ +# +# Copyright 2016 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 apps::lync::2013::mssql::mode::appsharingqoe; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'spoiled_tile_prct_total_avg', type => 0 }, + { name => 'rdp_tile_processing_latency_avg', type => 0 }, + { name => 'relative_one_way_average', type => 0 }, + ]; + + $self->{maps_counters}->{spoiled_tile_prct_total_avg} = [ + { label => 'spoiled-tile-prct-total-avg', set => { + key_values => [ { name => 'value' } ], + output_template => 'SpoiledTilePercentTotal(Avg) : %.2f ms', + perfdatas => [ + { label => 'spoiled_tile_prct_total_avg', value => 'value_absolute', template => '%.2f', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + + $self->{maps_counters}->{rdp_tile_processing_latency_avg} = [ + { label => 'rdp-tile-processing-latency-avg', set => { + key_values => [ { name => 'value' } ], + output_template => 'RDPTileProcessingLatencyAverage : %.2f ms', + perfdatas => [ + { label => 'rdp_tile_processing_latency_avg', value => 'value_absolute', template => '%.2f', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{relative_one_way_average} = [ + { label => 'relative-one-way-average', set => { + key_values => [ { name => 'value' } ], + output_template => 'RelativeOneWayAverage : %.2f ms', + perfdatas => [ + { label => 'relative_one_way_average', value => 'value_absolute', template => '%.2f', + unit => 'ms', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + $self->{sql}->query(query => q{SELECT avg(SpoiledTilePercentTotal) + ,avg(RDPTileProcessingLatencyAverage) + ,avg(RelativeOneWayAverage) + FROM [QoEMetrics].[dbo].AppSharingStream}); + + my ($spoiled_tile_prct_total_avg, $rdp_tile_processing_latency_avg, $relative_one_way_average) = $self->{sql}->fetchrow_array(); + + $self->{spoiled_tile_prct_total_avg} = { value => $spoiled_tile_prct_total_avg }; + $self->{rdp_tile_processing_latency_avg} = { value => $rdp_tile_processing_latency_avg }; + $self->{relative_one_way_average} = { value => $relative_one_way_average }; + +} + +1; + +__END__ + +=head1 MODE + +Check AppSharing Qoe metrics from SQL Server Lync 2013 Database ([QoEMetrics].[dbo].AppSharingStream) + +MS Recommandations : + +SpoiledTilePercentTotal (Total percentage of the content that did not reach the viewer but was instead discarded and overwritten by fresh content) > 36 +RDPTileProcessingLatencyAverage (Average processing time for remote desktop protocol (RDP) tiles. A higher total equates to a longer delay in the viewing experience) > 400 +RelativeOneWayAverage (Average amount of one-way latency. Relative one-way latency measures the delay between the client and the server) > 1.75 + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--warning-*> + +Set warning threshold for number of user. Can be : 'spoiled-tile-prct-total-avg', 'rdp-tile-processing-latency-avg', 'relative-one-way-average' + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'spoiled-tile-prct-total-avg', 'rdp-tile-processing-latency-avg', 'relative-one-way-average' + +=back + +=cut From 1ddbfc6aab8ac62719ea0ed586eeba702376c338 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Jan 2016 14:44:40 +0100 Subject: [PATCH 074/346] Ref #306 --- .../centreon/common/cisco/standard/snmp/mode/ipsla.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm index 8bcb53c07..dd2f67ebd 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm @@ -851,7 +851,7 @@ sub manage_selection { foreach my $oid ($options{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonCtrlAdminEntry}})) { next if ($oid !~ /^$mapping->{rttMonCtrlAdminTag}->{oid}\.(.*)$/); my $instance = $1; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rttMonCtrlAdminEntry}, instance => $instance); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rttMonCtrlAdminEntry}, instance => $instance); my $tag_name = $result->{rttMonCtrlAdminTag}; if (!defined($tag_name) || $tag_name eq '') { $self->{output}->output_add(long_msg => "skipping: please set a tag name"); @@ -867,9 +867,9 @@ sub manage_selection { next; } $self->{tag}->{$tag_name} = { %{$result} }; - $result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_rttMonEchoAdminPrecision}, instance => $instance); + $result = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_rttMonEchoAdminPrecision}, instance => $instance); $self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} }; - $result = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_rttMonLatestRttOperEntry}, instance => $instance); + $result = $options{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_rttMonLatestRttOperEntry}, instance => $instance); $self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} }; # there are two entries with rotation: 1 -> last hour, 2 -> current hour. @@ -878,7 +878,7 @@ sub manage_selection { $self->{tag}->{$tag_name}->{$key . '_2'} = 0; my $i = 1; my $instances = []; - foreach my $oid2 ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonJitterStatsEntry}})) { + foreach my $oid2 ($options{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonJitterStatsEntry}})) { next if ($oid2 !~ /^$oids_jitter_stats->{$key}\.$instance.(\d+)/); push @{$instances}, $1; $self->{tag}->{$tag_name}->{$key . '_' . $i} = $self->{results}->{$oid_rttMonJitterStatsEntry}->{$oid2}; From 166c702c032a09727ad7789d245458bddfe89696 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Jan 2016 15:16:26 +0100 Subject: [PATCH 075/346] + Fix indent --- centreon-plugins/centreon/plugins/statefile.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/centreon/plugins/statefile.pm b/centreon-plugins/centreon/plugins/statefile.pm index 8d4b50296..e77be2031 100644 --- a/centreon-plugins/centreon/plugins/statefile.pm +++ b/centreon-plugins/centreon/plugins/statefile.pm @@ -82,12 +82,12 @@ sub check_options { } sub error { - my ($self) = shift; + my ($self) = shift; - if (@_) { + if (@_) { $self->{error} = $_[0]; - } - return $self->{error}; + } + return $self->{error}; } sub read { From a3db0880fde2107ea0c440413009a45d7cd8d3b4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Jan 2016 15:48:41 +0100 Subject: [PATCH 076/346] + Fix parent call method --- .../centreon/common/airespace/snmp/mode/apstatus.pm | 2 +- .../centreon/common/cisco/standard/snmp/mode/ipsla.pm | 2 +- centreon-plugins/centreon/plugins/templates/counter.pm | 2 +- centreon-plugins/docs/en/developer/guide.rst | 2 +- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 2 +- centreon-plugins/network/f5/bigip/mode/nodestatus.pm | 2 +- centreon-plugins/network/f5/bigip/mode/poolstatus.pm | 2 +- centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm | 2 +- centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm | 2 +- centreon-plugins/storage/emc/DataDomain/mode/replication.pm | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm index 109ec3f6f..0034f233a 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm @@ -140,7 +140,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; $self->change_macros(); diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm index dd2f67ebd..ea714dc03 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/ipsla.pm @@ -812,7 +812,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { diff --git a/centreon-plugins/centreon/plugins/templates/counter.pm b/centreon-plugins/centreon/plugins/templates/counter.pm index dff402983..ef7961376 100644 --- a/centreon-plugins/centreon/plugins/templates/counter.pm +++ b/centreon-plugins/centreon/plugins/templates/counter.pm @@ -116,7 +116,7 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - foreach my $key (keys %{$self->{maps_counters}}) { + foreach my $key (keys %{$self->{maps_counters}}) { foreach (@{$self->{maps_counters}->{$key}}) { $_->{obj}->init(option_results => $self->{option_results}); } diff --git a/centreon-plugins/docs/en/developer/guide.rst b/centreon-plugins/docs/en/developer/guide.rst index b52ada7da..edffa0f57 100644 --- a/centreon-plugins/docs/en/developer/guide.rst +++ b/centreon-plugins/docs/en/developer/guide.rst @@ -2097,7 +2097,7 @@ The model can also be used to check strings (not only counters). So we want to c sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); # Sometimes, you'll need to have access of the current object in the callback $instance_mode = $self; diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index bc506f479..ac8508919 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -151,7 +151,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; $self->change_macros(); diff --git a/centreon-plugins/network/f5/bigip/mode/nodestatus.pm b/centreon-plugins/network/f5/bigip/mode/nodestatus.pm index bacbd7330..7d38da636 100644 --- a/centreon-plugins/network/f5/bigip/mode/nodestatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/nodestatus.pm @@ -92,7 +92,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; diff --git a/centreon-plugins/network/f5/bigip/mode/poolstatus.pm b/centreon-plugins/network/f5/bigip/mode/poolstatus.pm index 389c57829..0ee40101d 100644 --- a/centreon-plugins/network/f5/bigip/mode/poolstatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/poolstatus.pm @@ -92,7 +92,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; diff --git a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm index 416f40ed9..b425a2b5f 100644 --- a/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm +++ b/centreon-plugins/network/f5/bigip/mode/virtualserverstatus.pm @@ -92,7 +92,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm index b18d1693d..c2684dadd 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apstatus.pm @@ -119,7 +119,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; $self->change_macros(); diff --git a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm index ca306b66e..3b69e7eaf 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm @@ -118,7 +118,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $instance_mode = $self; $self->change_macros(); From e0b3ea9e7d7bc3a2c64c79cf8f5cb64fa34272a2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Jan 2016 16:00:09 +0100 Subject: [PATCH 077/346] + remove old lync (use new one) --- centreon-plugins/apps/lync/mode/imsessions.pm | 105 ------------- centreon-plugins/apps/lync/mode/lyncusers.pm | 148 ------------------ .../apps/lync/mode/remoteassistance.pm | 105 ------------- .../apps/lync/mode/sessionstype.pm | 142 ----------------- 4 files changed, 500 deletions(-) delete mode 100644 centreon-plugins/apps/lync/mode/imsessions.pm delete mode 100644 centreon-plugins/apps/lync/mode/lyncusers.pm delete mode 100644 centreon-plugins/apps/lync/mode/remoteassistance.pm delete mode 100644 centreon-plugins/apps/lync/mode/sessionstype.pm diff --git a/centreon-plugins/apps/lync/mode/imsessions.pm b/centreon-plugins/apps/lync/mode/imsessions.pm deleted file mode 100644 index fd941d27c..000000000 --- a/centreon-plugins/apps/lync/mode/imsessions.pm +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright 2016 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 apps::lync::mode::imsessions; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{sql} = sqlmode object - $self->{sql} = $options{sql}; - - $self->{sql}->connect(); - $self->{sql}->query(query => q{SELECT count(*) - FROM [LcsCDR].[dbo].[SessionDetails] s - left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId - WHERE (MediaTypes & 1)=1 - AND s.SessionIdTime>=dateadd(minute,-5,getdate())} - ); - my $im_sessions = $self->{sql}->fetchrow_array(); - - my $exit_code = $self->{perfdata}->threshold_check(value => $im_sessions, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("%i instant messaging sessions running", $im_sessions)); - $self->{output}->perfdata_add(label => 'im_sessions', unit => 'sessions', - value => $im_sessions, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check Lync number of active instant messaging session during last five minutes - -=over 8 - -=item B<--warning> - -Threshold warning on number of active messaging sessions - -=item B<--critical> - -Threshold critical on number of active messaging sessions - -=back - -=cut diff --git a/centreon-plugins/apps/lync/mode/lyncusers.pm b/centreon-plugins/apps/lync/mode/lyncusers.pm deleted file mode 100644 index 55613a909..000000000 --- a/centreon-plugins/apps/lync/mode/lyncusers.pm +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright 2016 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 apps::lync::mode::lyncusers; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - "warning-unique:s" => { name => 'warning_unique', }, - "critical-unique:s" => { name => 'critical_unique', }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning-unique', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-unique', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{sql} = sqlmode object - $self->{sql} = $options{sql}; - - $self->{sql}->connect(); - $self->{sql}->query(query => q{Select - (cast (RE.ClientApp as varchar (100))) as ClientVersion, - R.UserAtHost as UserName, - Reg.Fqdn - From - rtcdyn.dbo.RegistrarEndpoint RE - Inner Join - rtc.dbo.Resource R on R.ResourceId = RE.OwnerId - Inner Join - rtcdyn.dbo.Registrar Reg on Reg.RegistrarId = RE.PrimaryRegistrarClusterId - Order By ClientVersion, UserName } - ); - my $users = $self->{sql}->fetchrow_array(); - - $self->{sql}->query(query => q{Select - count(*) as totalonline, count(distinct UserAtHost) as totalunique - From - rtcdyn.dbo.RegistrarEndpoint RE - Inner Join - rtc.dbo.Resource R on R.ResourceId = RE.OwnerId - Inner Join - rtcdyn.dbo.Registrar Reg on Reg.RegistrarId = RE.PrimaryRegistrarClusterId} - ); - my $unique_users = $self->{sql}->fetchrow_array(); - - my $exit1 = $self->{perfdata}->threshold_check(value => $unique_users, threshold => [ { label => 'critical-unique', 'exit_litteral' => 'critical' }, { label => 'warning-unique', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $users, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - my $exit_code = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); - - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("%i lync unique user(s). (%i total users)", $unique_users, $users)); - $self->{output}->perfdata_add(label => 'unique_users', - value => $unique_users, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-unique'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-unique'), - min => 0); - $self->{output}->perfdata_add(label => 'total_users', - value => $users, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check Lync users and unique users (one user can be connected with several devices) -- use with dyn-mode mssql plugin) - -=over 8 - -=item B<--warning> - -Threshold warning on total users - -=item B<--critical> - -Threshold critical on total users - -=item B<--warning-unique> - -Threshold warning on unique users - -=item B<--critical-unique> - -Threshold critical on unique users - - -=back - -=cut diff --git a/centreon-plugins/apps/lync/mode/remoteassistance.pm b/centreon-plugins/apps/lync/mode/remoteassistance.pm deleted file mode 100644 index 8814abca9..000000000 --- a/centreon-plugins/apps/lync/mode/remoteassistance.pm +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright 2016 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 apps::lync::mode::remoteassistance; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{sql} = sqlmode object - $self->{sql} = $options{sql}; - - $self->{sql}->connect(); - $self->{sql}->query(query => q{SELECT count(*) - FROM [LcsCDR].[dbo].[SessionDetails] s - left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId - WHERE (MediaTypes & 1)=4 - AND s.SessionIdTime>=dateadd(minute,-5,getdate())} - ); - my $remote_assistance_sessions = $self->{sql}->fetchrow_array(); - - my $exit_code = $self->{perfdata}->threshold_check(value => $remote_assistance_sessions, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("%i remote assistance sessions running", $remote_assistance_sessions)); - $self->{output}->perfdata_add(label => 'assistance_sessions', unit => 'sessions', - value => $remote_assistance_sessions, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check Lync number of active remote assistance sessions during last five minutes -- use with dyn-mode mssql plugin - -=over 8 - -=item B<--warning> - -Threshold warning - -=item B<--critical> - -Threshold critical - -=back - -=cut diff --git a/centreon-plugins/apps/lync/mode/sessionstype.pm b/centreon-plugins/apps/lync/mode/sessionstype.pm deleted file mode 100644 index 67f8a5cb0..000000000 --- a/centreon-plugins/apps/lync/mode/sessionstype.pm +++ /dev/null @@ -1,142 +0,0 @@ -# -# Copyright 2016 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 apps::lync::mode::sessionstype; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning-audio:s" => { name => 'warning-audio', }, - "critical-audio:s" => { name => 'critical-audio', }, - "warning-video:s" => { name => 'warning_video', }, - "critical-video:s" => { name => 'critical_video', }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning-audio', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-audio threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-audio', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-audio threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning-video', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-video threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-video', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-video threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{sql} = sqlmode object - $self->{sql} = $options{sql}; - - $self->{sql}->connect(); - - $self->{sql}->query(query => q{SELECT count(*) - FROM [LcsCDR].[dbo].[SessionDetails] s - left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId - WHERE (MediaTypes & 1)=16 - AND s.SessionIdTime>=dateadd(minute,-5,getdate())} - ); - - - my $audio = $self->{sql}->fetchrow_array(); - - $self->{sql}->query(query => q{SELECT count(*) - FROM [LcsCDR].[dbo].[SessionDetails] s - left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId - WHERE (MediaTypes & 1)=32 - AND s.SessionIdTime>=dateadd(minute,-5,getdate())} - ); - - my $video = $self->{sql}->fetchrow_array(); - - my $exit1 = $self->{perfdata}->threshold_check(value => $audio, threshold => [ { label => 'critical-audio', 'exit_litteral' => 'critical' }, { label => 'warning-audio', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $video, threshold => [ { label => 'critical-video', 'exit_litteral' => 'critical' }, { label => 'warning-video', exit_litteral => 'warning' } ]); - my $exit_code = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); - - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("Lync sessions type : %i audio sessions and %i video sessions", $audio, $video)); - $self->{output}->perfdata_add(label => 'video_sessions', - value => $video, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-video'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-video'), - min => 0); - $self->{output}->perfdata_add(label => 'audio_sessions', - value => $audio, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-audio'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-audio'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check Lync type of sessions (audio or video) during the last five minutes -- use with dyn-mode and mssql plugin - -=over 8 - -=item B<--warning-audio> - -Threshold warning on number of audio sessions during last five minutes - -=item B<--critical-audio> - -Threshold critical on number of audio sessions during last five minutes - -=item B<--warning-video> - -Threshold critical on number of video sessions during last five minutes - -=item B<--critical-video> - -Threshold critical on number of video sessions during last five minutes - -=back - -=cut From 639d2b8d32fbeb5f0ec11f96c79164bb8186bec3 Mon Sep 17 00:00:00 2001 From: Florian Asche Date: Tue, 2 Feb 2016 15:06:06 +0100 Subject: [PATCH 078/346] Update libgetdata.pm --- centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm index 0d9f3d4e1..a3710515f 100644 --- a/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm +++ b/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm @@ -41,7 +41,7 @@ sub getdata { my ($value); #print $stdout; foreach (split(/\n/, $stdout)) { - if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C|F Internal|C|F)/i) { + if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C Internal|F Internal|C|F)/i) { $valueok = "1"; $value = $1; #print $value; From 7ea390315449a716c667c854be6c16a5e406a630 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Feb 2016 10:32:12 +0100 Subject: [PATCH 079/346] + Remove dead code --- centreon-plugins/network/bluecoat/snmp/mode/hardware.pm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm index 9ec141824..e96ca16e9 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/hardware.pm @@ -25,10 +25,6 @@ use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $thresholds = { - -}; - sub set_system { my ($self, %options) = @_; From f7a60f43c59f119ba98958251d7ad92af3f5841b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Feb 2016 11:44:33 +0100 Subject: [PATCH 080/346] + use --dyn-mode option (Fix #313) --- .../apps/centreon/sql/mode/countservices.pm | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 centreon-plugins/apps/centreon/sql/mode/countservices.pm diff --git a/centreon-plugins/apps/centreon/sql/mode/countservices.pm b/centreon-plugins/apps/centreon/sql/mode/countservices.pm new file mode 100644 index 000000000..58e8fb1b7 --- /dev/null +++ b/centreon-plugins/apps/centreon/sql/mode/countservices.pm @@ -0,0 +1,139 @@ +# +# Copyright 2016 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 apps::centreon::sql::mode::countservices; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'poller', type => 1, cb_prefix_output => 'prefix_poller_output', message_multiple => 'All poller hosts/services are ok' } + ]; + + $self->{maps_counters}->{poller} = [ + { label => 'host', set => { + key_values => [ { name => 'hosts' }, { name => 'display' } ], + output_template => 'Number of hosts : %s', + perfdatas => [ + { label => 'total_hosts', value => 'hosts_absolute', template => '%s', + min => 0, label_extra_instance => 1 }, + ], + } + }, + { label => 'service', set => { + key_values => [ { name => 'services' }, { name => 'display' } ], + output_template => 'Number of services : %s', + perfdatas => [ + { label => 'total_services', value => 'services_absolute', template => '%s', + min => 0, label_extra_instance => 1 }, + ], + } + }, + ]; +} + +sub prefix_poller_output { + my ($self, %options) = @_; + + return "Poller '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-poller:s" => { name => 'filter_poller' }, + "centreon-storage-database:s" => { name => 'centreon_storage_database', default => 'centreon_storage' }, + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $query = "SELECT instances.name, COUNT(DISTINCT hosts.host_id) as num_hosts, count(DISTINCT services.host_id, services.service_id) as num_services + FROM " . $self->{option_results}->{centreon_storage_database} . ".instances, " . $self->{option_results}->{centreon_storage_database} . ".hosts, " . $self->{option_results}->{centreon_storage_database} . ".services WHERE instances.running = '1' AND instances.instance_id = hosts.instance_id AND hosts.enabled = '1' AND hosts.host_id = services.host_id AND services.enabled = '1' GROUP BY hosts.instance_id"; + $options{sql}->connect(); + $options{sql}->query(query => $query); + + # check by ssid + $self->{poller} = {}; + while ((my $row = $options{sql}->fetchrow_hashref())) { + if (defined($self->{option_results}->{filter_poller}) && $self->{option_results}->{filter_poller} ne '' && + $row->{name} !~ /$self->{option_results}->{filter_poller}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $row->{name} . "': no matching filter.", debug => 1); + next; + } + + $self->{poller}->{$row->{name}} = { display => $row->{name}, hosts => $row->{num_hosts}, services => $row->{num_services} }; + } + + if (scalar(keys %{$self->{poller}}) == 0) { + $self->{output}->add_option_msg(short_msg => "No poller found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check the number of hosts/services by poller. + +=over 8 + +=item B<--centreon-storage-database> + +Centreon storage database name (default: 'centreon_storage'). + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^services$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'host', 'service'. + +=item B<--critical-*> + +Threshold critical. +Can be: Can be: 'host', 'service'. + +=item B<--filter-poller> + +Filter by poller name (regexp can be used). + +=back + +=cut From a974ad54b8dc92476f8cba6fef5866e903dbe1ae Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Feb 2016 16:19:30 +0100 Subject: [PATCH 081/346] + fix help --- centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm index f0e82d023..2fd4b6e99 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/memory.pm @@ -155,7 +155,7 @@ Check memory usage =item B<--filter-counters> Only display some counters (regexp can be used). -Example: --filter-counters='^(1m|5m)$' +Example: --filter-counters='^(memory)$' =item B<--warning-*> From 5c95dd6bce636fa7b40c3d9aae99a19a282557fa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Feb 2016 16:22:26 +0100 Subject: [PATCH 082/346] + fix help --- centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm index 274efdd52..d2c1b124d 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/mode/apusers.pm @@ -160,7 +160,7 @@ __END__ =head1 MODE -Check AP status. +Check AP users. =over 8 From 1476792fc2bf6d0c3f8c7b9135142f43edac621f Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 3 Feb 2016 16:23:05 +0100 Subject: [PATCH 083/346] * Fix little mistype s/ssid/poller/ :) --- centreon-plugins/apps/centreon/sql/mode/countservices.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/centreon/sql/mode/countservices.pm b/centreon-plugins/apps/centreon/sql/mode/countservices.pm index 58e8fb1b7..4e79c53e6 100644 --- a/centreon-plugins/apps/centreon/sql/mode/countservices.pm +++ b/centreon-plugins/apps/centreon/sql/mode/countservices.pm @@ -83,7 +83,7 @@ sub manage_selection { $options{sql}->connect(); $options{sql}->query(query => $query); - # check by ssid + # check by poller $self->{poller} = {}; while ((my $row = $options{sql}->fetchrow_hashref())) { if (defined($self->{option_results}->{filter_poller}) && $self->{option_results}->{filter_poller} ne '' && From e61effc10acd6036af711d1a1904d86dce701440 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 4 Feb 2016 11:25:44 +0100 Subject: [PATCH 084/346] + enhance oracle database: when bytes is superior than maxbytes --- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index 14976bcd8..f751d6d67 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -99,7 +99,7 @@ sub run { SELECT a.tablespace_name, SUM(a.bytes) bytes, - SUM(DECODE(a.autoextensible, 'YES', a.maxbytes, 'NO', a.bytes)) maxbytes + SUM(DECODE(a.autoextensible, 'YES', CASE WHEN (a.bytes > a.maxbytes) THEN 0 ELSE a.maxbytes END, 'NO', a.bytes)) maxbytes FROM dba_data_files a GROUP BY @@ -140,7 +140,7 @@ sub run { b.contents "Type", b.extent_management "Extent Mgmt", sum(a.bytes_free + a.bytes_used) bytes, -- allocated - SUM(DECODE(d.autoextensible, 'YES', d.maxbytes, 'NO', d.bytes)) bytes_max, + SUM(DECODE(d.autoextensible, 'YES', CASE WHEN (d.bytes > d.maxbytes) THEN 0 ELSE d.maxbytes END, 'NO', d.bytes)) bytes_max, SUM(a.bytes_free + a.bytes_used - NVL(c.bytes_used, 0)) bytes_free FROM sys.v_$TEMP_SPACE_HEADER a, From 8ca65513140b6b423f8f04808fd3e6356c566f6a Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 14:06:09 +0100 Subject: [PATCH 085/346] + Add plugin.pm for TemPERHum sensors https://github.com/centreon/centreon-plugins/issues/226 --- .../sensors/temperhum/local/plugin.pm | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 centreon-plugins/hardware/sensors/temperhum/local/plugin.pm diff --git a/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm b/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm new file mode 100644 index 000000000..9c23af6d0 --- /dev/null +++ b/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm @@ -0,0 +1,44 @@ +# +# Copyright 2016 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 hardware::sensors::temperhum::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; # $options->{options} = options object + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'environment' => 'hardware::sensors::temperhum::local::mode::environment', + ); + return $self;} +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check temperature, humidity and dew point for TemPerHum Sensors (the plugin can use SSH). + +=cut From 7f4fd90d565d7f2bbcdceaf4482a0f6931713947 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 14:16:29 +0100 Subject: [PATCH 086/346] + add environment check for TemPerHum sensors https://github.com/centreon/centreon-plugins/issues/226 --- .../temperhum/local/mode/environment.pm | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm diff --git a/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm b/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm new file mode 100644 index 000000000..8147f0d1a --- /dev/null +++ b/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm @@ -0,0 +1,192 @@ +# +# Copyright 2016 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 hardware::sensors::temperhum::local::mode::environment; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'drive', type => 1, cb_prefix_output => 'prefix_device_output', message_multiple => 'All measures are OK' }, + ]; + + $self->{maps_counters}->{drive} = [ + { label => 'humidity', set => { + key_values => [ { name => 'humidity' }, { name => 'display' } ], + output_template => 'Humidity: %.2f%%', + perfdatas => [ + { label => 'humidity', value => 'humidity_absolute', template => '%.2f', + unit => '%', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + }, + }, + { label => 'temperature', set => { + key_values => [ { name => 'temperature' }, { name => 'dewpoint' }, { name => 'display' } ], + output_template => 'Temperature: %.2f C', + perfdatas => [ + { label => 'temperature', value => 'temperature_absolute', template => '%.2f', + unit => 'C', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + }, + }, + { label => 'dew-point', set => { + key_values => [ { name => 'dewpoint' }, { name => 'display' } ], + output_template => 'Dew Point : %.2f C', + perfdatas => [ + { label => 'dew_point', value => 'dewpoint_absolute', template => '%.2f', + unit => 'C', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'delta', set => { + key_values => [ { name => 'delta' }, { name => 'display' } ], + output_template => 'Delta (Temp - Dew) : %.2f C', + perfdatas => [ + { label => 'delta', value => 'delta_absolute', template => '%.2f', + unit => 'C', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'tempered' }, + "command-path:s" => { name => 'command_path', default => '/opt/PCsensor/TEMPered/utils/' }, + "command-options:s" => { name => 'command_options' }, + "filter-drive:s" => { name => 'filter_drive', default => '.*' }, + }); + return $self; +} + +sub prefix_device_output { + my ($self, %options) = @_; + + return "'" . $options{instance_value}->{display} . "' "; +} + +sub manage_selection { + my ($self, %options) = @_; + + $self->{device} = {}; + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + + foreach (split(/\n/, $stdout)) { + next if !/(\/dev\/[a-z0-9]+).*temperature\s(\d*\.?\d+).*relative\shumidity\s(\d*\.?\d+).*dew\spoint\s(\d*\.?\d+)/; + my ($drive, $temp, $hum, $dew) = ($1, $2, $3, $4); + next if $drive !~ /$self->{option_results}->{filter_drive}/; + $self->{drive}{$drive} = { humidity => $hum, temperature => $temp, dewpoint => $dew, delta => ($temp - $dew), display => $drive }; + } + + if (scalar(keys %{$self->{drive}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No informations gathered, please check your filters"); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check metrics from TemPerHum sensors + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'tempered'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: '/usr/sbin'). + +=item B<--command-options> + +Command options (Default: '-u'). + +=item B<--filter-drive> +Filter by drive name (e.g --filter-drive raw4) + +=item B<--warning-*> +Threshold Warning +Can be: 'temperature', 'humidity', 'dew-point', 'delta' + +=item B<--critical-*> +Threshold Critical +Can be: 'temperature', 'humidity', 'dew-point', 'delta' + +=back + +=cut From bc2cf868b87909c47b6c55032d69db13ee53204f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 4 Feb 2016 16:39:26 +0100 Subject: [PATCH 087/346] + begin to work on netbackup plugin --- .../netbackup/local/mode/drivestatus.pm | 233 ++++++++++++++++++ .../apps/backup/netbackup/local/plugin.pm | 49 ++++ 2 files changed, 282 insertions(+) create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm create mode 100644 centreon-plugins/apps/backup/netbackup/local/plugin.pm diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm new file mode 100644 index 000000000..cba6c1161 --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm @@ -0,0 +1,233 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::drivestatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg = 'status : ' . $self->{result_values}->{status}; + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'drive', type => 1, cb_prefix_output => 'prefix_drive_output', message_multiple => 'All drive status are ok' } + ]; + + $self->{maps_counters}->{drive} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'tpconfig' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-l 2>&1' }, + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /up/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_drive_output { + my ($self, %options) = @_; + + return "Drive '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub manage_selection { + my ($self, %options) = @_; + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{drive} = {}; + #robot 0 - TLD - - - - {3,0,0,1} + # drive - 0 hcart2 2 UP - IBM.ULT3580-HH5.000 {3,0,1,0} + # drive - 2 hcart2 1 UP - IBM.ULT3580-HH5.002 {3,0,0,0} + while ($stdout =~ /^robot\s+(\d+)(.*?)(?=robot\s+\d+|\z)/msig) { + my ($robot_num, $drives) = ($1, $2); + while ($drives =~ /drive\s+\S+\s+(\d+)\s+\S+\s+\S+\s+(\S+)/msig) { + my $name = $robot_num . '.' . $1; + $self->{drive}->{$name} = { display => $name, status => $2 }; + } + } + + if (scalar(keys %{$self->{drive}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No drives found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check drive status. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'tpconfig'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-l 2>&1'). + +=item B<--filter-name> + +Filter drive name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{display}, %{status} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} !~ /up/i'). +Can used special variables like: %{display}, %{status} + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/plugin.pm b/centreon-plugins/apps/backup/netbackup/local/plugin.pm new file mode 100644 index 000000000..fdc3b750e --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/plugin.pm @@ -0,0 +1,49 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + # $options->{options} = options object + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'drive-status' => 'apps::backup::netbackup::local::mode::drivestatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Netbackup through local commands (the plugin can use SSH). + +=cut From f673f49e83541c9011f3193d3ef94184cf4e9fbd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 4 Feb 2016 17:00:20 +0100 Subject: [PATCH 088/346] + add mode for netbackup (WIP) --- .../netbackup/local/mode/drivecleaning.pm | 179 ++++++++++++++++++ .../netbackup/local/mode/drivestatus.pm | 6 + .../apps/backup/netbackup/local/plugin.pm | 1 + 3 files changed, 186 insertions(+) create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm b/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm new file mode 100644 index 000000000..ce8f8a721 --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm @@ -0,0 +1,179 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::drivecleaning; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'drive', type => 0 } + ]; + + $self->{maps_counters}->{drive} = [ + { label => 'cleaning', set => { + key_values => [ { name => 'num_cleaning' }, { name => 'total' } ], + output_template => '%d drives needs a reset mount time', + perfdatas => [ + { label => 'cleaning', value => 'num_cleaning_absolute', template => '%s', + min => 0, max => 'total_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'tpconfig' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-l 2>&1' }, + "filter-name:s" => { name => 'filter_name' }, + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{drive} = { total => 0, num_cleaning => 0 }; + #Drive Name Type Mount Time Frequency Last Cleaned Comment + #********** **** ********** ********* **************** ******* + #IBM.ULT3580-HH5.000 hcart2* 18.3 96 05:29 21/12/2015 + #IBM.ULT3580-HH5.002 hcart2* 36.8 0 11:10 20/12/2015 + my @lines = split /\n/, $stdout; + splice(@lines, 0, 2); + foreach my $line (@lines) { + $line =~ /^(\S+)/; + my $name = $1; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + $self->{output}->output_add(long_msg => "drive '" . $name . "' checked.", debug => 1); + + $self->{drive}->{total}++; + if ($line =~ /NEEDS CLEANING/i) { + $self->{drive}->{num_cleaning}++; + } + } + + if (scalar(keys %{$self->{drive}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No drives found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check drive cleaning. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'tpconfig'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-l 2>&1'). + +=item B<--filter-name> + +Filter drive name (can be a regexp). + +=item B<--warning-*> + +Threshold warning. +Can be: 'cleaning'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'cleaning'. + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm index cba6c1161..683f6f99f 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm @@ -153,6 +153,12 @@ sub manage_selection { my ($robot_num, $drives) = ($1, $2); while ($drives =~ /drive\s+\S+\s+(\d+)\s+\S+\s+\S+\s+(\S+)/msig) { my $name = $robot_num . '.' . $1; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + next; + } $self->{drive}->{$name} = { display => $name, status => $2 }; } } diff --git a/centreon-plugins/apps/backup/netbackup/local/plugin.pm b/centreon-plugins/apps/backup/netbackup/local/plugin.pm index fdc3b750e..a99c2b50d 100644 --- a/centreon-plugins/apps/backup/netbackup/local/plugin.pm +++ b/centreon-plugins/apps/backup/netbackup/local/plugin.pm @@ -32,6 +32,7 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( + 'drive-cleaning' => 'apps::backup::netbackup::local::mode::drivecleaning', 'drive-status' => 'apps::backup::netbackup::local::mode::drivestatus', ); From 65110dc5208645af99e1f2fedecf3f8545bd6456 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 18:23:33 +0100 Subject: [PATCH 089/346] + Enhance code portability - fix mistypes #226 --- .../hardware/sensors/temperhum/local/mode/environment.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm b/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm index 8147f0d1a..e07e88bf6 100644 --- a/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm +++ b/centreon-plugins/hardware/sensors/temperhum/local/mode/environment.pm @@ -104,7 +104,7 @@ sub prefix_device_output { sub manage_selection { my ($self, %options) = @_; - $self->{device} = {}; + $self->{drive} = {}; my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, sudo => $self->{option_results}->{sudo}, @@ -115,8 +115,8 @@ sub manage_selection { foreach (split(/\n/, $stdout)) { next if !/(\/dev\/[a-z0-9]+).*temperature\s(\d*\.?\d+).*relative\shumidity\s(\d*\.?\d+).*dew\spoint\s(\d*\.?\d+)/; my ($drive, $temp, $hum, $dew) = ($1, $2, $3, $4); - next if $drive !~ /$self->{option_results}->{filter_drive}/; - $self->{drive}{$drive} = { humidity => $hum, temperature => $temp, dewpoint => $dew, delta => ($temp - $dew), display => $drive }; + next if ($drive !~ /$self->{option_results}->{filter_drive}/); + $self->{drive}->{$drive} = { humidity => $hum, temperature => $temp, dewpoint => $dew, delta => ($temp - $dew), display => $drive }; } if (scalar(keys %{$self->{drive}}) <= 0) { From 4c3b7b61a8ca3f1aec5def3e9f1552de964ea8b7 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 22:00:12 +0100 Subject: [PATCH 090/346] * Enhance mode clusterhealth.pm --- .../storage/emc/xtremio/restapi/mode/clusterhealth.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm index 0e349e8c1..25ac27600 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm @@ -131,6 +131,7 @@ sub run { name => $item); foreach my $sensor (@sensors) { + next if (!defined($details->{$sensor}) || $details->{$sensor} eq ''); $self->{output}->output_add(long_msg => sprintf("Sensor '%s' state is '%s'", $sensor, $details->{$sensor})); From b53a2736123ceedd5ee53e5001cd81c5278d1a0d Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 22:06:35 +0100 Subject: [PATCH 091/346] + enhance help and correct threshold unit --- .../storage/emc/xtremio/restapi/mode/ssdiops.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm index 8edd9e6f7..046e74c6d 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm @@ -200,17 +200,16 @@ Check IOPS (Global, Read, Write) on each SSDs. =item B<--warning-*> -Threshold warning. -Can be: 'global' (%), 'read' (%), 'write' (%). +Threshold warning (number of iops) +Can be: 'global', 'read', 'write'. =item B<--critical-*> - -Threshold critical. -Can be: 'global' (%), 'read' (%), 'write' (%). +Threshold critical (number of iops) +Can be: 'global', 'read', 'write'. =item B<--filter-name> -Filter SSD name (can be a regexp). +Filter SSD name (can be a regexp). (e.g --filter-name '.*' for all SSDs) =back From 838f449a3aa3801fa2886ae38a0f672f4f1098d2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 5 Feb 2016 13:11:33 +0100 Subject: [PATCH 092/346] + add slack to send notification --- centreon-plugins/centreon/plugins/http.pm | 13 +- .../notification/slack/mode/alert.pm | 343 ++++++++++++++++++ centreon-plugins/notification/slack/plugin.pm | 48 +++ 3 files changed, 402 insertions(+), 2 deletions(-) create mode 100644 centreon-plugins/notification/slack/mode/alert.pm create mode 100644 centreon-plugins/notification/slack/plugin.pm diff --git a/centreon-plugins/centreon/plugins/http.pm b/centreon-plugins/centreon/plugins/http.pm index de399a190..59e5fb41b 100644 --- a/centreon-plugins/centreon/plugins/http.pm +++ b/centreon-plugins/centreon/plugins/http.pm @@ -205,7 +205,9 @@ sub request { my ($response, $content); my ($req, $url); - if (defined($request_options->{port}) && $request_options->{port} =~ /^[0-9]+$/) { + if (defined($request_options->{full_url})) { + $url = $request_options->{full_url}; + } elsif (defined($request_options->{port}) && $request_options->{port} =~ /^[0-9]+$/) { $url = $request_options->{proto}. "://" . $request_options->{hostname} . ':' . $request_options->{port} . $request_options->{url_path}; } else { $url = $request_options->{proto}. "://" . $request_options->{hostname} . $request_options->{url_path}; @@ -304,7 +306,8 @@ sub request { $self->{output}->exit(); } - $self->{headers} = $response->headers; + $self->{headers} = $response->{headers}; + $self->{response} = $response; return $response->content; } @@ -314,4 +317,10 @@ sub get_header { return $self->{headers}; } +sub get_response { + my ($self, %options) = @_; + + return $self->{response}; +} + 1; diff --git a/centreon-plugins/notification/slack/mode/alert.pm b/centreon-plugins/notification/slack/mode/alert.pm new file mode 100644 index 000000000..6b5a2fe14 --- /dev/null +++ b/centreon-plugins/notification/slack/mode/alert.pm @@ -0,0 +1,343 @@ +# +# Copyright 2016 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 notification::slack::mode::alert; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +my %slack_color_host = ( + up => 'good', + down => 'danger', + unreachable => 'danger', +); +my %slack_color_service = ( + ok => 'good', + warning => 'warning', + critical => 'danger', + unknown => 'warning', +); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "slack-url:s" => { name => 'slack_url' }, + "slack-channel:s" => { name => 'slack_channel' }, + "slack-username:s" => { name => 'slack_username' }, + "host-name:s" => { name => 'host_name' }, + "host-state:s" => { name => 'host_state' }, + "host-output:s" => { name => 'host_output' }, + "service-description:s" => { name => 'service_description' }, + "service-state:s" => { name => 'service_state' }, + "service-output:s" => { name => 'service_output' }, + "slack-color:s" => { name => 'slack_color' }, + "slack-emoji:s" => { name => 'slack_emoji', }, + "graph-url:s" => { name => 'graph_url' }, + "priority:s" => { name => 'priority' }, + "zone:s" => { name => 'zone' }, + "link-url:s" => { name => 'link_url' }, + "centreon-url:s" => { name => 'centreon_url' }, + "centreon-token:s" => { name => 'centreon_token' }, + + "credentials" => { name => 'credentials' }, + "ntlm" => { name => 'ntlm' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "timeout:s" => { name => 'timeout' }, + }); + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{payload_attachment} = { fields => [] }; + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (!defined($self->{option_results}->{slack_url}) || $self->{option_results}->{slack_url} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --slack-url option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{slack_channel}) || $self->{option_results}->{slack_channel} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --slack-channel option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{host_name}) || $self->{option_results}->{host_name} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --host-name option."); + $self->{output}->option_exit(); + } + + foreach (('graph_url', 'link_url')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{option_results}->{$1}/g; + eval "\$self->{option_results}->{\$_} = \"$self->{option_results}->{$_}\""; + } + } + + $self->{http}->set_options(%{$self->{option_results}}, hostname => 'dummy'); +} + +sub format_payload { + my ($self, %options) = @_; + + my $json = JSON->new; + my $payload = { channel => $self->{option_results}->{slack_channel}, + attachments => [ $self->{payload_attachment} ] }; + if (defined($self->{option_results}->{slack_emoji}) && $self->{option_results}->{slack_emoji} ne '') { + $payload->{icon_emoji} = $self->{option_results}->{slack_emoji}; + } + if (defined($self->{option_results}->{slack_username}) && $self->{option_results}->{slack_username} ne '') { + $payload->{username} = $self->{option_results}->{slack_username}; + } + eval { + $self->{payload_str} = $json->encode($payload); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot decode json response"); + $self->{output}->option_exit(); + } +} + +sub host_message { + my ($self, %options) = @_; + + my $url_host = $self->{option_results}->{host_name}; + if (defined($self->{option_results}->{link_url}) && $self->{option_results}->{link_url} ne '') { + $url_host = '<' . $self->{option_results}->{link_url} . '|' . $self->{option_results}->{host_name} . '>'; + $self->{payload_attachment}->{fallback} = "Host " . $self->{option_results}->{host_name}; + } + $self->{payload_attachment}->{text} = "Host " . $url_host; + + if (defined($self->{option_results}->{host_state}) && $self->{option_results}->{host_state} ne '') { + $self->{payload_attachment}->{text} .= ' is ' . $self->{option_results}->{host_state}; + $self->{payload_attachment}->{fallback} .= ' is ' . $self->{option_results}->{host_state}; + if (defined($slack_color_host{lc($self->{option_results}->{host_state})})) { + $self->{payload_attachment}->{color} = $slack_color_host{lc($self->{option_results}->{host_state})}; + } + } else { + $self->{payload_attachment}->{text} .= ' alert'; + $self->{payload_attachment}->{fallback} .= ' alert'; + } + + if (defined($self->{option_results}->{link_url}) && $self->{option_results}->{link_url} ne '') { + $self->{payload_attachment}->{fallback} .= ' : ' . $self->{option_results}->{link_url}; + } + + if (defined($self->{option_results}->{host_output}) && $self->{option_results}->{host_output} ne '') { + push @{$self->{payload_attachment}->{fields}}, { title => 'output', value => $self->{option_results}->{host_output} }; + } +} + +sub service_message { + my ($self, %options) = @_; + + my $url_service = $self->{option_results}->{service_description}; + if (defined($self->{option_results}->{link_url}) && $self->{option_results}->{link_url} ne '') { + $url_service = '<' . $self->{option_results}->{link_url} . '|' . $self->{option_results}->{host_name} . '/' . $self->{option_results}->{service_description} . '>'; + $self->{payload_attachment}->{fallback} = "Service " . $self->{option_results}->{host_name} . '/' . $self->{option_results}->{service_description}; + } + $self->{payload_attachment}->{text} = "Service " . $url_service; + + if (defined($self->{option_results}->{service_state}) && $self->{option_results}->{service_state} ne '') { + $self->{payload_attachment}->{text} .= ' is ' . $self->{option_results}->{service_state}; + $self->{payload_attachment}->{fallback} .= ' is ' . $self->{option_results}->{service_state}; + if (defined($slack_color_service{lc($self->{option_results}->{service_state})})) { + $self->{payload_attachment}->{color} = $slack_color_service{lc($self->{option_results}->{service_state})}; + } + } else { + $self->{payload_attachment}->{text} .= ' alert'; + $self->{payload_attachment}->{fallback} .= ' alert'; + } + + if (defined($self->{option_results}->{link_url}) && $self->{option_results}->{link_url} ne '') { + $self->{payload_attachment}->{fallback} .= ' : ' . $self->{option_results}->{link_url}; + } + + if (defined($self->{option_results}->{service_output}) && $self->{option_results}->{service_output} ne '') { + push @{$self->{payload_attachment}->{fields}}, { title => 'output', value => $self->{option_results}->{service_output} }; + } + + if (defined($self->{option_results}->{graph_url}) && $self->{option_results}->{graph_url} ne '') { + $self->{payload_attachment}->{image_url} = $self->{option_results}->{graph_url}; + } +} + +sub set_payload { + my ($self, %options) = @_; + + if (!defined($self->{option_results}->{service_description}) && $self->{option_results}->{service_description} ne '') { + $self->host_message(); + } else { + $self->service_message(); + } + + if (defined($self->{option_results}->{slack_color}) && $self->{option_results}->{slack_color} ne '') { + $self->{payload_attachment}->{color} = $self->{option_results}->{slack_color}; + } + + if (defined($self->{option_results}->{priority}) && $self->{option_results}->{priority} ne '') { + push @{$self->{payload_attachment}->{fields}}, { title => 'Priority', value => $self->{option_results}->{priority}, short => 'true' }; + } + if (defined($self->{option_results}->{zone}) && $self->{option_results}->{zone} ne '') { + push @{$self->{payload_attachment}->{fields}}, { title => 'Zone', value => $self->{option_results}->{zone}, short => 'true' }; + } +} + +sub run { + my ($self, %options) = @_; + + $self->set_payload(); + $self->format_payload(); + my $response = $self->{http}->request(full_url => $self->{option_results}->{slack_url}, + method => 'POST', + post_param => ['payload=' . $self->{payload_str}]); + + $self->{output}->output_add(short_msg => 'slack response: ' . $response); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Send slack alerts. + +Example for a host: +centreon_plugins.pl --plugin=notification::slack::plugin --mode=alert --slack-url='https://hooks.slack.com/services/T0A754E2V/B0E0CEL4B/81V8kCJusL7kafDSdsd' --slack-channel='#testchannel' --slack-username='bot' --slack-emoji=':ghost:' --host-name='srvi-clus-win' --host-state='DOWN' --host-output='test output' --priority='High' --zone='Production' --centreon-url='https://centreon.test.com/centreon/' --link-url='%{centreon_url}/main.php?p=20202&o=svc&host_search=%{host_name}' + +Example for a service: +centreon_plugins.pl --plugin=notification::slack::plugin --mode=alert --slack-url='https://hooks.slack.com/services/T0A754E2V/B0E0CEL4B/81V8kCJusL7kafDSdsd' --slack-channel='#tmptestqga' --slack-username='bot' --slack-emoji=':ghost:' --host-name='srvi-clus-win' --service-description='Ping' --service-state='WARNING' --service-output='CRITICAL - 10.50.1.78: rta nan, lost 100%' --priority='High' --zone='Production' --centreon-url='https://ces.merethis.net/centreon/' --link-url='%{centreon_url}/main.php?p=20201&o=svc&host_search=%{host_name}&svc_search=%{service_description}' --centreon-token='LxTQxFbLU6' --graph-url='%{centreon_url}/include/views/graphs/generateGraphs/generateImage.php?username=myuser&token=%{centreon_token}&hostname=%{host_name}&service=%{service_description}' + +=over 8 + +=item B<--slack-url> + +Specify slack url (Required). + +=item B<--slack-channel> + +Specify slack channel (Required). + +=item B<--slack-username> + +Specify slack username. + +=item B<--host-name> + +Specify host server name for the alert (Required). + +=item B<--host-state> + +Specify host server state for the alert. + +=item B<--host-output> + +Specify host server output message for the alert. + +=item B<--service-description> + +Specify service description name for the alert. + +=item B<--service-state> + +Specify service state for the alert. + +=item B<--service-output> + +Specify service output message for the alert. + +=item B<--slack-color> + +Specify slack color (According state option, color will be choosed). + +=item B<--slack-emoji> + +Specify slack emoji. + +=item B<--priority> + +Specify the priority message. + +=item B<--zone> + +Specify the zone message. + +=item B<--centreon-url> + +Specify the centreon url macro (could be used in link-url and graph-url option). + +=item B<--centreon-token> + +Specify the centreon token for autologin macro (could be used in link-url and graph-url option). + +=item B<--graph-url> + +Specify the graph url (Example: %{centreon_url}/include/views/graphs/generateGraphs/generateImage.php?username=myuser&token=%{centreon_token}&hostname=%{host_name}&service=%{service_description}). + +=item B<--link-url> + +Specify the link url (Example: %{centreon_url}/main.php?p=20201&o=svc&host_search=%{host_name}&svc_search=%{service_description}) + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--ntlm> + +Specify this option if you access webpage over ntlm authentification (Use with --credentials option) + +=item B<--username> + +Specify username for basic authentification (Mandatory if --credentials is specidied) + +=item B<--password> + +Specify password for basic authentification (Mandatory if --credentials is specidied) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 5) + +=back + +=cut diff --git a/centreon-plugins/notification/slack/plugin.pm b/centreon-plugins/notification/slack/plugin.pm new file mode 100644 index 000000000..b221d5af5 --- /dev/null +++ b/centreon-plugins/notification/slack/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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 notification::slack::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'alert' => 'notification::slack::mode::alert', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Send Slack notifications. + +=cut From 61f8f122efe39b1f88fb2d22c86c3e66271caf0c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 8 Feb 2016 22:33:53 +0100 Subject: [PATCH 093/346] + Enhance cisco ASA sessions (Fix #315) --- .../cisco/standard/snmp/mode/sessions.pm | 289 ++++++++++++++++++ .../network/cisco/asa/mode/sessions.pm | 154 ---------- centreon-plugins/network/cisco/asa/plugin.pm | 2 +- 3 files changed, 290 insertions(+), 155 deletions(-) create mode 100644 centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm delete mode 100644 centreon-plugins/network/cisco/asa/mode/sessions.pm diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm new file mode 100644 index 000000000..09a59e4ba --- /dev/null +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm @@ -0,0 +1,289 @@ +# +# Copyright 2016 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 centreon::common::cisco::standard::snmp::mode::sessions; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'connections', type => 0, cb_prefix_output => 'prefix_connections_output', skipped_code => { -10 => 1 } }, + { name => 'sessions', type => 0, cb_prefix_output => 'prefix_sessions_output', skipped_code => { -10 => 1 } }, + ]; + $self->{maps_counters}->{connections} = [ + { label => 'connections-current', set => { + key_values => [ { name => 'cufwConnGlobalNumActive' } ], + output_template => 'current : %s', output_error_template => "current : %s", + perfdatas => [ + { label => 'connections_current', value => 'cufwConnGlobalNumActive_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'connections-1m', set => { + key_values => [ { name => 'cufwConnGlobalConnSetupRate1' } ], + output_template => 'average last 1min %s', output_error_template => "average last 1min : %s", + perfdatas => [ + { label => 'connections_1m', value => 'cufwConnGlobalConnSetupRate1_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'connections-5m', set => { + key_values => [ { name => 'cufwConnGlobalConnSetupRate5' } ], + output_template => 'average last 5min : %s', output_error_template => "average last 5min : %s", + perfdatas => [ + { label => 'connections_5m', value => 'cufwConnGlobalConnSetupRate5_absolute', template => '%d', + min => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{sessions} = [ + { label => 'sessions-total', set => { + key_values => [ { name => 'crasNumSessions' } ], + output_template => 'total : %s', output_error_template => "total : %s", + perfdatas => [ + { label => 'sessions_total', value => 'crasNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-email-current', set => { + key_values => [ { name => 'crasEmailNumSessions' } ], + output_template => 'current email proxy : %s', output_error_template => "current email proxy : %s", + perfdatas => [ + { label => 'sessions_email_current', value => 'crasEmailNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-email-psec', set => { + key_values => [ { name => 'crasEmailCumulateSessions', diff => 1 } ], + output_template => 'email proxy : %.2f/s', output_error_template => "email proxy : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_email_psec', value => 'crasEmailCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + { label => 'sessions-ipsec-current', set => { + key_values => [ { name => 'crasIPSecNumSessions' } ], + output_template => 'current ipsec : %s', output_error_template => "current ipsec : %s", + perfdatas => [ + { label => 'sessions_ipsec_current', value => 'crasIPSecNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-ipsec-psec', set => { + key_values => [ { name => 'crasIPSecCumulateSessions', diff => 1 } ], + output_template => 'ipsec : %.2f/s', output_error_template => "ipsec : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_ipsec_psec', value => 'crasIPSecCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + { label => 'sessions-l2l-current', set => { + key_values => [ { name => 'crasL2LNumSessions' } ], + output_template => 'current LAN to LAN : %s', output_error_template => "current LAN to LAN : %s", + perfdatas => [ + { label => 'sessions_l2l_current', value => 'crasL2LNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-l2l-psec', set => { + key_values => [ { name => 'crasL2LCumulateSessions', diff => 1 } ], + output_template => 'LAN to LAN : %.2f/s', output_error_template => "LAN to LAN : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_l2l_psec', value => 'crasL2LCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + { label => 'sessions-lb-current', set => { + key_values => [ { name => 'crasLBNumSessions' } ], + output_template => 'current load balancing : %s', output_error_template => "current load balancing : %s", + perfdatas => [ + { label => 'sessions_lb_current', value => 'crasLBNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-lb-psec', set => { + key_values => [ { name => 'crasLBCumulateSessions', diff => 1 } ], + output_template => 'load balancing : %.2f/s', output_error_template => "load balancing : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_lb_psec', value => 'crasLBCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + { label => 'sessions-svc-current', set => { + key_values => [ { name => 'crasSVCNumSessions' } ], + output_template => 'current SVC : %s', output_error_template => "current SVC : %s", + perfdatas => [ + { label => 'sessions_svc_current', value => 'crasSVCNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-svc-psec', set => { + key_values => [ { name => 'crasSVCCumulateSessions', diff => 1 } ], + output_template => 'SVC : %.2f/s', output_error_template => "SVC : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_svc_psec', value => 'crasSVCCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + { label => 'sessions-webvpn-current', set => { + key_values => [ { name => 'crasWebvpnNumSessions' } ], + output_template => 'current webvpn : %s', output_error_template => "current webvpn : %s", + perfdatas => [ + { label => 'sessions_webvpn_current', value => 'crasWebvpnNumSessions_absolute', template => '%d', + min => 0 }, + ], + } + }, + { label => 'sessions-webvpn-psec', set => { + key_values => [ { name => 'crasWebvpnCumulateSessions', diff => 1 } ], + output_template => 'webvpn : %.2f/s', output_error_template => "webvpn : %s", + per_second => 1, + perfdatas => [ + { label => 'sessions_webvpn_psec', value => 'crasWebvpnCumulateSessions_per_second', template => '%.2f', + min => 0 }, + ], + } + }, + ]; +} + +sub prefix_connections_output { + my ($self, %options) = @_; + + return "Connections "; +} + +sub prefix_sessions_output { + my ($self, %options) = @_; + + return "Sessions "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +my %oids_connections = ( + cufwConnGlobalNumActive => '.1.3.6.1.4.1.9.9.491.1.1.1.6.0', + cufwConnGlobalConnSetupRate1 => '.1.3.6.1.4.1.9.9.491.1.1.1.10.0', + cufwConnGlobalConnSetupRate5 => '.1.3.6.1.4.1.9.9.491.1.1.1.11.0', +); +my %oids_sessions = ( + crasNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.1.0', + crasEmailNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.23.0', + crasEmailCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.24.0', + crasIPSecNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.26.0', + crasIPSecCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.27.0', + crasL2LNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.29.0', + crasL2LCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.30.0', + crasLBNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.32.0', + crasLBCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.33.0', + crasSVCNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.35.0', + crasSVCCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.36.0', + crasWebvpnNumSessions => '.1.3.6.1.4.1.9.9.392.1.3.38.0', + crasWebvpnCumulateSessions => '.1.3.6.1.4.1.9.9.392.1.3.39.0', +); + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cache_name} = "cisco_standard_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + $self->{connections} = {}; + $self->{sessions} = {}; + + $self->{results} = $options{snmp}->get_leef(oids => [values %oids_connections, values %oids_sessions], + nothing_quit => 1); + foreach my $name (keys %oids_connections) { + next if (!defined($self->{results}->{$oids_connections{$name}}) || $self->{results}->{$oids_connections{$name}} == 0); + $self->{connections}->{$name} = $self->{results}->{$oids_connections{$name}}; + } + foreach my $name (keys %oids_sessions) { + next if (!defined($self->{results}->{$oids_sessions{$name}}) || $self->{results}->{$oids_sessions{$name}} == 0); + $self->{sessions}->{$name} = $self->{results}->{$oids_sessions{$name}}; + } +} + +1; + +__END__ + +=head1 MODE + +Check sessions. + +=over 8 + +=item B<--warning-*> + +Threshold warning. +Can be: 'connections-current', 'connections-1m', 'connections-5m', +'sessions-total', 'sessions-email-current', 'sessions-email-psec', +'sessions-ipsec-current', 'sessions-ipsec-psec', 'sessions-l2l-current', 'sessions-lb-psec' +'sessions-lb-current', 'sessions-lb-psec', 'sessions-svc-current', 'sessions-svc-psec', +'sessions-webvpn-current', 'sessions-webvpn-psec'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'connections-current', 'connections-1m', 'connections-5m', +'sessions-total', 'sessions-email-current', 'sessions-email-psec', +'sessions-ipsec-current', 'sessions-ipsec-psec', 'sessions-l2l-current', 'sessions-lb-psec' +'sessions-lb-current', 'sessions-lb-psec', 'sessions-svc-current', 'sessions-svc-psec', +'sessions-webvpn-current', 'sessions-webvpn-psec'. + +=back + +=cut diff --git a/centreon-plugins/network/cisco/asa/mode/sessions.pm b/centreon-plugins/network/cisco/asa/mode/sessions.pm deleted file mode 100644 index a82602f0d..000000000 --- a/centreon-plugins/network/cisco/asa/mode/sessions.pm +++ /dev/null @@ -1,154 +0,0 @@ -# -# Copyright 2016 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::cisco::asa::mode::sessions; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning-average:s" => { name => 'warning_average', default => '' }, - "critical-average:s" => { name => 'critical_average', default => '' }, - "warning-current:s" => { name => 'warning_current' }, - "critical-current:s" => { name => 'critical_current' }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - ($self->{warn_avg1m}, $self->{warn_avg5m}) = split /,/, $self->{option_results}->{warning_average}; - ($self->{crit_avg1m}, $self->{crit_avg5m}) = split /,/, $self->{option_results}->{critical_average}; - - if (($self->{perfdata}->threshold_validate(label => 'warn_avg1m', value => $self->{warn_avg1m})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning average (1min) threshold '" . $self->{warn_avg1m} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warn_avg5m', value => $self->{warn_avg5m})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning average (5min) threshold '" . $self->{warn_avg5m} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'crit_avg1m', value => $self->{crit_avg1m})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical average (1min) threshold '" . $self->{crit_avg1m} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'crit_avg5m', value => $self->{crit_avg5m})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical average (5min) threshold '" . $self->{crit_avg5m} . "'."); - $self->{output}->option_exit(); - } - - if (($self->{perfdata}->threshold_validate(label => 'warning_current', value => $self->{option_results}->{warning_current})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning current threshold '" . $self->{option_results}->{warning_current} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_current', value => $self->{option_results}->{critical_current})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical current threshold '" . $self->{option_results}->{critical_current} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $oid_cufwConnGlobalNumActive = '.1.3.6.1.4.1.9.9.491.1.1.1.6.0'; - my $oid_cufwConnGlobalConnSetupRate1 = '.1.3.6.1.4.1.9.9.491.1.1.1.10.0'; - my $oid_cufwConnGlobalConnSetupRate5 = '.1.3.6.1.4.1.9.9.491.1.1.1.11.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_cufwConnGlobalNumActive, $oid_cufwConnGlobalConnSetupRate1, - $oid_cufwConnGlobalConnSetupRate5], nothing_quit => 1); - - my $exit1 = $self->{perfdata}->threshold_check(value => $result->{$oid_cufwConnGlobalConnSetupRate1}, - threshold => [ { label => 'crit_avg1m', 'exit_litteral' => 'critical' }, { label => 'warn_avg1m', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $result->{$oid_cufwConnGlobalConnSetupRate5}, - threshold => [ { label => 'crit_avg5m', 'exit_litteral' => 'critical' }, { label => 'warn_avg5m', exit_litteral => 'warning' } ]); - my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Average Connections per seconds: %d (last 1min), %d (last 5min)", - $result->{$oid_cufwConnGlobalConnSetupRate1}, $result->{$oid_cufwConnGlobalConnSetupRate5})); - - $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_cufwConnGlobalNumActive}, - threshold => [ { label => 'critical_current', 'exit_litteral' => 'critical' }, { label => 'warning_current', exit_litteral => 'warning' } ]); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Current active connections: %d", - $result->{$oid_cufwConnGlobalNumActive})); - - $self->{output}->perfdata_add(label => "connections_1m", unit => 'con/s', - value => $result->{$oid_cufwConnGlobalConnSetupRate1}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_avg1m'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_avg1m'), - min => 0); - $self->{output}->perfdata_add(label => "connections_5m", unit => 'con/s', - value => $result->{$oid_cufwConnGlobalConnSetupRate1}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn_avg1m'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit_avg1m'), - min => 0); - $self->{output}->perfdata_add(label => "connections_current", - value => $result->{$oid_cufwConnGlobalNumActive}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_current'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_current'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check current/average connections on Cisco ASA (CISCO-UNIFIED-FIREWALL-MIB). - -=over 8 - -=item B<--warning-average> - -Threshold warning: averaged number of connections which the firewall establishing per second (1min,5min). - -=item B<--critical-average> - -Threshold critical: averaged number of connections which the firewall establishing per second (1min,5min). - -=item B<--warning-current> - -Threshold warning: number of connections which are currently active. - -=item B<--critical-current> - -Threshold critical: number of connections which are currently active. - -=back - -=cut - \ No newline at end of file diff --git a/centreon-plugins/network/cisco/asa/plugin.pm b/centreon-plugins/network/cisco/asa/plugin.pm index d87fbb019..09eaa3ba9 100644 --- a/centreon-plugins/network/cisco/asa/plugin.pm +++ b/centreon-plugins/network/cisco/asa/plugin.pm @@ -37,7 +37,7 @@ sub new { 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'memory' => 'centreon::common::cisco::standard::snmp::mode::memory', - 'sessions' => 'network::cisco::asa::mode::sessions', + 'sessions' => 'centreon::common::cisco::standard::snmp::mode::sessions', ); return $self; From 1db8008e52191774dbb025f504e34e3e9214156a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 9 Feb 2016 13:26:05 +0100 Subject: [PATCH 094/346] + Fix MSSQL threshold for mode 'failed-jobs' --- centreon-plugins/database/mssql/mode/failedjobs.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/database/mssql/mode/failedjobs.pm b/centreon-plugins/database/mssql/mode/failedjobs.pm index 37e5740a6..dba5a75e9 100644 --- a/centreon-plugins/database/mssql/mode/failedjobs.pm +++ b/centreon-plugins/database/mssql/mode/failedjobs.pm @@ -66,11 +66,11 @@ sub check_options { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); } - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning_duration})) == 0) { + if (($self->{perfdata}->threshold_validate(label => 'warning-duration', value => $self->{option_results}->{warning_duration})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong warning duration threshold '" . $self->{option_results}->{warning_duration} . "'."); $self->{output}->option_exit(); } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical_duration})) == 0) { + if (($self->{perfdata}->threshold_validate(label => 'critical-duration', value => $self->{option_results}->{critical_duration})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong critical duration threshold '" . $self->{option_results}->{critical_duration} . "'."); $self->{output}->option_exit(); } @@ -132,7 +132,7 @@ sub run { $count_failed++; push (@job_failed, $job_name); } else { - my $exit_code1 = $self->{perfdata}->threshold_check(value => $run_duration, threshold => [ { label => 'critical_duration', 'exit_litteral' => 'critical' }, { label => 'warning_duration', exit_litteral => 'warning' } ]); + my $exit_code1 = $self->{perfdata}->threshold_check(value => $run_duration, threshold => [ { label => 'critical-duration', exit_litteral => 'critical' }, { label => 'warning-duration', exit_litteral => 'warning' } ]); if (!$self->{output}->is_status(value => $exit_code1, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit_code1, short_msg => sprintf("Job '%s' duration : %d minutes", $job_name, $run_duration)); @@ -141,7 +141,7 @@ sub run { $self->{output}->output_add(long_msg => sprintf("Job '%s' status %s [Runtime : %s %s] [Duration : %d minutes]", $job_name, $states{$run_status}, $run_date, $run_time, $run_duration)); } - my $exit_code2 = $self->{perfdata}->threshold_check(value => $count_failed, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my $exit_code2 = $self->{perfdata}->threshold_check(value => $count_failed, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); if(!defined($self->{option_results}->{skip}) && $count == 0) { $self->{output}->output_add(severity => 'Unknown', short_msg => "No job found."); From 51fd1e94c9356e1a7c3c3dfee4c2745de5ebcc73 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 9 Feb 2016 14:00:20 +0100 Subject: [PATCH 095/346] + Fix #315 --- .../centreon/common/cisco/standard/snmp/mode/sessions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm index 09a59e4ba..366285234 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/sessions.pm @@ -45,7 +45,7 @@ sub set_counters { }, { label => 'connections-1m', set => { key_values => [ { name => 'cufwConnGlobalConnSetupRate1' } ], - output_template => 'average last 1min %s', output_error_template => "average last 1min : %s", + output_template => 'average last 1min : %s', output_error_template => "average last 1min : %s", perfdatas => [ { label => 'connections_1m', value => 'cufwConnGlobalConnSetupRate1_absolute', template => '%d', min => 0 }, From 2c8206ad32841e4396e081e1209085978a994801 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 9 Feb 2016 15:24:18 +0100 Subject: [PATCH 096/346] + add plugin for emerson liebert pdu --- .../pdu/emerson/snmp/mode/globalstatus.pm | 206 ++++++++++++++++++ .../hardware/pdu/emerson/snmp/mode/psusage.pm | 167 ++++++++++++++ .../hardware/pdu/emerson/snmp/mode/rbusage.pm | 191 ++++++++++++++++ .../hardware/pdu/emerson/snmp/plugin.pm | 50 +++++ 4 files changed, 614 insertions(+) create mode 100644 centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm create mode 100644 centreon-plugins/hardware/pdu/emerson/snmp/mode/psusage.pm create mode 100644 centreon-plugins/hardware/pdu/emerson/snmp/mode/rbusage.pm create mode 100644 centreon-plugins/hardware/pdu/emerson/snmp/plugin.pm diff --git a/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm new file mode 100644 index 000000000..c9a747a3d --- /dev/null +++ b/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm @@ -0,0 +1,206 @@ +# +# Copyright 2016 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 hardware::pdu::emerson::snmp::mode::globalstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg = "status is '" . $self->{result_values}->{status} . "'"; + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'pdu', type => 1, cb_prefix_output => 'prefix_pdu_output', message_multiple => 'All PDU status are ok' } + ]; + + $self->{maps_counters}->{pdu} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /normalWithWarning/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /normalWithAlarm|abnormalOperation/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_pdu_output { + my ($self, %options) = @_; + + return "PDU '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %bitmap_status = ( + 1 => 'normalOperation', + 2 => 'startUp', + 8 => 'normalWithWarning', + 16 => 'normalWithAlarm', + 32 => 'abnormalOperation', +); +my $mapping = { + lgpPduEntryUsrLabel => { oid => '.1.3.6.1.4.1.476.1.42.3.8.20.1.10' }, + lgpPduEntrySysStatus => { oid => '.1.3.6.1.4.1.476.1.42.3.8.20.1.25' }, +}; +my $oid_lgpPduEntry = '.1.3.6.1.4.1.476.1.42.3.8.20.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{pdu} = {}; + $self->{results} = $options{snmp}->get_table(oid => $oid_lgpPduEntry, + start => $mapping->{lgpPduEntryUsrLabel}->{oid}, + end => $mapping->{lgpPduEntrySysStatus}->{oid}, + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{lgpPduEntrySysStatus}->{oid}\.(.*)$/); + my $instance = $1; + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + my $name = defined($result->{lgpPduEntryUsrLabel}) && $result->{lgpPduEntryUsrLabel} ne '' ? + $result->{lgpPduEntryUsrLabel} : $instance; + my $status = 'unknow'; + foreach (keys %bitmap_status) { + if (($result->{lgpPduEntrySysStatus} & $_)) { + $status = $bitmap_status{$_}; + last; + } + } + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{pdu}->{$instance} = { display => $name, + status => $status }; + } + + if (scalar(keys %{$self->{pdu}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "Cannot found pdu."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check global status. + +=over 8 + +=item B<--filter-name> + +Filter PDU name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{status} =~ /normalWithWarning/i'). +Can used special variables like: %{status}, %{display}. + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} =~ /normalWithAlarm|abnormalOperation/i'). +Can used special variables like: %{status}, %{display} + +=back + +=cut diff --git a/centreon-plugins/hardware/pdu/emerson/snmp/mode/psusage.pm b/centreon-plugins/hardware/pdu/emerson/snmp/mode/psusage.pm new file mode 100644 index 000000000..3e581086d --- /dev/null +++ b/centreon-plugins/hardware/pdu/emerson/snmp/mode/psusage.pm @@ -0,0 +1,167 @@ +# +# Copyright 2016 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 hardware::pdu::emerson::snmp::mode::psusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'ps', type => 1, cb_prefix_output => 'prefix_ps_output', message_multiple => 'All power sources are ok' }, + ]; + + $self->{maps_counters}->{ps} = [ + { label => 'power', set => { + key_values => [ { name => 'PwrTotal' }, { name => 'display' } ], + output_template => 'total input power : %s W', output_error_template => "total input power : %s", + perfdatas => [ + { label => 'power', value => 'PwrTotal_absolute', template => '%s', + unit => 'W', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'energy', set => { + key_values => [ { name => 'EnergyAccum', diff => 1 }, { name => 'display' } ], + output_template => 'Total energy : %.3f kWh', output_error_template => "Total energy : %s", + perfdatas => [ + { label => 'energy', value => 'EnergyAccum_absolute', template => '%.3f', + unit => 'kWh', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'current-neutral', set => { + key_values => [ { name => 'EcNeutral' }, { name => 'display' } ], + output_template => 'Current neutral : %s Amp AC RMS', output_error_template => "Current neutral : %s", + perfdatas => [ + { label => 'current_neutral', value => 'EcNeutral_absolute', template => '%s', + unit => 'AmpAcRMS', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_ps_output { + my ($self, %options) = @_; + + return "Power source '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + + return $self; +} + +my $mapping = { + lgpPduPsEntrySysAssignLabel => { oid => '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.15' }, + lgpPduPsEntryEnergyAccum => { oid => '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.50' }, # 0.1 Kilowatt-Hour + lgpPduPsEntryPwrTotal => { oid => '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.65' }, # Watt + lgpPduPsEntryEcNeutral => { oid => '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.70' }, # 0.1 Amp-AC-RMS +}; +my $oid_lgpPduEntryUsrLabel = '.1.3.6.1.4.1.476.1.42.3.8.20.1.10'; +my $oid_lgpPduPsEntry = '.1.3.6.1.4.1.476.1.42.3.8.30.20.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cache_name} = "pdu_emerson_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')) . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + $self->{ps} = {}; + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_lgpPduEntryUsrLabel }, + { oid => $oid_lgpPduPsEntry }, + ], + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}->{$oid_lgpPduPsEntry}}) { + next if ($oid !~ /^$mapping->{lgpPduPsEntryPwrTotal}->{oid}\.(\d+)\.(\d+)/); + my ($pdu_index, $ps_index) = ($1, $2); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_lgpPduPsEntry}, instance => $pdu_index . '.' . $ps_index); + my $pdu_name = defined($self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index}) && $self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index} ne '' ? + $self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index} : $pdu_index; + my $ps_name = defined($result->{lgpPduPsEntrySysAssignLabel}) && $result->{lgpPduPsEntrySysAssignLabel} ne '' ? + $result->{lgpPduPsEntrySysAssignLabel} : $ps_index; + my $name = $pdu_name . '/' . $ps_name; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{ps}->{$pdu_index . '.' . $ps_index} = { display => $name, + EnergyAccum => $result->{lgpPduPsEntryEnergyAccum} * 0.1, + PwrTotal => $result->{lgpPduPsEntryPwrTotal}, + EcNeutral => $result->{lgpPduPsEntryEcNeutral} * 0.1}; + } + + if (scalar(keys %{$self->{ps}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "Cannot found power sources."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check power source usage. + +=over 8 + +=item B<--filter-name> + +Filter power source name (can be a regexp). + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^(power|energy)$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'power', 'energy', 'current-neutral'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'power', 'energy', 'current-neutral'. + +=back + +=cut diff --git a/centreon-plugins/hardware/pdu/emerson/snmp/mode/rbusage.pm b/centreon-plugins/hardware/pdu/emerson/snmp/mode/rbusage.pm new file mode 100644 index 000000000..2de7a63d7 --- /dev/null +++ b/centreon-plugins/hardware/pdu/emerson/snmp/mode/rbusage.pm @@ -0,0 +1,191 @@ +# +# Copyright 2016 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 hardware::pdu::emerson::snmp::mode::rbusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'rb', type => 1, cb_prefix_output => 'prefix_rb_output', message_multiple => 'All receptacle branches are ok' }, + ]; + + $self->{maps_counters}->{rb} = [ + { label => 'energy', set => { + key_values => [ { name => 'EnergyAccum', diff => 1 }, { name => 'display' } ], + output_template => 'total energy : %.3f kWh', output_error_template => "total energy : %s", + perfdatas => [ + { label => 'energy', value => 'EnergyAccum_absolute', template => '%.3f', + unit => 'kWh', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'power-real-neutral', set => { + key_values => [ { name => 'Pwr' }, { name => 'display' } ], + output_template => 'line-to-neutral real power : %s W', output_error_template => "line-to-neutral real power : %s", + perfdatas => [ + { label => 'power_real_neutral', value => 'Pwr_absolute', template => '%s', + unit => 'W', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'power-apparent-neutral', set => { + key_values => [ { name => 'Ap' }, { name => 'display' } ], + output_template => 'line-to-neutral apparent power : %s VA', output_error_template => "line-to-neutral apparent power : %s", + perfdatas => [ + { label => 'power_apparent_neutral', value => 'Ap_absolute', template => '%s', + unit => 'VA', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'current-neutral', set => { + key_values => [ { name => 'EcHundredths' }, { name => 'display' } ], + output_template => 'line-to-neutral current : %s Amp AC RMS', output_error_template => "line-to-neutral current : %s", + perfdatas => [ + { label => 'current_neutral', value => 'EcHundredths_absolute', template => '%s', + unit => 'AmpAcRMS', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'potential-neutral', set => { + key_values => [ { name => 'EpLNTenths' }, { name => 'display' } ], + output_template => 'line-to-neutral potential : %s VoltRMS', output_error_template => "line-to-neutral potential : %s", + perfdatas => [ + { label => 'potential_neutral', value => 'EpLNTenths_absolute', template => '%s', + unit => 'VoltRMS', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_rb_output { + my ($self, %options) = @_; + + return "Receptacle branch '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + + return $self; +} + +my $mapping = { + lgpPduRbEntryUsrLabel => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.8' }, + lgpPduRbEntryEnergyAccum => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.85' }, # 0.1 Kilowatt-Hour + lgpPduRbEntryEpLNTenths => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.100' }, # 0.1 VoltRMS + lgpPduRbEntryPwr => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.115' }, # Watt + lgpPduRbEntryAp => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.120' }, # VoltAmp + lgpPduRbEntryEcHundredths => { oid => '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.130' }, # 0.01 Amp-AC-RMS +}; +my $oid_lgpPduEntryUsrLabel = '.1.3.6.1.4.1.476.1.42.3.8.20.1.10'; +my $oid_lgpPduRbEntry = '.1.3.6.1.4.1.476.1.42.3.8.40.20.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cache_name} = "pdu_emerson_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')) . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + $self->{rb} = {}; + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_lgpPduEntryUsrLabel }, + { oid => $oid_lgpPduRbEntry }, + ], + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}->{$oid_lgpPduRbEntry}}) { + next if ($oid !~ /^$mapping->{lgpPduRbEntryPwr}->{oid}\.(\d+)\.(\d+)/); + my ($pdu_index, $rb_index) = ($1, $2); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_lgpPduRbEntry}, instance => $pdu_index . '.' . $rb_index); + my $pdu_name = defined($self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index}) && $self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index} ne '' ? + $self->{results}->{$oid_lgpPduEntryUsrLabel}->{$oid_lgpPduEntryUsrLabel . '.' . $pdu_index} : $pdu_index; + my $rb_name = defined($result->{lgpPduRbEntryUsrLabel}) && $result->{lgpPduRbEntryUsrLabel} ne '' ? + $result->{lgpPduRbEntryUsrLabel} : $rb_index; + my $name = $pdu_name . '/' . $rb_name; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{rb}->{$pdu_index . '.' . $rb_index} = { display => $name, + EnergyAccum => $result->{lgpPduRbEntryEnergyAccum} * 0.1, + EpLNTenths => $result->{lgpPduRbEntryEpLNTenths} * 0.1, + Pwr => $result->{lgpPduRbEntryPwr}, + Ap => $result->{lgpPduRbEntryAp}, + EcHundredths => $result->{lgpPduRbEntryEcHundredths} * 0.01}; + } + + if (scalar(keys %{$self->{rb}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "Cannot found receptacle branches."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check receptacle branch usage. + +=over 8 + +=item B<--filter-name> + +Filter receptacle branch name (can be a regexp). + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^(energy)$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'energy', 'power-real-neutral', 'power-apparent-neutral', +'current-neutral', 'potential-neutral'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'energy', 'power-real-neutral', 'power-apparent-neutral', +'current-neutral', 'potential-neutral'. + +=back + +=cut diff --git a/centreon-plugins/hardware/pdu/emerson/snmp/plugin.pm b/centreon-plugins/hardware/pdu/emerson/snmp/plugin.pm new file mode 100644 index 000000000..f137dae18 --- /dev/null +++ b/centreon-plugins/hardware/pdu/emerson/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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 hardware::pdu::emerson::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}} = ( + 'global-status' => 'hardware::pdu::emerson::snmp::mode::globalstatus', + 'ps-usage' => 'hardware::pdu::emerson::snmp::mode::psusage', + 'rb-usage' => 'hardware::pdu::emerson::snmp::mode::rbusage', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Emerson Liebert PDU in SNMP. + +=cut From 43294055520abd4c4266e2c06e2c0e1d7b3ee2e6 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 9 Feb 2016 15:55:07 +0100 Subject: [PATCH 097/346] + Add poorcalls monitoring for MS Lync 2013 --- .../apps/lync/2013/mssql/mode/poorcalls.pm | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/poorcalls.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/poorcalls.pm b/centreon-plugins/apps/lync/2013/mssql/mode/poorcalls.pm new file mode 100644 index 000000000..96d8a21bf --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/poorcalls.pm @@ -0,0 +1,136 @@ +# +# Copyright 2016 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 apps::lync::2013::mssql::mode::poorcalls; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'uri', type => 1, cb_prefix_output => 'prefix_uri_output', message_multiple => 'All users are ok' }, + + ]; + + $self->{maps_counters}->{global} = [ + { label => 'global', set => { + key_values => [ { name => 'count' } ], + output_template => '%d Poor calls', + perfdatas => [ + { label => 'poor_calls', value => 'count_absolute', template => '%d', + unit => 'calls', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{uri} = [ + { label => 'user', set => { + key_values => [ { name => 'count' }, { name => 'display' } ], + output_template => 'count : %d', + perfdatas => [ + { label => 'poor_calls', value => 'count_absolute', template => '%d', + unit => 'calls', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + 'lookback:s' => { name => 'lookback', default => '65' }, + 'filter-user:s' => { name => 'filter_user' }, + }); + return $self; +} + +sub prefix_uri_output { + my ($self, %options) = @_; + + return "'" . $options{instance_value}->{display} . "' "; +} + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + $self->{sql}->query(query => "SELECT URI, LastPoorCallTime + FROM [QoEMetrics].[dbo].[User] + WHERE LastPoorCallTime>=dateadd(minute,-".$self->{option_results}->{lookback}.",getdate())"); + my $total; + while (my $row = $self->{sql}->fetchrow_hashref()) { + if (defined($self->{option_results}->{filter_user}) && $self->{option_results}->{filter_user} ne '' && + $row->{URI} !~ /$self->{option_results}->{filter_user}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $row->{URI} . "': no matching filter.", debug => 1); + next; + } + $self->{global}->{count}++; + $self->{uri}->{$row->{URI}} = {count => 0, display => $row->{URI}} if (!defined($self->{uri}->{$row->{URI}})); + $self->{uri}->{$row->{URI}}->{count}++; + } + +} + +1; + +__END__ + +=head1 MODE + +Check Lync Poor Calls during last X minutes (Total and per users) + +=over 8 + +=item B<--filter-user> + +Filter user name (can be a regexp) + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--lookback> + +Minutes to lookback (From you to UTC) default: 65 + +=item B<--warning-*> + +Set warning threshold for number of poor calls. Can be : 'total', 'user' + +=item B<--critical-*> + +Set critical threshold for number of poor calls. Can be : 'total', 'user' + +=back + +=cut From cb25d00ceb2cd08ec1e5b246381b9a8e25fae0c6 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 9 Feb 2016 15:56:45 +0100 Subject: [PATCH 098/346] + Add mode for unique and total users MS Lync 2013 --- .../apps/lync/2013/mssql/mode/lyncusers.pm | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm b/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm new file mode 100644 index 000000000..487c96657 --- /dev/null +++ b/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm @@ -0,0 +1,118 @@ +# +# Copyright 2016 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 apps::lync::2013::mssql::mode::lyncusers; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'users', type => 1, cb_prefix_output => 'prefix_user_output', message_multiple => 'User counts are OK' }, + ]; + + $self->{maps_counters}->{users} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => '%d Total users', + perfdatas => [ + { label => 'total_users', value => 'total_absolute', template => '%d', + unit => 'users', min => 0, label_extra_instance => 0 }, + ], + } + }, + { label => 'unique', set => { + key_values => [ { name => 'unique' } ], + output_template => '%d Unique users', + perfdatas => [ + { label => 'total_users', value => 'unique_absolute', template => '%d', + unit => 'users', min => 0, label_extra_instance => 0 }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +sub prefix_user_output { + my ($self, %options) = @_; + + return "'" . $options{instance_value}->{display} . "' "; +} + +sub manage_selection { + my ($self, %options) = @_; + # $options{sql} = sqlmode object + $self->{sql} = $options{sql}; + $self->{sql}->connect(); + + $self->{sql}->query(query => q{Select count(*) as totalonline, + count(distinct UserAtHost) as totalunique + From rtcdyn.dbo.RegistrarEndpoint RE + Inner Join + rtc.dbo.Resource R on R.ResourceId = RE.OwnerId + Inner Join + rtcdyn.dbo.Registrar Reg on Reg.RegistrarId = RE.PrimaryRegistrarClusterId}); + + my ($total_online, $total_unique) = $self->{sql}->fetchrow_array(); + $self->{users}{total} = { total => $total_online, unique => $total_unique, display => 'Frontend' }; + +} + +1; + +__END__ + +=head1 MODE + +Check Lync Users Total and Unique. Query your RTCLocal Lync Frontend Dabatase (Get instance port in SQL Server configuration if dynamic mode) + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--warning-*> + +Set warning threshold for number of user. Can be : 'total', 'unique' + +=item B<--critical-*> + +Set critical threshold for number of user. Can be : 'total', 'unique' + +=back + +=cut From 12648327c10b21ac5e8b12a53bb64b13eaa5a7bd Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 9 Feb 2016 16:13:01 +0100 Subject: [PATCH 099/346] + fix error in perfdata label Thanks Quentin ;) --- centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm b/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm index 487c96657..9e04aaff5 100644 --- a/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm +++ b/centreon-plugins/apps/lync/2013/mssql/mode/lyncusers.pm @@ -46,7 +46,7 @@ sub set_counters { key_values => [ { name => 'unique' } ], output_template => '%d Unique users', perfdatas => [ - { label => 'total_users', value => 'unique_absolute', template => '%d', + { label => 'unique_users', value => 'unique_absolute', template => '%d', unit => 'users', min => 0, label_extra_instance => 0 }, ], } From 69a0f3b4f74a1bde53b08eb43a1ccb36dca9922b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 10 Feb 2016 10:58:48 +0100 Subject: [PATCH 100/346] + Fix #245 --- .../common/cisco/standard/snmp/mode/components/fan.pm | 2 +- .../common/cisco/standard/snmp/mode/components/module.pm | 3 ++- .../common/cisco/standard/snmp/mode/components/physical.pm | 3 ++- .../common/cisco/standard/snmp/mode/components/psu.pm | 2 +- .../common/cisco/standard/snmp/mode/components/sensor.pm | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm index d34d81215..a869a541b 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/fan.pm @@ -103,7 +103,7 @@ sub check_fan_entity { my $exit = $self->get_severity(section => 'fan', value => $result->{cefcFanTrayOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Fan '%s' status is %s.", $fan_descr, $result->{cefcFanTrayOperStatus})); + short_msg => sprintf("Fan '%s/%s' status is %s", $fan_descr, $instance, $result->{cefcFanTrayOperStatus})); } } } diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm index ba77b43c2..36987ed71 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/module.pm @@ -87,7 +87,8 @@ sub check { my $exit = $self->get_severity(section => 'module', value => $result->{cefcModuleOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Module '%s' status is %s", $module_descr, $result->{cefcModuleOperStatus})); + short_msg => sprintf("Module '%s/%s' status is %s", $module_descr, + $instance, $result->{cefcModuleOperStatus})); } } } diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm index 605779c82..debfd9d0f 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/physical.pm @@ -69,7 +69,8 @@ sub check { my $exit = $self->get_severity(section => 'physical', value => $result->{cefcPhysicalStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Physical '%s' status is %s", $physical_descr, $result->{cefcPhysicalStatus})); + short_msg => sprintf("Physical '%s/%s' status is %s", $physical_descr, + $instance, $result->{cefcPhysicalStatus})); } } } diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm index 9903a4a54..f92712a58 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/psu.pm @@ -119,7 +119,7 @@ sub check_psu_entity { my $exit = $self->get_severity(section => 'psu', value => $result->{cefcFRUPowerOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power supply '%s' status is %s.", $psu_descr, $result->{cefcFRUPowerOperStatus})); + short_msg => sprintf("Power supply '%s/%s' status is %s", $psu_descr, $instance, $result->{cefcFRUPowerOperStatus})); } } } diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm index 4aa241d87..8b0c93814 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm @@ -202,8 +202,8 @@ sub check { my $exit = $self->get_severity(section => $result->{entSensorType}, label => 'sensor', value => $result->{entSensorStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Sensor '%s' status is '%s'", - $sensor_descr, $result->{entSensorStatus})); + short_msg => sprintf("Sensor '%s/%s' status is '%s'", + $sensor_descr, $instance, $result->{entSensorStatus})); } next if (!defined($result->{entSensorValue}) || $result->{entSensorValue} !~ /[0-9]/); @@ -222,7 +222,7 @@ sub check { } if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit2, - short_msg => sprintf("Sensor '%s' is %s %s", $sensor_descr, $result->{entSensorValue}, $perfdata_unit{$result->{entSensorType}})); + short_msg => sprintf("Sensor '%s/%s' is %s %s", $sensor_descr, $instance, $result->{entSensorValue}, $perfdata_unit{$result->{entSensorType}})); } $self->{output}->perfdata_add(label => $component . '_' . $sensor_descr, unit => $perfdata_unit{$result->{entSensorType}}, value => $result->{entSensorValue}, From 67407b3e3087a78e33bf062519f7d05853cdf7a4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 10 Feb 2016 13:56:42 +0100 Subject: [PATCH 101/346] + Fix #15 --- .../apps/protocols/dns/lib/dns.pm | 2 +- .../apps/protocols/dns/mode/request.pm | 54 ++++++++++++++----- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/centreon-plugins/apps/protocols/dns/lib/dns.pm b/centreon-plugins/apps/protocols/dns/lib/dns.pm index 14b2e85c6..9416a313d 100644 --- a/centreon-plugins/apps/protocols/dns/lib/dns.pm +++ b/centreon-plugins/apps/protocols/dns/lib/dns.pm @@ -72,7 +72,7 @@ sub search { } } - return @results; + return sort @results; } sub connect { diff --git a/centreon-plugins/apps/protocols/dns/mode/request.pm b/centreon-plugins/apps/protocols/dns/mode/request.pm index ef27ffad9..f6511037c 100644 --- a/centreon-plugins/apps/protocols/dns/mode/request.pm +++ b/centreon-plugins/apps/protocols/dns/mode/request.pm @@ -26,6 +26,8 @@ use strict; use warnings; use Time::HiRes qw(gettimeofday tv_interval); use apps::protocols::dns::lib::dns; +use centreon::plugins::statefile; +use Digest::MD5 qw(md5_hex); sub new { my ($class, %options) = @_; @@ -40,11 +42,13 @@ sub new { "dns-options:s@" => { name => 'dns_options' }, "search:s" => { name => 'search' }, "search-type:s" => { name => 'search_type' }, - "search-field:s" => { name => 'search_field' }, "expected-answer:s" => { name => 'expected_answer' }, "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, + "memory" => { name => 'memory' }, }); + + $self->{statefile_cache} = centreon::plugins::statefile->new(%options); return $self; } @@ -65,6 +69,21 @@ sub check_options { $self->{output}->add_option_msg(short_msg => "Please set the search option"); $self->{output}->option_exit(); } + + if (defined($self->{option_results}->{memory})) { + $self->{cache_filename} = $self->{option_results}->{search}; + foreach (('search_type', 'search', 'nameservers')) { + $self->{cache_filename} .= '_'; + if (defined($self->{option_results}->{$_})) { + if (ref($self->{option_results}->{$_}) eq 'ARRAY') { + $self->{cache_filename} .= join('-', @{$self->{option_results}->{$_}}); + } else { + $self->{cache_filename} .= $self->{option_results}->{$_}; + } + } + } + $self->{statefile_cache}->check_options(%options); + } } sub run { @@ -79,7 +98,7 @@ sub run { my $result_str = join(', ', @results); my $exit = $self->{perfdata}->threshold_check(value => $timeelapsed, - threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); $self->{output}->output_add(severity => $exit, short_msg => sprintf("Response time %.3f second(s) (answer: %s)", $timeelapsed, $result_str)); $self->{output}->perfdata_add(label => "time", unit => 's', @@ -101,6 +120,21 @@ sub run { } } + if (defined($self->{option_results}->{memory})) { + $self->{statefile_cache}->read(statefile => 'cache_dns_' . md5_hex($self->{cache_filename})); + my $datas = { result => $result_str }; + my $old_result = $self->{statefile_cache}->get(name => "result"); + if (defined($old_result)) { + if ($old_result ne $result_str) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("Result has changed [answer: %s] [old answer: %s]", $result_str, $old_result)); + } + } else { + $self->{output}->output_add(long_msg => 'cache file created.'); + } + $self->{statefile_cache}->write(data => $datas); + } + $self->{output}->display(); $self->{output}->exit(); } @@ -136,14 +170,6 @@ Set the search value (required). Set the search type. Can be: 'MX', 'SOA', 'NS', 'A' or 'PTR'. 'A' or 'PTR' is used by default (depends if an IP or not). -=item B<--search-field> - -Set the search field used for 'expected-answer'. -By default: -'MX' is 'exchange', 'SOA' is 'mname', 'NS' is 'nsdname', -'A' is 'address' and 'PTR' is 'name'. -'A' or 'PTR' is used by default (depends if an IP or not). - =item B<--expected-answer> What the server must answer (can be a regexp). @@ -154,13 +180,17 @@ Add custom dns options. Example: --dns-options='debug=1' --dns-options='retry=2' --dns-options='port=972' --dns-options='recurse=0' ... +=item B<--memory> + +Critical threshold if the answer changed between two checks. + =item B<--warning> -Threshold warning in seconds +Threshold warning in seconds. =item B<--critical> -Threshold critical in seconds +Threshold critical in seconds. =back From 008f030443bee1cbc04daec8b79c08048077f6e1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 10 Feb 2016 16:39:50 +0100 Subject: [PATCH 102/346] + Fix #286 --- .../ucopia/wlc/snmp/mode/temperature.pm | 111 ++++++++++++++++++ .../network/ucopia/wlc/snmp/mode/users.pm | 100 ++++++++++++++++ .../network/ucopia/wlc/snmp/plugin.pm | 50 ++++++++ 3 files changed, 261 insertions(+) create mode 100644 centreon-plugins/network/ucopia/wlc/snmp/mode/temperature.pm create mode 100644 centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm create mode 100644 centreon-plugins/network/ucopia/wlc/snmp/plugin.pm diff --git a/centreon-plugins/network/ucopia/wlc/snmp/mode/temperature.pm b/centreon-plugins/network/ucopia/wlc/snmp/mode/temperature.pm new file mode 100644 index 000000000..56c704437 --- /dev/null +++ b/centreon-plugins/network/ucopia/wlc/snmp/mode/temperature.pm @@ -0,0 +1,111 @@ +# +# Copyright 2016 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::ucopia::wlc::snmp::mode::temperature; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + my $oid_cpuTemperature = '.1.3.6.1.4.1.31218.3.3.0'; + my $oid_diskTemperature = '.1.3.6.1.4.1.31218.3.4.0'; + + my $result = $options{snmp}->get_leef(oids => [$oid_cpuTemperature, $oid_diskTemperature], nothing_quit => 1); + + if ($result->{$oid_cpuTemperature} != 0) { + my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_cpuTemperature}, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("CPU Temp: %dC", $result->{$oid_cpuTemperature})); + $self->{output}->perfdata_add(value => $result->{$oid_cpuTemperature}, + label => 'cpu_temp', unit => 'C', + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + } + + if ($result->{$oid_diskTemperature} != 0) { + my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_diskTemperature}, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("DISK Temp: %dC", $result->{$oid_diskTemperature})); + $self->{output}->perfdata_add(value => $result->{$oid_diskTemperature}, + label => 'disk_temp', unit => 'C', + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + } + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check temperatures. + +=over 8 + +=item B<--warning> + +Threshold warning. + +=item B<--critical> + +Threshold critical. + +=back + +=cut + diff --git a/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm b/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm new file mode 100644 index 000000000..2be97c1c8 --- /dev/null +++ b/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm @@ -0,0 +1,100 @@ +# +# Copyright 2016 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::ucopia::wlc::snmp::mode::users; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + my $oid_totalConnectedUsers = '.1.3.6.1.4.1.31218.3.1.0'; + my $oid_licenceUsers = '.1.3.6.1.4.1.31218.3.5.0'; + + my $result = $options{snmp}->get_leef(oids => [$oid_totalConnectedUsers, $oid_licenceUsers], nothing_quit => 1); + my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_totalConnectedUsers}, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + + $result->{$oid_licenceUsers} = undef if ($result->{$oid_licenceUsers} == 0); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("'%d' connected users (Available licence: %s)", + $result->{$oid_totalConnectedUsers}), + defined($result->{$oid_licenceUsers}) ? $result->{$oid_licenceUsers} : '-'); + $self->{output}->perfdata_add(value => $result->{$oid_totalConnectedUsers}, label => 'users', + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0, max => $result->{$oid_licenceUsers}); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check connected users. + +=over 8 + +=item B<--warning> + +Threshold warning. + +=item B<--critical> + +Threshold critical. + +=back + +=cut + diff --git a/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm b/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm new file mode 100644 index 000000000..daab7ca41 --- /dev/null +++ b/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::ucopia::wlc::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; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'temperature' => 'network::ucopia::wlc::snmp::mode::temperature', + 'users' => 'network::ucopia::wlc::snmp::mode::users', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Ucopia Wlc in SNMP. + +=cut From f30fad160b9a31362c6a90379344f6f1bfdb055b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 11 Feb 2016 11:12:23 +0100 Subject: [PATCH 103/346] + Better memory snmp for freebsd --- .../os/freebsd/snmp/mode/memory.pm | 203 ++++++++++++++++++ centreon-plugins/os/freebsd/snmp/plugin.pm | 2 +- 2 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 centreon-plugins/os/freebsd/snmp/mode/memory.pm diff --git a/centreon-plugins/os/freebsd/snmp/mode/memory.pm b/centreon-plugins/os/freebsd/snmp/mode/memory.pm new file mode 100644 index 000000000..698e5f7be --- /dev/null +++ b/centreon-plugins/os/freebsd/snmp/mode/memory.pm @@ -0,0 +1,203 @@ +# +# Copyright 2016 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 os::freebsd::snmp::mode::memory; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + "swap" => { name => 'check_swap' }, + "warning-swap:s" => { name => 'warning_swap' }, + "critical-swap:s" => { name => 'critical_swap' }, + "no-swap:s" => { name => 'no_swap' }, + }); + $self->{no_swap} = 'critical'; + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } + if (defined($self->{option_results}->{check_swap})) { + if (($self->{perfdata}->threshold_validate(label => 'warning-swap', value => $self->{option_results}->{warning_swap})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning-swap threshold '" . $self->{option_results}->{warning_swap} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical-swap', value => $self->{option_results}->{critical_swap})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical-swap threshold '" . $self->{option_results}->{critical_swap} . "'."); + $self->{output}->option_exit(); + } + if (defined($self->{option_results}->{no_swap}) && $self->{option_results}->{no_swap} ne '') { + if ($self->{output}->is_litteral_status(status => $self->{option_results}->{no_swap}) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong --no-swap status '" . $self->{option_results}->{no_swap} . "'."); + $self->{output}->option_exit(); + } + $self->{no_swap} = $self->{option_results}->{no_swap}; + } + } +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + # with bsnmpd-ucd 0.4.1 + my $oid_memTotalReal = '.1.3.6.1.4.1.2021.4.5.0'; # hw.physmem + my $oid_memAvailReal = '.1.3.6.1.4.1.2021.4.6.0'; # vm.stats.vm.v_free_count + my $oid_memShared = '.1.3.6.1.4.1.2021.4.13.0'; # not needed + my $oid_memBuffer = '.1.3.6.1.4.1.2021.4.14.0'; # vfs.bufspace (not needed) + my $oid_memCached = '.1.3.6.1.4.1.2021.4.15.0'; # vm.stats.vm.v_cache_count + vm.stats.vm.v_inactive_count + my $oid_memTotalSwap = '.1.3.6.1.4.1.2021.4.3.0'; # KB + my $oid_memAvailSwap = '.1.3.6.1.4.1.2021.4.4.0'; # KB + + my $oids = [$oid_memTotalReal, $oid_memAvailReal, + $oid_memShared, $oid_memBuffer, $oid_memCached]; + if (defined($self->{option_results}->{check_swap})) { + push @$oids, ($oid_memTotalSwap, $oid_memAvailSwap); + } + + my $result = $self->{snmp}->get_leef(oids => $oids, + nothing_quit => 1); + + my $cached_used = $result->{$oid_memCached} * 1024; + my $physical_used = ($result->{$oid_memTotalReal} * 1024) - ($result->{$oid_memAvailReal} * 1024); + # mem_available = total - mem_inactive - mem_cache - mem_free + # Maybe it's will be better to have have total with: total = 'active' + 'wired' + 'cache' + 'inactive' + 'free' + # But i can't have that with values from bsnmpd-ucd + my $nobuf_used = $physical_used - $cached_used; + + my $total_size = $result->{$oid_memTotalReal} * 1024; + + my $prct_used = $nobuf_used * 100 / $total_size; + my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + + my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size); + my ($nobuf_value, $nobuf_unit) = $self->{perfdata}->change_bytes(value => $nobuf_used); + my ($cached_value, $cached_unit) = $self->{perfdata}->change_bytes(value => $cached_used); + + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Ram Total: %s, Used (-cache): %s (%.2f%%), Cached: %s", + $total_value . " " . $total_unit, + $nobuf_value . " " . $nobuf_unit, $prct_used, + $cached_value . " " . $cached_unit)); + + $self->{output}->perfdata_add(label => "cached", unit => 'B', + value => $cached_used, + min => 0); + $self->{output}->perfdata_add(label => "used", unit => 'B', + value => $nobuf_used, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $total_size, cast_int => 1), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $total_size, cast_int => 1), + min => 0, max => $total_size); + + if (defined($self->{option_results}->{check_swap})) { + if ($result->{$oid_memTotalSwap} == 0) { + $self->{output}->output_add(severity => $self->{no_swap}, + short_msg => 'No active swap.'); + $self->{output}->display(); + $self->{output}->exit(); + } + + $total_size = $result->{$oid_memTotalSwap} * 1024; + my $swap_used = ($result->{$oid_memTotalSwap} - $result->{$oid_memAvailSwap}) * 1024; + + $prct_used = $swap_used * 100 / $total_size; + $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical-swap', 'exit_litteral' => 'critical' }, { label => 'warning-swap', exit_litteral => 'warning' } ]); + + my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size); + my ($swap_used_value, $swap_used_unit) = $self->{perfdata}->change_bytes(value => $swap_used); + my ($swap_free_value, $swap_free_unit) = $self->{perfdata}->change_bytes(value => ($total_size - $swap_used)); + + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Swap Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_value . " " . $total_unit, + $swap_used_value . " " . $swap_used_unit, $prct_used, + $swap_free_value . " " . $swap_free_unit, (100 - $prct_used))); + + $self->{output}->perfdata_add(label => "swap", unit => 'B', + value => $swap_used, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-swap', total => $total_size, cast_int => 1), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-swap', total => $total_size, cast_int => 1), + min => 0, max => $total_size); + } + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check physical memory (UCD-SNMP-MIB). + +=over 8 + +=item B<--warning> + +Threshold warning in percent. + +=item B<--critical> + +Threshold critical in percent. + +=item B<--swap> + +Check swap also. + +=item B<--warning-swap> + +Threshold warning in percent. + +=item B<--critical-swap> + +Threshold critical in percent. + +=item B<--no-swap> + +Threshold if no active swap (default: 'critical'). + +=back + +=cut diff --git a/centreon-plugins/os/freebsd/snmp/plugin.pm b/centreon-plugins/os/freebsd/snmp/plugin.pm index 1b0ac9867..136c4a9ec 100644 --- a/centreon-plugins/os/freebsd/snmp/plugin.pm +++ b/centreon-plugins/os/freebsd/snmp/plugin.pm @@ -42,7 +42,7 @@ sub new { 'list-diskspath' => 'snmp_standard::mode::listdiskspath', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'list-storages' => 'snmp_standard::mode::liststorages', - 'memory' => 'snmp_standard::mode::memory', + 'memory' => 'os::freebsd::snmp::mode::memory', 'processcount' => 'snmp_standard::mode::processcount', 'storage' => 'snmp_standard::mode::storage', 'swap' => 'snmp_standard::mode::swap', From 0afbb32bd796c6a557d5475e909c368b06ff82d5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 11 Feb 2016 17:34:52 +0100 Subject: [PATCH 104/346] + Fix list-interfaces warn message --- .../snmp_standard/mode/listinterfaces.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index 511af60c2..c8634f78b 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -146,8 +146,10 @@ sub run { my $interface_speed = 0; if ($self->{no_speed} == 0) { - $interface_speed = (defined($result->{$oid_speed64 . "." . $_}) && $result->{$oid_speed64 . "." . $_} ne '' && $result->{$oid_speed64 . "." . $_} != 0 ? - ($result->{$oid_speed64 . "." . $_}) : (sprintf("%g", $result->{$oid_speed32 . "." . $_} / 1000 / 1000))); + $interface_speed = (defined($result->{$oid_speed64 . "." . $_}) && $result->{$oid_speed64 . "." . $_} ne '' && $result->{$oid_speed64 . "." . $_} != 0) ? + ($result->{$oid_speed64 . "." . $_}) : + (defined($result->{$oid_speed32 . "." . $_}) && $result->{$oid_speed32 . "." . $_} ne '' && $result->{$oid_speed32 . "." . $_} != 0 ? + (sprintf("%g", $result->{$oid_speed32 . "." . $_} / 1000 / 1000)) : ''); } if (defined($self->{option_results}->{speed}) && $self->{option_results}->{speed} ne '') { $interface_speed = $self->{option_results}->{speed}; @@ -173,7 +175,9 @@ sub run { $extra_display_append = ', '; } - $self->{output}->output_add(long_msg => "'" . $display_value . "' [speed = $interface_speed, status = " . $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}} . ', id = ' . $_ . $extra_display . ']'); + $self->{output}->output_add(long_msg => "'" . $display_value . "' [speed = $interface_speed, status = " . + (defined($result->{$self->{oid_opstatus} . "." . $_}) ? $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}} : '') . + ', id = ' . $_ . $extra_display . ']'); } $self->{output}->output_add(severity => 'OK', @@ -283,8 +287,10 @@ sub disco_show { my $interface_speed = 0; if ($self->{no_speed} == 0) { - $interface_speed = (defined($result->{$oid_speed64 . "." . $_}) && $result->{$oid_speed64 . "." . $_} ne '' && $result->{$oid_speed64 . "." . $_} != 0 ? - ($result->{$oid_speed64 . "." . $_}) : (sprintf("%g", $result->{$oid_speed32 . "." . $_} / 1000 / 1000))); + $interface_speed = (defined($result->{$oid_speed64 . "." . $_}) && $result->{$oid_speed64 . "." . $_} ne '' && $result->{$oid_speed64 . "." . $_} != 0) ? + ($result->{$oid_speed64 . "." . $_}) : + (defined($result->{$oid_speed32 . "." . $_}) && $result->{$oid_speed32 . "." . $_} ne '' && $result->{$oid_speed32 . "." . $_} != 0 ? + (sprintf("%g", $result->{$oid_speed32 . "." . $_} / 1000 / 1000)) : ''); } if (defined($self->{option_results}->{speed}) && $self->{option_results}->{speed} ne '') { $interface_speed = $self->{option_results}->{speed}; @@ -302,7 +308,7 @@ sub disco_show { $self->{output}->add_disco_entry(name => $display_value, total => $interface_speed, - status => $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}}, + status => defined($result->{$self->{oid_opstatus} . "." . $_}) ? $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}} : '', interfaceid => $_, %extra_values); } From c1ee7544ac2be9a4caa4ace09421e85cd321b99e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 12 Feb 2016 15:41:47 +0100 Subject: [PATCH 105/346] + Enhance cpu for cisco ironport --- .../network/cisco/ironport/snmp/mode/cpu.pm | 99 +++++++++---------- 1 file changed, 46 insertions(+), 53 deletions(-) diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm index 78c3887e8..26f49cfa5 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/cpu.pm @@ -20,11 +20,39 @@ package network::cisco::ironport::snmp::mode::cpu; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ', skipped_code => { -10 => 1 } }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'mail', set => { + key_values => [ { name => 'perCentCPUUtilization' } ], + output_template => 'CPU Mail usage is: %.2f%%', + perfdatas => [ + { label => 'cpu_mail', value => 'perCentCPUUtilization_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'websecurity', set => { + key_values => [ { name => 'cacheCpuUsage' } ], + output_template => 'CPU WebSecurity usage is: %.2f%%', + perfdatas => [ + { label => 'cpu_websecurity', value => 'cacheCpuUsage_absolute', template => '%.2f', + min => 0, max => 100, unit => '%' }, + ], + } + }, + ]; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -32,62 +60,24 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, + { }); return $self; } -sub check_options { +sub manage_selection { my ($self, %options) = @_; - $self->SUPER::init(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); + my %oids = ( + perCentCPUUtilization => '.1.3.6.1.4.1.15497.1.1.1.2.0', + cacheCpuUsage => '.1.3.6.1.4.1.15497.1.2.3.1.2.0', + ); + my $result = $options{snmp}->get_leef(oids => [values %oids], nothing_quit => 1); + $self->{global} = {}; + foreach (keys %oids) { + $self->{global}->{$_} = $result->{$oids{$_}} if (defined($result->{$oids{$_}})); } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $oid_perCentCPUUtilization = '.1.3.6.1.4.1.15497.1.1.1.2.0'; - my $oid_cacheCpuUsage = '.1.3.6.1.4.1.15497.1.2.3.1.2.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_perCentCPUUtilization, $oid_cacheCpuUsage], nothing_quit => 1); - - if (defined($result->{$oid_perCentCPUUtilization})) { - my $exit_code = $self->{perfdata}->threshold_check(value => $result->{$oid_perCentCPUUtilization}, - threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("CPU Mail usage is: %.2f%%", $result->{$oid_perCentCPUUtilization})); - $self->{output}->perfdata_add(label => 'cpu_mail', unit => '%', - value => sprintf("%.2f", $result->{$oid_perCentCPUUtilization}), - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0, max => 100); - } - if (defined($result->{$oid_cacheCpuUsage})) { - my $exit_code = $self->{perfdata}->threshold_check(value => $result->{$oid_cacheCpuUsage}, - threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("CPU WebSecurity usage is: %.2f%%", $result->{$oid_cacheCpuUsage})); - $self->{output}->perfdata_add(label => 'cpu_websecurity', unit => '%', - value => sprintf("%.2f", $result->{$oid_cacheCpuUsage}), - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0, max => 100); - } - - $self->{output}->display(); - $self->{output}->exit(); } 1; @@ -97,16 +87,19 @@ __END__ =head1 MODE Check cpu usage of web security and mail (ASYNCOS-MAIL-MIB, ASYNCOSWEBSECURITYAPPLIANCE-MIB). +Use linux SNMP plugin for global CPU. =over 8 -=item B<--warning> +=item B<--warning-*> -Threshold warning in percent. +Threshold warning. +Can be: 'mail', 'websecurity'. -=item B<--critical> +=item B<--critical-*> -Threshold critical in percent. +Threshold critical. +Can be: 'mail', 'websecurity'. =back From 4513a9c60377ad9f557e2b3abd11953197fee4b7 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 13 Feb 2016 23:39:09 +0100 Subject: [PATCH 106/346] + ref #201: WIP (still some components todo) --- .../idrac/snmp/mode/components/amperage.pm | 122 ++++++++ .../snmp/mode/components/coolingdevice.pm | 113 ++++++++ .../idrac/snmp/mode/components/coolingunit.pm | 74 +++++ .../dell/idrac/snmp/mode/components/memory.pm | 74 +++++ .../idrac/snmp/mode/components/network.pm | 66 +++++ .../dell/idrac/snmp/mode/components/pci.pm | 74 +++++ .../idrac/snmp/mode/components/processor.pm | 74 +++++ .../dell/idrac/snmp/mode/components/psu.pm | 67 +++++ .../dell/idrac/snmp/mode/components/punit.pm | 74 +++++ .../idrac/snmp/mode/components/resources.pm | 87 ++++++ .../snmp/mode/components/systembattery.pm | 74 +++++ .../idrac/snmp/mode/components/temperature.pm | 55 ++-- .../idrac/snmp/mode/components/voltage.pm | 113 ++++++++ .../server/dell/idrac/snmp/mode/hardware.pm | 264 ++++-------------- 14 files changed, 1091 insertions(+), 240 deletions(-) create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm new file mode 100644 index 000000000..1ebd18442 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm @@ -0,0 +1,122 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::amperage; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_probe_status %map_state %map_amperage_type); + +my $mapping = { + amperageProbeStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.4', map => \%map_state }, + amperageProbeStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.5', map => \%map_probe_status }, + amperageProbeReading => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.6' }, + amperageProbeType => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.7', map => \%map_amperage_type }, + amperageProbeLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.8' }, + amperageProbeUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.10' }, + amperageProbeUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.11' }, + amperageProbeLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.12' }, + amperageProbeLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.30.1.13' }, +}; +my $oid_amperageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.30.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_amperageProbeTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking amperages"); + $self->{components}->{amperage} = {name => 'amperages', total => 0, skip => 0}; + return if ($self->check_filter(section => 'amperage')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_amperageProbeTableEntry}})) { + next if ($oid !~ /^$mapping->{amperageProbeStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_amperageProbeTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'amperage', instance => $instance)); + $self->{components}->{amperage}->{total}++; + + my ($divisor, $unit) = (1000, 'A'); + if ($result->{amperageProbeType} =~ /amperageProbeTypeIsPowerSupplyAmps|amperageProbeTypeIsSystemAmps/) { + $divisor = 10; + } elsif ($result->{amperageProbeType} =~ /amperageProbeTypeIsPowerSupplyWatts|amperageProbeTypeIsSystemWatts/) { + $unit = 'W'; + } + $result->{amperageProbeReading} = (defined($result->{amperageProbeReading})) ? $result->{amperageProbeReading} / $divisor : 'unknown'; + $self->{output}->output_add(long_msg => sprintf("amperage '%s' status is '%s' [instance = %s] [state = %s] [value = %s]", + $result->{amperageProbeLocationName}, $result->{amperageProbeStatus}, $instance, + $result->{amperageProbeStateSettings}, $result->{amperageProbeReading})); + + my $exit = $self->get_severity(label => 'default.state', section => 'amperage.state', value => $result->{amperageProbeStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Amperage '%s' state is '%s'", $result->{amperageProbeLocationName}, $result->{amperageProbeStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'probe.status', section => 'amperage.status', value => $result->{amperageProbeStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Amperage '%s' status is '%s'", $result->{amperageProbeLocationName}, $result->{amperageProbeStatus})); + } + + next if ($result->{amperageProbeType} =~ /amperageProbeTypeIsDiscrete/); + + if (defined($result->{amperageProbeReading}) && $result->{amperageProbeReading} =~ /[0-9]/) { + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'amperage', instance => $instance, value => $result->{amperageProbeReading}); + if ($checked == 0) { + $result->{amperageProbeLowerNonCriticalThreshold} = (defined($result->{amperageProbeLowerNonCriticalThreshold}) && $result->{amperageProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? + $result->{amperageProbeLowerNonCriticalThreshold} / $divisor : ''; + $result->{amperageProbeLowerCriticalThreshold} = (defined($result->{amperageProbeLowerCriticalThreshold}) && $result->{amperageProbeLowerCriticalThreshold} =~ /[0-9]/) ? + $result->{amperageProbeLowerCriticalThreshold} / $divisor : ''; + $result->{amperageProbeUpperNonCriticalThreshold} = (defined($result->{amperageProbeUpperNonCriticalThreshold}) && $result->{amperageProbeUpperNonCriticalThreshold} =~ /[0-9]/) ? + $result->{amperageProbeUpperNonCriticalThreshold} / $divisor : ''; + $result->{amperageProbeUpperCriticalThreshold} = (defined($result->{amperageProbeUpperCriticalThreshold}) && $result->{amperageProbeUpperCriticalThreshold} =~ /[0-9]/) ? + $result->{amperageProbeUpperCriticalThreshold} / $divisor : ''; + my $warn_th = $result->{amperageProbeLowerNonCriticalThreshold} . ':' . $result->{amperageProbeUpperNonCriticalThreshold}; + my $crit_th = $result->{amperageProbeLowerCriticalThreshold} . ':' . $result->{amperageProbeUpperCriticalThreshold}; + $self->{perfdata}->threshold_validate(label => 'warning-amperage-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-amperage-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{amperageProbeReading}, threshold => [ { label => 'critical-amperage-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-amperage-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-amperage-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-amperage-instance-' . $instance) + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Amperage '%s' is %s %s", $result->{amperageProbeLocationName}, $result->{amperageProbeReading}, $unit)); + } + $self->{output}->perfdata_add(label => 'amperage_' . $result->{amperageProbeLocationName}, unit => $unit, + value => $result->{amperageProbeReading}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm new file mode 100644 index 000000000..9eaf13818 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm @@ -0,0 +1,113 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::coolingdevice; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_probe_status %map_state); + +my $mapping = { + coolingDeviceStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.12.1.4', map => \%map_state }, + coolingDeviceStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.12.1.5', map => \%map_probe_status }, + coolingDeviceReading => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.12.1.6' }, + coolingDeviceLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.12.1.8' }, + coolingDeviceUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.10' }, + coolingDeviceUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.11' }, + coolingDeviceLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.12' }, + coolingDeviceLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.12.1.13' }, +}; +my $oid_coolingDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.12.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_coolingDeviceTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking cooling devices"); + $self->{components}->{coolingdevice} = {name => 'cooling devices', total => 0, skip => 0}; + return if ($self->check_filter(section => 'coolingdevice')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_coolingDeviceTableEntry}})) { + next if ($oid !~ /^$mapping->{coolingDeviceStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingDeviceTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'coolingdevice', instance => $instance)); + $self->{components}->{coolingdevice}->{total}++; + + $result->{coolingDeviceReading} = (defined($result->{coolingDeviceReading})) ? $result->{coolingDeviceReading} : 'unknown'; + $self->{output}->output_add(long_msg => sprintf("cooling device '%s' status is '%s' [instance = %s] [state = %s] [value = %s]", + $result->{coolingDeviceLocationName}, $result->{coolingDeviceStatus}, $instance, + $result->{coolingDeviceStateSettings}, $result->{coolingDeviceReading})); + + my $exit = $self->get_severity(label => 'default.state', section => 'coolingdevice.state', value => $result->{coolingDeviceStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cooling device '%s' state is '%s'", $result->{coolingDeviceLocationName}, $result->{coolingDeviceStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'probe.status', section => 'coolingdevice.status', value => $result->{coolingDeviceStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cooling device '%s' status is '%s'", $result->{coolingDeviceLocationName}, $result->{coolingDeviceStatus})); + } + + if (defined($result->{coolingDeviceReading}) && $result->{coolingDeviceReading} =~ /[0-9]/) { + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'coolingdevice', instance => $instance, value => $result->{coolingDeviceReading}); + if ($checked == 0) { + $result->{coolingDeviceLowerNonCriticalThreshold} = (defined($result->{coolingDeviceLowerNonCriticalThreshold}) && $result->{coolingDeviceLowerNonCriticalThreshold} =~ /[0-9]/) ? + $result->{coolingDeviceLowerNonCriticalThreshold} / 10 : ''; + $result->{coolingDeviceLowerCriticalThreshold} = (defined($result->{coolingDeviceLowerCriticalThreshold}) && $result->{coolingDeviceLowerCriticalThreshold} =~ /[0-9]/) ? + $result->{coolingDeviceLowerCriticalThreshold} / 10 : ''; + $result->{coolingDeviceUpperNonCriticalThreshold} = (defined($result->{coolingDeviceUpperNonCriticalThreshold}) && $result->{coolingDeviceUpperNonCriticalThreshold} =~ /[0-9]/) ? + $result->{coolingDeviceUpperNonCriticalThreshold} / 10 : ''; + $result->{coolingDeviceUpperCriticalThreshold} = (defined($result->{coolingDeviceUpperCriticalThreshold}) && $result->{coolingDeviceUpperCriticalThreshold} =~ /[0-9]/) ? + $result->{coolingDeviceUpperCriticalThreshold} : ''; + my $warn_th = $result->{coolingDeviceLowerNonCriticalThreshold} . ':' . $result->{coolingDeviceUpperNonCriticalThreshold}; + my $crit_th = $result->{coolingDeviceLowerCriticalThreshold} . ':' . $result->{coolingDeviceUpperCriticalThreshold}; + $self->{perfdata}->threshold_validate(label => 'warning-coolingdevice-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-coolingdevice-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{coolingDeviceReading}, threshold => [ { label => 'critical-coolingdevice-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-coolingdevice-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-coolingdevice-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-coolingdevice-instance-' . $instance) + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cooling device '%s' is %s rpm", $result->{coolingDeviceLocationName}, $result->{coolingDeviceReading})); + } + $self->{output}->perfdata_add(label => 'fan_' . $result->{coolingDeviceLocationName}, unit => 'rpm', + value => $result->{coolingDeviceReading}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm new file mode 100644 index 000000000..6968331a6 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingunit.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::coolingunit; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + coolingUnitStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.10.1.4', map => \%map_state }, + coolingUnitName => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.10.1.7' }, + coolingUnitStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.10.1.8', map => \%map_status }, +}; +my $oid_coolingUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_coolingUnitTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking cooling units"); + $self->{components}->{coolingunit} = {name => 'cooling units', total => 0, skip => 0}; + return if ($self->check_filter(section => 'coolingunit')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_coolingUnitTableEntry}})) { + next if ($oid !~ /^$mapping->{coolingUnitStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingUnitTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'coolingunit', instance => $instance)); + $self->{components}->{coolingunit}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("cooling unit '%s' status is '%s' [instance = %s] [state = %s]", + $result->{coolingUnitName}, $result->{coolingUnitStatus}, $instance, + $result->{coolingUnitStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'coolingunit.state', value => $result->{coolingUnitStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cooling unit '%s' state is '%s'", $result->{coolingUnitName}, $result->{coolingUnitStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'coolingunit.status', value => $result->{coolingUnitStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cooling unit '%s' status is '%s'", $result->{coolingUnitName}, $result->{coolingUnitStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm new file mode 100644 index 000000000..00d08f636 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/memory.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::memory; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + memoryDeviceStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.50.1.4', map => \%map_state }, + memoryDeviceStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.50.1.5', map => \%map_status }, + memoryDeviceLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.50.1.8' }, +}; +my $oid_memoryDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.50.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_memoryDeviceTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking memories"); + $self->{components}->{memory} = {name => 'memories', total => 0, skip => 0}; + return if ($self->check_filter(section => 'memory')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_memoryDeviceTableEntry}})) { + next if ($oid !~ /^$mapping->{memoryDeviceStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_memoryDeviceTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'memory', instance => $instance)); + $self->{components}->{memory}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("memory '%s' status is '%s' [instance = %s] [state = %s]", + $result->{memoryDeviceLocationName}, $result->{memoryDeviceStatus}, $instance, + $result->{memoryDeviceStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'memory.state', value => $result->{memoryDeviceStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Memory '%s' state is '%s'", $result->{memoryDeviceLocationName}, $result->{memoryDeviceStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'memory.status', value => $result->{memoryDeviceStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Memory '%s' status is '%s'", $result->{memoryDeviceLocationName}, $result->{memoryDeviceStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm new file mode 100644 index 000000000..e83342b77 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/network.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::network; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + networkDeviceStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.90.1.3', map => \%map_status }, + networkDeviceProductName => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.90.1.6' }, +}; +my $oid_networkDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.90.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_networkDeviceTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking networks"); + $self->{components}->{network} = {name => 'networks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'network')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_networkDeviceTableEntry}})) { + next if ($oid !~ /^$mapping->{networkDeviceStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_networkDeviceTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'network', instance => $instance)); + $self->{components}->{network}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("network '%s' status is '%s' [instance = %s]", + $result->{networkDeviceProductName}, $result->{networkDeviceStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default.status', section => 'network.status', value => $result->{networkDeviceStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Network '%s' status is '%s'", $result->{networkDeviceProductName}, $result->{networkDeviceStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm new file mode 100644 index 000000000..497e99352 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pci.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::pci; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + pCIDeviceStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.80.1.4', map => \%map_state }, + pCIDeviceStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.80.1.5', map => \%map_status }, + pCIDeviceDescriptionName => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.80.1.9' }, +}; +my $oid_pCIDeviceTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.80.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_pCIDeviceTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking pci"); + $self->{components}->{pci} = {name => 'pci', total => 0, skip => 0}; + return if ($self->check_filter(section => 'pci')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_pCIDeviceTableEntry}})) { + next if ($oid !~ /^$mapping->{pCIDeviceStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_pCIDeviceTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'pci', instance => $instance)); + $self->{components}->{pci}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("pci '%s' status is '%s' [instance = %s] [state = %s]", + $result->{pCIDeviceDescriptionName}, $result->{pCIDeviceStatus}, $instance, + $result->{pCIDeviceStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'pci.state', value => $result->{pCIDeviceStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("PCI '%s' state is '%s'", $result->{pCIDeviceDescriptionName}, $result->{pCIDeviceStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'pci.status', value => $result->{pCIDeviceStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("PCI '%s' status is '%s'", $result->{pCIDeviceDescriptionName}, $result->{pCIDeviceStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm new file mode 100644 index 000000000..bc2a896ad --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/processor.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::processor; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + processorDeviceStatusStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.32.1.4', map => \%map_state }, + processorDeviceStatusStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.32.1.5', map => \%map_status }, + processorDeviceStatusLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.1100.32.1.7' }, +}; +my $oid_processorDeviceStatusTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1100.32.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_processorDeviceStatusTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking processors"); + $self->{components}->{processor} = {name => 'processors', total => 0, skip => 0}; + return if ($self->check_filter(section => 'processor')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_processorDeviceStatusTableEntry}})) { + next if ($oid !~ /^$mapping->{processorDeviceStatusStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_processorDeviceStatusTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'processor', instance => $instance)); + $self->{components}->{processor}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("processor '%s' status is '%s' [instance = %s] [state = %s]", + $result->{processorDeviceStatusLocationName}, $result->{processorDeviceStatusStatus}, $instance, + $result->{processorDeviceStatusStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'processor.state', value => $result->{processorDeviceStatusStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Processor '%s' state is '%s'", $result->{processorDeviceStatusLocationName}, $result->{processorDeviceStatusStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'processor.status', value => $result->{processorDeviceStatusStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Processor '%s' status is '%s'", $result->{processorDeviceStatusLocationName}, $result->{processorDeviceStatusStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm new file mode 100644 index 000000000..c866a1720 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/psu.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::psu; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + powerSupplyStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.12.1.5', map => \%map_status }, + powerSupplyLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.12.1.8' }, +}; +my $oid_powerSupplyTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.12.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_powerSupplyTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power supplies"); + $self->{components}->{psu} = {name => 'power supplies', total => 0, skip => 0}; + return if ($self->check_filter(section => 'psu')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerSupplyTableEntry}})) { + next if ($oid !~ /^$mapping->{powerSupplyStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerSupplyTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'psu', instance => $instance)); + $self->{components}->{psu}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance = %s]", + $result->{powerSupplyLocationName}, $result->{powerSupplyStatus}, $instance, + )); + + + my $exit = $self->get_severity(label => 'default.status', section => 'psu.status', value => $result->{powerSupplyStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power supply '%s' status is '%s'", $result->{powerSupplyLocationName}, $result->{powerSupplyStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm new file mode 100644 index 000000000..d42aead49 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/punit.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::punit; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + powerUnitStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.10.1.4', map => \%map_state }, + powerUnitName => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.10.1.7' }, + powerUnitStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.10.1.8', map => \%map_status }, +}; +my $oid_powerUnitTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_powerUnitTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power units"); + $self->{components}->{punit} = {name => 'power units', total => 0, skip => 0}; + return if ($self->check_filter(section => 'punit')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_powerUnitTableEntry}})) { + next if ($oid !~ /^$mapping->{powerUnitStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerUnitTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'punit', instance => $instance)); + $self->{components}->{punit}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power unit '%s' status is '%s' [instance = %s] [state = %s]", + $result->{powerUnitName}, $result->{powerUnitStatus}, $instance, + $result->{powerUnitStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'punit.state', value => $result->{powerUnitStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power unit '%s' state is '%s'", $result->{powerUnitName}, $result->{powerUnitStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'punit.status', value => $result->{powerUnitStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power unit '%s' status is '%s'", $result->{powerUnitName}, $result->{powerUnitStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm new file mode 100644 index 000000000..2cbad5fb8 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm @@ -0,0 +1,87 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our %map_state; +our %map_status; +our %map_probe_status; +our %map_amperage_type; + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw(%map_probe_status %map_state %map_status %map_amperage_type); + +%map_probe_status = ( + 1 => 'other', + 2 => 'unknown', + 3 => 'ok', + 4 => 'nonCriticalUpper', + 5 => 'criticalUpper', + 6 => 'nonRecoverableUpper', + 7 => 'nonCriticalLower', + 8 => 'criticalLower', + 9 => 'nonRecoverableLower', + 10 => 'failed', +); + +%map_status = ( + 1 => 'other', + 2 => 'unknown', + 3 => 'ok', + 4 => 'nonCritical', + 5 => 'critical', + 6 => 'nonRecoverable', +); + +%map_state = ( + 1 => 'unknown', + 2 => 'enabled', + 4 => 'notReady', + 6 => 'enabledAndNotReady', +); + +%map_amperage_type = ( + 1 => 'amperageProbeTypeIsOther', + 2 => 'amperageProbeTypeIsUnknown', + 3 => 'amperageProbeTypeIs1Point5Volt', + 4 => 'amperageProbeTypeIs3Point3volt', + 5 => 'amperageProbeTypeIs5Volt', + 6 => 'amperageProbeTypeIsMinus5Volt', + 7 => 'amperageProbeTypeIs12Volt', + 8 => 'amperageProbeTypeIsMinus12Volt', + 9 => 'amperageProbeTypeIsIO', + 10 => 'amperageProbeTypeIsCore', + 11 => 'amperageProbeTypeIsFLEA', + 12 => 'amperageProbeTypeIsBattery', + 13 => 'amperageProbeTypeIsTerminator', + 14 => 'amperageProbeTypeIs2Point5Volt', + 15 => 'amperageProbeTypeIsGTL', + 16 => 'amperageProbeTypeIsDiscrete', + 23 => 'amperageProbeTypeIsPowerSupplyAmps', + 24 => 'amperageProbeTypeIsPowerSupplyWatts', + 25 => 'amperageProbeTypeIsSystemAmps', + 26 => 'amperageProbeTypeIsSystemWatts', +); + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm new file mode 100644 index 000000000..6d595dee8 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/systembattery.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::systembattery; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_state); + +my $mapping = { + systemBatteryStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.50.1.4', map => \%map_state }, + systemBatteryStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.50.1.5', map => \%map_status }, + systemBatteryLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.50.1.7' }, +}; +my $oid_systemBatteryTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.50.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_systemBatteryTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking system batteries"); + $self->{components}->{systembattery} = {name => 'system batteries', total => 0, skip => 0}; + return if ($self->check_filter(section => 'systembattery')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_systemBatteryTableEntry}})) { + next if ($oid !~ /^$mapping->{systemBatteryStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_systemBatteryTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'systembattery', instance => $instance)); + $self->{components}->{systembattery}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("system battery '%s' status is '%s' [instance = %s] [state = %s]", + $result->{systemBatteryLocationName}, $result->{systemBatteryStatus}, $instance, + $result->{systemBatteryStateSettings})); + + my $exit = $self->get_severity(label => 'default.state', section => 'systembattery.state', value => $result->{systemBatteryStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("System battery '%s' state is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'systembattery.status', value => $result->{systemBatteryStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("System battery '%s' status is '%s'", $result->{systemBatteryLocationName}, $result->{systemBatteryStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm index 68fe2a743..95213638a 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm @@ -22,25 +22,8 @@ package hardware::server::dell::idrac::snmp::mode::components::temperature; use strict; use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_probe_status %map_state); -my %map_temp_status = ( - 1 => 'other', - 2 => 'unknown', - 3 => 'ok', - 4 => 'nonCriticalUpper', - 5 => 'criticalUpper', - 6 => 'nonRecoverableUpper', - 7 => 'nonCriticalLower', - 8 => 'criticalLower', - 9 => 'nonRecoverableLower', - 10 => 'failed', -); -my %map_temp_state = ( - 1 => 'unknown', - 2 => 'enabled', - 4 => 'notReady', - 6 => 'enabledAndNotReady', -); my %map_temp_type = ( 1 => 'temperatureProbeTypeIsOther', 2 => 'temperatureProbeTypeIsUnknown', @@ -49,22 +32,22 @@ my %map_temp_type = ( ); my $mapping = { - temperatureProbeStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.4', map => \%map_temp_state }, - temperatureProbeStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.5', map => \%map_temp_status }, + temperatureProbeStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.4', map => \%map_state }, + temperatureProbeStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.5', map => \%map_probe_status }, temperatureProbeReading => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.6' }, temperatureProbeType => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.7', map => \%map_temp_type }, temperatureProbeLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.8' }, temperatureProbeUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.10' }, - temperatureProbeUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.10' }, - temperatureProbeLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.11' }, - temperatureProbeLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.12' }, + temperatureProbeUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.11' }, + temperatureProbeLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.12' }, + temperatureProbeLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.700.20.1.13' }, }; my $oid_temperatureProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.700.20.1'; sub load { - my (%options) = @_; + my ($self) = @_; - push @{$options{request}}, { oid => $oid_temperatureProbeTableEntry, begin => $mapping->{temperatureProbeStateSettings}->{oid}, end => $mapping->{temperatureProbeLowerCriticalThreshold}->{oid} }; + push @{$self->{request}}, { oid => $oid_temperatureProbeTableEntry, begin => $mapping->{temperatureProbeStateSettings}->{oid}, end => $mapping->{temperatureProbeLowerCriticalThreshold}->{oid} }; } sub check { @@ -72,29 +55,29 @@ sub check { $self->{output}->output_add(long_msg => "Checking temperatures"); $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); + return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_temperatureProbeTableEntry}})) { next if ($oid !~ /^$mapping->{temperatureProbeStatus}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureProbeTableEntry}, instance => $instance); - next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $result->{temperatureProbeReading} = (defined($result->{temperatureProbeReading})) ? $result->{temperatureProbeReading} / 10 : 'unknown'; - $self->{output}->output_add(long_msg => sprintf("Temperature '%s' status is '%s' [instance = %s] [state = %s] [value = %s]", + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s' [instance = %s] [state = %s] [value = %s]", $result->{temperatureProbeLocationName}, $result->{temperatureProbeStatus}, $instance, $result->{temperatureProbeStateSettings}, $result->{temperatureProbeReading})); - my $exit = $self->get_severity(section => 'temperature-state', value => $result->{temperatureProbeStateSettings}); + my $exit = $self->get_severity(label => 'default.state', section => 'temperature.state', value => $result->{temperatureProbeStateSettings}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Temperature '%s' state is '%s'", $result->{temperatureProbeLocationName}, $result->{temperatureProbeStateSettings})); next; } - $exit = $self->get_severity(section => 'temperature-status', value => $result->{temperatureProbeStatus}); + $exit = $self->get_severity(label => 'probe.status', section => 'temperature.status', value => $result->{temperatureProbeStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Temperature '%s' status is '%s'", $result->{temperatureProbeLocationName}, $result->{temperatureProbeStatus})); @@ -103,7 +86,15 @@ sub check { if (defined($result->{temperatureProbeReading}) && $result->{temperatureProbeReading} =~ /[0-9]/) { my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{temperatureProbeReading}); if ($checked == 0) { - my $warn_th = $result->{temperatureProbeLowerNonCriticalThreshold} . ':' . $result->{temperatureProbeUpperCriticalThreshold}; + $result->{temperatureProbeLowerNonCriticalThreshold} = (defined($result->{temperatureProbeLowerNonCriticalThreshold}) && $result->{temperatureProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? + $result->{temperatureProbeLowerNonCriticalThreshold} / 10 : ''; + $result->{temperatureProbeLowerCriticalThreshold} = (defined($result->{temperatureProbeLowerCriticalThreshold}) && $result->{temperatureProbeLowerCriticalThreshold} =~ /[0-9]/) ? + $result->{temperatureProbeLowerCriticalThreshold} / 10 : ''; + $result->{temperatureProbeUpperNonCriticalThreshold} = (defined($result->{temperatureProbeUpperNonCriticalThreshold}) && $result->{temperatureProbeUpperNonCriticalThreshold} =~ /[0-9]/) ? + $result->{temperatureProbeUpperNonCriticalThreshold} / 10 : ''; + $result->{temperatureProbeUpperCriticalThreshold} = (defined($result->{temperatureProbeUpperCriticalThreshold}) && $result->{temperatureProbeUpperCriticalThreshold} =~ /[0-9]/) ? + $result->{temperatureProbeUpperCriticalThreshold} / 10 : ''; + my $warn_th = $result->{temperatureProbeLowerNonCriticalThreshold} . ':' . $result->{temperatureProbeUpperNonCriticalThreshold}; my $crit_th = $result->{temperatureProbeLowerCriticalThreshold} . ':' . $result->{temperatureProbeUpperCriticalThreshold}; $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th); $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); @@ -118,7 +109,7 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{temperatureProbeLocationName}, $result->{temperatureProbeReading})); } - $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', + $self->{output}->perfdata_add(label => 'temp_' . $result->{temperatureProbeLocationName}, unit => 'C', value => $result->{temperatureProbeReading}, warning => $warn, critical => $crit, diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm new file mode 100644 index 000000000..ff3399c7b --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm @@ -0,0 +1,113 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::voltage; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_probe_status %map_state); + +my $mapping = { + voltageProbeStateSettings => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.4', map => \%map_state }, + voltageProbeStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.5', map => \%map_probe_status }, + voltageProbeReading => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.6' }, + voltageProbeLocationName => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.8' }, + voltageProbeUpperCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.10' }, + voltageProbeUpperNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.11' }, + voltageProbeLowerNonCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.12' }, + voltageProbeLowerCriticalThreshold => { oid => '.1.3.6.1.4.1.674.10892.5.4.600.20.1.13' }, +}; +my $oid_voltageProbeTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.20.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_voltageProbeTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking voltages"); + $self->{components}->{voltage} = {name => 'voltages', total => 0, skip => 0}; + return if ($self->check_filter(section => 'voltage')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_voltageProbeTableEntry}})) { + next if ($oid !~ /^$mapping->{voltageProbeStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_voltageProbeTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'voltage', instance => $instance)); + $self->{components}->{voltage}->{total}++; + + $result->{voltageProbeReading} = (defined($result->{voltageProbeReading})) ? $result->{voltageProbeReading} / 1000 : 'unknown'; + $self->{output}->output_add(long_msg => sprintf("voltage '%s' status is '%s' [instance = %s] [state = %s] [value = %s]", + $result->{voltageProbeLocationName}, $result->{voltageProbeStatus}, $instance, + $result->{voltageProbeStateSettings}, $result->{voltageProbeReading})); + + my $exit = $self->get_severity(label => 'default.state', section => 'voltage.state', value => $result->{voltageProbeStateSettings}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Voltage '%s' state is '%s'", $result->{voltageProbeLocationName}, $result->{voltageProbeStateSettings})); + next; + } + + $exit = $self->get_severity(label => 'probe.status', section => 'voltage.status', value => $result->{voltageProbeStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Voltage '%s' status is '%s'", $result->{voltageProbeLocationName}, $result->{voltageProbeStatus})); + } + + if (defined($result->{voltageProbeReading}) && $result->{voltageProbeReading} =~ /[0-9]/) { + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'voltage', instance => $instance, value => $result->{voltageProbeReading}); + if ($checked == 0) { + $result->{voltageProbeLowerNonCriticalThreshold} = (defined($result->{voltageProbeLowerNonCriticalThreshold}) && $result->{voltageProbeLowerNonCriticalThreshold} =~ /[0-9]/) ? + $result->{voltageProbeLowerNonCriticalThreshold} / 1000 : ''; + $result->{voltageProbeLowerCriticalThreshold} = (defined($result->{voltageProbeLowerCriticalThreshold}) && $result->{voltageProbeLowerCriticalThreshold} =~ /[0-9]/) ? + $result->{voltageProbeLowerCriticalThreshold} / 1000 : ''; + $result->{voltageProbeUpperNonCriticalThreshold} = (defined($result->{voltageProbeUpperNonCriticalThreshold}) && $result->{voltageProbeUpperNonCriticalThreshold} =~ /[0-9]/) ? + $result->{voltageProbeUpperNonCriticalThreshold} / 1000 : ''; + $result->{voltageProbeUpperCriticalThreshold} = (defined($result->{voltageProbeUpperCriticalThreshold}) && $result->{voltageProbeUpperCriticalThreshold} =~ /[0-9]/) ? + $result->{voltageProbeUpperCriticalThreshold} / 1000 : ''; + my $warn_th = $result->{voltageProbeLowerNonCriticalThreshold} . ':' . $result->{voltageProbeUpperNonCriticalThreshold}; + my $crit_th = $result->{voltageProbeLowerCriticalThreshold} . ':' . $result->{voltageProbeUpperCriticalThreshold}; + $self->{perfdata}->threshold_validate(label => 'warning-voltage-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-voltage-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{voltageProbeReading}, threshold => [ { label => 'critical-voltage-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-voltage-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-voltage-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-voltage-instance-' . $instance) + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Voltage '%s' is %s V", $result->{voltageProbeLocationName}, $result->{voltageProbeReading})); + } + $self->{output}->perfdata_add(label => 'voltage_' . $result->{voltageProbeLocationName}, unit => 'V', + value => $result->{voltageProbeReading}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm index 57e57e7f0..a1e0b9802 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -20,33 +20,60 @@ package hardware::server::dell::idrac::snmp::mode::hardware; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -use centreon::plugins::misc; -my $thresholds = { - 'temperature-state' => [ - ['unknown', 'UNKNOWN'], - ['enabled', 'OK'], - ['notReady', 'WARNING'], - ['enabledAndNotReady', 'WARNING'], - ['.*', 'UNKNOWN'], - ], - 'temperature-status' => [ - ['other', 'UNKNOWN'], - ['unknown', 'UNKNOWN'], - ['ok', 'OK'], - ['nonCriticalUpper', 'WARNING'], - ['criticalUpper', 'CRITICAL'], - ['nonCriticalLower', 'WARNING'], - ['criticalLower', 'CRITICAL'], - ['nonRecoverableLower', 'CRITICAL'], - ['failed', 'CRITICAL'], - ['.*', 'UNKNOWN'], - ], -}; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(psu|punit|temperature|voltage|amperage|systembattery|coolingunit|coolingdevice|processor|memory|pci|network)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|amperage|coolingdevice)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + 'default.state' => [ + ['unknown', 'UNKNOWN'], + ['enabled', 'OK'], + ['notReady', 'WARNING'], + ['enabledAndNotReady', 'WARNING'], + ], + 'default.status' => [ + ['other', 'UNKNOWN'], + ['unknown', 'UNKNOWN'], + ['ok', 'OK'], + ['nonCritical', 'WARNING'], + ['critical', 'CRITICAL'], + ['nonRecoverable', 'CRITICAL'], + ], + 'probe.status' => [ + ['other', 'UNKNOWN'], + ['unknown', 'UNKNOWN'], + ['ok', 'OK'], + ['nonCriticalUpper', 'WARNING'], + ['criticalUpper', 'CRITICAL'], + ['nonCriticalLower', 'WARNING'], + ['criticalLower', 'CRITICAL'], + ['nonRecoverableLower', 'CRITICAL'], + ['failed', 'CRITICAL'], + ], + }; + + # need also: fru, systemslot, storagectrl (storage controller), storagebattery + # physicaldisk, virtualdisk + $self->{components_path} = 'hardware::server::dell::idrac::snmp::mode::components'; + $self->{components_module} = ['psu', 'punit', 'temperature', 'voltage', 'amperage', + 'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -56,189 +83,11 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => '.*' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning:s@" => { name => 'warning' }, - "critical:s@" => { name => 'critical' }, }); - - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - $self->{numeric_threshold} = {}; - foreach my $option (('warning', 'critical')) { - foreach my $val (@{$self->{option_results}->{$option}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $regexp, $value) = ($1, $2, $3); - if ($section !~ /(temperature)/) { - $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "' (type must be: temperature)."); - $self->{output}->option_exit(); - } - my $position = 0; - if (defined($self->{numeric_threshold}->{$section})) { - $position = scalar(@{$self->{numeric_threshold}->{$section}}); - } - if (($self->{perfdata}->threshold_validate(label => $option . '-' . $section . '-' . $position, value => $value)) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong $option threshold '" . $value . "'."); - $self->{output}->option_exit(); - } - $self->{numeric_threshold}->{$section} = [] if (!defined($self->{numeric_threshold}->{$section})); - push @{$self->{numeric_threshold}->{$section}}, { label => $option . '-' . $section . '-' . $position, threshold => $option, regexp => $regexp }; - } - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $snmp_request = []; - my @components = ('temperature'); - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::dell::idrac::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'); - $func->(request => $snmp_request); - } - } - - if (scalar(@{$snmp_request}) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - $self->{results} = $self->{snmp}->get_multiple_table(oids => $snmp_request); - - foreach (@components) { - if (/$self->{option_results}->{component}/) { - my $mod_name = "hardware::server::dell::idrac::snmp::mode::components::$_"; - my $func = $mod_name->can('check'); - $func->($self); - } - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub get_severity_numeric { - my ($self, %options) = @_; - my $status = 'OK'; # default - my $thresholds = { warning => undef, critical => undef }; - my $checked = 0; - - if (defined($self->{numeric_threshold}->{$options{section}})) { - my $exits = []; - foreach (@{$self->{numeric_threshold}->{$options{section}}}) { - if ($options{instance} =~ /$_->{regexp}/) { - push @{$exits}, $self->{perfdata}->threshold_check(value => $options{value}, threshold => [ { label => $_->{label}, exit_litteral => $_->{threshold} } ]); - $thresholds->{$_->{threshold}} = $self->{perfdata}->get_perfdata_for_output(label => $_->{label}); - $checked = 1; - } - } - $status = $self->{output}->get_most_critical(status => $exits) if (scalar(@{$exits}) > 0); - } - - return ($status, $thresholds->{warning}, $thresholds->{critical}, $checked); -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - 1; __END__ @@ -246,7 +95,6 @@ __END__ =head1 MODE Check hardware components (temperatures,...). -Mode is in WIP. =over 8 @@ -255,10 +103,10 @@ Mode is in WIP. Which component to check (Default: '.*'). Can be: 'temperature', -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='temperature#1.1#' +Exclude some parts (comma seperated list) (Example: --filter=temperature --filter=psu) +Can also exclude specific instance: --filter=temperature,1.1 =item B<--no-component> @@ -267,9 +115,9 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). -Example: --threshold-overload='temperature-state,CRITICAL,^(?!(enabled)$)' +Example: --threshold-overload='temperature.state,CRITICAL,^(?!(enabled)$)' =item B<--warning> From 2f7b7e2d562cfd998b7e78795ed1ca2bc4ce97d6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 14 Feb 2016 21:10:08 +0100 Subject: [PATCH 107/346] + Fix #201 --- .../dell/idrac/snmp/mode/components/fru.pm | 66 +++++++++++++++++ .../dell/idrac/snmp/mode/components/pdisk.pm | 74 +++++++++++++++++++ .../idrac/snmp/mode/components/resources.pm | 23 +++++- .../dell/idrac/snmp/mode/components/slot.pm | 66 +++++++++++++++++ .../snmp/mode/components/storagebattery.pm | 66 +++++++++++++++++ .../idrac/snmp/mode/components/storagectrl.pm | 66 +++++++++++++++++ .../dell/idrac/snmp/mode/components/vdisk.pm | 67 +++++++++++++++++ .../server/dell/idrac/snmp/mode/hardware.pm | 38 +++++++--- 8 files changed, 456 insertions(+), 10 deletions(-) create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm create mode 100644 centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm new file mode 100644 index 000000000..f69778544 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/fru.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::fru; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + fruInformationStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.2000.10.1.3', map => \%map_status }, + fruSerialNumberName => { oid => '.1.3.6.1.4.1.674.10892.5.4.2000.10.1.7' }, +}; +my $oid_fruTableEntry = '.1.3.6.1.4.1.674.10892.5.4.2000.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_fruTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fru"); + $self->{components}->{fru} = {name => 'fru', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fru')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_fruTableEntry}})) { + next if ($oid !~ /^$mapping->{fruInformationStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fruTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fru', instance => $instance)); + $self->{components}->{fru}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fru '%s' status is '%s' [instance = %s]", + $result->{fruSerialNumberName}, $result->{fruInformationStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default.status', section => 'fru.status', value => $result->{fruInformationStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fru '%s' status is '%s'", $result->{fruSerialNumberName}, $result->{fruInformationStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm new file mode 100644 index 000000000..3e7d42eac --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/pdisk.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::pdisk; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status %map_pdisk_state); + +my $mapping = { + physicalDiskState => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.4', map => \%map_pdisk_state }, + physicalDiskComponentStatus => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.24', map => \%map_status }, + physicalDiskFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.54' }, +}; +my $oid_physicalDiskTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_physicalDiskTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking physical disks"); + $self->{components}->{pdisk} = {name => 'physical disks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'pdisk')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_physicalDiskTableEntry}})) { + next if ($oid !~ /^$mapping->{physicalDiskComponentStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_physicalDiskTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'pdisk', instance => $instance)); + $self->{components}->{pdisk}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power unit '%s' status is '%s' [instance = %s] [state = %s]", + $result->{physicalDiskFQDD}, $result->{physicalDiskComponentStatus}, $instance, + $result->{physicalDiskState})); + + my $exit = $self->get_severity(section => 'pdisk.state', value => $result->{physicalDiskState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power unit '%s' state is '%s'", $result->{physicalDiskFQDD}, $result->{physicalDiskState})); + next; + } + + $exit = $self->get_severity(label => 'default.status', section => 'pdisk.status', value => $result->{physicalDiskComponentStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power unit '%s' status is '%s'", $result->{physicalDiskFQDD}, $result->{physicalDiskComponentStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm index 2cbad5fb8..c90f092c0 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/resources.pm @@ -28,9 +28,11 @@ our %map_state; our %map_status; our %map_probe_status; our %map_amperage_type; +our %map_pdisk_state; +our %map_vdisk_state; our @ISA = qw(Exporter); -our @EXPORT_OK = qw(%map_probe_status %map_state %map_status %map_amperage_type); +our @EXPORT_OK = qw(%map_probe_status %map_state %map_status %map_amperage_type %map_pdisk_state %map_vdisk_state); %map_probe_status = ( 1 => 'other', @@ -61,6 +63,25 @@ our @EXPORT_OK = qw(%map_probe_status %map_state %map_status %map_amperage_type) 6 => 'enabledAndNotReady', ); +%map_pdisk_state = ( + 1 => 'unknown', + 2 => 'ready', + 3 => 'online', + 4 => 'foreign', + 5 => 'offline', + 6 => 'blocked', + 7 => 'failed', + 8 => 'non-raid', + 9 => 'removed', +); + +%map_vdisk_state = ( + 1 => 'unknown', + 2 => 'online', + 3 => 'failed', + 4 => 'degraded', +); + %map_amperage_type = ( 1 => 'amperageProbeTypeIsOther', 2 => 'amperageProbeTypeIsUnknown', diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm new file mode 100644 index 000000000..6635f6b07 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/slot.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::slot; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + systemSlotStatus => { oid => '.1.3.6.1.4.1.674.10892.5.4.1200.10.1.5', map => \%map_status }, + systemSlotSlotExternalSlotName => { oid => '.1.3.6.1.4.1.674.10892.5.4.1200.10.1.8' }, +}; +my $oid_systemSlotTableEntry = '.1.3.6.1.4.1.674.10892.5.4.1200.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_systemSlotTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking slots"); + $self->{components}->{slot} = {name => 'slots', total => 0, skip => 0}; + return if ($self->check_filter(section => 'slot')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_systemSlotTableEntry}})) { + next if ($oid !~ /^$mapping->{systemSlotStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_systemSlotTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'slot', instance => $instance)); + $self->{components}->{slot}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("slot '%s' status is '%s' [instance = %s]", + $result->{systemSlotSlotExternalSlotName}, $result->{systemSlotStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default.status', section => 'slot.status', value => $result->{systemSlotStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Slot '%s' status is '%s'", $result->{systemSlotSlotExternalSlotName}, $result->{systemSlotStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm new file mode 100644 index 000000000..13d76bb0e --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagebattery.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::storagebattery; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + batteryComponentStatus => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.6', map => \%map_status }, + batteryFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.20' }, +}; +my $oid_batteryTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_batteryTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking storage batteries"); + $self->{components}->{storagebattery} = {name => 'storage batteries', total => 0, skip => 0}; + return if ($self->check_filter(section => 'storagebattery')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_batteryTableEntry}})) { + next if ($oid !~ /^$mapping->{batteryComponentStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_batteryTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'storagebattery', instance => $instance)); + $self->{components}->{storagebattery}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("storage battery '%s' status is '%s' [instance = %s]", + $result->{batteryFQDD}, $result->{batteryComponentStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default.status', section => 'storagebattery.status', value => $result->{batteryComponentStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Storage battery '%s' status is '%s'", $result->{batteryFQDD}, $result->{batteryComponentStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm new file mode 100644 index 000000000..f25df4572 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/storagectrl.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::storagectrl; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_status); + +my $mapping = { + controllerComponentStatus => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.38', map => \%map_status }, + controllerFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.78' }, +}; +my $oid_controllerTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_controllerTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking storage controllers"); + $self->{components}->{storagectrl} = {name => 'storage controllers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'storagectrl')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_controllerTableEntry}})) { + next if ($oid !~ /^$mapping->{controllerComponentStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_controllerTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'storagectrl', instance => $instance)); + $self->{components}->{storagectrl}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("storage controller '%s' status is '%s' [instance = %s]", + $result->{controllerFQDD}, $result->{controllerComponentStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default.status', section => 'storagectrl.status', value => $result->{controllerComponentStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Storage controllers '%s' status is '%s'", $result->{controllerFQDD}, $result->{controllerComponentStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm new file mode 100644 index 000000000..ecf397788 --- /dev/null +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/vdisk.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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 hardware::server::dell::idrac::snmp::mode::components::vdisk; + +use strict; +use warnings; +use hardware::server::dell::idrac::snmp::mode::components::resources qw(%map_vdisk_state); + +my $mapping = { + virtualDiskState => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4', map => \%map_vdisk_state }, + virtualDiskFQDD => { oid => '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.35' }, +}; +my $oid_virtualDiskTableEntry = '.1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_virtualDiskTableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking virtual disks"); + $self->{components}->{vdisk} = {name => 'virtual disks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'vdisk')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_virtualDiskTableEntry}})) { + next if ($oid !~ /^$mapping->{virtualDiskState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_virtualDiskTableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'vdisk', instance => $instance)); + $self->{components}->{vdisk}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("virtual disk '%s' state is '%s' [instance = %s]", + $result->{virtualDiskFQDD}, $result->{virtualDiskState}, $instance, + )); + + my $exit = $self->get_severity(section => 'vdisk.state', value => $result->{virtualDiskState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Virtual disk '%s' state is '%s'", $result->{virtualDiskFQDD}, $result->{virtualDiskState})); + next; + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm index a1e0b9802..e5914295a 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu|punit|temperature|voltage|amperage|systembattery|coolingunit|coolingdevice|processor|memory|pci|network)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|amperage|coolingdevice)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -59,13 +58,32 @@ sub set_system { ['nonRecoverableLower', 'CRITICAL'], ['failed', 'CRITICAL'], ], + 'pdisk.state' => [ + ['unknown', 'UNKNOWN'], + ['ready', 'OK'], + ['online', 'OK'], + ['foreign', 'OK'], + ['offline', 'WARNING'], + ['blocked', 'WARNING'], + ['failed', 'CRITICAL'], + ['non-raid', 'OK'], + ['removed', 'OK'], + ], + 'vdisk.state' => [ + ['unknown', 'UNKNOWN'], + ['online', 'OK'], + ['failed', 'CRITICAL'], + ['degraded', 'WARNING'], + ], }; - - # need also: fru, systemslot, storagectrl (storage controller), storagebattery - # physicaldisk, virtualdisk + $self->{components_path} = 'hardware::server::dell::idrac::snmp::mode::components'; $self->{components_module} = ['psu', 'punit', 'temperature', 'voltage', 'amperage', - 'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network']; + 'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network', + 'slot', 'fru', 'storagectrl', 'storagebattery', 'pdisk', 'vdisk']; + + $self->{regexp_threshold_overload_check_section_option} = + '^(' . join('|', @{$self->{components_module}}). ')$'; } sub snmp_execute { @@ -94,14 +112,16 @@ __END__ =head1 MODE -Check hardware components (temperatures,...). +Check hardware components. =over 8 =item B<--component> Which component to check (Default: '.*'). -Can be: 'temperature', +Can be: 'psu', 'punit', 'temperature', 'voltage', 'amperage', +'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network', +'slot', 'fru', 'storagectrl', 'storagebattery', 'pdisk', 'vdisk'. =item B<--filter> @@ -121,12 +141,12 @@ Example: --threshold-overload='temperature.state,CRITICAL,^(?!(enabled)$)' =item B<--warning> -Set warning threshold for temperature (syntax: type,regexp,treshold) +Set warning threshold (syntax: type,regexp,treshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperature (syntax: type,regexp,treshold) +Set critical threshold (syntax: type,regexp,treshold) Example: --critical='temperature,.*,40' =back From 24e67d56a40e73f4b57887e418387a7c1584a697 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 16 Feb 2016 14:38:31 +0100 Subject: [PATCH 108/346] + add modes for netbackup --- .../netbackup/local/mode/dedupstatus.pm | 267 +++++++++++ .../backup/netbackup/local/mode/jobstatus.pm | 421 ++++++++++++++++++ .../netbackup/local/mode/listpolicies.pm | 189 ++++++++ .../apps/backup/netbackup/local/plugin.pm | 3 + 4 files changed, 880 insertions(+) create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm new file mode 100644 index 000000000..c95cc81cb --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm @@ -0,0 +1,267 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::dedupstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg = 'status : ' . $self->{result_values}->{status}; + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'pool', type => 1, cb_prefix_output => 'prefix_pool_output', message_multiple => 'All dedup status are ok' } + ]; + + $self->{maps_counters}->{pool} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'usage' }, { name => 'display' } ], + output_template => 'Use: %s %%', + perfdatas => [ + { label => 'used', value => 'usage_absolute', template => '%s', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'nbdevquery' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-listdv -U -stype PureDisk 2>&1' }, + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /up/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_pool_output { + my ($self, %options) = @_; + + return "Disk pool name '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub manage_selection { + my ($self, %options) = @_; + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{pool} = {}; + #Disk Pool Name : NBU-MASTER-DP + #Disk Type : PureDisk + #Disk Volume Name : PureDiskVolume + #Disk Media ID : @aaaah + #Total Capacity (GB) : 9777.56 + #Free Space (GB) : 837.72 + #Use% : 91 + #Status : UP + #Flag : ReadOnWrite + #Flag : AdminUp + #Flag : InternalUp + while ($stdout =~ /^(Disk Pool Name.*?)(?=Disk Pool Name|\z)/msig) { + my $pool = $1; + + my ($display, $usage, $status); + $display = centreon::plugins::misc::trim($1) if ($pool =~ /^Disk Pool Name\s*:\s*(.*?)\n/msi); + $status = $1 if ($pool =~ /^Status\s*:\s*(.*?)\n/msi); + $usage = $1 if ($pool =~ /^Use%\s*:\s*(.*?)\n/msi); + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $display !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $display . "': no matching filter.", debug => 1); + next; + } + + $self->{pool}->{$display} = { display => $display, usage => $usage, status => $status }; + } + + if (scalar(keys %{$self->{pool}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No pool found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check deduplication status. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'nbdevquery'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-listdv -U -stype PureDisk 2>&1'). + +=item B<--filter-name> + +Filter pool name (can be a regexp). + +=item B<--warning-usage> + +Set warning threshold in percent. + +=item B<--critical-usage> + +Set critical threshold in percent. + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{display}, %{status} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} !~ /up/i'). +Can used special variables like: %{display}, %{status} + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm new file mode 100644 index 000000000..287f064a8 --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm @@ -0,0 +1,421 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::jobstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; +use Digest::MD5 qw(md5_hex); + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + # To exclude some OK + if (defined($instance_mode->{option_results}->{ok_status}) && $instance_mode->{option_results}->{ok_status} ne '' && + eval "$instance_mode->{option_results}->{ok_status}") { + $status = 'ok'; + } elsif (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg = 'status : ' . $self->{result_values}->{status}; + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + return 0; +} + +sub custom_long_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_long}) && $instance_mode->{option_results}->{critical_long} ne '' && + eval "$instance_mode->{option_results}->{critical_long}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_long}) && $instance_mode->{option_results}->{warning_long} ne '' && + eval "$instance_mode->{option_results}->{warning_long}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_long_output { + my ($self, %options) = @_; + my $msg = 'started since : ' . centreon::plugins::misc::change_seconds(value => $self->{result_values}->{elapsed}); + + return $msg; +} + +sub custom_long_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{elapsed} = $options{new_datas}->{$self->{instance} . '_elapsed'}; + $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + + return -11 if ($self->{result_values}->{state} !~ /queued|active/); + + return 0; +} + +my $last_status_frozen; + +sub custom_frozen_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_frozen}) && $instance_mode->{option_results}->{critical_frozen} ne '' && + eval "$instance_mode->{option_results}->{critical_frozen}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_frozen}) && $instance_mode->{option_results}->{warning_frozen} ne '' && + eval "$instance_mode->{option_results}->{warning_frozen}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + $last_status_frozen = $status; + return $status; +} + +sub custom_frozen_output { + my ($self, %options) = @_; + my $msg = 'frozen : no'; + + if (!$self->{output}->is_status(value => $last_status_frozen, compare => 'ok', litteral => 1)) { + $msg = 'frozen: yes'; + } + return $msg; +} + +sub custom_frozen_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{elapsed} = $options{new_datas}->{$self->{instance} . '_elapsed'}; + $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{kb} = $options{new_datas}->{$self->{instance} . '_kb'} - $options{old_datas}->{$self->{instance} . '_kb'}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'job', type => 1, cb_prefix_output => 'prefix_job_output', message_multiple => 'All jobs are ok', skipped_code => { -11 => 1 } } + ]; + + $self->{maps_counters}->{job} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' }, { name => 'type' }, { name => 'state' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'long', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' }, { name => 'elapsed' }, { name => 'type' }, { name => 'state' } ], + closure_custom_calc => $self->can('custom_long_calc'), + closure_custom_output => $self->can('custom_long_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_long_threshold'), + } + }, + { label => 'frozen', threshold => 0, set => { + key_values => [ { name => 'kb', diff => 1 }, { name => 'status' }, { name => 'display' }, { name => 'elapsed' }, { name => 'type' }, { name => 'state' } ], + closure_custom_calc => $self->can('custom_frozen_calc'), + closure_custom_output => $self->can('custom_frozen_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_frozen_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'bpdbjobs' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-report -most_columns 2>&1' }, + "filter-policy-name:s" => { name => 'filter_policy_name' }, + "filter-end-time:s" => { name => 'filter_end_time', default => 86400 }, + "ok-status:s" => { name => 'ok_status', default => '%{status} == 0' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} == 1' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} > 1' }, + "warning-long:s" => { name => 'warning_long' }, + "critical-long:s" => { name => 'critical_long' }, + "warning-frozen:s" => { name => 'warning_frozen' }, + "critical-frozen:s" => { name => 'critical_frozen', default => '%{state} =~ /active|queue/ && %{kb} == 0' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_job_output { + my ($self, %options) = @_; + + return "Job '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('ok_status', 'warning_status', 'critical_status', 'warning_long', 'critical_long', 'warning_frozen', 'critical_frozen')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %job_type = ( + 0 => 'backup', 1 => 'archive', 2 => 'restore', 3 => 'verify', 4 => 'duplicate', 5 => 'phase 1 or phase 2 import', + 6 => 'catalog backup', 7 => 'vault duplicate', 8 => 'label tape', 9 => 'erase tape', + 10 => 'tape request', 11 => 'clean tape', 12 => 'format tape', 13 => 'physical inventory of robotic library', + 14 => 'qualification test of drive or robotic library', 15 => 'catalog recovery', 16 => 'media contents', + 17 => 'image cleanup', 18 => 'LiveUpdate', 20 => 'Replication (Auto Image Replication)', 21 => 'Import (Auto Image Replication)', + 22 => 'backup From Snapshot', 23 => 'Replication (snap)', 24 => 'Import (snap)', 25 => 'application state capture', + 26 => 'indexing', 27 => 'index cleanup', 28 => 'Snapshot', + 29 => 'SnapIndex', 30 => 'ActivateInstantRecovery', 31 => 'DeactivateInstantRecovery', + 32 => 'ReactivateInstantRecovery', 33 => 'StopInstantRecovery', 34 => 'InstantRecovery', +); + +my %job_state = ( + 0 => 'queued and awaiting resources', + 1 => 'active', + 2 => 'requeued and awaiting resources', + 3 => 'done', 4 => 'suspended', 5 => 'incomplete', +); + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cache_name} = "netbackup_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{sudo} : 'me') . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{job} = {}; + my $current_time = time(); + foreach my $line (split /\n/, $stdout) { + my @values = split /,/, $line; + my ($job_id, $job_type, $job_state, $job_status, $job_pname, $job_start_time, $job_end_time, $job_kb) = + ($values[0], $values[1], $values[2], $values[3], $values[4], $values[8], $values[10], $values[14]); + + my $display = $job_pname . '/' . $job_id; + if (defined($self->{option_results}->{filter_policy_name}) && $self->{option_results}->{filter_policy_name} ne '' && + $job_pname !~ /$self->{option_results}->{filter_policy_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $display . "': no matching filter.", debug => 1); + next; + } + if (defined($self->{option_results}->{filter_end_time}) && $self->{option_results}->{filter_end_time} =~ /[0-9]+/ && + defined($job_end_time) && $job_end_time =~ /[0-9]+/ && $job_end_time < $current_time - $self->{option_results}->{filter_end_time}) { + $self->{output}->output_add(long_msg => "skipping '" . $display . "': too old.", debug => 1); + next; + } + + my $elapsed_time = $current_time - $job_start_time; + $self->{job}->{$display} = { display => $display, elapsed => $elapsed_time, + status => $job_status, state => $job_state{$job_state}, type => $job_type{$job_type}, + kb => $job_kb }; + } + + if (scalar(keys %{$self->{job}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No job found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check job status. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'bpdbjobs'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-report -most_columns 2>&1'). + +=item B<--filter-policy-name> + +Filter job policy name (can be a regexp). + +=item B<--filter-end-time> + +Filter job with end time greater than current time less value in seconds (Default: 86400). + +=item B<--ok-status> + +Set ok threshold for status (Default: '%{status} == 0') +Can used special variables like: %{display}, %{status} + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{status} == 1') +Can used special variables like: %{display}, %{status}, %{type} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} > 1'). +Can used special variables like: %{display}, %{status}, %{type} + +=item B<--warning-long> + +Set warning threshold for long jobs (Default: none) +Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} + +=item B<--critical-long> + +Set critical threshold for long jobs (Default: none). +Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} + +=item B<--warning-frozen> + +Set warning threshold for frozen jobs (Default: none) +Can used special variables like: %{display}, %{status}, %{elapsed}, %{type}, %{kb} + +=item B<--critical-frozen> + +Set critical threshold for frozen jobs (Default: '%{state} =~ /active|queue/ && %{kb} == 0'). +Can used special variables like: %{display}, %{status}, %{elapsed}, %{type}, %{kb} + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm b/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm new file mode 100644 index 000000000..4868e741e --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm @@ -0,0 +1,189 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::listpolicies; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'bppllist' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '' }, + "command2:s" => { name => 'command2', default => 'bpplinfo %{policy_name} -L' }, + "filter-name:s" => { name => 'filter_name' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub run { + my ($self, %options) = @_; + + $self->manage_selection(%options); + + foreach (sort keys %{$self->{policies}}) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $_ !~ /$self->{option_results}->{filter_name}/i) { + $self->{output}->output_add(long_msg => "skipping policy '" . $_ . "': no type or no matching filter type"); + next; + } + + $self->{output}->output_add(long_msg => "'" . $_ . "' [active = " . $self->{policies}->{$_}->{active} . "]"); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List policy:'); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +sub disco_format { + my ($self, %options) = @_; + + $self->{output}->add_disco_format(elements => ['name', 'active']); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->manage_selection(%options); + foreach (sort keys %{$self->{policies}}) { + next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $_ !~ /$self->{option_results}->{filter_name}/i); + + $self->{output}->add_disco_entry(name => $_, + active => $self->{policies}->{$_}->{active} + ); + } +} + +sub manage_selection { + my ($self, %options) = @_; + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{policies} = {}; + my @lines = split /\n/, $stdout; + foreach my $policy_name (@lines) { + my $command2 = $self->{option_results}->{command2}; + $command2 =~ s/%{policy_name}/$policy_name/g; + my $stdout2 = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $command2); + + #Policy Type: NBU-Catalog (35) + #Active: yes + my $active = ''; + $active = $1 if ($stdout2 =~ /^Active\s*:\s+(\S+)/msi); + $self->{policies}->{$policy_name} = { active => $active }; + } +} + +1; + +__END__ + +=head1 MODE + +List policies. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'bppllist'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: none). + +=item B<--command2> + +Command to get active policy information (Default: 'bpplinfo %{policy_name} -L'). +Can be changed if you have output in a file. + +=item B<--filter-name> + +Filter policy name (can be a regexp). + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/plugin.pm b/centreon-plugins/apps/backup/netbackup/local/plugin.pm index a99c2b50d..66a3b91e6 100644 --- a/centreon-plugins/apps/backup/netbackup/local/plugin.pm +++ b/centreon-plugins/apps/backup/netbackup/local/plugin.pm @@ -32,8 +32,11 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( + 'dedup-status' => 'apps::backup::netbackup::local::mode::dedupstatus', 'drive-cleaning' => 'apps::backup::netbackup::local::mode::drivecleaning', 'drive-status' => 'apps::backup::netbackup::local::mode::drivestatus', + 'job-status' => 'apps::backup::netbackup::local::mode::jobstatus', + 'list-policies' => 'apps::backup::netbackup::local::mode::listpolicies', ); return $self; From 0e4fbd5ac4d12cbfba85bb4df8b6efe2a84d066c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 17 Feb 2016 10:17:08 +0100 Subject: [PATCH 109/346] + Fix netbackup plugin --- .../netbackup/local/mode/dedupstatus.pm | 16 +++++++-------- .../netbackup/local/mode/drivecleaning.pm | 16 +++++++-------- .../netbackup/local/mode/drivestatus.pm | 16 +++++++-------- .../backup/netbackup/local/mode/jobstatus.pm | 20 +++++++++---------- .../netbackup/local/mode/listpolicies.pm | 20 +++++++++---------- centreon-plugins/centreon/plugins/misc.pm | 12 ++++++++++- 6 files changed, 55 insertions(+), 45 deletions(-) diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm index c95cc81cb..3baa279e6 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/dedupstatus.pm @@ -112,7 +112,7 @@ sub new { "sudo" => { name => 'sudo' }, "command:s" => { name => 'command', default => 'nbdevquery' }, "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => '-listdv -U -stype PureDisk 2>&1' }, + "command-options:s" => { name => 'command_options', default => '-listdv -U -stype PureDisk' }, "filter-name:s" => { name => 'filter_name' }, "warning-status:s" => { name => 'warning_status', default => '' }, "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /up/i' }, @@ -148,12 +148,12 @@ sub change_macros { sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); $self->{pool} = {}; #Disk Pool Name : NBU-MASTER-DP #Disk Type : PureDisk @@ -238,7 +238,7 @@ Command path (Default: none). =item B<--command-options> -Command options (Default: '-listdv -U -stype PureDisk 2>&1'). +Command options (Default: '-listdv -U -stype PureDisk'). =item B<--filter-name> diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm b/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm index ce8f8a721..22422bbfa 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/drivecleaning.pm @@ -63,7 +63,7 @@ sub new { "sudo" => { name => 'sudo' }, "command:s" => { name => 'command', default => 'tpconfig' }, "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => '-l 2>&1' }, + "command-options:s" => { name => 'command_options', default => '-l' }, "filter-name:s" => { name => 'filter_name' }, }); @@ -73,12 +73,12 @@ sub new { sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); $self->{drive} = { total => 0, num_cleaning => 0 }; #Drive Name Type Mount Time Frequency Last Cleaned Comment #********** **** ********** ********* **************** ******* @@ -158,7 +158,7 @@ Command path (Default: none). =item B<--command-options> -Command options (Default: '-l 2>&1'). +Command options (Default: '-l'). =item B<--filter-name> diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm index 683f6f99f..423420ff3 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/drivestatus.pm @@ -103,7 +103,7 @@ sub new { "sudo" => { name => 'sudo' }, "command:s" => { name => 'command', default => 'tpconfig' }, "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => '-l 2>&1' }, + "command-options:s" => { name => 'command_options', default => '-l' }, "filter-name:s" => { name => 'filter_name' }, "warning-status:s" => { name => 'warning_status', default => '' }, "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /up/i' }, @@ -139,12 +139,12 @@ sub change_macros { sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); $self->{drive} = {}; #robot 0 - TLD - - - - {3,0,0,1} # drive - 0 hcart2 2 UP - IBM.ULT3580-HH5.000 {3,0,1,0} @@ -218,7 +218,7 @@ Command path (Default: none). =item B<--command-options> -Command options (Default: '-l 2>&1'). +Command options (Default: '-l'). =item B<--filter-name> diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm index 287f064a8..a4b275d83 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm @@ -221,7 +221,7 @@ sub new { "sudo" => { name => 'sudo' }, "command:s" => { name => 'command', default => 'bpdbjobs' }, "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => '-report -most_columns 2>&1' }, + "command-options:s" => { name => 'command_options', default => '-report -most_columns' }, "filter-policy-name:s" => { name => 'filter_policy_name' }, "filter-end-time:s" => { name => 'filter_end_time', default => 86400 }, "ok-status:s" => { name => 'ok_status', default => '%{status} == 0' }, @@ -285,12 +285,12 @@ sub manage_selection { $self->{cache_name} = "netbackup_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{sudo} : 'me') . '_' . (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); $self->{job} = {}; my $current_time = time(); foreach my $line (split /\n/, $stdout) { @@ -298,7 +298,7 @@ sub manage_selection { my ($job_id, $job_type, $job_state, $job_status, $job_pname, $job_start_time, $job_end_time, $job_kb) = ($values[0], $values[1], $values[2], $values[3], $values[4], $values[8], $values[10], $values[14]); - my $display = $job_pname . '/' . $job_id; + my $display = (defined($job_pname) ? $job_pname : '-') . '/' . $job_id; if (defined($self->{option_results}->{filter_policy_name}) && $self->{option_results}->{filter_policy_name} ne '' && $job_pname !~ /$self->{option_results}->{filter_policy_name}/) { $self->{output}->output_add(long_msg => "skipping '" . $display . "': no matching filter.", debug => 1); @@ -313,7 +313,7 @@ sub manage_selection { my $elapsed_time = $current_time - $job_start_time; $self->{job}->{$display} = { display => $display, elapsed => $elapsed_time, status => $job_status, state => $job_state{$job_state}, type => $job_type{$job_type}, - kb => $job_kb }; + kb => defined($job_kb) && $job_kb =~ /[0-9]+/ ? $job_kb : undef }; } if (scalar(keys %{$self->{job}}) <= 0) { @@ -371,7 +371,7 @@ Command path (Default: none). =item B<--command-options> -Command options (Default: '-report -most_columns 2>&1'). +Command options (Default: '-report -most_columns'). =item B<--filter-policy-name> diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm b/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm index 4868e741e..b27e48404 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/listpolicies.pm @@ -100,21 +100,21 @@ sub disco_show { sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); $self->{policies} = {}; my @lines = split /\n/, $stdout; foreach my $policy_name (@lines) { my $command2 = $self->{option_results}->{command2}; $command2 =~ s/%{policy_name}/$policy_name/g; - my $stdout2 = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $command2); + my ($stdout2) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $command2); #Policy Type: NBU-Catalog (35) #Active: yes diff --git a/centreon-plugins/centreon/plugins/misc.pm b/centreon-plugins/centreon/plugins/misc.pm index 863114257..13e8377cb 100644 --- a/centreon-plugins/centreon/plugins/misc.pm +++ b/centreon-plugins/centreon/plugins/misc.pm @@ -24,6 +24,16 @@ use strict; use warnings; use utf8; +sub execute { + my (%options) = @_; + + if ($^O eq 'MSWin32') { + return windows_execute(%options, timeout => $options{options}->{timeout}); + } else { + return unix_execute(%options); + } +} + sub windows_execute { my (%options) = @_; my $result; @@ -109,7 +119,7 @@ sub windows_execute { return ($stdout, $result->{$pid}->{exitcode}); } -sub execute { +sub unix_execute { my (%options) = @_; my $cmd = ''; my $args = []; From d719341c8f67c6665517c76a9bf9c27ddd6fd05b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 17 Feb 2016 11:27:08 +0100 Subject: [PATCH 110/346] + add kemp plugin --- .../network/kemp/snmp/mode/listvs.pm | 133 +++++++++ .../network/kemp/snmp/mode/rsstatus.pm | 252 ++++++++++++++++++ .../network/kemp/snmp/mode/vsstatus.pm | 250 +++++++++++++++++ centreon-plugins/network/kemp/snmp/plugin.pm | 55 ++++ 4 files changed, 690 insertions(+) create mode 100644 centreon-plugins/network/kemp/snmp/mode/listvs.pm create mode 100644 centreon-plugins/network/kemp/snmp/mode/rsstatus.pm create mode 100644 centreon-plugins/network/kemp/snmp/mode/vsstatus.pm create mode 100644 centreon-plugins/network/kemp/snmp/plugin.pm diff --git a/centreon-plugins/network/kemp/snmp/mode/listvs.pm b/centreon-plugins/network/kemp/snmp/mode/listvs.pm new file mode 100644 index 000000000..f8629fa30 --- /dev/null +++ b/centreon-plugins/network/kemp/snmp/mode/listvs.pm @@ -0,0 +1,133 @@ +# +# Copyright 2016 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::kemp::snmp::mode::listvs; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + $self->{vs_id_selected} = []; + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +my %map_state = ( + 1 => 'inService', + 2 => 'outOfService', + 4 => 'disabled', + 5 => 'sorry', + 6 => 'redirect', + 7 => 'errormsg', +); +my $mapping = { + vSname => { oid => '.1.3.6.1.4.1.12196.13.1.1.13' }, + vSstate => { oid => '.1.3.6.1.4.1.12196.13.1.1.14', map => \%map_state }, +}; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{results} = $self->{snmp}->get_multiple_table(oids => [ { oid => $mapping->{vSname}->{oid} }, { oid => $mapping->{vSstate}->{oid} } ], + nothing_quit => 1, return_type => 1); + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{vSname}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{vSname} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{vSname} . "': no matching filter.", debug => 1); + next; + } + + push @{$self->{vs_id_selected}}, $instance; + } +} + +sub run { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->manage_selection(); + foreach my $instance (sort @{$self->{vs_id_selected}}) { + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + $self->{output}->output_add(long_msg => "'" . $result->{vSname} . "' [state = " . $result->{vSstate} . "]"); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List Virtual Servers:'); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +sub disco_format { + my ($self, %options) = @_; + + $self->{output}->add_disco_format(elements => ['name', 'state']); +} + +sub disco_show { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + $self->manage_selection(disco => 1); + foreach my $instance (sort @{$self->{vs_id_selected}}) { + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + $self->{output}->add_disco_entry(name => $result->{vSname}, state => $result->{vSstate}); + } +} + +1; + +__END__ + +=head1 MODE + +List virtual servers. + +=over 8 + +=item B<--filter-name> + +Set the virtual server name. + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm b/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm new file mode 100644 index 000000000..703fe851d --- /dev/null +++ b/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm @@ -0,0 +1,252 @@ +# +# Copyright 2016 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::kemp::snmp::mode::rsstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'rs', type => 1, cb_prefix_output => 'prefix_rs_output', message_multiple => 'All real servers are ok' } + ]; + + $self->{maps_counters}->{rs} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'active', set => { + key_values => [ { name => 'rSActiveConns' }, { name => 'display' } ], + output_template => 'Active connections : %s', + perfdatas => [ + { label => 'active', value => 'rSActiveConns_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'in-traffic', set => { + key_values => [ { name => 'rSInBytes', diff => 1 }, { name => 'display' } ], + output_template => 'Traffic In : %s %s/s', + per_second => 1, output_change_bytes => 2, + perfdatas => [ + { label => 'traffic_in', value => 'rSInBytes_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'out-traffic', set => { + key_values => [ { name => 'rSOutBytes', diff => 1 }, { name => 'display' } ], + output_template => 'Traffic Out : %s %s/s', + per_second => 1, output_change_bytes => 2, + perfdatas => [ + { label => 'traffic_out', value => 'rSOutBytes_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /inService|disabled/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_rs_output { + my ($self, %options) = @_; + + return "Real server '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + 1 => 'inService', + 2 => 'outOfService', + 4 => 'disabled', +); +my $mapping = { + rSvsidx => { oid => '.1.3.6.1.4.1.12196.13.2.1.1' }, + rSip => { oid => '.1.3.6.1.4.1.12196.13.2.1.2' }, + rSport => { oid => '.1.3.6.1.4.1.12196.13.2.1.3' }, + rSstate => { oid => '.1.3.6.1.4.1.12196.13.2.1.8', map => \%map_state }, + rSInBytes => { oid => '.1.3.6.1.4.1.12196.13.2.1.15' }, + rSOutBytes => { oid => '.1.3.6.1.4.1.12196.13.2.1.16' }, + rSActiveConns => { oid => '.1.3.6.1.4.1.12196.13.2.1.17' }, +}; + +my $oid_rsEntry = '.1.3.6.1.4.1.12196.13.2.1'; +my $oid_vSname = '.1.3.6.1.4.1.12196.13.1.1.13'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{rs} = {}; + my $snmp_result = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_rsEntry }, { oid => $oid_vSname } ], + nothing_quit => 1); + + + foreach my $oid (keys %{$snmp_result->{$oid_rsEntry}}) { + next if ($oid !~ /^$mapping->{rSstate}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result->{$oid_rsEntry}, instance => $instance); + my $vs_name = $snmp_result->{$oid_vSname}->{$oid_vSname . '.' . $result->{rSvsidx}}; + + my $display_name = $vs_name . '/' . $result->{rSip} . ':' . $result->{rSport}; + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $display_name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $display_name . "': no matching filter.", debug => 1); + next; + } + + $self->{rs}->{$instance} = { display => $display_name, + status => $result->{rSstate}, + rSInBytes => $result->{rSInBytes} * 8, rSOutBytes => $result->{rSOutBytes} * 8, rSActiveConns => $result->{rSActiveConns} }; + } + + if (scalar(keys %{$self->{rs}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No real server found."); + $self->{output}->option_exit(); + } + + $self->{cache_name} = "kemp_" . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); +} + +1; + +__END__ + +=head1 MODE + +Check real server status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter real server name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{status}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} !~ /inService|disabled/i'). +Can used special variables like: %{status}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'active', 'in-traffic' (b/s), 'out-traffic' (b/s). + +=item B<--critical-*> + +Threshold critical. +Can be: 'active', 'in-traffic' (b/s), 'out-traffic' (b/s). + +=back + +=cut diff --git a/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm b/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm new file mode 100644 index 000000000..3f73101dc --- /dev/null +++ b/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm @@ -0,0 +1,250 @@ +# +# Copyright 2016 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::kemp::snmp::mode::vsstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'vs', type => 1, cb_prefix_output => 'prefix_vs_output', message_multiple => 'All virtual servers are ok' } + ]; + + $self->{maps_counters}->{vs} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'active', set => { + key_values => [ { name => 'vSActivConns' }, { name => 'display' } ], + output_template => 'Active connections : %s', + perfdatas => [ + { label => 'active', value => 'vSActivConns_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'in-traffic', set => { + key_values => [ { name => 'vSInBytes', diff => 1 }, { name => 'display' } ], + output_template => 'Traffic In : %s %s/s', + per_second => 1, output_change_bytes => 2, + perfdatas => [ + { label => 'traffic_in', value => 'vSInBytes_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'out-traffic', set => { + key_values => [ { name => 'vSOutBytes', diff => 1 }, { name => 'display' } ], + output_template => 'Traffic Out : %s %s/s', + per_second => 1, output_change_bytes => 2, + perfdatas => [ + { label => 'traffic_out', value => 'vSOutBytes_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /inService|disabled|redirect/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_vs_output { + my ($self, %options) = @_; + + return "Virtual server '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + 1 => 'inService', + 2 => 'outOfService', + 4 => 'disabled', + 5 => 'sorry', + 6 => 'redirect', + 7 => 'errormsg', +); +my $mapping = { + vSname => { oid => '.1.3.6.1.4.1.12196.13.1.1.13' }, + vSstate => { oid => '.1.3.6.1.4.1.12196.13.1.1.14', map => \%map_state }, + vSInBytes => { oid => '.1.3.6.1.4.1.12196.13.1.1.19' }, + vSOutBytes => { oid => '.1.3.6.1.4.1.12196.13.1.1.20' }, + vSActivConns => { oid => '.1.3.6.1.4.1.12196.13.1.1.21' }, +}; + +my $oid_vsEntry = '.1.3.6.1.4.1.12196.13.1.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{vs} = {}; + my $snmp_result = $options{snmp}->get_table(oid => $oid_vsEntry, + nothing_quit => 1); + + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{vSstate}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{vSname} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{vSname} . "': no matching filter.", debug => 1); + next; + } + + $self->{vs}->{$instance} = { display => $result->{vSname}, + status => $result->{vSstate}, + vSInBytes => $result->{vSInBytes} * 8, vSOutBytes => $result->{vSOutBytes} * 8, vSActivConns => $result->{vSActivConns} }; + } + + if (scalar(keys %{$self->{vs}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No virtual server found."); + $self->{output}->option_exit(); + } + + $self->{cache_name} = "kemp_" . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); +} + +1; + +__END__ + +=head1 MODE + +Check virtual server status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter virtual server name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{status}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} !~ /inService|disabled|redirect/i'). +Can used special variables like: %{status}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'active', 'in-traffic' (b/s), 'out-traffic' (b/s). + +=item B<--critical-*> + +Threshold critical. +Can be: 'active', 'in-traffic' (b/s), 'out-traffic' (b/s). + +=back + +=cut diff --git a/centreon-plugins/network/kemp/snmp/plugin.pm b/centreon-plugins/network/kemp/snmp/plugin.pm new file mode 100644 index 000000000..eac98d26a --- /dev/null +++ b/centreon-plugins/network/kemp/snmp/plugin.pm @@ -0,0 +1,55 @@ +# +# Copyright 2016 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::kemp::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} = '0.1'; + %{$self->{modes}} = ( + 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'load' => 'snmp_standard::mode::loadaverage', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'list-vs' => 'network::kemp::snmp::mode::listvs', + 'memory' => 'snmp_standard::mode::memory', + 'rs-status' => 'network::kemp::snmp::mode::rsstatus', + 'vs-status' => 'network::kemp::snmp::mode::vsstatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Kemp equipments in SNMP. + +=cut From 21e7551be13bd5f33a141012bdbc01298535c85c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 17 Feb 2016 15:12:15 +0100 Subject: [PATCH 111/346] + add ha-status mode for kemp --- .../network/kemp/snmp/mode/hastatus.pm | 210 ++++++++++++++++++ centreon-plugins/network/kemp/snmp/plugin.pm | 1 + 2 files changed, 211 insertions(+) create mode 100644 centreon-plugins/network/kemp/snmp/mode/hastatus.pm diff --git a/centreon-plugins/network/kemp/snmp/mode/hastatus.pm b/centreon-plugins/network/kemp/snmp/mode/hastatus.pm new file mode 100644 index 000000000..15ef72920 --- /dev/null +++ b/centreon-plugins/network/kemp/snmp/mode/hastatus.pm @@ -0,0 +1,210 @@ +# +# Copyright 2016 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::kemp::snmp::mode::hastatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{'critical_' . $self->{result_values}->{label}}) && $instance_mode->{option_results}->{'critical_' . $self->{result_values}->{label}} ne '' && + eval "$instance_mode->{option_results}->{\"critical_\" . $self->{result_values}->{label}}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{'warning_' . $self->{result_values}->{label}}) && $instance_mode->{option_results}->{'warning_' . $self->{result_values}->{label}} ne '' && + eval "$instance_mode->{option_results}->{\"warning_\" . $self->{result_values}->{label}}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_hastatus_output { + my ($self, %options) = @_; + + my $msg = 'HA status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_syncstatus_output { + my ($self, %options) = @_; + + my $msg = 'Synchronization l4 status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_hastatus_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_hAstate'}; + $self->{result_values}->{label} = 'ha_status'; + return 0; +} + +sub custom_syncstatus_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_daemonState'}; + $self->{result_values}->{label} = 'sync_status'; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' } + ]; + + $self->{maps_counters}->{global} = [ + { label => 'ha-status', threshold => 0, set => { + key_values => [ { name => 'hAstate' } ], + closure_custom_calc => $self->can('custom_hastatus_calc'), + closure_custom_output => $self->can('custom_hastatus_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'sync-status', threshold => 0, set => { + key_values => [ { name => 'daemonState' } ], + closure_custom_calc => $self->can('custom_syncstatus_calc'), + closure_custom_output => $self->can('custom_syncstatus_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning-ha-status:s" => { name => 'warning_ha_status', default => '' }, + "critical-ha-status:s" => { name => 'critical_ha_status', default => '' }, + "warning-sync-status:s" => { name => 'warning_sync_status', default => '' }, + "critical-sync-status:s" => { name => 'critical_sync_status', default => '' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_ha_status', 'critical_ha_status', 'warning_sync_status', 'critical_sync_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_daemon_state = ( + 0 => 'none', + 1 => 'master', + 2 => 'backup', +); +my %map_ha_state = ( + 0 => 'none', + 1 => 'master', + 2 => 'standby', + 3 => 'passive', +); +my $mapping = { + daemonState => { oid => '.1.3.6.1.4.1.12196.13.0.7', map => \%map_daemon_state }, + hAstate => { oid => '.1.3.6.1.4.1.12196.13.0.9', map => \%map_ha_state }, +}; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{vs} = {}; + my $snmp_result = $options{snmp}->get_leef(oids => [ $mapping->{daemonState}->{oid} . '.0', $mapping->{hAstate}->{oid} . '.0' ], + nothing_quit => 1); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => '0'); + + $self->{global} = { %$result }; +} + +1; + +__END__ + +=head1 MODE + +Check ha status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^ha-status$' + +=item B<--warning-ha-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{status}, %{display} + +=item B<--critical-ha-status> + +Set critical threshold for status (Default: none). +Can used special variables like: %{status}, %{display} + +=item B<--warning-sync-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{status}, %{display} + +=item B<--critical-sync-status> + +Set critical threshold for status (Default: none). +Can used special variables like: %{status}, %{display} + +=back + +=cut diff --git a/centreon-plugins/network/kemp/snmp/plugin.pm b/centreon-plugins/network/kemp/snmp/plugin.pm index eac98d26a..3e6367ce3 100644 --- a/centreon-plugins/network/kemp/snmp/plugin.pm +++ b/centreon-plugins/network/kemp/snmp/plugin.pm @@ -36,6 +36,7 @@ sub new { 'load' => 'snmp_standard::mode::loadaverage', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'list-vs' => 'network::kemp::snmp::mode::listvs', + 'ha-status' => 'network::kemp::snmp::mode::hastatus', 'memory' => 'snmp_standard::mode::memory', 'rs-status' => 'network::kemp::snmp::mode::rsstatus', 'vs-status' => 'network::kemp::snmp::mode::vsstatus', From 0f87eb849db40992ac245a0e23e956781d5f157f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 17 Feb 2016 17:13:04 +0100 Subject: [PATCH 112/346] + update version and changelog --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index 61f97788c..ed90ea232 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -31,7 +31,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160122; +my $global_version = 20160217; sub new { my $class = shift; diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index 64f50d1de..3bc5034ab 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,20 @@ +2016-02-17 Quentin Garnier + * Plugin added: to check Kemp + * Plugin added: to check Netbackup + * Plugin added: to check Ucopia Wireless Controller + * Plugin added: to check Emerson Liebert PDU + * Plugin added: to check Microsoft Lync 2013 + * Plugin added: to check TemPERHum sensors + * Mode added: [mysql] 'table-size' + * Mode added: [centreon] 'count-services' + * Mode added: [iDrac] 'hardware' (for iDrac 8) + * Enhancement: [xtremio] hardened code + * Enhancement: [cisco asa]{sessions} better metrics (#315) + * Enhancement: [freebsd]{memory} More real values + * Fix: [oracle]{tablespace-usage} Usage more than 100% + * Fix: [clariion]{disks} Last disks was missing + * Fix: [mssql]{failed-jobs} wrong thresholds + 2016-01-22 Quentin Garnier * Plugin added: Add a plugin to check Juniper Trapeze in SNMP * Plugin added: Add a plugin to check Dell ML6000 in SNMP From ff3c9bf02c9a147b9e90c7e10f47454650f4ac7e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 18 Feb 2016 15:06:54 +0100 Subject: [PATCH 113/346] + fix kemp warn message with snmpv1 --- centreon-plugins/network/kemp/snmp/mode/rsstatus.pm | 4 +++- centreon-plugins/network/kemp/snmp/mode/vsstatus.pm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm b/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm index 703fe851d..f221a1001 100644 --- a/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm +++ b/centreon-plugins/network/kemp/snmp/mode/rsstatus.pm @@ -196,7 +196,9 @@ sub manage_selection { $self->{rs}->{$instance} = { display => $display_name, status => $result->{rSstate}, - rSInBytes => $result->{rSInBytes} * 8, rSOutBytes => $result->{rSOutBytes} * 8, rSActiveConns => $result->{rSActiveConns} }; + rSInBytes => defined($result->{rSInBytes}) ? $result->{rSInBytes} * 8 : undef, + rSOutBytes => defined($result->{rSOutBytes}) ? $result->{rSOutBytes} * 8 : undef, + rSActiveConns => $result->{rSActiveConns} }; } if (scalar(keys %{$self->{rs}}) <= 0) { diff --git a/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm b/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm index 3f73101dc..95b406aab 100644 --- a/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm +++ b/centreon-plugins/network/kemp/snmp/mode/vsstatus.pm @@ -194,7 +194,9 @@ sub manage_selection { $self->{vs}->{$instance} = { display => $result->{vSname}, status => $result->{vSstate}, - vSInBytes => $result->{vSInBytes} * 8, vSOutBytes => $result->{vSOutBytes} * 8, vSActivConns => $result->{vSActivConns} }; + vSInBytes => defined($result->{vSInBytes}) ? $result->{vSInBytes} * 8 : undef, + vSOutBytes => defined($result->{vSOutBytes}) ? $result->{vSOutBytes} * 8 : undef, + vSActivConns => $result->{vSActivConns} }; } if (scalar(keys %{$self->{vs}}) <= 0) { From b2dafdd840d100e0389d4814742695a89fb8eabe Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 19 Feb 2016 15:27:58 +0100 Subject: [PATCH 114/346] + Enhance to have mode display --- centreon-plugins/centreon/plugins/options.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/plugins/options.pm b/centreon-plugins/centreon/plugins/options.pm index 33e8ce3ce..bbbc59b03 100644 --- a/centreon-plugins/centreon/plugins/options.pm +++ b/centreon-plugins/centreon/plugins/options.pm @@ -79,9 +79,10 @@ sub display_help { { local *STDOUT; open STDOUT, '>', \$stdout; - pod2usage(-exitval => 'NOEXIT', -input => pod_where({-inc => 1}, $_->{package}), + my $where = pod_where({-inc => 1}, $_->{package}); + pod2usage(-exitval => 'NOEXIT', -input => $where, -verbose => 99, - -sections => $_->{sections}); + -sections => $_->{sections}) if (defined($where)); } $self->{output}->add_option_msg(long_msg => $stdout) if (defined($stdout)); From d340d2c25151284a59d2c7e4b1cefc1bc4c92b4d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 20 Feb 2016 16:19:57 +0100 Subject: [PATCH 115/346] + add some code in core to display help with fatpacker build --- .../plugins/alternative/FatPackerOptions.pm | 64 +++++++++++++++++++ centreon-plugins/centreon/plugins/script.pm | 22 ++++++- 2 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 centreon-plugins/centreon/plugins/alternative/FatPackerOptions.pm diff --git a/centreon-plugins/centreon/plugins/alternative/FatPackerOptions.pm b/centreon-plugins/centreon/plugins/alternative/FatPackerOptions.pm new file mode 100644 index 000000000..c8a6b0a67 --- /dev/null +++ b/centreon-plugins/centreon/plugins/alternative/FatPackerOptions.pm @@ -0,0 +1,64 @@ +# +# Copyright 2016 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 centreon::plugins::alternative::FatPackerOptions; + +use base qw(centreon::plugins::options); + +use strict; +use warnings; +use Pod::Usage; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + return $self; +} + +sub display_help { + my ($self, %options) = @_; + + my $stdout; + foreach (@{$self->{pod_package}}) { + + { + my $pp = $_->{package} . ".pm"; + $pp =~ s{::}{/}g; + my $content_class = $INC{$pp}->{$pp}; + open my $str_fh, '<', \$content_class; + + local *STDOUT; + open STDOUT, '>', \$stdout; + pod2usage(-exitval => 'NOEXIT', -input => $str_fh, + -verbose => 99, + -sections => $_->{sections}); + + close $str_fh; + } + + $self->{output}->add_option_msg(long_msg => $stdout) if (defined($stdout)); + } +} + +1; + +__END__ diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index ed90ea232..81e81dfd8 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -22,7 +22,6 @@ package centreon::plugins::script; use strict; use warnings; -use centreon::plugins::options; use centreon::plugins::output; use centreon::plugins::misc; use FindBin; @@ -32,6 +31,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); my $global_version = 20160217; +my $alternative_fatpacker = 0; sub new { my $class = shift; @@ -84,7 +84,13 @@ sub get_plugin { ###### # Need to load global 'Output' and 'Options' ###### - $self->{options} = centreon::plugins::options->new(); + if ($alternative_fatpacker == 0) { + require centreon::plugins::options; + $self->{options} = centreon::plugins::options->new(); + } else { + require centreon::plugins::alternative::FatPackerOptions; + $self->{options} = centreon::plugins::alternative::FatPackerOptions->new(); + } $self->{output} = centreon::plugins::output->new(options => $self->{options}); $self->{options}->set_output(output => $self->{output}); @@ -122,7 +128,17 @@ sub display_local_help { if ($self->{help}) { local *STDOUT; open STDOUT, '>', \$stdout; - pod2usage(-exitval => "NOEXIT", -input => pod_where({-inc => 1}, __PACKAGE__)); + + if ($alternative_fatpacker == 0) { + pod2usage(-exitval => "NOEXIT", -input => pod_where({-inc => 1}, __PACKAGE__)); + } else { + my $pp = __PACKAGE__ . ".pm"; + $pp =~ s{::}{/}g; + my $content_class = $INC{$pp}->{$pp}; + open my $str_fh, '<', \$content_class; + pod2usage(-exitval => "NOEXIT", -input => $str_fh); + close $str_fh; + } } $self->{output}->add_option_msg(long_msg => $stdout) if (defined($stdout)); From 37c42847f79f28bc7c633efc362d94ebb48d5617 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 20 Feb 2016 16:48:33 +0100 Subject: [PATCH 116/346] + update changelog --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index 81e81dfd8..babc300a8 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160217; +my $global_version = 20160220; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index 3bc5034ab..8d5e2bccf 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,6 @@ +2016-02-20 Quentin Garnier + * Add a class for FatPacker system + 2016-02-17 Quentin Garnier * Plugin added: to check Kemp * Plugin added: to check Netbackup From 18796eb101a5a29df952413d0cafa18e46f5a1bf Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 22 Feb 2016 12:47:15 +0100 Subject: [PATCH 117/346] + Fix #342 --- .../ibm/bladecenter/snmp/mode/components/blade.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm index c48e4007b..add7e90c6 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/mode/components/blade.pm @@ -82,20 +82,23 @@ sub check { next; } $self->{components}->{blade}->{total}++; + $result->{bladeName} = defined($result->{bladeName}) ? $result->{bladeName} : '-'; if ($result->{bladePowerState} =~ /off/) { - $self->{output}->output_add(long_msg => sprintf("Blade '%s' power state is %s", - $result->{bladeId}, $result->{bladePowerState})); + $self->{output}->output_add(long_msg => sprintf("Blade '%s/%s' power state is %s", + $result->{bladeName}, $result->{bladeId}, $result->{bladePowerState}, + )); next; } - $self->{output}->output_add(long_msg => sprintf("Blade '%s' state is %s [power state: %s]", - $result->{bladeId}, $result->{bladeHealthState}, $result->{bladePowerState})); + $self->{output}->output_add(long_msg => sprintf("Blade '%s/%s' state is %s [power state: %s]", + $result->{bladeName}, $result->{bladeId}, $result->{bladeHealthState}, $result->{bladePowerState}, + )); my $exit = $self->get_severity(section => 'blade', value => $result->{bladeHealthState}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Blade '%s' state is %s", - $result->{bladeId}, $result->{bladeHealthState})); + short_msg => sprintf("Blade '%s/%s' state is %s", + $result->{bladeName}, $result->{bladeId}, $result->{bladeHealthState})); } } } From 259338ac15049a85fe41d863604f203f6298b2f3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 28 Feb 2016 15:56:51 +0100 Subject: [PATCH 118/346] + Fix #347 --- .../akcp/snmp/mode/components/humidity.pm | 106 +++++++++++++++ .../akcp/snmp/mode/components/resources.pm | 62 +++++++++ .../akcp/snmp/mode/components/serial.pm | 72 +++++++++++ .../akcp/snmp/mode/components/switch.pm | 72 +++++++++++ .../akcp/snmp/mode/components/temperature.pm | 107 ++++++++++++++++ .../sensors/akcp/snmp/mode/sensors.pm | 121 ++++++++++++++++++ .../hardware/sensors/akcp/snmp/plugin.pm | 48 +++++++ .../idrac/snmp/mode/components/amperage.pm | 2 +- .../snmp/mode/components/coolingdevice.pm | 2 +- .../idrac/snmp/mode/components/temperature.pm | 2 +- .../idrac/snmp/mode/components/voltage.pm | 2 +- 11 files changed, 592 insertions(+), 4 deletions(-) create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/components/humidity.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/components/serial.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/components/switch.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/components/temperature.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/mode/sensors.pm create mode 100644 centreon-plugins/hardware/sensors/akcp/snmp/plugin.pm diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/humidity.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/humidity.pm new file mode 100644 index 000000000..27d0376b6 --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/humidity.pm @@ -0,0 +1,106 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::components::humidity; + +use strict; +use warnings; +use hardware::sensors::akcp::snmp::mode::components::resources qw(%map_default1_status %map_online); + +my $mapping = { + hhmsSensorArrayHumidityDescription => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.1' }, + hhmsSensorArrayHumidityPercent => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.3' }, + hhmsSensorArrayHumidityStatus => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.4', map => \%map_default1_status }, + hhmsSensorArrayHumidityOnline => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.5', map => \%map_online }, + hhmsSensorArrayHumidityHighWarning => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.7' }, + hhmsSensorArrayHumidityHighCritical => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.8' }, + hhmsSensorArrayHumidityLowWarning => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.9' }, + hhmsSensorArrayHumidityLowCritical => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.17.1.10' }, +}; +my $oid_hhmsSensorArrayHumidityEntry = '.1.3.6.1.4.1.3854.1.2.2.1.17.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_hhmsSensorArrayHumidityEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking humidities"); + $self->{components}->{humidity} = {name => 'humidities', total => 0, skip => 0}; + return if ($self->check_filter(section => 'humidity')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_hhmsSensorArrayHumidityEntry}})) { + next if ($oid !~ /^$mapping->{hhmsSensorArrayHumidityOnline}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hhmsSensorArrayHumidityEntry}, instance => $instance); + + next if ($self->check_filter(section => 'humidity', instance => $instance)); + if ($result->{hhmsSensorArrayHumidityOnline} eq 'offline') { + $self->{output}->output_add(long_msg => sprintf("skipping '%s': is offline", $result->{hhmsSensorArrayHumidityDescription})); + next; + } + $self->{components}->{humidity}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("humidity '%s' status is '%s' [instance = %s] [value = %s]", + $result->{hhmsSensorArrayHumidityDescription}, $result->{hhmsSensorArrayHumidityStatus}, $instance, + $result->{hhmsSensorArrayHumidityPercent})); + + my $exit = $self->get_severity(label => 'default1', section => 'humidity', value => $result->{hhmsSensorArrayHumidityStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Humdity '%s' status is '%s'", $result->{hhmsSensorArrayHumidityDescription}, $result->{hhmsSensorArrayHumidityStatus})); + next; + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'humidity', instance => $instance, value => $result->{hhmsSensorArrayHumidityPercent}); + if ($checked == 0) { + $result->{hhmsSensorArrayHumidityLowWarning} = (defined($result->{hhmsSensorArrayHumidityLowWarning}) && $result->{hhmsSensorArrayHumidityLowWarning} =~ /[0-9]/) ? + $result->{hhmsSensorArrayHumidityLowWarning} : ''; + $result->{hhmsSensorArrayHumidityLowCritical} = (defined($result->{hhmsSensorArrayHumidityLowCritical}) && $result->{hhmsSensorArrayHumidityLowCritical} =~ /[0-9]/) ? + $result->{hhmsSensorArrayHumidityLowCritical} : ''; + $result->{hhmsSensorArrayHumidityHighWarning} = (defined($result->{hhmsSensorArrayHumidityHighWarning}) && $result->{hhmsSensorArrayHumidityHighWarning} =~ /[0-9]/) ? + $result->{hhmsSensorArrayHumidityHighWarning} : ''; + $result->{hhmsSensorArrayHumidityHighCritical} = (defined($result->{hhmsSensorArrayHumidityHighCritical}) && $result->{hhmsSensorArrayHumidityHighCritical} =~ /[0-9]/) ? + $result->{hhmsSensorArrayHumidityHighCritical} : ''; + my $warn_th = $result->{hhmsSensorArrayHumidityLowWarning} . ':' . $result->{hhmsSensorArrayHumidityHighWarning}; + my $crit_th = $result->{hhmsSensorArrayHumidityLowCritical} . ':' . $result->{hhmsSensorArrayHumidityHighCritical}; + $self->{perfdata}->threshold_validate(label => 'warning-humidity-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-humidity-instance-' . $instance, value => $crit_th); + + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-humidity-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-humidity-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Humdity '%s' is %s %%", $result->{hhmsSensorArrayHumidityDescription}, $result->{hhmsSensorArrayHumidityPercent})); + } + $self->{output}->perfdata_add(label => 'humidity_' . $result->{hhmsSensorArrayHumidityDescription}, unit => '%', + value => $result->{hhmsSensorArrayHumidityPercent}, + warning => $warn, + critical => $crit, + min => 0, max => 100); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/resources.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/resources.pm new file mode 100644 index 000000000..413abeb9e --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/resources.pm @@ -0,0 +1,62 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our %map_default1_status; +our %map_default2_status; +our %map_online; +our %map_degree_type; + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw(%map_default1_status %map_default2_status %map_online %map_degree_type); + +%map_default1_status = ( + 1 => 'noStatus', + 2 => 'normal', + 3 => 'highWarning', + 4 => 'highCritical', + 5 => 'lowWarning', + 6 => 'lowCritical', + 7 => 'sensorError', +); + +%map_default2_status = ( + 1 => 'noStatus', + 2 => 'normal', + 4 => 'critical', + 7 => 'sensorError', +); + +%map_online = ( + 1 => 'online', + 2 => 'offline', +); + +%map_degree_type = ( + 0 => 'F', + 1 => 'C', +); + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/serial.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/serial.pm new file mode 100644 index 000000000..0b524dde0 --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/serial.pm @@ -0,0 +1,72 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::components::serial; + +use strict; +use warnings; +use hardware::sensors::akcp::snmp::mode::components::resources qw(%map_default2_status %map_online); + +my $mapping = { + hhmsSensorArraySerialDescription => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.19.1.1' }, + hhmsSensorArraySerialStatus => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.19.1.3', map => \%map_default2_status }, + hhmsSensorArraySerialOnline => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.19.1.4', map => \%map_online }, +}; +my $oid_hhmsSensorArraySwitchEntry = '.1.3.6.1.4.1.3854.1.2.2.1.18.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_hhmsSensorArraySwitchEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking serials"); + $self->{components}->{serial} = {name => 'serials', total => 0, skip => 0}; + return if ($self->check_filter(section => 'serial')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_hhmsSensorArraySwitchEntry}})) { + next if ($oid !~ /^$mapping->{hhmsSensorArraySerialOnline}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hhmsSensorArraySwitchEntry}, instance => $instance); + + next if ($self->check_filter(section => 'serial', instance => $instance)); + if ($result->{hhmsSensorArraySerialOnline} eq 'offline') { + $self->{output}->output_add(long_msg => sprintf("skipping '%s': is offline", $result->{hhmsSensorArraySerialDescription})); + next; + } + $self->{components}->{serial}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("serial '%s' status is '%s' [instance = %s]", + $result->{hhmsSensorArraySerialDescription}, $result->{hhmsSensorArraySerialStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default2', section => 'serial', value => $result->{hhmsSensorArraySerialStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Serial '%s' status is '%s'", $result->{hhmsSensorArraySerialDescription}, $result->{hhmsSensorArraySerialStatus})); + next; + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/switch.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/switch.pm new file mode 100644 index 000000000..d3b3f93dd --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/switch.pm @@ -0,0 +1,72 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::components::switch; + +use strict; +use warnings; +use hardware::sensors::akcp::snmp::mode::components::resources qw(%map_default2_status %map_online); + +my $mapping = { + hhmsSensorArraySwitchDescription => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.18.1.1' }, + hhmsSensorArraySwitchStatus => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.18.1.3', map => \%map_default2_status }, + hhmsSensorArraySwitchOnline => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.18.1.4', map => \%map_online }, +}; +my $oid_hhmsSensorArraySwitchEntry = '.1.3.6.1.4.1.3854.1.2.2.1.18.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_hhmsSensorArraySwitchEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking switches"); + $self->{components}->{switch} = {name => 'switches', total => 0, skip => 0}; + return if ($self->check_filter(section => 'switch')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_hhmsSensorArraySwitchEntry}})) { + next if ($oid !~ /^$mapping->{hhmsSensorArraySwitchOnline}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hhmsSensorArraySwitchEntry}, instance => $instance); + + next if ($self->check_filter(section => 'switch', instance => $instance)); + if ($result->{hhmsSensorArraySwitchOnline} eq 'offline') { + $self->{output}->output_add(long_msg => sprintf("skipping '%s': is offline", $result->{hhmsSensorArraySwitchDescription})); + next; + } + $self->{components}->{switch}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("switch '%s' status is '%s' [instance = %s]", + $result->{hhmsSensorArraySwitchDescription}, $result->{hhmsSensorArraySwitchStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default2', section => 'switch', value => $result->{hhmsSensorArraySwitchStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Switch '%s' status is '%s'", $result->{hhmsSensorArraySwitchDescription}, $result->{hhmsSensorArraySwitchStatus})); + next; + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/temperature.pm new file mode 100644 index 000000000..20a4894ba --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/components/temperature.pm @@ -0,0 +1,107 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::components::temperature; + +use strict; +use warnings; +use hardware::sensors::akcp::snmp::mode::components::resources qw(%map_default1_status %map_online %map_degree_type); + +my $mapping = { + hhmsSensorArrayTempDescription => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.1' }, + hhmsSensorArrayTempDegree => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.3' }, + hhmsSensorArrayTempStatus => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', map => \%map_default1_status }, + hhmsSensorArrayTempOnline => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.5', map => \%map_online }, + hhmsSensorArrayTempHighWarning => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.7' }, + hhmsSensorArrayTempHighCritical => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.8' }, + hhmsSensorArrayTempLowWarning => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.9' }, + hhmsSensorArrayTempLowCritical => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.10' }, + hhmsSensorArrayTempDegreeType => { oid => '.1.3.6.1.4.1.3854.1.2.2.1.16.1.12', map => \%map_degree_type }, +}; +my $oid_hhmsSensorArrayTempEntry = '.1.3.6.1.4.1.3854.1.2.2.1.16.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_hhmsSensorArrayTempEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_hhmsSensorArrayTempEntry}})) { + next if ($oid !~ /^$mapping->{hhmsSensorArrayTempOnline}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_hhmsSensorArrayTempEntry}, instance => $instance); + + next if ($self->check_filter(section => 'temperature', instance => $instance)); + if ($result->{hhmsSensorArrayTempOnline} eq 'offline') { + $self->{output}->output_add(long_msg => sprintf("skipping '%s': is offline", $result->{hhmsSensorArrayTempDescription})); + next; + } + $self->{components}->{temperature}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s' [instance = %s] [value = %s]", + $result->{hhmsSensorArrayTempDescription}, $result->{hhmsSensorArrayTempStatus}, $instance, + $result->{hhmsSensorArrayTempDegree})); + + my $exit = $self->get_severity(label => 'default1', section => 'temperature', value => $result->{hhmsSensorArrayTempStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' status is '%s'", $result->{hhmsSensorArrayTempDescription}, $result->{hhmsSensorArrayTempStatus})); + next; + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{hhmsSensorArrayTempDegree}); + if ($checked == 0) { + $result->{hhmsSensorArrayTempLowWarning} = (defined($result->{hhmsSensorArrayTempLowWarning}) && $result->{hhmsSensorArrayTempLowWarning} =~ /[0-9]/) ? + $result->{hhmsSensorArrayTempLowWarning} : ''; + $result->{hhmsSensorArrayTempLowCritical} = (defined($result->{hhmsSensorArrayTempLowCritical}) && $result->{hhmsSensorArrayTempLowCritical} =~ /[0-9]/) ? + $result->{hhmsSensorArrayTempLowCritical} : ''; + $result->{hhmsSensorArrayTempHighWarning} = (defined($result->{hhmsSensorArrayTempHighWarning}) && $result->{hhmsSensorArrayTempHighWarning} =~ /[0-9]/) ? + $result->{hhmsSensorArrayTempHighWarning} : ''; + $result->{hhmsSensorArrayTempHighCritical} = (defined($result->{hhmsSensorArrayTempHighCritical}) && $result->{hhmsSensorArrayTempHighCritical} =~ /[0-9]/) ? + $result->{hhmsSensorArrayTempHighCritical} : ''; + my $warn_th = $result->{hhmsSensorArrayTempLowWarning} . ':' . $result->{hhmsSensorArrayTempHighWarning}; + my $crit_th = $result->{hhmsSensorArrayTempLowCritical} . ':' . $result->{hhmsSensorArrayTempHighCritical}; + $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); + + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Temperature '%s' is %s %s", $result->{hhmsSensorArrayTempDescription}, $result->{hhmsSensorArrayTempDegree}, $result->{hhmsSensorArrayTempDegreeType})); + } + $self->{output}->perfdata_add(label => 'temperature_' . $result->{hhmsSensorArrayTempDescription}, unit => $result->{hhmsSensorArrayTempDegreeType}, + value => $result->{hhmsSensorArrayTempDegree}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/akcp/snmp/mode/sensors.pm new file mode 100644 index 000000000..02c20526e --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/mode/sensors.pm @@ -0,0 +1,121 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::snmp::mode::sensors; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|switch|serial)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + default1 => [ + ['noStatus', 'OK'], + ['normal', 'OK'], + ['highWarning', 'WARNING'], + ['highCritical', 'CRITICAL'], + ['lowWarning', 'WARNING'], + ['lowCritical', 'CRITICAL'], + ['sensorError', 'CRITICAL'], + ], + default2 => [ + ['noStatus', 'OK'], + ['normal', 'OK'], + ['critical', 'CRITICAL'], + ['sensorError', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'hardware::sensors::akcp::snmp::mode::components'; + $self->{components_module} = ['temperature', 'humidity', 'switch', 'serial']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check sensors. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'temperature', 'humidity', 'switch', 'serial'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,101 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='psu,CRITICAL,^(?!(presentOK)$)' + +=item B<--warning> + +Set warning threshold for 'temperature', 'humidity' (syntax: type,regexp,threshold) +Example: --warning='temperature,1,30' + +=item B<--critical> + +Set critical threshold for 'temperature', 'humidity' (syntax: type,regexp,threshold) +Example: --warning='temperature,1,50' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/hardware/sensors/akcp/snmp/plugin.pm b/centreon-plugins/hardware/sensors/akcp/snmp/plugin.pm new file mode 100644 index 000000000..ca4f3e967 --- /dev/null +++ b/centreon-plugins/hardware/sensors/akcp/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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 hardware::sensors::akcp::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}} = ( + 'sensors' => 'hardware::sensors::akcp::snmp::mode::sensors', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check AKCP sensors in SNMP. + +=cut diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm index 1ebd18442..ad1d0ead1 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/amperage.pm @@ -103,7 +103,7 @@ sub check { $exit = $self->{perfdata}->threshold_check(value => $result->{amperageProbeReading}, threshold => [ { label => 'critical-amperage-instance-' . $instance, exit_litteral => 'critical' }, { label => 'warning-amperage-instance-' . $instance, exit_litteral => 'warning' } ]); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-amperage-instance-' . $instance); - $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-amperage-instance-' . $instance) + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-amperage-instance-' . $instance); } if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm index 9eaf13818..73a99338b 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/coolingdevice.pm @@ -94,7 +94,7 @@ sub check { $exit = $self->{perfdata}->threshold_check(value => $result->{coolingDeviceReading}, threshold => [ { label => 'critical-coolingdevice-instance-' . $instance, exit_litteral => 'critical' }, { label => 'warning-coolingdevice-instance-' . $instance, exit_litteral => 'warning' } ]); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-coolingdevice-instance-' . $instance); - $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-coolingdevice-instance-' . $instance) + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-coolingdevice-instance-' . $instance); } if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm index 95213638a..fca6c432d 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/temperature.pm @@ -102,7 +102,7 @@ sub check { $exit = $self->{perfdata}->threshold_check(value => $result->{temperatureProbeReading}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); - $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance) + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); } if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm index ff3399c7b..67cee6160 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/components/voltage.pm @@ -94,7 +94,7 @@ sub check { $exit = $self->{perfdata}->threshold_check(value => $result->{voltageProbeReading}, threshold => [ { label => 'critical-voltage-instance-' . $instance, exit_litteral => 'critical' }, { label => 'warning-voltage-instance-' . $instance, exit_litteral => 'warning' } ]); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-voltage-instance-' . $instance); - $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-voltage-instance-' . $instance) + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-voltage-instance-' . $instance); } if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { From b2c50e271658d268412aadd2dacf5c680b48ef83 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 28 Feb 2016 16:22:57 +0100 Subject: [PATCH 119/346] + Fix #334 --- .../standard/rfc1628/snmp/mode/inputlines.pm | 207 +++++++----------- 1 file changed, 75 insertions(+), 132 deletions(-) diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm index 2407632f6..579e594c7 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm @@ -20,48 +20,63 @@ package hardware::ups::standard::rfc1628::snmp::mode::inputlines; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -my %oids = ( - '.1.3.6.1.2.1.33.1.3.3.1.2' => { counter => 'frequence' }, # in dH upsInputFrequency - '.1.3.6.1.2.1.33.1.3.3.1.3' => { counter => 'voltage' }, # in Volt upsInputVoltage - '.1.3.6.1.2.1.33.1.3.3.1.4' => { counter => 'current' }, # in dA upsInputCurrent - '.1.3.6.1.2.1.33.1.3.3.1.5' => { counter => 'power' }, # in Watt upsInputTruePower -); +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'line', type => 1, cb_prefix_output => 'prefix_line_output', message_multiple => 'All input lines are ok', skipped_code => { -10 => 1 } } + ]; + + $self->{maps_counters}->{line} = [ + { label => 'frequence', set => { + key_values => [ { name => 'upsInputFrequency' }, { name => 'display' } ], + output_template => 'Frequence : %.2f Hz', + perfdatas => [ + { label => 'frequence', value => 'upsInputFrequency_absolute', template => '%s', + unit => 'Hz', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'voltage', set => { + key_values => [ { name => 'upsInputVoltage' }, { name => 'display' } ], + output_template => 'Voltage : %.2f V', + perfdatas => [ + { label => 'voltage', value => 'upsInputVoltage_absolute', template => '%s', + unit => 'V', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'current', set => { + key_values => [ { name => 'upsInputCurrent' }, { name => 'display' } ], + output_template => 'Current : %.2f A', + perfdatas => [ + { label => 'current', value => 'upsInputCurrent_absolute', template => '%s', + unit => 'A', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'power', set => { + key_values => [ { name => 'upsInputTruePower' }, { name => 'display' } ], + output_template => 'Power : %.2f W', + perfdatas => [ + { label => 'power', value => 'upsInputTruePower_absolute', template => '%s', + unit => 'W', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} -my $maps_counters = { - frequence => { thresholds => { - warning_frequence => { label => 'warning-frequence', exit_value => 'warning' }, - critical_frequence => { label => 'critical-frequence', exit_value => 'critical' }, - }, - output_msg => 'Frequence : %.2f Hz', - factor => 0.1, unit => 'Hz', - }, - voltage => { thresholds => { - warning_voltage => { label => 'warning-voltage', exit_value => 'warning' }, - critical_voltage => { label => 'critical-voltage', exit_value => 'critical' }, - }, - output_msg => 'Voltage : %.2f V', - factor => 1, unit => 'V', - }, - current => { thresholds => { - warning_current => { label => 'warning-current', exit_value => 'warning' }, - critical_current => { label => 'critical-current', exit_value => 'critical' }, - }, - output_msg => 'Current : %.2f A', - factor => 0.1, unit => 'A', - }, - power => { thresholds => { - warning_power => { label => 'warning-power', exit_value => 'warning' }, - critical_power => { label => 'critical-power', exit_value => 'critical' }, - }, - output_msg => 'Power : %.2f W', - factor => 1, unit => 'W', - }, -}; +sub prefix_line_output { + my ($self, %options) = @_; + + return "Input Line '" . $options{instance_value}->{display} . "' "; +} sub new { my ($class, %options) = @_; @@ -72,110 +87,33 @@ sub new { $options{options}->add_options(arguments => { }); - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - $options{options}->add_options(arguments => { - $maps_counters->{$_}->{thresholds}->{$name}->{label} . ':s' => { name => $name }, - }); - } - } - - $self->{counters_value} = {}; - $self->{instances_done} = {}; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); +my $oids = { + '.1.3.6.1.2.1.33.1.3.3.1.2' => { name => 'upsInputFrequency', factor => 0.1 }, # in dH + '.1.3.6.1.2.1.33.1.3.3.1.3' => { name => 'upsInputVoltage', factor => 1 }, # in Volt + '.1.3.6.1.2.1.33.1.3.3.1.4' => { name => 'upsInputCurrent', factor => 0.1 }, # in dA + '.1.3.6.1.2.1.33.1.3.3.1.5' => { name => 'upsInputTruePower', factor => 1 }, # in Watt +}; - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - if (($self->{perfdata}->threshold_validate(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, value => $self->{option_results}->{$name})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong " . $maps_counters->{$_}->{thresholds}->{$name}->{label} . " threshold '" . $self->{option_results}->{$name} . "'."); - $self->{output}->option_exit(); - } - } - } -} - -sub build_values { +sub manage_selection { my ($self, %options) = @_; - my $counters_value = {}; - my $instance = undef; - - foreach my $oid (keys %oids) { - if ($options{current} =~ /^$oid\.(.*)/) { - $instance = $1; - last; - } - } - - # Skip already done - if (!defined($instance) || defined($self->{instances_done}->{$instance})) { - return 0; - } - - $self->{instances_done}->{$instance} = 1; - $self->{counters_value}->{$instance} = {}; - foreach my $oid (keys %oids) { - $self->{counters_value}->{$instance}->{$oids{$oid}->{counter}} = defined($options{result}->{$oid . '.' . $instance}) ? $options{result}->{$oid . '.' . $instance} : 0; - } -} -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - my $oid_upsInputEntry = '.1.3.6.1.2.1.33.1.3.3.1'; - my $result = $self->{snmp}->get_table(oid => $oid_upsInputEntry, nothing_quit => 1); - foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) { - $self->build_values(current => $key, result => $result); - } - - my $num = scalar(keys %{$self->{instances_done}}); - foreach my $instance (keys %{$self->{instances_done}}) { - my $instance_output = $instance; - $instance_output =~ s/\./#/g; + my $results = $options{snmp}->get_table(oid => $oid_upsInputEntry, nothing_quit => 1); + + $self->{line} = {}; + foreach my $oid (keys %{$results}) { + next if ($oid !~ /^(.*)\.(.*?)\.(.*?)$/); + my ($base, $instance) = ($1 . '.' . $2, $3); + next if (!defined($oids->{$base})); + next if ($results->{$oid} !~ /\d/ || $results->{$oid} == 0); - my @exits; - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} =~ /\d/ && $self->{counters_value}->{$instance}->{$_} != 0) { - push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]); - } - } - } - - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - my $extra_label = ''; - $extra_label = '_' . $instance_output if ($num > 1); - - my $str_output = "Input Line '$instance_output' "; - my $str_append = ''; - foreach (keys %{$maps_counters}) { - next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} !~ /\d/ || $self->{counters_value}->{$instance}->{$_} == 0); - - $str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}); - $str_append = ', '; - my ($warning, $critical); - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - $warning = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'warning'); - $critical = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'critical'); - } - - $self->{output}->perfdata_add(label => $_ . $extra_label, unit => $maps_counters->{$_}->{unit}, - value => sprintf("%.2f", $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}), - warning => $warning, - critical => $critical); - } - $self->{output}->output_add(severity => $exit, - short_msg => $str_output); + $self->{line}->{$instance} = { display => $instance } if (!defined($self->{line}->{$instance})); + $self->{line}->{$instance}->{$oids->{$base}->{name}} = $results->{$oid} * $oids->{$base}->{factor}; } - - $self->{output}->display(); - $self->{output}->exit(); } 1; @@ -188,6 +126,11 @@ Check Input lines metrics (frequence, voltage, current and true power). =over 8 +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^power$' + =item B<--warning-*> Threshold warning. From 0402afe7aab743063319bbe1d397b922b1f8cb3f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 28 Feb 2016 16:45:10 +0100 Subject: [PATCH 120/346] + Fix #348 : problem with onOff --- .../hardware/pdu/raritan/snmp/mode/components/resources.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm index 9483bee88..1e0043db7 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/mode/components/resources.pm @@ -191,7 +191,7 @@ $thresholds = { ], onoff => [ ['unavailable', 'UNKNOWN'], - ['ok', 'OK'], + ['on', 'OK'], ['off', 'OK'], ], contact => [ From 9209e5ce30539d91981a8ac93573f95013c3647f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 3 Mar 2016 14:01:41 +0100 Subject: [PATCH 121/346] + fix help numeric value --- centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm index 6eb9e3ae0..00a64d7db 100644 --- a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm +++ b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm @@ -258,10 +258,6 @@ perl centreon_plugins.pl --plugin=apps::protocols::jmx::plugin --custommode=jolo =over 8 -=item B<--oid> - -OID value to check (numeric format only). - =item B<--lookup-path> What to lookup (from internal Jmx4Perl). Use --lookup-jpath for complex matching. @@ -279,9 +275,9 @@ Threshold warning. Threshold critical. -=item B<--oid-type> +=item B<--type> -Type of the OID (Default: 'gauge'). +Type (Default: 'gauge'). Can be 'counter' also. 'counter' will use a retention file. =item B<--counter-per-seconds> From 4a376255ee4067f60ff364df9648289fb1ec0586 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 3 Mar 2016 17:47:41 +0100 Subject: [PATCH 122/346] + Fix #228 --- .../snmp_standard/mode/stringvalue.pm | 303 +++++++++++++++--- 1 file changed, 256 insertions(+), 47 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/stringvalue.pm b/centreon-plugins/snmp_standard/mode/stringvalue.pm index 52cfbae7a..de2bbb0db 100644 --- a/centreon-plugins/snmp_standard/mode/stringvalue.pm +++ b/centreon-plugins/snmp_standard/mode/stringvalue.pm @@ -35,15 +35,44 @@ sub new { $options{options}->add_options(arguments => { "oid:s" => { name => 'oid' }, + "oid-leef:s" => { name => 'oid_leef' }, + "oid-table:s" => { name => 'oid_table' }, + "oid-instance:s" => { name => 'oid_instance' }, + "filter-table:s" => { name => 'filter_table' }, + "warning-regexp:s" => { name => 'warning_regexp' }, "critical-regexp:s" => { name => 'critical_regexp' }, "unknown-regexp:s" => { name => 'unknown_regexp' }, - "format:s" => { name => 'format', default => 'current value is %s' }, - "map-values:s" => { name => 'map_values' }, - "map-values-separator:s" => { name => 'map_values_separator', default => ',' }, - "regexp-map-values" => { name => 'use_regexp_map_values' }, "regexp-isensitive" => { name => 'use_iregexp' }, + + "warning-absent:s@" => { name => 'warning_absent' }, + "critical-absent:s@" => { name => 'critical_absent' }, + "unknown-absent:s@" => { name => 'unknown_absent' }, + "warning-present:s@" => { name => 'warning_present' }, + "critical-present:s@" => { name => 'critical_present' }, + "unknown-present:s@" => { name => 'unknown_present' }, + + "format-ok:s" => { name => 'format_ok', default => '%{filter_rows} value(s)' }, + "format-warning:s" => { name => 'format_warning', default => 'value(s): %{details_warning}' }, + "format-critical:s" => { name => 'format_critical', default => 'value(s): %{details_critical}' }, + "format-unknown:s" => { name => 'format_unknown', default => 'value(s): %{details_unknown}' }, + + "format-details-ok:s" => { name => 'format_details_ok', default => '%{value}' }, + "format-details-warning:s" => { name => 'format_details_warning', default => '%{value}' }, + "format-details-critical:s" => { name => 'format_details_critical', default => '%{value}' }, + "format-details-unknown:s" => { name => 'format_details_unknown', default => '%{value}' }, + + "format-details-separator-ok:s" => { name => 'format_details_separator_ok', default => ', ' }, + "format-details-separator-warning:s" => { name => 'format_details_separator_warning', default => ', ' }, + "format-details-separator-critical:s" => { name => 'format_details_separator_critical', default => ', ' }, + "format-details-separator-unknown:s" => { name => 'format_details_separator_unknown', default => ', ' }, + + "map-values:s" => { name => 'map_values' }, + "map-value-other:s" => { name => 'map_value_other' }, + "map-values-separator:s" => { name => 'map_values_separator', default => ',' }, }); + + $self->{macros} = { ok => {}, warning => {}, critical => {}, unknown => {} }; return $self; } @@ -51,12 +80,16 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - if (!defined($self->{option_results}->{oid}) || $self->{option_results}->{oid} eq '') { - $self->{output}->add_option_msg(short_msg => "Need to specify an OID."); + $self->{option_results}->{oid_leef} = $self->{option_results}->{oid} if (defined($self->{option_results}->{oid}) && $self->{option_results}->{oid} ne ''); + if ((!defined($self->{option_results}->{oid_leef}) || $self->{option_results}->{oid_leef} eq '') && + (!defined($self->{option_results}->{oid_table}) || $self->{option_results}->{oid_table} eq '')) { + $self->{output}->add_option_msg(short_msg => "Need to specify an OID with option --oid-leef or --oid-table."); $self->{output}->option_exit(); } - $self->{option_results}->{oid} = '.' . $self->{option_results}->{oid} if ($self->{option_results}->{oid} !~ /^\./); - + foreach (('oid_leef', 'oid_table', 'oid_instance')) { + $self->{option_results}->{$_} = '.' . $self->{option_results}->{$_} if (defined($self->{option_results}->{$_}) && $self->{option_results}->{$_} ne '' && $self->{option_results}->{$_} !~ /^\./); + } + $self->{map_values} = {}; if (defined($self->{option_results}->{map_values})) { foreach (split /$self->{option_results}->{map_values_separator}/, $self->{option_results}->{map_values}) { @@ -66,47 +99,196 @@ sub check_options { } } -sub check_regexp { +sub get_instance_value { + my ($self, %options) = @_; + + if (!defined($self->{option_results}->{oid_instance}) || $self->{option_results}->{oid_instance} eq '' + || !defined($self->{results}->{$self->{option_results}->{oid_instance} . '.' . $options{instance}})) { + return $options{instance}; + } + + return $self->{results}->{$self->{option_results}->{oid_instance} . '.' . $options{instance}}; +} + +sub get_map_value { + my ($self, %options) = @_; + + my $value = $options{value}; + return '' if (!defined($options{value})); + if (defined($self->{map_values}->{$options{value}})) { + $value = $self->{map_values}->{$options{value}}; + } elsif (defined($self->{option_results}->{map_value_other}) && $self->{option_results}->{map_value_other} ne '') { + $value = $self->{option_results}->{map_value_other}; + } + + return $value; +} + +sub get_snmp_values { + my ($self, %options) = @_; + + $self->{instances} = {}; + if (defined($self->{option_results}->{oid_leef}) && $self->{option_results}->{oid_leef} ne '') { + $self->{results} = $self->{snmp}->get_leef(oids => [$self->{option_results}->{oid_leef}], nothing_quit => 1); + $self->{macros}->{rows} = 1; + $self->{macros}->{filter_rows} = 1; + $self->{instances}->{0} = $self->get_map_value(value => $self->{results}->{$self->{option_results}->{oid_leef}}); + return 0; + } + + my $tables = [ { oid => $self->{option_results}->{oid_table}} ]; + push @$tables, { oid => $self->{option_results}->{oid_instance} } if (defined($self->{option_results}->{oid_instance}) && $self->{option_results}->{oid_instance} ne ''); + $self->{results} = $self->{snmp}->get_multiple_table(oids => $tables, nothing_quit => 1, return_type => 1); + my ($row, $filter_row) = (0, 0); + foreach (keys %{$self->{results}}) { + next if ($_ !~ /^$self->{option_results}->{oid_table}\.(.*)$/); + + $row++; + my $instance = $self->get_instance_value(instance => $1); + my $value = $self->get_map_value(value => $self->{results}->{$_}); + $self->{output}->output_add(long_msg => sprintf("[instance: %s][value: %s]", $_, $value), debug => 1); + if (defined($self->{option_results}->{filter_table}) && $self->{option_results}->{filter_table} ne '' && + $value !~ /$self->{option_results}->{filter_table}/) { + $self->{output}->output_add(long_msg => sprintf("skipping oid '%s' value '%s': not matching the filter", $_, $value), debug => 1); + next; + } + + $self->{instances}->{$instance} = $value; + $filter_row++; + } + $self->{macros}->{rows} = $row; + $self->{macros}->{filter_rows} = $filter_row; + + return 0; +} + +sub checking_regexp { my ($self, %options) = @_; return 0 if (!defined($self->{option_results}->{$options{severity} . '_regexp'})); my $regexp = $self->{option_results}->{$options{severity} . '_regexp'}; if (defined($self->{option_results}->{use_iregexp}) && $options{value} =~ /$regexp/i) { - $self->{exit_code} = $options{severity}; + $self->{instances}->{$options{severity}}->{$options{instance}} = $options{value}; return 1; } elsif (!defined($self->{option_results}->{use_iregexp}) && $options{value} =~ /$regexp/) { - $self->{exit_code} = $options{severity}; + $self->{instances}->{$options{severity}}->{$options{instance}} = $options{value}; return 1; - } + } return 0; } -sub run { +sub store_ok { my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $result = $self->{snmp}->get_leef(oids => [$self->{option_results}->{oid}], nothing_quit => 1); - my $value_check = $result->{$self->{option_results}->{oid}}; - my $value_display = $value_check; - if (defined($self->{option_results}->{map_values})) { - # If we don't find it. We keep the original value - $value_display = defined($self->{map_values}->{$value_check}) ? $self->{map_values}->{$value_check} : $value_check; - if (defined($self->{option_results}->{use_regexp_map_values})) { - $value_check = $value_display; + foreach my $severity (('critical', 'warning', 'unknown')) { + foreach my $type (('absent', 'present')) { + if (defined($self->{option_results}->{$severity . '_' . $type}) && scalar(@{$self->{option_results}->{$severity . '_' . $type}}) > 0) { + return 0; + } } } - - $self->{exit_code} = 'ok'; - $self->check_regexp(severity => 'critical', value => $value_check) || - $self->check_regexp(severity => 'warning', value => $value_check) || - $self->check_regexp(severity => 'unknown', value => $value_check); - $self->{output}->output_add(severity => $self->{exit_code}, - short_msg => sprintf($self->{option_results}->{format}, $value_display)); + $self->{instances}->{ok}->{$options{instance}} = $options{value}; +} + +sub checking_exist { + my ($self, %options) = @_; + + foreach my $severity (('critical', 'warning', 'unknown')) { + foreach my $absent (@{$self->{option_results}->{$severity . '_absent'}}) { + my $match = 0; + foreach (keys %{$self->{instances}}) { + if ($self->{instances}->{$_} eq $absent) { + $match = 1; + last; + } + } + + if ($match == 0) { + $self->{instances}->{$severity}->{$absent} = $absent; + } + } + + foreach my $present (@{$self->{option_results}->{$severity . '_present'}}) { + my $match = 0; + foreach (keys %{$self->{instances}}) { + if ($self->{instances}->{$_} eq $present) { + $self->{instances}->{$severity}->{$_} = $self->{instances}->{$_}; + } + } + } + } +} + +sub change_macros { + my ($self, %options) = @_; + + my $value = $self->{option_results}->{'format_' . $options{severity}}; + while ($value =~ /%\{(.*?)\}/g) { + $value =~ s/%\{($1)\}/\$self->{macros}->{$1}/g; + } + + return $value; +} + +sub build_format_details { + my ($self, %options) = @_; + + foreach my $severity (('ok', 'critical', 'warning', 'unknown')) { + $self->{macros}->{'details_' . $severity} = ''; + my $append = ''; + foreach my $instance (sort keys %{$self->{instances}->{$severity}}) { + my $details = $self->{option_results}->{'format_details_' . $severity}; + $details =~ s/%{rows}/$self->{macros}->{rows}/g; + $details =~ s/%{filter_rows}/$self->{macros}->{filter_rows}/g; + $details =~ s/%{instance}/$instance/g; + $details =~ s/%{value}/$self->{instances}->{$severity}->{$instance}/g; + + $self->{macros}->{'details_' . $severity} .= $append . $details; + $append = $self->{option_results}->{'format_details_separator_' . $severity}; + } + } +} + +sub display_severity { + my ($self, %options) = @_; + + if (!(defined($options{force}) && $options{force} == 1) && scalar(keys %{$self->{instances}->{$options{severity}}}) == 0) { + return 0; + } + + my $display = $self->change_macros(severity => $options{severity}); + eval "\$display = \"$display\""; + $self->{output}->output_add(severity => $options{severity}, + short_msg => $display); +} + +sub display_result { + my ($self, %options) = @_; + + $self->build_format_details(); + $self->display_severity(severity => 'ok', force => 1); + foreach my $severity (('critical', 'warning', 'unknown')) { + $self->display_severity(severity => $severity); + } +} + +sub run { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + $self->get_snmp_values(); + + foreach (keys %{$self->{instances}}) { + $self->checking_regexp(severity => 'critical', instance => $_, value => $self->{instances}->{$_}) || + $self->checking_regexp(severity => 'warning', instance => $_, value => $self->{instances}->{$_}) || + $self->checking_regexp(severity => 'unknown', instance => $_, value => $self->{instances}->{$_}) || + $self->store_ok(instance => $_, value => $self->{instances}->{$_}); + } + $self->checking_exist(); + $self->display_result(); $self->{output}->display(); $self->{output}->exit(); @@ -118,47 +300,74 @@ __END__ =head1 MODE -Check an SNMP string value (can be a String or an Integer). +Check SNMP string values (can be a String or an Integer). +Check values absent: +centreon_plugins.pl --plugin=snmp_standard::plugin --mode=string-value --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public + --oid-table='.1.3.6.1.2.1.25.4.2.1.2' --format-ok='%{filter_rows} processes' --format-critical='processes are absent: %{details_critical}' --critical-absent='centengine' --critical-absent='crond' --filter-table='centengine|crond' + +Check table status: +centreon_plugins.pl --plugin=snmp_standard::plugin --mode=string-value --hostname=127.0.0.1 --snmp-version=2c --snmp-community=akcp + --oid-table='.1.3.6.1.4.1.3854.1.2.2.1.16.1.4' --oid-instance='.1.3.6.1.4.1.3854.1.2.2.1.16.1.1' --map-values='1=>noStatus,2=>normal,3=>highWarning,4=>highCritical,5=>lowWarning,6=>lowCritical,7=>sensorError' --map-value-other='unknown' --format-ok='All %{rows} entries [%{filter_rows}/%{rows} Temperatures] are ok.' --format-critical='%{details_critical}' --format-details-critical='%{instance} status is %{value}' --critical-regexp='highCritical|lowCritical|sensorError' + +Check like the old plugin: +centreon_plugins.pl --plugin=snmp_standard::plugin --mode=string-value --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public + --oid='.1.3.6.1.2.1.1.1.0' --format-ok='current value is: %{details_ok}' --format-details-warning='current value is: %{details_warning}' --format-details-critical='current value is: %{details_critical}' + =over 8 -=item B<--oid> +=item B<--oid> or <--oid-leef> OID value to check (numeric format only). +=item B<--oid-table> + +OID table value to check (numeric format only). + +=item B<--oid-instance> + +OID table value for the instance (numeric format only). +Can be used to have human readable instance name. + +=item B<--filter-table> + +Filter value from --oid-table option (can be a regexp). + =item B<--warning-regexp> -Return Warning if the oid value match the regexp. +Return Warning if an oid value match the regexp. =item B<--critical-regexp> -Return Critical if the oid value match the regexp. +Return Critical if an oid value match the regexp. -=item B<--unknown-regexp> +=item B<--regexp-isensitive> -Return Unknown if the oid value match the regexp. +Allows to use regexp non case-sensitive. -=item B<--format> +=item B<--format-*> -Output format (Default: 'current value is %s'). +Output format according the threshold. +Can be: +'ok' (default: '%{filter_rows} value(s)'), +'warning' (default: 'value(s): %{details_warning}'), +'critical' (default: 'value(s): %{details_critical}'), +'unknown' (default: 'value(s): %{details_unknown}'). +Can used: %{rows}, %{filter_rows}, %{details_warning}, %{details_ok}, %{details_critical}, %{details_unknown} =item B<--map-values> Use to transform an integer value in most common case. Example: --map-values='1=>ok,10=>fan failed,11=>psu recovery' +=item B<--map-value-other> + +Use to transform an integer value not defined in --map-values option. + =item B<--map-values-separator> Separator uses between values (default: coma). -=item B<--regexp-map-values> - -Use the 'map values' to match in regexp (need --map-values option). - -=item B<--regexp-isensitive> - -Allows to use regexp non case-sensitive. - =back =cut From 6b6a7b409c48431231b1b90715409b0b13171fdb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 3 Mar 2016 18:03:15 +0100 Subject: [PATCH 123/346] + change filter --- .../snmp_standard/mode/stringvalue.pm | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/stringvalue.pm b/centreon-plugins/snmp_standard/mode/stringvalue.pm index de2bbb0db..ad8c5c01f 100644 --- a/centreon-plugins/snmp_standard/mode/stringvalue.pm +++ b/centreon-plugins/snmp_standard/mode/stringvalue.pm @@ -38,7 +38,8 @@ sub new { "oid-leef:s" => { name => 'oid_leef' }, "oid-table:s" => { name => 'oid_table' }, "oid-instance:s" => { name => 'oid_instance' }, - "filter-table:s" => { name => 'filter_table' }, + "filter-table-value:s" => { name => 'filter_table_value' }, + "filter-table-instance:s" => { name => 'filter_table_instance' }, "warning-regexp:s" => { name => 'warning_regexp' }, "critical-regexp:s" => { name => 'critical_regexp' }, @@ -147,11 +148,16 @@ sub get_snmp_values { my $instance = $self->get_instance_value(instance => $1); my $value = $self->get_map_value(value => $self->{results}->{$_}); $self->{output}->output_add(long_msg => sprintf("[instance: %s][value: %s]", $_, $value), debug => 1); - if (defined($self->{option_results}->{filter_table}) && $self->{option_results}->{filter_table} ne '' && - $value !~ /$self->{option_results}->{filter_table}/) { + if (defined($self->{option_results}->{filter_table_value}) && $self->{option_results}->{filter_table_value} ne '' && + $value !~ /$self->{option_results}->{filter_table_value}/) { $self->{output}->output_add(long_msg => sprintf("skipping oid '%s' value '%s': not matching the filter", $_, $value), debug => 1); next; } + if (defined($self->{option_results}->{filter_table_instance}) && $self->{option_results}->{filter_table_instance} ne '' && + $instance !~ /$self->{option_results}->{filter_table_instance}/) { + $self->{output}->output_add(long_msg => sprintf("skipping oid '%s' instance '%s': not matching the filter", $_, $instance), debug => 1); + next; + } $self->{instances}->{$instance} = $value; $filter_row++; @@ -304,7 +310,7 @@ Check SNMP string values (can be a String or an Integer). Check values absent: centreon_plugins.pl --plugin=snmp_standard::plugin --mode=string-value --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public - --oid-table='.1.3.6.1.2.1.25.4.2.1.2' --format-ok='%{filter_rows} processes' --format-critical='processes are absent: %{details_critical}' --critical-absent='centengine' --critical-absent='crond' --filter-table='centengine|crond' + --oid-table='.1.3.6.1.2.1.25.4.2.1.2' --format-ok='%{filter_rows} processes' --format-critical='processes are absent: %{details_critical}' --critical-absent='centengine' --critical-absent='crond' --filter-table-value='centengine|crond' Check table status: centreon_plugins.pl --plugin=snmp_standard::plugin --mode=string-value --hostname=127.0.0.1 --snmp-version=2c --snmp-community=akcp @@ -329,10 +335,14 @@ OID table value to check (numeric format only). OID table value for the instance (numeric format only). Can be used to have human readable instance name. -=item B<--filter-table> +=item B<--filter-table-value> Filter value from --oid-table option (can be a regexp). +=item B<--filter-table-instance> + +Filter instance from --oid-table option (can be a regexp). + =item B<--warning-regexp> Return Warning if an oid value match the regexp. From f3370bd9d4c2301401c9219bbd0ef80274cfff52 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 7 Mar 2016 15:52:22 +0100 Subject: [PATCH 124/346] + add juniper isg (Fix #316) --- .../network/juniper/isg/plugin.pm | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 centreon-plugins/network/juniper/isg/plugin.pm diff --git a/centreon-plugins/network/juniper/isg/plugin.pm b/centreon-plugins/network/juniper/isg/plugin.pm new file mode 100644 index 000000000..d949df4f5 --- /dev/null +++ b/centreon-plugins/network/juniper/isg/plugin.pm @@ -0,0 +1,53 @@ +# +# Copyright 2016 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::juniper::ssg::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' => 'network::juniper::common::screenos::mode::cpu', + 'memory' => 'network::juniper::common::screenos::mode::memory', + 'sessions' => 'network::juniper::common::screenos::mode::sessions', + 'hardware' => 'network::juniper::common::screenos::mode::hardware', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Juniper ISG series in SNMP. + +=cut From e192b0538cdeead0c50aea530ec90fb1149031b4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 7 Mar 2016 21:57:10 +0100 Subject: [PATCH 125/346] + Fix juniper isg --- centreon-plugins/network/juniper/isg/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/juniper/isg/plugin.pm b/centreon-plugins/network/juniper/isg/plugin.pm index d949df4f5..c3bbc8d20 100644 --- a/centreon-plugins/network/juniper/isg/plugin.pm +++ b/centreon-plugins/network/juniper/isg/plugin.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::juniper::ssg::plugin; +package network::juniper::isg::plugin; use strict; use warnings; From cdf17dbb15964653e86dfebf636c199afe21f38b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 10 Mar 2016 15:08:23 +0100 Subject: [PATCH 126/346] + fix bgp plugin help --- centreon-plugins/apps/protocols/bgp/4/plugin.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/centreon-plugins/apps/protocols/bgp/4/plugin.pm b/centreon-plugins/apps/protocols/bgp/4/plugin.pm index 9f403eb40..36b24a42a 100644 --- a/centreon-plugins/apps/protocols/bgp/4/plugin.pm +++ b/centreon-plugins/apps/protocols/bgp/4/plugin.pm @@ -44,7 +44,6 @@ __END__ =head1 PLUGIN DESCRIPTION -Check Arkoon firewall in SNMP. -!!! Be careful: ifAlias and ifName are empty. Use --oid-filter and --oid-display on ifDesc !!! +Check BGP protocol in SNMP. =cut From d88e309c8242d904acd1df654deb65524c7af61f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 10 Mar 2016 16:28:57 +0100 Subject: [PATCH 127/346] + add ospf (in snmp) plugin --- .../apps/protocols/ospf/snmp/mode/neighbor.pm | 281 ++++++++++++++++++ .../apps/protocols/ospf/snmp/plugin.pm | 48 +++ 2 files changed, 329 insertions(+) create mode 100644 centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm create mode 100644 centreon-plugins/apps/protocols/ospf/snmp/plugin.pm diff --git a/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm b/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm new file mode 100644 index 000000000..26308ed94 --- /dev/null +++ b/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm @@ -0,0 +1,281 @@ +# +# Copyright 2016 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 apps::protocols::ospf::snmp::mode::neighbor; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{NbrState}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{NbrState} = $options{new_datas}->{$self->{instance} . '_NbrState'}; + $self->{result_values}->{NbrIpAddr} = $options{new_datas}->{$self->{instance} . '_NbrIpAddr'}; + $self->{result_values}->{NbrRtrId} = $options{new_datas}->{$self->{instance} . '_NbrRtrId'}; + return 0; +} + +sub custom_change_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_total_change}) && $instance_mode->{option_results}->{critical_total_change} ne '' && + eval "$instance_mode->{option_results}->{critical_total_change}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_total_change}) && $instance_mode->{option_results}->{warning_total_change} ne '' && + eval "$instance_mode->{option_results}->{warning_total_change}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_change_output { + my ($self, %options) = @_; + + my $msg = 'Neighbors current : ' . $self->{result_values}->{Total} . ' (last : ' . $self->{result_values}->{TotalLast} . ')'; + return $msg; +} + +sub custom_change_calc { + my ($self, %options) = @_; + + $self->{result_values}->{TotalLast} = $options{old_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{Total} = $options{new_datas}->{$self->{instance} . '_total'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' }, + { name => 'nb', type => 1, cb_prefix_output => 'prefix_nb_output', message_multiple => 'All neighbor relations are ok' } + ]; + + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total neighbors : %s', + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-change', threshold => 0, set => { + key_values => [ { name => 'total', diff => 1 } ], + closure_custom_calc => $self->can('custom_change_calc'), + closure_custom_output => $self->can('custom_change_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_change_threshold'), + } + }, + ]; + $self->{maps_counters}->{nb} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'NbrIpAddr' }, { name => 'NbrRtrId' }, { name => 'NbrState' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{NbrState} ~ /down/i' }, + "warning-total-change:s" => { name => 'warning_total_change', default => '' }, + "critical-total-change:s" => { name => 'critical_total_change', default => '' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_nb_output { + my ($self, %options) = @_; + + return "Neighbor '" . $options{instance_value}->{NbrIpAddr} . "/" . $options{instance_value}->{NbrRtrId} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'warning_total_change', 'critical_total_change')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + 1 => 'down', + 2 => 'attempt', + 3 => 'init', + 4 => 'twoWay', + 5 => 'exchangeStart', + 6 => 'exchange', + 7 => 'loading', + 8 => 'full', +); +my $mapping = { + NbrIpAddr => { oid => '.1.3.6.1.2.1.14.10.1.1' }, + NbrRtrId => { oid => '.1.3.6.1.2.1.14.10.1.3' }, + NbrState => { oid => '.1.3.6.1.2.1.14.10.1.6', map => \%map_state }, +}; + +my $oid_ospfNbrEntry = '.1.3.6.1.2.1.14.10.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{nb} = {}; + $self->{global} = { total => 0 }; + my $snmp_result = $options{snmp}->get_table(oid => $oid_ospfNbrEntry, + nothing_quit => 1); + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{NbrState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + + $self->{global}->{total}++; + $self->{nb}->{$instance} = { %$result }; + } + + if (scalar(keys %{$self->{nb}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No neighbors found."); + $self->{output}->option_exit(); + } + + $self->{cache_name} = "ospf_" . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); +} + +1; + +__END__ + +=head1 MODE + +Check neighbor relations. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{NbrState} ~ /down/i'). +Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} + +=item B<--warning-total-change> + +Set warning threshold. Should be used if there is a difference of total neighbors between two checks. +Example: %{TotalLast} != %{Total} + +=item B<--critical-total-change> + +Set critical threshold. Should be used if there is a difference of total neighbors between two checks. +Example: %{TotalLast} != %{Total} + +=item B<--warning-*> + +Threshold warning. +Can be: 'total'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'total'. + +=back + +=cut diff --git a/centreon-plugins/apps/protocols/ospf/snmp/plugin.pm b/centreon-plugins/apps/protocols/ospf/snmp/plugin.pm new file mode 100644 index 000000000..4c1e3dd59 --- /dev/null +++ b/centreon-plugins/apps/protocols/ospf/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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 apps::protocols::ospf::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}} = ( + 'neighbor' => 'apps::protocols::ospf::snmp::mode::neighbor', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check OSPF protocol in SNMP. + +=cut From ae550fc1e6416e2b581118014886181209b2587a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 10 Mar 2016 17:05:00 +0100 Subject: [PATCH 128/346] + fix ospf threshold --- centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm b/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm index 26308ed94..10b3690d2 100644 --- a/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm +++ b/centreon-plugins/apps/protocols/ospf/snmp/mode/neighbor.pm @@ -155,7 +155,7 @@ sub new { $options{options}->add_options(arguments => { "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '%{NbrState} ~ /down/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{NbrState} =~ /down/i' }, "warning-total-change:s" => { name => 'warning_total_change', default => '' }, "critical-total-change:s" => { name => 'critical_total_change', default => '' }, }); @@ -253,7 +253,7 @@ Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} =item B<--critical-status> -Set critical threshold for status (Default: '%{NbrState} ~ /down/i'). +Set critical threshold for status (Default: '%{NbrState} =~ /down/i'). Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} =item B<--warning-total-change> From 577d7b4054ea840953f59261a87abed2f867baba Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 11 Mar 2016 10:01:25 +0100 Subject: [PATCH 129/346] + protocol http: set it in debug mode --- centreon-plugins/apps/protocols/http/mode/jsoncontent.pm | 2 +- centreon-plugins/apps/protocols/http/mode/soapcontent.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm b/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm index 46e73c952..c4f4e7b58 100644 --- a/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm +++ b/centreon-plugins/apps/protocols/http/mode/jsoncontent.pm @@ -239,7 +239,7 @@ sub run { $self->{json_response} = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); my $timeelapsed = tv_interval ($timing0, [gettimeofday]); - $self->{output}->output_add(long_msg => $self->{json_response}); + $self->{output}->output_add(long_msg => $self->{json_response}, debug => 1); if (!defined($self->{option_results}->{lookup}) || scalar(@{$self->{option_results}->{lookup}}) == 0) { $self->{output}->output_add(severity => 'OK', short_msg => "JSON webservice request success"); diff --git a/centreon-plugins/apps/protocols/http/mode/soapcontent.pm b/centreon-plugins/apps/protocols/http/mode/soapcontent.pm index ee124246d..bdccf9de2 100644 --- a/centreon-plugins/apps/protocols/http/mode/soapcontent.pm +++ b/centreon-plugins/apps/protocols/http/mode/soapcontent.pm @@ -248,7 +248,7 @@ sub run { $self->{soap_response} = $self->{http}->request(method => 'POST', query_form_post => $self->{soap_request}); my $timeelapsed = tv_interval ($timing0, [gettimeofday]); - $self->{output}->output_add(long_msg => $self->{soap_response}); + $self->{output}->output_add(long_msg => $self->{soap_response}, debug => 1); if (!defined($self->{option_results}->{lookup}) || scalar(@{$self->{option_results}->{lookup}}) == 0) { $self->{output}->output_add(severity => 'OK', short_msg => "SOAP request success"); From 0fdb6b212e6463a42c8f3282fa32e49f263091a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Rameau?= Date: Tue, 15 Mar 2016 14:28:31 +0100 Subject: [PATCH 130/346] Update users.pm --- centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm b/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm index 2be97c1c8..51c0b0d50 100644 --- a/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm +++ b/centreon-plugins/network/ucopia/wlc/snmp/mode/users.pm @@ -65,8 +65,8 @@ sub run { $result->{$oid_licenceUsers} = undef if ($result->{$oid_licenceUsers} == 0); $self->{output}->output_add(severity => $exit, short_msg => sprintf("'%d' connected users (Available licence: %s)", - $result->{$oid_totalConnectedUsers}), - defined($result->{$oid_licenceUsers}) ? $result->{$oid_licenceUsers} : '-'); + $result->{$oid_totalConnectedUsers}, + defined($result->{$oid_licenceUsers}) ? $result->{$oid_licenceUsers} : '-')); $self->{output}->perfdata_add(value => $result->{$oid_totalConnectedUsers}, label => 'users', warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), From 1598258c5fbbba0ab515c8a24d98da6e6796128f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 22 Mar 2016 15:25:20 +0100 Subject: [PATCH 131/346] + add a plugin for dell compellent sc in snmp (hardware) --- .../compellent/snmp/mode/components/cache.pm | 66 ++++++++++ .../compellent/snmp/mode/components/ctrl.pm | 66 ++++++++++ .../snmp/mode/components/ctrlfan.pm | 102 ++++++++++++++++ .../snmp/mode/components/ctrlpower.pm | 66 ++++++++++ .../snmp/mode/components/ctrltemp.pm | 101 ++++++++++++++++ .../snmp/mode/components/ctrlvoltage.pm | 101 ++++++++++++++++ .../compellent/snmp/mode/components/disk.pm | 66 ++++++++++ .../compellent/snmp/mode/components/encl.pm | 66 ++++++++++ .../snmp/mode/components/enclfan.pm | 66 ++++++++++ .../snmp/mode/components/encliomod.pm | 66 ++++++++++ .../snmp/mode/components/enclpower.pm | 66 ++++++++++ .../snmp/mode/components/encltemp.pm | 80 ++++++++++++ .../snmp/mode/components/resources.pm | 38 ++++++ .../compellent/snmp/mode/components/sc.pm | 66 ++++++++++ .../compellent/snmp/mode/components/server.pm | 66 ++++++++++ .../compellent/snmp/mode/components/volume.pm | 66 ++++++++++ .../dell/compellent/snmp/mode/hardware.pm | 114 ++++++++++++++++++ .../storage/dell/compellent/snmp/plugin.pm | 48 ++++++++ 18 files changed, 1310 insertions(+) create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/cache.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrl.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlfan.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlpower.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrltemp.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlvoltage.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/disk.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/encl.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/enclfan.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/encliomod.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/enclpower.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/encltemp.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/sc.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/server.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/components/volume.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/mode/hardware.pm create mode 100644 centreon-plugins/storage/dell/compellent/snmp/plugin.pm diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/cache.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/cache.pm new file mode 100644 index 000000000..54e329b67 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/cache.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::cache; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCacheStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.28.1.3', map => \%map_sc_status }, + scCacheName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.28.1.4' }, +}; +my $oid_scCacheEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.28.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCacheEntry, begin => $mapping->{scCacheStatus}->{oid}, end => $mapping->{scCacheName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking caches"); + $self->{components}->{cache} = {name => 'caches', total => 0, skip => 0}; + return if ($self->check_filter(section => 'cache')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCacheEntry}})) { + next if ($oid !~ /^$mapping->{scCacheStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCacheEntry}, instance => $instance); + + next if ($self->check_filter(section => 'cache', instance => $instance)); + $self->{components}->{cache}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("cache '%s' status is '%s' [instance = %s]", + $result->{scCacheName}, $result->{scCacheStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'cache', value => $result->{scCacheStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cache '%s' status is '%s'", $result->{scCacheName}, $result->{scCacheStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrl.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrl.pm new file mode 100644 index 000000000..534a668bf --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrl.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::ctrl; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCtlrStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.13.1.3', map => \%map_sc_status }, + scCtlrName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.13.1.4' }, +}; +my $oid_scCtlrEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.13.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCtlrEntry, begin => $mapping->{scCtlrStatus}->{oid}, end => $mapping->{scCtlrName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controllers"); + $self->{components}->{ctrl} = {name => 'controllers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'ctrl')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCtlrEntry}})) { + next if ($oid !~ /^$mapping->{scCtlrStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCtlrEntry}, instance => $instance); + + next if ($self->check_filter(section => 'ctrl', instance => $instance)); + $self->{components}->{ctrl}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller '%s' status is '%s' [instance = %s]", + $result->{scCtlrName}, $result->{scCtlrStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'ctrl', value => $result->{scCtlrStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller '%s' status is '%s'", $result->{scCtlrName}, $result->{scCtlrStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlfan.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlfan.pm new file mode 100644 index 000000000..f896432bd --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlfan.pm @@ -0,0 +1,102 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::ctrlfan; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCtlrFanStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.3', map => \%map_sc_status }, + scCtlrFanName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.4' }, + scCtlrFanCurrentRpm => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.5' }, + scCtlrFanWarnLwrRpm => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.8' }, + scCtlrFanWarnUprRpm => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.9' }, + scCtlrFanCritLwrRpm => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.10' }, + scCtlrFanCritUprRpm => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1.11' }, +}; +my $oid_scCtlrFanEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.16.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCtlrFanEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controller fans"); + $self->{components}->{ctrlfan} = {name => 'controller fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'ctrlfan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCtlrFanEntry}})) { + next if ($oid !~ /^$mapping->{scCtlrFanStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCtlrFanEntry}, instance => $instance); + + next if ($self->check_filter(section => 'ctrlfan', instance => $instance)); + + $self->{components}->{ctrlfan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller fan '%s' status is '%s' [instance = %s] [value = %s]", + $result->{scCtlrFanName}, $result->{scCtlrFanStatus}, $instance, + $result->{scCtlrFanCurrentRpm})); + + my $exit = $self->get_severity(label => 'default', section => 'ctrlfan', value => $result->{scCtlrFanStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller fan '%s' status is '%s'", $result->{scCtlrFanName}, $result->{scCtlrFanStatus})); + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'ctrlfan', instance => $instance, value => $result->{scCtlrFanCurrentRpm}); + if ($checked == 0) { + $result->{scCtlrFanWarnLwrRpm} = (defined($result->{scCtlrFanWarnLwrRpm}) && $result->{scCtlrFanWarnLwrRpm} =~ /[0-9]/) ? + $result->{scCtlrFanWarnLwrRpm} : ''; + $result->{scCtlrFanCritLwrRpm} = (defined($result->{scCtlrFanCritLwrRpm}) && $result->{scCtlrFanCritLwrRpm} =~ /[0-9]/) ? + $result->{scCtlrFanCritLwrRpm} : ''; + $result->{scCtlrFanWarnUprRpm} = (defined($result->{scCtlrFanWarnUprRpm}) && $result->{scCtlrFanWarnUprRpm} =~ /[0-9]/) ? + $result->{scCtlrFanWarnUprRpm} : ''; + $result->{scCtlrFanCritUprRpm} = (defined($result->{scCtlrFanCritUprRpm}) && $result->{scCtlrFanCritUprRpm} =~ /[0-9]/) ? + $result->{scCtlrFanCritUprRpm} : ''; + my $warn_th = $result->{scCtlrFanWarnLwrRpm} . ':' . $result->{scCtlrFanWarnUprRpm}; + my $crit_th = $result->{scCtlrFanCritLwrRpm} . ':' . $result->{scCtlrFanCritUprRpm}; + $self->{perfdata}->threshold_validate(label => 'warning-ctrlfan-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-ctrlfan-instance-' . $instance, value => $crit_th); + + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-ctrlfan-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-ctrlfan-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Controller fan '%s' is %s rpm", $result->{scCtlrFanName}, $result->{scCtlrFanCurrentRpm})); + } + $self->{output}->perfdata_add(label => 'ctrlfan_' . $instance, unit => 'rpm', + value => $result->{scCtlrFanCurrentRpm}, + warning => $warn, + critical => $crit, + min => 0 + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlpower.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlpower.pm new file mode 100644 index 000000000..cad63091e --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlpower.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::ctrlpower; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCtlrPowerStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.17.1.3', map => \%map_sc_status }, + scCtlrPowerName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.17.1.4' }, +}; +my $oid_scCtlrPowerEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.17.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCtlrPowerEntry, begin => $mapping->{scCtlrPowerStatus}->{oid}, end => $mapping->{scCtlrPowerName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controller power supplies"); + $self->{components}->{ctrlpower} = {name => 'controller psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'ctrlpower')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCtlrPowerEntry}})) { + next if ($oid !~ /^$mapping->{scCtlrPowerStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCtlrPowerEntry}, instance => $instance); + + next if ($self->check_filter(section => 'ctrlpower', instance => $instance)); + $self->{components}->{ctrlpower}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller power supply '%s' status is '%s' [instance = %s]", + $result->{scCtlrPowerName}, $result->{scCtlrPowerStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'ctrlpower', value => $result->{scCtlrPowerStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller power supply '%s' status is '%s'", $result->{scCtlrPowerName}, $result->{scCtlrPowerStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrltemp.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrltemp.pm new file mode 100644 index 000000000..ef0d76f94 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrltemp.pm @@ -0,0 +1,101 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::ctrltemp; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCtlrTempStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.3', map => \%map_sc_status }, + scCtlrTempName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.4' }, + scCtlrTempCurrentC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.5' }, + scCtlrTempWarnLwrC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.8' }, + scCtlrTempWarnUprC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.9' }, + scCtlrTempCritLwrC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.10' }, + scCtlrTempCritUprC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1.11' }, +}; +my $oid_scCtlrTempEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.19.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCtlrTempEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controller temperatures"); + $self->{components}->{ctrltemp} = {name => 'controller temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'ctrltemp')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCtlrTempEntry}})) { + next if ($oid !~ /^$mapping->{scCtlrTempStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCtlrTempEntry}, instance => $instance); + + next if ($self->check_filter(section => 'ctrltemp', instance => $instance)); + + $self->{components}->{ctrltemp}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller temperature '%s' status is '%s' [instance = %s] [value = %s]", + $result->{scCtlrTempName}, $result->{scCtlrTempStatus}, $instance, + $result->{scCtlrTempCurrentC})); + + my $exit = $self->get_severity(label => 'default', section => 'ctrltemp', value => $result->{scCtlrTempStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller temperature '%s' status is '%s'", $result->{scCtlrTempName}, $result->{scCtlrTempStatus})); + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'ctrltemp', instance => $instance, value => $result->{scCtlrTempCurrentC}); + if ($checked == 0) { + $result->{scCtlrTempWarnLwrC} = (defined($result->{scCtlrTempWarnLwrC}) && $result->{scCtlrTempWarnLwrC} =~ /[0-9]/) ? + $result->{scCtlrTempWarnLwrC} : ''; + $result->{scCtlrTempCritLwrC} = (defined($result->{scCtlrTempCritLwrC}) && $result->{scCtlrTempCritLwrC} =~ /[0-9]/) ? + $result->{scCtlrTempCritLwrC} : ''; + $result->{scCtlrTempWarnUprC} = (defined($result->{scCtlrTempWarnUprC}) && $result->{scCtlrTempWarnUprC} =~ /[0-9]/) ? + $result->{scCtlrTempWarnUprC} : ''; + $result->{scCtlrTempCritUprC} = (defined($result->{scCtlrTempCritUprC}) && $result->{scCtlrTempCritUprC} =~ /[0-9]/) ? + $result->{scCtlrTempCritUprC} : ''; + my $warn_th = $result->{scCtlrTempWarnLwrC} . ':' . $result->{scCtlrTempWarnUprC}; + my $crit_th = $result->{scCtlrTempCritLwrC} . ':' . $result->{scCtlrTempCritUprC}; + $self->{perfdata}->threshold_validate(label => 'warning-ctrltemp-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-ctrltemp-instance-' . $instance, value => $crit_th); + + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-ctrltemp-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-ctrltemp-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Controller temperature '%s' is %s C", $result->{scCtlrTempName}, $result->{scCtlrTempCurrentC})); + } + $self->{output}->perfdata_add(label => 'ctrltemp_' . $instance, unit => 'C', + value => $result->{scCtlrTempCurrentC}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlvoltage.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlvoltage.pm new file mode 100644 index 000000000..275e85220 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/ctrlvoltage.pm @@ -0,0 +1,101 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::ctrlvoltage; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scCtlrVoltageStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.3', map => \%map_sc_status }, + scCtlrVoltageName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.4' }, + scCtlrVoltageCurrentV => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.5' }, + scCtlrVoltageWarnLwrV => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.8' }, + scCtlrVoltageWarnUprV => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.9' }, + scCtlrVoltageCritLwrV => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.10' }, + scCtlrVoltageCritUprV => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.11' }, +}; +my $oid_scCtlrVoltageEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.18.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scCtlrVoltageEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controller voltages"); + $self->{components}->{ctrlvoltage} = {name => 'controller voltages', total => 0, skip => 0}; + return if ($self->check_filter(section => 'ctrlvoltage')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scCtlrVoltageEntry}})) { + next if ($oid !~ /^$mapping->{scCtlrVoltageStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scCtlrVoltageEntry}, instance => $instance); + + next if ($self->check_filter(section => 'ctrlvoltage', instance => $instance)); + + $self->{components}->{ctrlvoltage}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller voltage '%s' status is '%s' [instance = %s] [value = %s]", + $result->{scCtlrVoltageName}, $result->{scCtlrVoltageStatus}, $instance, + $result->{scCtlrVoltageCurrentV})); + + my $exit = $self->get_severity(label => 'default', section => 'ctrlvoltage', value => $result->{scCtlrVoltageStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller voltage '%s' status is '%s'", $result->{scCtlrVoltageName}, $result->{scCtlrVoltageStatus})); + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'ctrlvoltage', instance => $instance, value => $result->{scCtlrVoltageCurrentV}); + if ($checked == 0) { + $result->{scCtlrVoltageWarnLwrV} = (defined($result->{scCtlrVoltageWarnLwrV}) && $result->{scCtlrVoltageWarnLwrV} =~ /[0-9]/) ? + $result->{scCtlrVoltageWarnLwrV} : ''; + $result->{scCtlrVoltageCritLwrV} = (defined($result->{scCtlrVoltageCritLwrV}) && $result->{scCtlrVoltageCritLwrV} =~ /[0-9]/) ? + $result->{scCtlrVoltageCritLwrV} : ''; + $result->{scCtlrVoltageWarnUprV} = (defined($result->{scCtlrVoltageWarnUprV}) && $result->{scCtlrVoltageWarnUprV} =~ /[0-9]/) ? + $result->{scCtlrVoltageWarnUprV} : ''; + $result->{scCtlrVoltageCritUprV} = (defined($result->{scCtlrVoltageCritUprV}) && $result->{scCtlrVoltageCritUprV} =~ /[0-9]/) ? + $result->{scCtlrVoltageCritUprV} : ''; + my $warn_th = $result->{scCtlrVoltageWarnLwrV} . ':' . $result->{scCtlrVoltageWarnUprV}; + my $crit_th = $result->{scCtlrVoltageCritLwrV} . ':' . $result->{scCtlrVoltageCritUprV}; + $self->{perfdata}->threshold_validate(label => 'warning-ctrlvoltage-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-ctrlvoltage-instance-' . $instance, value => $crit_th); + + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-ctrlvoltage-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-ctrlvoltage-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Controller voltage '%s' is %s V", $result->{scCtlrVoltageName}, $result->{scCtlrVoltageCurrentV})); + } + $self->{output}->perfdata_add(label => 'ctrlvoltage_' . $instance, unit => 'V', + value => $result->{scCtlrVoltageCurrentV}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/disk.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/disk.pm new file mode 100644 index 000000000..e8ac28059 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/disk.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::disk; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scDiskStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.14.1.3', map => \%map_sc_status }, + scDiskNamePosition => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.14.1.4' }, +}; +my $oid_scDiskEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.14.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scDiskEntry, begin => $mapping->{scDiskStatus}->{oid}, end => $mapping->{scDiskNamePosition}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking disks"); + $self->{components}->{disk} = {name => 'disks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'disk')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scDiskEntry}})) { + next if ($oid !~ /^$mapping->{scDiskStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scDiskEntry}, instance => $instance); + + next if ($self->check_filter(section => 'disk', instance => $instance)); + $self->{components}->{disk}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("disk '%s' status is '%s' [instance = %s]", + $result->{scDiskNamePosition}, $result->{scDiskStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'disk', value => $result->{scDiskStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Disk '%s' status is '%s'", $result->{scDiskNamePosition}, $result->{scDiskStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/encl.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encl.pm new file mode 100644 index 000000000..19e85cb00 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encl.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::encl; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scEnclStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.15.1.3', map => \%map_sc_status }, + scEnclName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.15.1.4' }, +}; +my $oid_scEnclEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.15.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scEnclEntry, begin => $mapping->{scEnclStatus}->{oid}, end => $mapping->{scEnclName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosures"); + $self->{components}->{encl} = {name => 'enclosures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'encl')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scEnclEntry}})) { + next if ($oid !~ /^$mapping->{scEnclStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scEnclEntry}, instance => $instance); + + next if ($self->check_filter(section => 'encl', instance => $instance)); + $self->{components}->{encl}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure '%s' status is '%s' [instance = %s]", + $result->{scEnclName}, $result->{scEnclStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'encl', value => $result->{scEnclStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure '%s' status is '%s'", $result->{scEnclName}, $result->{scEnclStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclfan.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclfan.pm new file mode 100644 index 000000000..9794bc204 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclfan.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::enclfan; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scEnclFanStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.20.1.3', map => \%map_sc_status }, + scEnclFanLocation => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.20.1.4' }, +}; +my $oid_scEnclFanEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.20.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scEnclFanEntry, begin => $mapping->{scEnclFanStatus}->{oid}, end => $mapping->{scEnclFanLocation}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure fans"); + $self->{components}->{enclfan} = {name => 'enclosure fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclfan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scEnclFanEntry}})) { + next if ($oid !~ /^$mapping->{scEnclFanStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scEnclFanEntry}, instance => $instance); + + next if ($self->check_filter(section => 'enclfan', instance => $instance)); + $self->{components}->{enclfan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure fan '%s' status is '%s' [instance = %s]", + $result->{scEnclFanLocation}, $result->{scEnclFanStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'enclfan', value => $result->{scEnclFanStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure fan '%s' status is '%s'", $result->{scEnclFanLocation}, $result->{scEnclFanStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/encliomod.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encliomod.pm new file mode 100644 index 000000000..5bbcbd137 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encliomod.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::encliomod; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scEnclIoModStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.22.1.3', map => \%map_sc_status }, + scEnclIoModPosition => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.22.1.4' }, +}; +my $oid_scEnclIoModEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.22.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scEnclIoModEntry, begin => $mapping->{scEnclIoModStatus}->{oid}, end => $mapping->{scEnclIoModPosition}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure I/O modules"); + $self->{components}->{encliomod} = {name => 'enclosure I/O modules', total => 0, skip => 0}; + return if ($self->check_filter(section => 'encliomod')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scEnclIoModEntry}})) { + next if ($oid !~ /^$mapping->{scEnclIoModStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scEnclIoModEntry}, instance => $instance); + + next if ($self->check_filter(section => 'encliomod', instance => $instance)); + $self->{components}->{encliomod}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure I/O module '%s' status is '%s' [instance = %s]", + $result->{scEnclIoModPosition}, $result->{scEnclIoModStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'encliomod', value => $result->{scEnclIoModStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure I/O module '%s' status is '%s'", $result->{scEnclIoModPosition}, $result->{scEnclIoModStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclpower.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclpower.pm new file mode 100644 index 000000000..36105d2ba --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/enclpower.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::enclpower; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scEnclPowerStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.21.1.3', map => \%map_sc_status }, + scEnclPowerPosition => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.21.1.4' }, +}; +my $oid_scEnclPowerEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.21.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scEnclPowerEntry, begin => $mapping->{scEnclPowerStatus}->{oid}, end => $mapping->{scEnclPowerPosition}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure power supplies"); + $self->{components}->{enclpower} = {name => 'enclosure psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclpower')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scEnclPowerEntry}})) { + next if ($oid !~ /^$mapping->{scEnclPowerStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scEnclPowerEntry}, instance => $instance); + + next if ($self->check_filter(section => 'enclpower', instance => $instance)); + $self->{components}->{enclpower}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure power supply '%s' status is '%s' [instance = %s]", + $result->{scEnclPowerPosition}, $result->{scEnclPowerStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'enclpower', value => $result->{scEnclPowerStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure power supply '%s' status is '%s'", $result->{scEnclPowerPosition}, $result->{scEnclPowerStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/encltemp.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encltemp.pm new file mode 100644 index 000000000..0c60642c1 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/encltemp.pm @@ -0,0 +1,80 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::encltemp; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scEnclTempStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.23.1.3', map => \%map_sc_status }, + scEnclTempLocation => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.23.1.4' }, + scEnclTempCurrentC => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.23.1.5' }, +}; +my $oid_scEnclTempEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.23.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scEnclTempEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure temperatures"); + $self->{components}->{encltemp} = {name => 'enclosure temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'encltemp')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scEnclTempEntry}})) { + next if ($oid !~ /^$mapping->{scEnclTempStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scEnclTempEntry}, instance => $instance); + + next if ($self->check_filter(section => 'encltemp', instance => $instance)); + + $self->{components}->{encltemp}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure temperature '%s' status is '%s' [instance = %s] [value = %s]", + $result->{scEnclTempLocation}, $result->{scEnclTempStatus}, $instance, + $result->{scEnclTempCurrentC})); + + my $exit = $self->get_severity(label => 'default', section => 'encltemp', value => $result->{scEnclTempStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure temperature '%s' status is '%s'", $result->{scEnclTempLocation}, $result->{scEnclTempStatus})); + } + + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'encltemp', instance => $instance, value => $result->{scEnclTempCurrentC}); + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Enclosure temperature '%s' is %s C", $result->{scEnclTempLocation}, $result->{scEnclTempCurrentC})); + } + $self->{output}->perfdata_add(label => 'encltemp_' . $instance, unit => 'C', + value => $result->{scEnclTempCurrentC}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/resources.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/resources.pm new file mode 100644 index 000000000..206e7dbf4 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/resources.pm @@ -0,0 +1,38 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our %map_sc_status; + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw(%map_sc_status); + +%map_sc_status = ( + 1 => 'up', + 2 => 'down', + 3 => 'degraded', +); + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/sc.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/sc.pm new file mode 100644 index 000000000..fcb4ec115 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/sc.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::sc; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scScStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.29.1.3', map => \%map_sc_status }, + scScName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.29.1.4' }, +}; +my $oid_scScEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.29.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scScEntry, begin => $mapping->{scScStatus}->{oid}, end => $mapping->{scScName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking storage centers"); + $self->{components}->{sc} = {name => 'storage centers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'sc')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scScEntry}})) { + next if ($oid !~ /^$mapping->{scScStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scScEntry}, instance => $instance); + + next if ($self->check_filter(section => 'sc', instance => $instance)); + $self->{components}->{sc}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("storage center '%s' status is '%s' [instance = %s]", + $result->{scScName}, $result->{scScStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'sc', value => $result->{scScStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Storage center '%s' status is '%s'", $result->{scScName}, $result->{scScStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/server.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/server.pm new file mode 100644 index 000000000..802ca7c8e --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/server.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::server; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scServerStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.3', map => \%map_sc_status }, + scServerName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.4' }, +}; +my $oid_scServerEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.27.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scServerEntry, begin => $mapping->{scServerStatus}->{oid}, end => $mapping->{scServerName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking servers"); + $self->{components}->{server} = {name => 'servers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'server')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scServerEntry}})) { + next if ($oid !~ /^$mapping->{scServerStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scServerEntry}, instance => $instance); + + next if ($self->check_filter(section => 'server', instance => $instance)); + $self->{components}->{server}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("server '%s' status is '%s' [instance = %s]", + $result->{scServerName}, $result->{scServerStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'server', value => $result->{scServerStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Server '%s' status is '%s'", $result->{scServerName}, $result->{scServerStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/components/volume.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/components/volume.pm new file mode 100644 index 000000000..6e31d56b4 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/components/volume.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::components::volume; + +use strict; +use warnings; +use storage::dell::compellent::snmp::mode::components::resources qw(%map_sc_status); + +my $mapping = { + scVolumeStatus => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.26.1.3', map => \%map_sc_status }, + scVolumeName => { oid => '.1.3.6.1.4.1.674.11000.2000.500.1.2.26.1.4' }, +}; +my $oid_scVolumeEntry = '.1.3.6.1.4.1.674.11000.2000.500.1.2.26.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_scVolumeEntry, begin => $mapping->{scVolumeStatus}->{oid}, end => $mapping->{scVolumeName}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking volumes"); + $self->{components}->{volume} = {name => 'volumes', total => 0, skip => 0}; + return if ($self->check_filter(section => 'volume')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_scVolumeEntry}})) { + next if ($oid !~ /^$mapping->{scVolumeStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_scVolumeEntry}, instance => $instance); + + next if ($self->check_filter(section => 'volume', instance => $instance)); + $self->{components}->{volume}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("volume '%s' status is '%s' [instance = %s]", + $result->{scVolumeName}, $result->{scVolumeStatus}, $instance, + )); + + my $exit = $self->get_severity(label => 'default', section => 'volume', value => $result->{scVolumeStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Volume '%s' status is '%s'", $result->{scVolumeName}, $result->{scVolumeStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/mode/hardware.pm b/centreon-plugins/storage/dell/compellent/snmp/mode/hardware.pm new file mode 100644 index 000000000..e09232baa --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/mode/hardware.pm @@ -0,0 +1,114 @@ +# +# Copyright 2016 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::dell::compellent::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = + '^(ctrl|disk|encl|ctrlfan|ctrlpower|ctrlvoltage|ctrltemp|enclfan|enclpower|encliomod|encltemp|volume|cache|server|sc)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(ctrltemp|ctrlvoltage|ctrlfan|encltemp)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + default => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ['degraded', 'WARNING'], + ], + }; + + $self->{components_path} = 'storage::dell::compellent::snmp::mode::components'; + $self->{components_module} = ['ctrl', 'disk', 'ctrlfan', 'ctrlpower', 'ctrlvoltage', 'ctrltemp', + 'encl', 'enclfan', 'enclpower', 'encliomod', 'encltemp', 'volume', 'cache', 'server', 'sc']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check sensors. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'ctrl', 'disk', 'encl', 'ctrlfan', 'ctrlpower', 'ctrlvoltage', +'ctrltemp', 'enclfan', 'enclpower', 'encliomod', 'encltemp', 'volume', 'cache', 'server', 'sc'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=ctrlfan --filter=enclpower) +Can also exclude specific instance: --filter=ctrlfan,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='ctrl,CRITICAL,^(?!(up)$)' + +=item B<--warning> + +Set warning threshold for 'ctrltemp', 'ctrlfan', 'ctrlvoltage', 'encltemp' (syntax: type,regexp,threshold) +Example: --warning='ctrltemp,1,30' + +=item B<--critical> + +Set critical threshold for 'ctrltemp', 'ctrlfan', 'ctrlvoltage', 'encltemp' (syntax: type,regexp,threshold) +Example: --critical='ctrltemp,1,50' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/snmp/plugin.pm b/centreon-plugins/storage/dell/compellent/snmp/plugin.pm new file mode 100644 index 000000000..c9afbb898 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::dell::compellent::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}} = ( + 'hardware' => 'storage::dell::compellent::snmp::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Dell Compellent in SNMP. + +=cut From 696a4c9945d3b74545f62fbc30987050a679ae99 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 23 Mar 2016 10:12:13 +0100 Subject: [PATCH 132/346] + add interfaces for dell compellent snmp --- centreon-plugins/storage/dell/compellent/snmp/plugin.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/storage/dell/compellent/snmp/plugin.pm b/centreon-plugins/storage/dell/compellent/snmp/plugin.pm index c9afbb898..050341b61 100644 --- a/centreon-plugins/storage/dell/compellent/snmp/plugin.pm +++ b/centreon-plugins/storage/dell/compellent/snmp/plugin.pm @@ -31,7 +31,9 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'hardware' => 'storage::dell::compellent::snmp::mode::hardware', + 'hardware' => 'storage::dell::compellent::snmp::mode::hardware', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', ); return $self; From c9507181abd44db680c0f6932f55bf47bb949707 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 23 Mar 2016 16:23:30 +0100 Subject: [PATCH 133/346] + add compellent plugin to check volume usage (with sdk powershell api) --- .../powershell/dell/compellent/volumeusage.pm | 109 ++++++ .../dell/compellent/local/mode/volumeusage.pm | 338 ++++++++++++++++++ .../storage/dell/compellent/local/plugin.pm | 48 +++ 3 files changed, 495 insertions(+) create mode 100644 centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm create mode 100644 centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm create mode 100644 centreon-plugins/storage/dell/compellent/local/plugin.pm diff --git a/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm b/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm new file mode 100644 index 000000000..fc06d1a84 --- /dev/null +++ b/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm @@ -0,0 +1,109 @@ +# +# Copyright 2016 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 centreon::common::powershell::dell::compellent::volumeusage; + +use strict; +use warnings; +use centreon::plugins::misc; + +sub get_powershell { + my (%options) = @_; + my $no_ps = (defined($options{no_ps})) ? 1 : 0; + + return '' if ($no_ps == 1); + + my $ps = ' +$culture = new-object "System.Globalization.CultureInfo" "en-us" +[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture +$ProgressPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" + +$scuser = "' . $options{cem_user} . '" +$scpass = ConvertTo-SecureString "' . $options{cem_password} . '" -AsPlainText -Force +$schost = "' . $options{cem_host} . '" +$scport = "' . $options{cem_port} . '" +$connName = "EMDefault" + +Function display_volume_information { + $conn = Connect-DellApiConnection -HostName $schost -Port $scport -User $scuser -password $scpass -Save $connName +'; + if (defined($options{filter_sc}) && $options{filter_sc} ne '') { + $ps .= '$storageCenters = Get-DellStorageCenter -ConnectionName $connName -Name "' . $options{filter_sc} . '" +'; + } else { + $ps .= '$storageCenters = Get-DellStorageCenter -ConnectionName $connName +'; + } + + $ps .= ' + foreach ($sc in $storageCenters) { + $volumeList = Get-DellScVolume -ConnectionName $connName -StorageCenter $sc + foreach ($vol in $volumeList) { + $volusage = Get-DellScVolumeStorageUsageAssociation -ConnectionName $connName -Instance $vol + $usage = Get-DellScVolumeStorageUsage -ConnectionName $connName -Instance $volusage + + write-host ("[sc={0}]" -f $sc.Name) -NoNewline + write-host ("[volume={0}]" -f $usage.Name) -NoNewline + write-host ("[configuredSpace={0}]" -f $usage.ConfiguredSpace.GetByteSize()) -NoNewline + write-host ("[freeSpace={0}]" -f $usage.FreeSpace.GetByteSize()) -NoNewline + write-host ("[activeSpace={0}]" -f $usage.ActiveSpace.GetByteSize()) -NoNewline + write-host ("[raidOverhead={0}]" -f $usage.RaidOverhead.GetByteSize()) -NoNewline + write-host ("[totalDiskSpace={0}]" -f $usage.TotalDiskSpace.GetByteSize()) -NoNewline + write-host ("[replaySpace={0}]" -f $usage.replaySpace.GetByteSize()) + } + + $diskList = Get-DellScDisk -ConnectionName $connName -StorageCenter $sc + foreach ($disk in $diskList) { + $diskusage = Get-DellScDiskStorageUsageAssociation -ConnectionName $connName -Instance $disk + $usage = Get-DellScDiskStorageUsage -ConnectionName $connName -Instance $diskusage + write-host ("[sc={0}]" -f $sc.Name) -NoNewline + write-host ("[disk={0}]" -f $disk.Name) -NoNewline + write-host ("[spare={0}]" -f $disk.Spare) -NoNewline + write-host ("[allocatedSpace={0}]" -f $usage.AllocatedSpace.GetByteSize()) + } + } +} + +Try { + Import-Module "' . $options{sdk_path_dll} . '" + display_volume_information +} Catch { + Write-Host $Error[0].Exception + $ret = Remove-DellSavedApiConnection -Name $connName + exit 1 +} + +$ret = Remove-DellSavedApiConnection -Name $connName +exit 0 +'; + + return centreon::plugins::misc::powershell_encoded($ps); +} + +1; + +__END__ + +=head1 DESCRIPTION + +Method to get compellent volume informations. + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm new file mode 100644 index 000000000..0cdcc0830 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm @@ -0,0 +1,338 @@ +# +# Copyright 2016 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::dell::compellent::local::mode::volumeusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; +use centreon::common::powershell::dell::compellent::volumeusage; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'sc', type => 1, cb_prefix_output => 'prefix_sc_output', message_multiple => 'All storage centers are ok' }, + { name => 'volume', type => 1, cb_prefix_output => 'prefix_volume_output', message_multiple => 'All volumes are ok' } + ]; + $self->{maps_counters}->{sc} = [ + { label => 'sc-total', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' }, { name => 'type' } ], + closure_custom_calc => \&custom_usage_calc, + closure_custom_output => \&custom_usage_output, + closure_custom_perfdata => \&custom_usage_perfdata, + closure_custom_threshold_check => \&custom_usage_threshold, + } + }, + ]; + + $self->{maps_counters}->{volume} = [ + { label => 'volume-usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' }, { name => 'type' } ], + closure_custom_calc => \&custom_usage_calc, + closure_custom_output => \&custom_usage_output, + closure_custom_perfdata => \&custom_usage_perfdata, + closure_custom_threshold_check => \&custom_usage_threshold, + } + }, + { label => 'volume-overhead', set => { + key_values => [ { name => 'overhead' }, { name => 'display' } ], + output_template => 'Raid Overhead : %s %s', + output_change_bytes => 1, + perfdatas => [ + { label => 'volume_overhead', value => 'overhead_absolute', template => '%d', + unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'volume-replay', set => { + key_values => [ { name => 'replay' }, { name => 'display' } ], + output_template => 'Replay : %s %s', + output_change_bytes => 1, + perfdatas => [ + { label => 'volume_replay', value => 'replay_absolute', template => '%d', + unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_sc_output { + my ($self, %options) = @_; + + return "Storage center '" . $options{instance_value}->{display} . "' "; +} + +sub prefix_volume_output { + my ($self, %options) = @_; + + return "Volume '" . $options{instance_value}->{display} . "' "; +} + +my $instance_mode; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = $self->{result_values}->{type} . '_used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = $self->{result_values}->{type} . '_free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + # snapshot can be over 100% + if ($self->{result_values}->{free} < 0) { + $self->{result_values}->{free} = 0; + $self->{result_values}->{prct_free} = 0; + } + + return 0; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "cem-host:s" => { name => 'cem_host' }, + "cem-user:s" => { name => 'cem_user' }, + "cem-password:s" => { name => 'cem_password' }, + "cem-port:s" => { name => 'cem_port', default => 3033 }, + "sdk-path-dll:s" => { name => 'sdk_path_dll' }, + "timeout:s" => { name => 'timeout', default => 50 }, + "command:s" => { name => 'command', default => 'powershell.exe' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' }, + "no-ps" => { name => 'no_ps' }, + "ps-exec-only" => { name => 'ps_exec_only' }, + "ps-sc-filter:s" => { name => 'ps_sc_filter' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + foreach my $label (('cem_host', 'cem_user', 'cem_password', 'cem_port', 'sdk_path_dll')) { + if (!defined($self->{option_results}->{$label}) || $self->{option_results}->{$label} eq '') { + my ($label_opt) = $label; + $label_opt =~ tr/_/-/; + $self->{output}->add_option_msg(short_msg => "Need to specify --" . $label_opt . " option."); + $self->{output}->option_exit(); + } + } + + $instance_mode = $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $ps = centreon::common::powershell::dell::compellent::volumeusage::get_powershell(cem_host => $self->{option_results}->{cem_host}, + cem_user => $self->{option_results}->{cem_user}, + cem_password => $self->{option_results}->{cem_password}, + cem_port => $self->{option_results}->{cem_port}, + sdk_path_dll => $self->{option_results}->{sdk_path_dll}, + no_ps => $self->{option_results}->{no_ps}, + filter_sc => $self->{option_results}->{ps_sc_filter}); + + $self->{option_results}->{command_options} .= " " . $ps; + my ($stdout) = centreon::plugins::misc::windows_execute(output => $self->{output}, + timeout => $self->{option_results}->{timeout}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + if (defined($self->{option_results}->{ps_exec_only})) { + $self->{output}->output_add(severity => 'OK', + short_msg => $stdout); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + } + + # [sc=PRD-SAN-01][volume=SC-S06][configuredSpace=xxxxx][freeSpace=xxxxx][activeSpace=xxxxx][raidOverhead=xxx][totalDiskSpace=xxxx][replaySpace=xxxx] + $self->{volume} = {}; + $self->{sc} = {}; + while ($stdout =~ /^\[sc=(.*?)\]\[volume=(.*?)\]\[configuredSpace=(.*?)\]\[freeSpace=(.*?)\]\[activeSpace=(.*?)\]\[raidOverhead=(.*?)\]\[totalDiskSpace=(.*?)\]\[replaySpace=(.*?)\]/mig) { + my ($sc, $volume, $configured_space, $free_space, $active_space, $raid_overhead, $total_disk_space, $replay_space) = + ($1, $2, $3, $4, $5, $6, $7, $8); + my $name = $sc . '/' . $volume; + + $self->{volume}->{$name} = { display => $name, total => $configured_space, type => 'volume', + used => $active_space + $raid_overhead + $replay_space, + overhead => $raid_overhead, replay => $replay_space}; + $self->{sc}->{$sc} = { display => $sc, total => 0, used => 0, type => 'sc' } if (!defined($self->{sc}->{$sc})); + $self->{sc}->{$sc}->{used} += $active_space + $raid_overhead + $replay_space; + } + + # [sc=PRD-SAN-01][disk=01-01][spare=False][allocatedSpace=960195723264] + while ($stdout =~ /^\[sc=(.*?)\]\[disk=(.*?)\]\[spare=(.*?)\]\[allocatedSpace=(.*?)\]/mig) { + my ($sc, $disk, $spare, $allocated_space) = + ($1, $2, $3, $4); + $self->{sc}->{$sc}->{total} += $allocated_space; + } +} + +1; + +__END__ + +=head1 MODE + +Check storage center and volume usages. + +=over 8 + +=item B<--cem-host> + +Compellent Entreprise Manager hostname (Required). + +=item B<--cem-user> + +Compellent Entreprise Manager username (Required). + +=item B<--cem-password> + +Compellent Entreprise Manager password (Required). + +=item B<--cem-port> + +Compellent Entreprise Manager port (Default: 3033). + +=item B<--sdk-path-dll> + +Path to 'DellStorage.ApiCommandSet.dll' (Required). + +=item B<--timeout> + +Set timeout time for command execution (Default: 50 sec) + +=item B<--no-ps> + +Don't encode powershell. To be used with --command and 'type' command. + +=item B<--command> + +Command to get information (Default: 'powershell.exe'). +Can be changed if you have output in a file. To be used with --no-ps option!!! + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-InputFormat none -NoLogo -EncodedCommand'). + +=item B<--ps-exec-only> + +Print powershell output. + +=item B<--ps-sc-filter> + +Filter Storage Center (only wilcard '*' can be used. In Powershell). + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^sc-total$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'sc-total', 'volume-usage', 'volume-overhead', 'volume-replay'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'sc-total', 'volume-usage', 'volume-overhead', 'volume-replay'. + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/local/plugin.pm b/centreon-plugins/storage/dell/compellent/local/plugin.pm new file mode 100644 index 000000000..4605f328b --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/local/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::dell::compellent::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'volume-usage' => 'storage::dell::compellent::local::mode::volumeusage', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Dell Compellent Storage. Need Dell Storage PowerShell SDK. + +=cut From 84cae57a3c5760f94215b4079bb16e50a02b1616 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 24 Mar 2016 15:37:33 +0100 Subject: [PATCH 134/346] + add plugin for microsoft cluster service --- .../apps/cluster/mscs/local/mode/listnodes.pm | 128 ++++++++++ .../cluster/mscs/local/mode/listresources.pm | 148 ++++++++++++ .../cluster/mscs/local/mode/networkstatus.pm | 199 ++++++++++++++++ .../cluster/mscs/local/mode/nodestatus.pm | 199 ++++++++++++++++ .../mscs/local/mode/resourcegroupstatus.pm | 222 ++++++++++++++++++ .../cluster/mscs/local/mode/resourcestatus.pm | 204 ++++++++++++++++ .../apps/cluster/mscs/local/plugin.pm | 53 +++++ 7 files changed, 1153 insertions(+) create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/listnodes.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm create mode 100644 centreon-plugins/apps/cluster/mscs/local/plugin.pm diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/listnodes.pm b/centreon-plugins/apps/cluster/mscs/local/mode/listnodes.pm new file mode 100644 index 000000000..28ab65f79 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/listnodes.pm @@ -0,0 +1,128 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::listnodes; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use Win32::OLE; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'up', + 1 => 'down', + 2 => 'paused', + 3 => 'joining', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{nodes} = {}; + my $query = "Select * from MSCluster_Node"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{nodes}->{$name} = { name => $name, state => $state }; + } +} + +sub run { + my ($self, %options) = @_; + + $self->manage_selection(); + foreach my $name (sort keys %{$self->{nodes}}) { + $self->{output}->output_add(long_msg => "'" . $name . "' [state = " . $self->{nodes}->{$name}->{state} . "]"); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List Nodes:'); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +sub disco_format { + my ($self, %options) = @_; + + $self->{output}->add_disco_format(elements => ['name', 'state']); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->manage_selection(disco => 1); + foreach my $name (sort keys %{$self->{nodes}}) { + $self->{output}->add_disco_entry(name => $name, state => $self->{nodes}->{$name}->{state}); + } +} + +1; + +__END__ + +=head1 MODE + +List nodes. + +=over 8 + +=item B<--filter-name> + +Filter node name (can be a regexp). + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm new file mode 100644 index 000000000..504c36e76 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm @@ -0,0 +1,148 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::listresources; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use Win32::OLE; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'inherited', + 1 => 'initializing', + 2 => 'online', + 3 => 'offline', + 4 => 'failed', + 128 => 'pending', + 129 => 'online pending', + 130 => 'offline pending', +); + +my %map_class = ( + 0 => 'unknown', + 1 => 'storage', + 2 => 'network', + 32768 => 'user', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{resources} = {}; + my $query = "Select * from MSCluster_Resource"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + my $class = $map_class{$obj->{ResourceClass}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{resources}->{$obj->{Id}} = { name => $name, state => $state, owner_node => $obj->{OwnerNode}, + class => $class }; + } +} + +sub run { + my ($self, %options) = @_; + + $self->manage_selection(); + foreach my $id (sort keys %{$self->{resources}}) { + $self->{output}->output_add(long_msg => "'" . $self->{resources}->{$id}->{name} . + "' [state = " . $self->{resources}->{$id}->{state} . "]" . + "[owner node = " . $self->{resources}->{$id}->{owner_node} . "]" . + "[class = " . $self->{resources}->{$id}->{class} . "]"); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List Resources:'); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +sub disco_format { + my ($self, %options) = @_; + + $self->{output}->add_disco_format(elements => ['name', 'state', 'id', 'owner_node', 'class']); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->manage_selection(disco => 1); + foreach my $id (sort keys %{$self->{resources}}) { + $self->{output}->add_disco_entry(name => $self->{resources}->{$id}->{name}, + state => $self->{resources}->{$id}->{state}, + id => $id, + owner_node => $self->{resources}->{$id}->{owner_node}, + class => $self->{resources}->{$id}->{class}); + } +} + +1; + +__END__ + +=head1 MODE + +List resources. + +=over 8 + +=item B<--filter-name> + +Filter resource name (can be a regexp). + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm new file mode 100644 index 000000000..594034c4b --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm @@ -0,0 +1,199 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::networkstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Win32::OLE; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'network', type => 1, cb_prefix_output => 'prefix_network_output', message_multiple => 'All networks are ok' } + ]; + + $self->{maps_counters}->{network} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{state}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub prefix_network_output { + my ($self, %options) = @_; + + return "Network '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "unknown-status:s" => { name => 'unknown_status', default => '%{state} =~ /unknown/' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /down|paritioned|unavailable/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'unavailable', + 1 => 'down', + 2 => 'paritioned', + 3 => 'up', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{network} = {}; + my $query = "Select * from MSCluster_Network"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{network}->{$obj->{ID}} = { display => $name, state => $state }; + } +} + +1; + +__END__ + +=head1 MODE + +Check network status. + +=over 8 + +=item B<--filter-name> + +Filter interface name (can be a regexp). + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{state} =~ /unknown/'). +Can used special variables like: %{state}, %{display} + +=item B<--warning-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{state}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /down|paritioned|unavailable/'). +Can used special variables like: %{state}, %{display} + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm new file mode 100644 index 000000000..b8706ce12 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm @@ -0,0 +1,199 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::nodestatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Win32::OLE; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'node', type => 1, cb_prefix_output => 'prefix_node_output', message_multiple => 'All nodes are ok' } + ]; + + $self->{maps_counters}->{node} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{state}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub prefix_node_output { + my ($self, %options) = @_; + + return "Node '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "unknown-status:s" => { name => 'unknown_status', default => '%{state} =~ /unknown/' }, + "warning-status:s" => { name => 'warning_status', default => '%{state} =~ /pause|joining/' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /down/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'up', + 1 => 'down', + 2 => 'paused', + 3 => 'joining', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{node} = {}; + my $query = "Select * from MSCluster_Node"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{node}->{$name} = { display => $name, state => $state }; + } +} + +1; + +__END__ + +=head1 MODE + +Check node status. + +=over 8 + +=item B<--filter-name> + +Filter node name (can be a regexp). + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{state} =~ /unknown/'). +Can used special variables like: %{state}, %{display} + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{state} =~ /pause|joining/'). +Can used special variables like: %{state}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /down/'). +Can used special variables like: %{state}, %{display} + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm new file mode 100644 index 000000000..b64a9a080 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm @@ -0,0 +1,222 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::resourcegroupstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Win32::OLE; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'rg', type => 1, cb_prefix_output => 'prefix_rg_output', message_multiple => 'All resource groups are ok' } + ]; + + $self->{maps_counters}->{rg} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' }, { name => 'owner_node' }, { name => 'preferred_owners' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; +my $instance_current; + +sub is_preferred_node { + if (!defined($instance_current->{result_values}->{preferred_owners}) || + scalar(@{$instance_current->{result_values}->{preferred_owners}}) == 0) { + return 1; + } + + foreach my $pref_node (@{$instance_current->{result_values}->{preferred_owners}}) { + if ($pref_node eq $instance_current->{result_values}->{owner_node}) { + return 1; + } + } + + return 0; +} + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + $instance_current = $self; + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{state} . ' [node: ' . $self->{result_values}->{owner_node} . ']'; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{owner_node} = $options{new_datas}->{$self->{instance} . '_owner_node'}; + $self->{result_values}->{preferred_owners} = $options{new_datas}->{$self->{instance} . '_preferred_owners'}; + return 0; +} + +sub prefix_rg_output { + my ($self, %options) = @_; + + return "Resource group '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "unknown-status:s" => { name => 'unknown_status', default => '%{state} =~ /unknown/' }, + "warning-status:s" => { name => 'warning_status', default => 'not is_preferred_node()' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /failed|offline/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'online', + 1 => 'offline', + 2 => 'failed', + 3 => 'partial online', + 4 => 'pending', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{rg} = {}; + my $query = "Select * from MSCluster_ResourceGroup"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + my $preferred_owners = []; + $obj->GetPreferredOwners(\$preferred_owners) if ($obj->can('GetPreferredOwners')); + + $self->{rg}->{$obj->{Id}} = { display => $name, state => $state, owner_node => $obj->{OwnerNode}, + preferred_owners => $preferred_owners }; + } +} + +1; + +__END__ + +=head1 MODE + +Check resource group status. + +=over 8 + +=item B<--filter-name> + +Filter resource group name (can be a regexp). + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{state} =~ /unknown/'). +Can used special variables like: %{state}, %{display}, %{owner_node} + +=item B<--warning-status> + +Set warning threshold for status (Default: 'not is_preferred_node()'). +Can used special variables like: %{state}, %{display}, %{owner_node} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /failed|offline/'). +Can used special variables like: %{state}, %{display}, %{owner_node} + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm new file mode 100644 index 000000000..1adcb2e44 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm @@ -0,0 +1,204 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::mode::resourcestatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Win32::OLE; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'resource', type => 1, cb_prefix_output => 'prefix_resource_output', message_multiple => 'All resources are ok' } + ]; + + $self->{maps_counters}->{resource} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' }, { name => 'owner_node' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{state} . ' [node: ' . $self->{result_values}->{owner_node} . ']'; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{owner_node} = $options{new_datas}->{$self->{instance} . '_owner_node'}; + return 0; +} + +sub prefix_resource_output { + my ($self, %options) = @_; + + return "Resource '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "unknown-status:s" => { name => 'unknown_status', default => '%{state} =~ /unknown/' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /failed|offline/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_state = ( + -1 => 'unknown', + 0 => 'inherited', + 1 => 'initializing', + 2 => 'online', + 3 => 'offline', + 4 => 'failed', + 128 => 'pending', + 129 => 'online pending', + 130 => 'offline pending', +); + +sub manage_selection { + my ($self, %options) = @_; + + # winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\.\root\mscluster + my $wmi = Win32::OLE->GetObject('winmgmts:root\mscluster'); + if (!defined($wmi)) { + $self->{output}->add_option_msg(short_msg => "Cant create server object:" . Win32::OLE->LastError()); + $self->{output}->option_exit(); + } + + $self->{resource} = {}; + my $query = "Select * from MSCluster_Resource"; + my $resultset = $wmi->ExecQuery($query); + foreach my $obj (in $resultset) { + my $name = $obj->{Name}; + my $state = $map_state{$obj->{State}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $name !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; + } + + $self->{resource}->{$obj->{Id}} = { display => $name, state => $state, owner_node => $obj->{OwnerNode} }; + } +} + +1; + +__END__ + +=head1 MODE + +Check resource status. + +=over 8 + +=item B<--filter-name> + +Filter resource name (can be a regexp). + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{state} =~ /unknown/'). +Can used special variables like: %{state}, %{display} + +=item B<--warning-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{state}, %{display}, %{owner_node} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /failed|offline/'). +Can used special variables like: %{state}, %{display}, %{owner_node} + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/apps/cluster/mscs/local/plugin.pm b/centreon-plugins/apps/cluster/mscs/local/plugin.pm new file mode 100644 index 000000000..482d7d4c7 --- /dev/null +++ b/centreon-plugins/apps/cluster/mscs/local/plugin.pm @@ -0,0 +1,53 @@ +# +# Copyright 2016 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 apps::cluster::mscs::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'list-nodes' => 'apps::cluster::mscs::local::mode::listnodes', + 'list-resources' => 'apps::cluster::mscs::local::mode::listresources', + 'network-status' => 'apps::cluster::mscs::local::mode::networkstatus', + 'node-status' => 'apps::cluster::mscs::local::mode::nodestatus', + 'resource-status' => 'apps::cluster::mscs::local::mode::resourcestatus', + 'resourcegroup-status' => 'apps::cluster::mscs::local::mode::resourcegroupstatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Microsoft Cluster Service. + +=cut From c94a12d938bcf4bd1fed22416adcf310c0d18db5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 24 Mar 2016 16:06:12 +0100 Subject: [PATCH 135/346] + fix mcsc plugin --- .../mscs/local/mode/resourcegroupstatus.pm | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm index b64a9a080..4bcd22fa7 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm @@ -94,7 +94,13 @@ sub custom_threshold_output { sub custom_status_output { my ($self, %options) = @_; - my $msg = 'state : ' . $self->{result_values}->{state} . ' [node: ' . $self->{result_values}->{owner_node} . ']'; + my $pref_nodes = 'any'; + if (defined($instance_current->{result_values}->{preferred_owners}) && + scalar(@{$instance_current->{result_values}->{preferred_owners}}) > 0) { + $pref_nodes = join(', ', @{$instance_current->{result_values}->{preferred_owners}}); + } + + my $msg = 'state : ' . $self->{result_values}->{state} . ' [node: ' . $self->{result_values}->{owner_node} . '] [preferred nodes: ' . $pref_nodes . ']'; return $msg; } @@ -168,9 +174,25 @@ sub manage_selection { $self->{output}->option_exit(); } - $self->{rg} = {}; - my $query = "Select * from MSCluster_ResourceGroup"; + my $query = "Select * from MSCluster_ResourceGroupToPreferredNode"; my $resultset = $wmi->ExecQuery($query); + my $preferred_nodes = {}; + foreach my $obj (in $resultset) { + use Data::Dumper; + + # MSCluster_ResourceGroup.Name="xxx" + if ($obj->GroupComponent =~ /MSCluster_ResourceGroup.Name="(.*?)"/i) { + my $rg = $1; + next if ($obj->PartComponent !~ /MSCluster_Node.Name="(.*?)"/i); + my $node = $1; + $preferred_nodes->{$rg} = [] if (!defined($preferred_nodes->{$rg})); + push @{$preferred_nodes->{$rg}}, $node; + } + } + + $self->{rg} = {}; + $query = "Select * from MSCluster_ResourceGroup"; + $resultset = $wmi->ExecQuery($query); foreach my $obj (in $resultset) { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; @@ -180,11 +202,9 @@ sub manage_selection { $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); next; } - my $preferred_owners = []; - $obj->GetPreferredOwners(\$preferred_owners) if ($obj->can('GetPreferredOwners')); $self->{rg}->{$obj->{Id}} = { display => $name, state => $state, owner_node => $obj->{OwnerNode}, - preferred_owners => $preferred_owners }; + preferred_owners => defined($preferred_nodes->{$name}) ? $preferred_nodes->{$name} : [] }; } } From d459d99746da4fdf153f1f91bd557a071832c3b0 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 24 Mar 2016 16:36:57 +0100 Subject: [PATCH 136/346] + prepare new tag --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index babc300a8..eba9379e6 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160220; +my $global_version = 20160324; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index 8d5e2bccf..c5ac6ddb6 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,12 @@ +2016-03-24 Quentin Garnier + * Plugin added: to check AKCP SensorProbe + * Plugin added: to check Juniper ISG + * Plugin added: to check OSPF protocol + * Plugin added: to check Microsoft Cluster Service + * Plugin added: to check Dell Compellent in SNMP and Powershell SDK + * Enhancement: [snmp_standard]{string-value} Many changes (#228) + * Fix: [raritan] OnOff sending errors (#348) + 2016-02-20 Quentin Garnier * Add a class for FatPacker system From 282b9026a45b7f52f038fe19b1ad050f7f96a75e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 24 Mar 2016 22:06:38 +0100 Subject: [PATCH 137/346] + Fix unknown status --- centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm | 2 +- centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm | 2 +- .../apps/cluster/mscs/local/mode/resourcegroupstatus.pm | 2 +- centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm | 2 +- centreon-plugins/storage/emc/DataDomain/mode/replication.pm | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm index 594034c4b..f14298e97 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm @@ -64,7 +64,7 @@ sub custom_threshold_output { $status = 'warning'; } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && eval "$instance_mode->{option_results}->{unknown_status}") { - $status = 'warning'; + $status = 'unknown'; } }; if (defined($message)) { diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm index b8706ce12..89d28337b 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/nodestatus.pm @@ -64,7 +64,7 @@ sub custom_threshold_output { $status = 'warning'; } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && eval "$instance_mode->{option_results}->{unknown_status}") { - $status = 'warning'; + $status = 'unknown'; } }; if (defined($message)) { diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm index 4bcd22fa7..6731475da 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm @@ -81,7 +81,7 @@ sub custom_threshold_output { $status = 'warning'; } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && eval "$instance_mode->{option_results}->{unknown_status}") { - $status = 'warning'; + $status = 'unknown'; } }; if (defined($message)) { diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm index 1adcb2e44..381535539 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm @@ -64,7 +64,7 @@ sub custom_threshold_output { $status = 'warning'; } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && eval "$instance_mode->{option_results}->{unknown_status}") { - $status = 'warning'; + $status = 'unknown'; } }; if (defined($message)) { diff --git a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm index 3b69e7eaf..974c8021b 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/replication.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/replication.pm @@ -45,7 +45,7 @@ sub custom_threshold_output { $status = 'warning'; } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && eval "$instance_mode->{option_results}->{unknown_status}") { - $status = 'warning'; + $status = 'unknown'; } }; if (defined($message)) { From fe13d63571da473da29d8b94597024368b030596 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 25 Mar 2016 09:20:26 +0100 Subject: [PATCH 138/346] + Change plugin.pm to use BSD memory check --- centreon-plugins/network/netasq/snmp/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index 773b0f4e7..ba2e8517c 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -38,7 +38,7 @@ sub new { 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'load' => 'snmp_standard::mode::loadaverage', 'ha-status' => 'network::netasq::snmp::mode::hastatus', - 'memory' => 'snmp_standard::mode::memory', + 'memory' => 'os::freebsd::snmp::mode::memory', 'storage' => 'snmp_standard::mode::storage', 'swap' => 'snmp_standard::mode::swap', 'vpn-status' => 'network::netasq::snmp::mode::vpnstatus', From f588f9613a39bcd49ab69211a73c765bfe089c71 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 25 Mar 2016 11:24:43 +0100 Subject: [PATCH 139/346] + Add UDP/TCP connections mode for Netasq https://github.com/centreon/centreon-plugins/issues/99 --- .../network/netasq/snmp/mode/connections.pm | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 centreon-plugins/network/netasq/snmp/mode/connections.pm diff --git a/centreon-plugins/network/netasq/snmp/mode/connections.pm b/centreon-plugins/network/netasq/snmp/mode/connections.pm new file mode 100644 index 000000000..1215cbc5c --- /dev/null +++ b/centreon-plugins/network/netasq/snmp/mode/connections.pm @@ -0,0 +1,108 @@ +# +# Copyright 2016 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::netasq::snmp::mode::connections; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'udp', set => { + key_values => [ { name => 'udp', diff => 1 } ], + per_second => 1, + output_template => 'UDP : %d connections/s', + perfdatas => [ + { label => 'udp', value => 'udp_per_second', template => '%d', + min => 0, unit => 'con' }, + ], + } + }, + { label => 'tcp', set => { + key_values => [ { name => 'tcp', diff => 1 } ], + per_second => 1, + output_template => 'TCP : %d connections/s', + perfdatas => [ + { label => 'tcp', value => 'tcp_per_second', template => '%d', + min => 0, unit => 'con' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + $self->{cache_name} = "fw_netasq_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . md5_hex('all'); + + my $oid_ntqASQStatsStatefulUdpConn = '.1.3.6.1.4.1.11256.1.12.1.33.0'; + my $oid_ntqASQStatsStatefulTcpConn = '.1.3.6.1.4.1.11256.1.12.1.23.0'; + + my $result = $options{snmp}->get_leef(oids => [ $oid_ntqASQStatsStatefulUdpConn, $oid_ntqASQStatsStatefulTcpConn ], + nothing_quit => 1); + $self->{global} = { + udp => $result->{$oid_ntqASQStatsStatefulUdpConn}, + tcp => $result->{$oid_ntqASQStatsStatefulTcpConn}, + }; +} + +1; + +__END__ + +=head1 MODE + +Check connections setup rate on Netasq Firewall equipments. + +=over 8 + +=item B<--warning-*> + +Threshold warning. +Can be: 'tcp', 'udp' + +=item B<--critical-*> + +Threshold critical. +Can be: 'tcp', 'udp' + +=back + +=cut From aa2392ce79de763e59af62b830a7946e6c35b450 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 25 Mar 2016 11:25:57 +0100 Subject: [PATCH 140/346] + add connection mode https://github.com/centreon/centreon-plugins/issues/99 --- centreon-plugins/network/netasq/snmp/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index ba2e8517c..751fb4acf 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -34,6 +34,7 @@ sub new { %{$self->{modes}} = ( 'cpu' => 'snmp_standard::mode::cpu', 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', + 'connections' => 'network::netasq::snmp::mode::connections', 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'load' => 'snmp_standard::mode::loadaverage', From d8d54d72a43948d873111c77ffb7811087d0ce92 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 25 Mar 2016 11:27:10 +0100 Subject: [PATCH 141/346] + Fix #356 --- centreon-plugins/apps/tomcat/web/mode/applications.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/tomcat/web/mode/applications.pm b/centreon-plugins/apps/tomcat/web/mode/applications.pm index 7056a985a..f360564b8 100644 --- a/centreon-plugins/apps/tomcat/web/mode/applications.pm +++ b/centreon-plugins/apps/tomcat/web/mode/applications.pm @@ -65,7 +65,7 @@ sub manage_selection { my $webcontent = $self->{http}->request(); - while ($webcontent =~ m/(.*):(.*):(.*):(.*)/g) { + while ($webcontent =~ /^(.*?):(.*?):(.*?):(.*)/mg) { my ($context, $state, $sessions, $contextpath) = ($1, $2, $3, $4); next if (defined($self->{option_results}->{filter_path}) && $self->{option_results}->{filter_path} ne '' && From 62528ef674d97bc3f7f155ee6abe1f0b4efb857c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 29 Mar 2016 11:44:50 +0200 Subject: [PATCH 142/346] + Fix time-host command issue --- centreon-plugins/apps/vmware/connector/mode/timehost.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/centreon-plugins/apps/vmware/connector/mode/timehost.pm b/centreon-plugins/apps/vmware/connector/mode/timehost.pm index d16c02cfe..f1dce6305 100644 --- a/centreon-plugins/apps/vmware/connector/mode/timehost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/timehost.pm @@ -66,7 +66,6 @@ sub run { my ($self, %options) = @_; $self->{connector} = $options{custom}; - $self->{connector}->set_discovery(); $self->{connector}->add_params(params => $self->{option_results}, command => 'timehost'); $self->{connector}->run(); From 0b38034472a2553c050114eef6ae3df2d33a6ee4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 30 Mar 2016 10:27:41 +0200 Subject: [PATCH 143/346] + Add mode 'data-files-status' for oracle --- .../database/oracle/mode/datafilesstatus.pm | 218 ++++++++++++++++++ centreon-plugins/database/oracle/plugin.pm | 2 +- 2 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 centreon-plugins/database/oracle/mode/datafilesstatus.pm diff --git a/centreon-plugins/database/oracle/mode/datafilesstatus.pm b/centreon-plugins/database/oracle/mode/datafilesstatus.pm new file mode 100644 index 000000000..119632ba9 --- /dev/null +++ b/centreon-plugins/database/oracle/mode/datafilesstatus.pm @@ -0,0 +1,218 @@ +# +# Copyright 2016 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 database::oracle::mode::datafilesstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'df', type => 1, cb_prefix_output => 'prefix_df_output', message_multiple => 'All data files are ok' }, + ]; + + $self->{maps_counters}->{df} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'online-status', threshold => 0, set => { + key_values => [ { name => 'online_status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_online_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{'critical_' . $self->{result_values}->{label_th}}) && $instance_mode->{option_results}->{'critical_' . $self->{result_values}->{label_th}} ne '' && + eval "$instance_mode->{option_results}->{'critical_' . $self->{result_values}->{label_th}}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{'warning_' . $self->{result_values}->{label_th}}) && $instance_mode->{option_results}->{'warning_' . $self->{result_values}->{label_th}} ne '' && + eval "$instance_mode->{option_results}->{'warning_' . $self->{result_values}->{label_th}}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg = $self->{result_values}->{label_display} . ' : ' . $self->{result_values}->{$self->{result_values}->{label_th}}; + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{label_display} = 'Status'; + $self->{result_values}->{label_th} = 'status'; + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_online_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{label_display} = 'Online Status'; + $self->{result_values}->{label_th} = 'online_status'; + $self->{result_values}->{online_status} = $options{new_datas}->{$self->{instance} . '_online_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-tablespace:s" => { name => 'filter_tablespace' }, + "filter-data-file:s" => { name => 'filter_data_file' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '' }, + "warning-online-status:s" => { name => 'warning_online_status', default => '%{online_status} =~ /sysoff/i' }, + "critical-online-status:s" => { name => 'critical_online_status', default => '%{online_status} =~ /system|offline|recover/i' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'warning_online_status', 'critical_online_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub prefix_df_output { + my ($self, %options) = @_; + + return "Data file '" . $options{instance_value}->{display} . "' "; +} + +sub manage_selection { + my ($self, %options) = @_; + + $options{sql}->connect(); + $options{sql}->query(query => "SELECT file_name, tablespace_name, status, online_status + FROM dba_data_files"); + my $result = $options{sql}->fetchall_arrayref(); + + $self->{df} = {}; + foreach my $row (@$result) { + if (defined($self->{option_results}->{filter_data_file}) && $self->{option_results}->{filter_data_file} ne '' && + $$row[0] !~ /$self->{option_results}->{filter_data_file}/) { + $self->{output}->output_add(long_msg => "skipping '" . $$row[0] . "': no matching filter.", debug => 1); + next; + } + if (defined($self->{option_results}->{filter_tablespace}) && $self->{option_results}->{filter_tablespace} ne '' && + $$row[1] !~ /$self->{option_results}->{filter_tablespace}/) { + $self->{output}->output_add(long_msg => "skipping '" . $$row[1] . "': no matching filter.", debug => 1); + next + } + $self->{df}->{$$row[1] . '/' . $$row[0]} = { status => $$row[2], online_status => $$row[3], display => $$row[1] . '/' . $$row[0] }; + } +} + +1; + +__END__ + +=head1 MODE + +Check data files status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). + +=item B<--filter-tablespace> + +Filter tablespace name (can be a regexp). + +=item B<--filter-data-file> + +Filter data file name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: none). +Can used special variables like: %{display}, %{status} + +=item B<--critical-status> + +Set critical threshold for status (Default: none). +Can used special variables like: %{display}, %{status} + +=item B<--warning-online-status> + +Set warning threshold for online status (Default: '%{online_status} =~ /sysoff/i'). +Can used special variables like: %{display}, %{online_status} + +=item B<--critical-online-status> + +Set critical threshold for online status (Default: '%{online_status} =~ /system|offline|recover/i'). +Can used special variables like: %{display}, %{online_status} + +=back + +=cut diff --git a/centreon-plugins/database/oracle/plugin.pm b/centreon-plugins/database/oracle/plugin.pm index ff665ab2a..24a6d39a3 100644 --- a/centreon-plugins/database/oracle/plugin.pm +++ b/centreon-plugins/database/oracle/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( @@ -37,6 +36,7 @@ sub new { 'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime', 'connected-users' => 'database::oracle::mode::connectedusers', 'corrupted-blocks' => 'database::oracle::mode::corruptedblocks', + 'data-files-status' => 'database::oracle::mode::datafilesstatus', 'datacache-hitratio' => 'database::oracle::mode::datacachehitratio', 'process-usage' => 'database::oracle::mode::processusage', 'rman-backup-problems' => 'database::oracle::mode::rmanbackupproblems', From f0dfe7eeb6ebf9bee1c05377c1265adb7b0da6ce Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 30 Mar 2016 14:15:13 +0200 Subject: [PATCH 144/346] + change oracle data-files-status mode threshold --- centreon-plugins/database/oracle/mode/datafilesstatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/datafilesstatus.pm b/centreon-plugins/database/oracle/mode/datafilesstatus.pm index 119632ba9..78ed67f56 100644 --- a/centreon-plugins/database/oracle/mode/datafilesstatus.pm +++ b/centreon-plugins/database/oracle/mode/datafilesstatus.pm @@ -118,7 +118,7 @@ sub new { "warning-status:s" => { name => 'warning_status', default => '' }, "critical-status:s" => { name => 'critical_status', default => '' }, "warning-online-status:s" => { name => 'warning_online_status', default => '%{online_status} =~ /sysoff/i' }, - "critical-online-status:s" => { name => 'critical_online_status', default => '%{online_status} =~ /system|offline|recover/i' }, + "critical-online-status:s" => { name => 'critical_online_status', default => '%{online_status} =~ /offline|recover/i' }, }); return $self; } @@ -210,7 +210,7 @@ Can used special variables like: %{display}, %{online_status} =item B<--critical-online-status> -Set critical threshold for online status (Default: '%{online_status} =~ /system|offline|recover/i'). +Set critical threshold for online status (Default: '%{online_status} =~ /offline|recover/i'). Can used special variables like: %{display}, %{online_status} =back From 5f7ddb491202476eea9abfd95889202e3194aa18 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 1 Apr 2016 11:26:58 +0200 Subject: [PATCH 145/346] + add a case for mysql replication slave mode --- .../mysql/mode/replicationmasterslave.pm | 67 +++++++++++-------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/centreon-plugins/database/mysql/mode/replicationmasterslave.pm b/centreon-plugins/database/mysql/mode/replicationmasterslave.pm index 516e253d6..b8988adbe 100644 --- a/centreon-plugins/database/mysql/mode/replicationmasterslave.pm +++ b/centreon-plugins/database/mysql/mode/replicationmasterslave.pm @@ -45,18 +45,17 @@ sub check_options { $self->SUPER::init(%options); if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); } } sub run { my ($self, %options) = @_; - # $options{sql} = sqlmode object if (ref($options{sql}) ne 'ARRAY') { $self->{output}->add_option_msg(short_msg => "Need to use --multiple options."); @@ -232,7 +231,7 @@ sub run { my $slave_position = $result2->{Read_Master_Log_Pos}; # 'Read_Master_Log_Pos' my $num_sec_lates = $result2->{Seconds_Behind_Master}; - my $exit_code_sec = $self->{perfdata}->threshold_check(value => $num_sec_lates, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my $exit_code_sec = $self->{perfdata}->threshold_check(value => $num_sec_lates, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); if (!$self->{output}->is_status(value => $exit_code_sec, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit_code_sec, short_msg => sprintf("Slave has %d seconds latency behind master", $num_sec_lates)); @@ -262,51 +261,63 @@ sub run { $position_status_error .= " Slave replication has connection issue with the master."; } elsif (($master_file ne $slave_file || $master_position != $slave_position) && $slave_sql_thread_warning == 0) { $position_status = -1; - $position_status_error .= " Slave replication is late but it's progressing.."; + $position_status_error .= " Slave replication is late but it's progressing."; } elsif (($master_file ne $slave_file || $master_position != $slave_position) && $slave_sql_thread_ok == 0) { $position_status = -1; - $position_status_error .= " Slave replication is late but it's progressing.."; + $position_status_error .= " Slave replication is late but it's progressing."; + } else { + $master_file =~ /(\d+)$/; + my $master_bin_num = $1; + $slave_file =~ /(\d+)$/; + my $slave_bin_num = $1; + my $diff_binlog = abs($master_bin_num - $slave_bin_num); + + # surely of missconfiguration of the plugin + if ($diff_binlog > 1 && $num_sec_lates < 10) { + $position_status = -3; + $position_status_error .= " Surely a configuration problem of the plugin (not good master and slave server used)"; + } } } } - - $self->replication_add($slave_status, "Slave Thread Status", $slave_status_error); - $self->replication_add($position_status, "Position Status", $position_status_error); + $self->replication_add($position_status, "Position Status", $position_status_error); $self->{output}->display(); $self->{output}->exit(); } sub replication_add { - my ($self, $lstate, $str_display, $lerr) = @_; - my $status; + my ($self, $lstate, $str_display, $lerr) = @_; + my $status; my $status_msg; - if ($lstate == 0) { - $status = 'OK'; - } elsif ($lstate == -1) { - $status = 'WARNING'; - } elsif ($lstate == -2) { - $status = 'CRITICAL'; + if ($lstate == 0) { + $status = 'OK'; + } elsif ($lstate == -1) { + $status = 'WARNING'; + } elsif ($lstate == -2) { + $status = 'CRITICAL'; $status_msg = 'SKIP'; - } else { - $status = 'CRITICAL'; - } + } elsif ($lstate == -3) { + $status = 'UNKNOWN'; + } else { + $status = 'CRITICAL'; + } my $output; - if (defined($lerr) && $lerr ne "") { - $output = $str_display . " [" . (defined($status_msg) ? $status_msg : $status) . "] [" . $lerr . "]"; - } else { - $output = $str_display . " [" . (defined($status_msg) ? $status_msg : $status) . "]"; - } + if (defined($lerr) && $lerr ne "") { + $output = $str_display . " [" . (defined($status_msg) ? $status_msg : $status) . "] [" . $lerr . "]"; + } else { + $output = $str_display . " [" . (defined($status_msg) ? $status_msg : $status) . "]"; + } if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $status, short_msg => $output); } - $self->{output}->output_add(long_msg => $output); + $self->{output}->output_add(long_msg => $output); } 1; From aa17c3f4e1712e3de128c0524c6debb4e9c27e49 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 14 Apr 2016 15:56:10 +0200 Subject: [PATCH 146/346] + add mode for netbackup + add new type in counter template system --- .../backup/netbackup/local/mode/jobstatus.pm | 36 ++- .../backup/netbackup/local/mode/tapeusage.pm | 256 ++++++++++++++++++ .../apps/backup/netbackup/local/plugin.pm | 2 +- .../centreon/plugins/templates/counter.pm | 66 ++++- 4 files changed, 347 insertions(+), 13 deletions(-) create mode 100644 centreon-plugins/apps/backup/netbackup/local/mode/tapeusage.pm diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm index a4b275d83..0a1bee52f 100644 --- a/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm +++ b/centreon-plugins/apps/backup/netbackup/local/mode/jobstatus.pm @@ -173,7 +173,9 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'job', type => 1, cb_prefix_output => 'prefix_job_output', message_multiple => 'All jobs are ok', skipped_code => { -11 => 1 } } + { name => 'policy', type => 2, cb_prefix_output => 'prefix_policy_output', cb_long_output => 'policy_long_output', message_multiple => 'All policies are ok', + group => [ { name => 'job', cb_prefix_output => 'prefix_job_output', skipped_code => { -11 => 1 } } ] + } ]; $self->{maps_counters}->{job} = [ @@ -244,10 +246,22 @@ sub check_options { $self->change_macros(); } +sub policy_long_output { + my ($self, %options) = @_; + + return "checking policy '" . $options{instance_value}->{display} . "'"; +} + +sub prefix_policy_output { + my ($self, %options) = @_; + + return "policy '" . $options{instance_value}->{display} . "' "; +} + sub prefix_job_output { my ($self, %options) = @_; - return "Job '" . $options{instance_value}->{display} . "' "; + return "job '" . $options{instance_value}->{display} . "' "; } sub change_macros { @@ -291,32 +305,34 @@ sub manage_selection { command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options}); - $self->{job} = {}; + $self->{policy} = {}; my $current_time = time(); foreach my $line (split /\n/, $stdout) { my @values = split /,/, $line; my ($job_id, $job_type, $job_state, $job_status, $job_pname, $job_start_time, $job_end_time, $job_kb) = ($values[0], $values[1], $values[2], $values[3], $values[4], $values[8], $values[10], $values[14]); - my $display = (defined($job_pname) ? $job_pname : '-') . '/' . $job_id; + $job_pname = defined($job_pname) && $job_pname ne '' ? $job_pname : 'unknown'; + $job_status = defined($job_status) && $job_status =~ /[0-9]/ ? $job_status : undef; if (defined($self->{option_results}->{filter_policy_name}) && $self->{option_results}->{filter_policy_name} ne '' && $job_pname !~ /$self->{option_results}->{filter_policy_name}/) { - $self->{output}->output_add(long_msg => "skipping '" . $display . "': no matching filter.", debug => 1); + $self->{output}->output_add(long_msg => "skipping job '" . $job_pname . "/" . $job_id . "': no matching filter.", debug => 1); next; } if (defined($self->{option_results}->{filter_end_time}) && $self->{option_results}->{filter_end_time} =~ /[0-9]+/ && defined($job_end_time) && $job_end_time =~ /[0-9]+/ && $job_end_time < $current_time - $self->{option_results}->{filter_end_time}) { - $self->{output}->output_add(long_msg => "skipping '" . $display . "': too old.", debug => 1); + $self->{output}->output_add(long_msg => "skipping job '" . $job_pname . "/" . $job_id . "': too old.", debug => 1); next; } + $self->{policy}->{$job_pname} = { job => {}, display => $job_pname } if (!defined($self->{policy}->{$job_pname})); my $elapsed_time = $current_time - $job_start_time; - $self->{job}->{$display} = { display => $display, elapsed => $elapsed_time, - status => $job_status, state => $job_state{$job_state}, type => $job_type{$job_type}, - kb => defined($job_kb) && $job_kb =~ /[0-9]+/ ? $job_kb : undef }; + $self->{policy}->{$job_pname}->{job}->{$job_id} = { display => $job_id, elapsed => $elapsed_time, + status => $job_status, state => $job_state{$job_state}, type => $job_type{$job_type}, + kb => defined($job_kb) && $job_kb =~ /[0-9]+/ ? $job_kb : undef }; } - if (scalar(keys %{$self->{job}}) <= 0) { + if (scalar(keys %{$self->{policy}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No job found."); $self->{output}->option_exit(); } diff --git a/centreon-plugins/apps/backup/netbackup/local/mode/tapeusage.pm b/centreon-plugins/apps/backup/netbackup/local/mode/tapeusage.pm new file mode 100644 index 000000000..90c8da675 --- /dev/null +++ b/centreon-plugins/apps/backup/netbackup/local/mode/tapeusage.pm @@ -0,0 +1,256 @@ +# +# Copyright 2016 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 apps::backup::netbackup::local::mode::tapeusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; + +my $instance_mode; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label, + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $self->{result_values}->{total}, + $self->{result_values}->{used}, $self->{result_values}->{prct_used}, + $self->{result_values}->{free}, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 } + ]; + + $self->{maps_counters}->{global} = [ + { label => 'usage', set => { + key_values => [ { name => 'total' }, { name => 'used' } ], + closure_custom_calc => \&custom_usage_calc, + closure_custom_output => \&custom_usage_output, + closure_custom_perfdata => \&custom_usage_perfdata, + closure_custom_threshold_check => \&custom_usage_threshold, + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'vmquery' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-a -w' }, + "filter-scratch:s" => { name => 'filter_scratch', default => 'scratch' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + $self->{global} = { total => 0, used => 0 }; + #media optical media barcode robot robot robot robot side/ volume prev # of max # of create assigned first mount last mount expiration off sent off return off off + #ID partner type barcode partner host type # slot face group pool pool # pool mounts mounts cleanings datetime datetime datetime datetime datetime status offsite location datetime datetime slot ses id version description + #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + #000001 - HCART2 000001L5 - - NONE - - - --- VP-05WEEKS-EXT 9 VP-SCRATCH 1250 0 - 30/11/2012 15:30 29/02/2016 20:43 27/01/2013 17:57 02/03/2016 01:36 00/00/0000 00:00 0 - 00/00/0000 00:00 00/00/0000 00:00 - - 50 --- + #000002 - HCART2 000002L5 - XXX-NBU-XXX TLD 0 8 - 000_00000_TLD VP-SCRATCH 4 VP-05WEEKS-EXT + + # Remove header + $stdout =~ s/\x00//msg; + $stdout =~ s/^.*?----.*?\n//ms; + foreach my $line (split /\n/, $stdout) { + $line =~ /^\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\S+\s+(\S+)/; + my ($robot_host, $robot_slot, $pool) = ($1, $2, $3); + + next if ($robot_slot !~ /[0-9]/); + + $self->{global}->{total}++; + if (defined($self->{option_results}->{filter_scratch}) && $self->{option_results}->{filter_scratch} ne '' && + $pool !~ /$self->{option_results}->{filter_scratch}/i) { + $self->{global}->{used}++; + } + } + + if ($self->{global}->{total} == 0) { + $self->{output}->add_option_msg(short_msg => "No tape found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check tapes available in library. + +=over 8 + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'vmquery'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-a -w'). + +=item B<--filter-scratch> + +Filter tape scratch (Default: 'scratch'). + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'absolute'). + +=item B<--free> + +Thresholds are on free tape left. + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage'. + +=back + +=cut diff --git a/centreon-plugins/apps/backup/netbackup/local/plugin.pm b/centreon-plugins/apps/backup/netbackup/local/plugin.pm index 66a3b91e6..3c575df15 100644 --- a/centreon-plugins/apps/backup/netbackup/local/plugin.pm +++ b/centreon-plugins/apps/backup/netbackup/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( @@ -37,6 +36,7 @@ sub new { 'drive-status' => 'apps::backup::netbackup::local::mode::drivestatus', 'job-status' => 'apps::backup::netbackup::local::mode::jobstatus', 'list-policies' => 'apps::backup::netbackup::local::mode::listpolicies', + 'tape-usage' => 'apps::backup::netbackup::local::mode::tapeusage', ); return $self; diff --git a/centreon-plugins/centreon/plugins/templates/counter.pm b/centreon-plugins/centreon/plugins/templates/counter.pm index ef7961376..3bda7758b 100644 --- a/centreon-plugins/centreon/plugins/templates/counter.pm +++ b/centreon-plugins/centreon/plugins/templates/counter.pm @@ -190,13 +190,16 @@ sub run_instances { my ($self, %options) = @_; return undef if (defined($options{config}->{cb_init}) && $self->call_object_callback(method_name => $options{config}->{cb_init}) == 1); + my $display_status_lo = defined($options{display_status_long_output}) && $options{display_status_long_output} == 1 ? 1 : 0; + my $resume = defined($options{resume}) && $options{resume} == 1 ? 1 : 0; + $self->{lproblems} = 0; $self->{multiple} = 1; if (scalar(keys %{$self->{$options{config}->{name}}}) == 1) { $self->{multiple} = 0; } - if ($self->{multiple} == 1) { + if ($self->{multiple} == 1 && $resume == 0) { $self->{output}->output_add(severity => 'OK', short_msg => $options{config}->{message_multiple}); } @@ -230,6 +233,7 @@ sub run_instances { $long_msg_append = $message_separator; if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { + $self->{lproblems}++; $short_msg .= $short_msg_append . $output; $short_msg_append = $message_separator; } @@ -246,8 +250,13 @@ sub run_instances { if (defined($options{config}->{cb_suffix_output})); $suffix_output = '' if (!defined($suffix_output)); - $self->{output}->output_add(long_msg => "${prefix_output}${long_msg}${suffix_output}"); my $exit = $self->{output}->get_most_critical(status => [ @exits ]); + $self->{output}->output_add(long_msg => ($display_status_lo == 1 ? lc($exit) . ': ' : '') . "${prefix_output}${long_msg}${suffix_output}"); + if ($resume == 1) { + $self->{most_critical_instance} = $self->{output}->get_most_critical(status => [ $self->{most_critical_instance}, $exit ]); + next; + } + if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { $self->{output}->output_add(severity => $exit, short_msg => "${prefix_output}${short_msg}${suffix_output}" @@ -260,6 +269,57 @@ sub run_instances { } } +sub run_group { + my ($self, %options) = @_; + + my $multiple = 1; + if (scalar(keys %{$self->{$options{config}->{name}}}) == 1) { + $multiple = 0; + } + + if ($multiple == 1) { + $self->{output}->output_add(severity => 'OK', + short_msg => $options{config}->{message_multiple}); + } + + my ($global_exit, $total_problems) = ([], 0); + foreach my $id (sort keys %{$self->{$options{config}->{name}}}) { + $self->{most_critical_instance} = 'ok'; + if (defined($options{config}->{cb_long_output})) { + $self->{output}->output_add(long_msg => $self->call_object_callback(method_name => $options{config}->{cb_long_output}, + instance_value => $self->{$options{config}->{name}}->{$id})); + } + + foreach my $group (@{$options{config}->{group}}) { + $self->{$group->{name}} = $self->{$options{config}->{name}}->{$id}->{$group->{name}}; + + # we resume datas + $self->run_instances(config => $group, display_status_long_output => 1, resume => 1); + + push @{$global_exit}, $self->{most_critical_instance}; + $total_problems += $self->{lproblems}; + + my $prefix_output; + $prefix_output = $self->call_object_callback(method_name => $options{config}->{cb_prefix_output}, instance_value => $self->{$options{config}->{name}}->{$id}) + if (defined($options{config}->{cb_prefix_output})); + $prefix_output = '' if (!defined($prefix_output)); + + if ($multiple == 0) { + $self->{output}->output_add(severity => $self->{most_critical_instance}, + short_msg => "${prefix_output}$self->{lproblems} problem(s) detected"); + } + } + } + + if ($multiple == 1) { + my $exit = $self->{output}->get_most_critical(status => [ @{$global_exit} ]); + if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { + $self->{output}->output_add(severity => $exit, + short_msg => "$total_problems problem(s) detected"); + } + } +} + sub run { my ($self, %options) = @_; @@ -277,6 +337,8 @@ sub run { $self->run_global(config => $entry); } elsif ($entry->{type} == 1) { $self->run_instances(config => $entry); + } elsif ($entry->{type} == 2) { + $self->run_group(config => $entry); } } From 61a1b8b8946658a10ccde7b4fb5a1d736153bad2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 14 Apr 2016 15:57:02 +0200 Subject: [PATCH 147/346] + add a comment for ntp mode windows --- centreon-plugins/os/windows/local/mode/ntp.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/os/windows/local/mode/ntp.pm b/centreon-plugins/os/windows/local/mode/ntp.pm index fcb4697da..a8e327db3 100644 --- a/centreon-plugins/os/windows/local/mode/ntp.pm +++ b/centreon-plugins/os/windows/local/mode/ntp.pm @@ -99,7 +99,7 @@ sub run { } my %ntp; - + # Need to set following patch: https://rt.cpan.org/Public/Bug/Display.html?id=59607 eval { %ntp = Net::NTP::get_ntp_response($ntp_hostname, $self->{option_results}->{ntp_port}); }; From 0fb9336ce96819de4c654cd22396ea15183ea9e2 Mon Sep 17 00:00:00 2001 From: Etienne G Date: Tue, 19 Apr 2016 09:11:42 +0200 Subject: [PATCH 148/346] Get only issue type ticket Add filter on issue type --- centreon-plugins/apps/github/mode/issues.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/github/mode/issues.pm b/centreon-plugins/apps/github/mode/issues.pm index 353c52b63..0fffc26c5 100644 --- a/centreon-plugins/apps/github/mode/issues.pm +++ b/centreon-plugins/apps/github/mode/issues.pm @@ -74,7 +74,7 @@ sub check_options { $self->{output}->option_exit(); } - $self->{option_results}->{url_path} = "/search/issues?q=state:open+repo:" . $self->{option_results}->{owner} . "/" . $self->{option_results}->{repository}; + $self->{option_results}->{url_path} = "/search/issues?q=state:open+is:issue+repo:" . $self->{option_results}->{owner} . "/" . $self->{option_results}->{repository}; if (defined($self->{option_results}->{label}) && $self->{option_results}->{label} ne '') { $self->{option_results}->{url_path} .= "+label:" . $self->{option_results}->{label}; } From bcae01833ed92fc495f9afc90021ca4a923f4c0f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 19 Apr 2016 20:16:44 +0200 Subject: [PATCH 149/346] + Fix ntp protocol plugin mode offset --- centreon-plugins/apps/protocols/ntp/mode/offset.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/protocols/ntp/mode/offset.pm b/centreon-plugins/apps/protocols/ntp/mode/offset.pm index 370cdb53f..600a48ffc 100644 --- a/centreon-plugins/apps/protocols/ntp/mode/offset.pm +++ b/centreon-plugins/apps/protocols/ntp/mode/offset.pm @@ -77,7 +77,7 @@ sub run { } my $localtime = time(); - my $offset = ($ntp{'Receive Timestamp'} - $ntp{'Originate Timestamp'}) + ($ntp{'Transmit Timestamp'} - $localtime) / 2); + my $offset = (($ntp{'Receive Timestamp'} - $ntp{'Originate Timestamp'}) + ($ntp{'Transmit Timestamp'} - $localtime)) / 2; my $exit = $self->{perfdata}->threshold_check(value => $offset, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); From d555f496fd73e3397c2865f9d5c4efc219255cef Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 23 Apr 2016 18:11:57 +0200 Subject: [PATCH 150/346] + add symmetrix dmx34 plugin --- .../dmx34/local/mode/components/config.pm | 56 ++++ .../dmx34/local/mode/components/director.pm | 92 ++++++ .../dmx34/local/mode/components/directors.pm | 70 +++++ .../dmx34/local/mode/components/disk.pm | 116 ++++++++ .../local/mode/components/environment.pm | 56 ++++ .../dmx34/local/mode/components/memory.pm | 92 ++++++ .../dmx34/local/mode/components/test.pm | 60 ++++ .../dmx34/local/mode/components/xcm.pm | 75 +++++ .../symmetrix/dmx34/local/mode/hardware.pm | 281 ++++++++++++++++++ .../emc/symmetrix/dmx34/local/plugin.pm | 48 +++ 10 files changed, 946 insertions(+) create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/config.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/director.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/disk.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/environment.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/memory.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/test.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/xcm.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/plugin.pm diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/config.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/config.pm new file mode 100644 index 000000000..65812a25f --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/config.pm @@ -0,0 +1,56 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::config; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +# ---------[ Configuration Information ]--------- +# +#... +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking config"); + $self->{components}->{config} = {name => 'config', total => 0, skip => 0}; + return if ($self->check_filter(section => 'config')); + + if ($self->{content_file_health} !~ /----\[ Configuration Information(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find config'); + return ; + } + + my $content = $1; + $self->{components}->{config}->{total}++; + + # Error if not present: + # CODE OK! + if ($content !~ /CODE OK!/msi) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("problem of configuration")); + } else { + $self->{output}->output_add(long_msg => sprintf("no configuration problem detected")); + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/director.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/director.pm new file mode 100644 index 000000000..5c8fa18ae --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/director.pm @@ -0,0 +1,92 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::director; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +# ---------------[ Director Status ]------------- +# +# 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 +# +# D ON .. .. .. .. .. .. ON ON .. .. .. .. .. .. ON +# C ON .. .. .. .. .. .. ON ON .. .. .. .. .. .. ON +# B ON .. .. .. .. .. .. DD ON .. .. .. .. .. .. ON +# A ON .. .. .. .. .. .. ON ON .. .. .. .. .. .. ON +# +# Key: +# ON - Director is online +# OF - Director is offline +# OF - DA is offline +# DD - Director is in DD state +# PR - Director is in Probe mode +# NC - Director is not comunicating +# ** - Director status is unknown + +my %mapping = ( + DD => 'DD state', + PR => 'Probe mode', + NC => 'not comunicating', + '**' => 'unknown',, + OF => 'offline', + ON => 'online',, + '..' => 'not configured', +); + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking directors"); + $self->{components}->{director} = {name => 'directors', total => 0, skip => 0}; + return if ($self->check_filter(section => 'director')); + + if ($self->{content_file_health} !~ /---------------\[ Director Status(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find directors'); + return ; + } + + my $content = $1; + while ($content =~ /\s([A-Z]\s+.*?)\n/msig) { + my ($director, @nums) = split /\s+/, $1; + my $i = 0; + foreach (@nums) { + $i++; + my $state = defined($mapping{$_}) ? $mapping{$_} : 'unknown'; + my $instance = $director . '.' . $i; + + next if ($self->check_filter(section => 'director', instance => $instance)); + $self->{components}->{director}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("director '%s' state is '%s'", + $instance, $state)); + my $exit = $self->get_severity(section => 'director', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Director '%s' state is '%s'", + $instance, $state)); + } + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm new file mode 100644 index 000000000..c8a79299f --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm @@ -0,0 +1,70 @@ +# +# Copyright 2016 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::mode::components::communication; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %map_com_states = ( + 1 => 'initializing', + 2 => 'transitioning', + 3 => 'active', + 4 => 'inactive', + 5 => 'reconfiguring', + 6 => 'nonexistent', +); +my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; +my $oid_enclContactState = '.1.3.6.1.4.1.789.1.21.1.2.1.2'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_enclContactState }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking communications"); + $self->{components}->{communication} = {name => 'communications', total => 0, skip => 0}; + return if ($self->check_filter(section => 'communication')); + + for (my $i = 1; $i <= $self->{number_shelf}; $i++) { + my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; + my $com_state = $map_com_states{$self->{results}->{$oid_enclContactState}->{$oid_enclContactState . '.' . $i}}; + + next if ($self->check_filter(section => 'communication', instance => $shelf_addr)); + + $self->{components}->{communication}->{total}++; + $self->{output}->output_add(long_msg => sprintf("Shelve '%s' communication state is '%s'", + $shelf_addr, $com_state)); + my $exit = $self->get_severity(section => 'communication', value => $com_state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Shelve '%s' communication state is '%s'", + $shelf_addr, $com_state)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/disk.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/disk.pm new file mode 100644 index 000000000..01f7e9c54 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/disk.pm @@ -0,0 +1,116 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::disk; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +# ------------[ Device Information ]------------- +# +# RAID6 Configured: NO +# RAID5 Configured: NO +# RDF Configured: NO_RDF + +# Verify Volume Status +# There are 16 local devices are not ready (device(DA)):- à 0 si pas de problème +# 10000(01a) 10072(01a) 20086(01a) 1009A(01a) 200AE(01a) 100C2(01a) 100EA(01a) +# 10112(01a) 20075(01d) 10089(01d) 2009D(01d) 100B1(01d) 100C9(01d) 100F1(01d) +# 10119(01d) 20061(01d) +# +# No local devices have invalid tracks +# +# Deferred disk service is NOT enabled +# +# 8 hot spares are configured, 1 are invoked, none are not ready à none si pas de problème +# +# HotSpare 16d:D5 is invoked against 1d:D4 Time: MAR/24/16 04:48:49 à récupérer si pb +# +# No DAs have any volumes with Not Ready bit set +# +# All DAs have Write Optimize enabled +# +# No devices have TimeFinder Lock +# +# No Devices Found in Transient State + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking disks"); + $self->{components}->{disk} = {name => 'disks (1 means all)', total => 0, skip => 0}; + return if ($self->check_filter(section => 'disk')); + + if ($self->{content_file_health} !~ /----\[ Device Information(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find devices'); + return ; + } + + my $content = $1; + $self->{components}->{disk}->{total}++; + + # Error if not present: + # No local devices have invalid tracks + + if ($content !~ /No local devices have invalid tracks/msi) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("problem of invalid tracks on disks")); + } else { + $self->{output}->output_add(long_msg => sprintf("no invalid tracks on disks")); + } + + # Error if not present: + # All local devices are ready + if ($content !~ /All local devices are ready/msi) { + $content =~ /There are\s+(\S+)\s+local devices are not ready.*?\n(.*?)\n\s*\n/msi; + my ($num, $disks) = ($1, $2); + $disks =~ s/\n/ /msg; + $disks =~ s/\s+/ /msg; + $disks =~ s/^\s+//; + $self->{output}->output_add(long_msg => sprintf("problem on following disks '%s'", $disks)); + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("problem on '%s' disks", $num)); + } else { + $self->{output}->output_add(long_msg => sprintf("all devices are ready")); + } + + return if ($content !~ /(\S+) hot spares are configured, (\S+) are invoked/msi); + my ($total, $used) = ($1, $2); + $used = 0 if ($used =~ /none/i); + + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'disk', instance => '1', value => $total - $used); + + $self->{output}->output_add(long_msg => sprintf("'%s' spare disk availables on '%s'", + $total - $used, $total)); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("'%s' spare disk availables on '%s'", + $total - $used, $total)); + } + + $self->{output}->perfdata_add(label => "disk_spare_available", + value => $total - $used, + warning => $warn, + critical => $crit, min => 0, max => $total); +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/environment.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/environment.pm new file mode 100644 index 000000000..8edda26ae --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/environment.pm @@ -0,0 +1,56 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::environment; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +# -------------[ Power Information ]------------- +# +# No Environmental Problems found +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking environment"); + $self->{components}->{environment} = {name => 'environment', total => 0, skip => 0}; + return if ($self->check_filter(section => 'environment')); + + if ($self->{content_file_health} !~ /----\[ Power Information(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find environment'); + return ; + } + + my $content = $1; + $self->{components}->{environment}->{total}++; + + # Error if not present: + # No Environmental Problems found + if ($content !~ /No Environmental Problems found/msi) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("environment problem detected")); + } else { + $self->{output}->output_add(long_msg => sprintf("no environment problem detected")); + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/memory.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/memory.pm new file mode 100644 index 000000000..e36f700d8 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/memory.pm @@ -0,0 +1,92 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::memory; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +#------------[ Memory Information ]------------- +# +# Memory Size: 80 GB +# Cache start Addr: 00088000 (Hex) +# Cache start Bank: 00000022 (Hex) +# Cache last Addr: 01400000 (Hex) +# Cache last Bank: 000004FF (Hex) +# +# Board Number M0 M1 M2 M3 M4 M5 M6 M7 +# Slot Number 10 11 12 13 14 15 16 17 +# ---------------------------------------------------------- +# Size (GB) 16 16 16 16 8 8 .. .. +# Mode OPER OPER OPER OPER OPER OPER .. .. +# Status OK OK OK OK OK OK .. .. +# +# Status Key +# OK - Board is operating normally + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking memory"); + $self->{components}->{memory} = {name => 'memory', total => 0, skip => 0}; + return if ($self->check_filter(section => 'memory')); + + if ($self->{content_file_health} !~ /----\[ Memory Information(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find memory'); + return ; + } + + my $content = $1; + + $content =~ /Board Number\s+(.*?)\n/msi; + my @board_numbers = split /\s+/, $1; + + $content =~ /Slot Number\s+(.*?)\n/msi; + my @slot_numbers = split /\s+/, $1; + + $content =~ /Mode\s+(.*?)\n/msi; + my @modes = split /\s+/, $1; + + $content =~ /Status\s+(.*?)\n/msi; + my @status = split /\s+/, $1; + + my $i = -1; + foreach my $name (@board_numbers) { + $i++; + my $instance = $name . '#' . $slot_numbers[$i]; + my $state = $modes[$i] . '/' . $status[$i]; + + next if ($self->check_filter(section => 'memory', instance => $instance)); + $self->{components}->{memory}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("memory '%s' state is '%s'", + $instance, $state)); + my $exit = $self->get_severity(section => 'memory', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Memory '%s' state is '%s'", + $instance, $state)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/test.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/test.pm new file mode 100644 index 000000000..09f9b05fa --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/test.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::test; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +#--------------[ Director Tests ]--------------- +# +# No offline pending DAs are present +# 1C test: All Directors Passed +# F2,SAME,,,EE test: All Directors Passed +# EE test: All Directors Passed +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking test"); + $self->{components}->{test} = {name => 'test', total => 0, skip => 0}; + return if ($self->check_filter(section => 'test')); + + if ($self->{content_file_health} !~ /----\[ Director Tests(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find tests'); + return ; + } + + my $content = $1; + $self->{components}->{test}->{total}++; + + foreach (('No offline pending DAs are present', '1C test: All Directors Passed', + 'F2,SAME,,,EE test: All Directors Passed', 'EE test: All Directors Passed')) { + if ($content !~ /$_/msi) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("test problem detected")); + } else { + $self->{output}->output_add(long_msg => sprintf("%s", $_)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/xcm.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/xcm.pm new file mode 100644 index 000000000..21b4c0505 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/xcm.pm @@ -0,0 +1,75 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::components::xcm; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +# --------------[ XCM Information ]-------------- +# +#XCM/ECM/CCM status +# XCM0 XCM1 +# EMUL EMUL +# +#Message Bus status + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking xcm"); + $self->{components}->{xcm} = {name => 'xcm', total => 0, skip => 0}; + return if ($self->check_filter(section => 'xcm')); + + if ($self->{content_file_health} !~ /----\[ XCM Information(.*?)----\[/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find xcm'); + return ; + } + + my $content = $1; + + if ($content =~ /XCM\/ECM\/CCM status\s*\n\s*(.*?)\n\s*(.*?)\n\s*\n/msig) { + my @names = split /\s+/, $1; + my @status = split /\s+/, $2; + + my $i = -1; + foreach my $name (@names) { + $i++; + my $instance = $name; + my $state = $status[$i]; + + next if ($self->check_filter(section => 'xcm', instance => $instance)); + $self->{components}->{xcm}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("xcm '%s' state is '%s'", + $instance, $state)); + my $exit = $self->get_severity(section => 'xcm', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("XCM '%s' state is '%s'", + $instance, $state)); + } + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm new file mode 100644 index 000000000..be3fcab6d --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -0,0 +1,281 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; +use centreon::plugins::misc; +use centreon::plugins::statefile; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_numeric_check_section_option} = '^(disk)$'; + + $self->{cb_hook1} = 'read_files'; + $self->{cb_hook4} = 'send_email'; + + $self->{thresholds} = { + director => [ + ['DD state', 'CRITICAL'], + ['Probe mode', 'CRITICAL'], + ['not comunicating', 'CRITICAL'], + ['unknown', 'CRITICAL'], + ['offline', 'OK'], + ['online', 'OK'], + ['not configured', 'OK'], + ], + xcm => [ + ['emul', 'OK'], + ['.*', 'CRITICAL'], + ], + memory => [ + ['OPER/OK', 'OK'], + ['\.\./.*', 'OK'], + ['.*', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'storage::emc::symmetrix::dmx34::local::mode::components'; + $self->{components_module} = ['director', 'xcm', 'disk', 'memory', 'config', 'environment', 'test']; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->{statefile_cache}->check_options(%options); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "file-health:s" => { name => 'file_health' }, + "file-health-env:s" => { name => 'file_health_env' }, + # Email + "email-warning:s" => { name => 'email_warning' }, + "email-critical:s" => { name => 'email_critical' }, + "email-smtp-host:s" => { name => 'email_smtp_host' }, + "email-smtp-username:s" => { name => 'email_smtp_username' }, + "email-smtp-password:s" => { name => 'email_smtp_password' }, + "email-smtp-from:s" => { name => 'email_smtp_from' }, + "email-smtp-options:s@" => { name => 'email_smtp_options' }, + "email-memory" => { name => 'email_memory' }, + }); + + $self->{statefile_cache} = centreon::plugins::statefile->new(%options); + $self->{components_exec_load} = 0; + return $self; +} + +sub read_files { + my ($self, %options) = @_; + + if (!defined($self->{option_results}->{file_health}) || !defined($self->{option_results}->{file_health_env})) { + $self->{output}->add_option_msg(short_msg => "Please set option --file-health and --file-health-env."); + $self->{output}->option_exit(); + } + $self->{content_file_health} = do { + local $/ = undef; + if (!open my $fh, "<", $self->{option_results}->{file_health}) { + $self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{file_health} : $!"); + $self->{output}->option_exit(); + } + <$fh>; + }; + + # We remove color syntax + $self->{content_file_health} =~ s/\x{1b}\[.*?m|\r//msg; + + # ***************************************************************** + #* Health Check Run From Scheduler Version 2.0 * + #* * + #* Serial: 000290103984 Run Time: 03/24/2016 12:27:07 * + #* Run Type: FULL Code Level: 5773-184-130 * + #***************************************************************** + + my ($serial, $site) = ('unknown', 'unknown'); + $serial = $1 if ($self->{content_file_health} =~ /Serial:\s*(\S+)/msi); + + $self->{output}->output_add(long_msg => sprintf('serial number: %s, site name: %s', $serial, $site)); +} + +# +# maybe we should add it in core (with cleaner code ;) +# + +sub send_email { + my ($self, %options) = @_; + + ####### + # Check SMTP options + return if (!((defined($self->{option_results}->{email_warning}) && $self->{option_results}->{email_warning} ne '') + || (defined($self->{option_results}->{email_critical}) && $self->{option_results}->{email_critical} ne ''))); + + if (!defined($self->{option_results}->{email_smtp_host})) { + $self->{output}->add_option_msg(short_msg => "Please set the --email-smtp-host option"); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{email_smtp_from})) { + $self->{output}->add_option_msg(short_msg => "Please set --email-smtp-from option"); + $self->{output}->option_exit(); + } + + my %smtp_options = ('-auth' => 'none'); + if (defined($self->{option_results}->{email_smtp_username}) && $self->{option_results}->{email_smtp_username} ne '') { + $smtp_options{-login} = $self->{option_results}->{email_smtp_username}; + delete $smtp_options{-auth}; + } + if (defined($self->{option_results}->{email_smtp_username}) && defined($self->{option_results}->{email_smtp_password})) { + $smtp_options{-pass} = $self->{option_results}->{email_smtp_password}; + } + foreach my $option (@{$self->{option_results}->{smtp_options}}) { + next if ($option !~ /^(.+?)=(.+)$/); + $smtp_options{-$1} = $2; + } + + ####### + # Get current data + my $stdout; + { + local *STDOUT; + open STDOUT, '>', \$stdout; + $self->{output}->display(force_long_output => 1); + } + + $stdout =~ /^(.*?)(\||\n)/msi; + my $subject = $1; + my $status = lc($self->{output}->get_litteral_status()); + + my $send_email = 0; + $send_email = 1 if ($status ne 'ok'); + ####### + # Check memory file + if (defined($self->{option_results}->{email_memory})) { + $self->{new_datas} = { status => $status, output => $subject }; + $self->{statefile_cache}->read(statefile => "cache_emc_symmetrix_dmx34_email"); + my $prev_status = $self->{statefile_cache}->get(name => 'status'); + my $prev_output = $self->{statefile_cache}->get(name => 'output'); + # non-ok output is the same + $send_email = 0 if ($status ne 'ok' && defined($prev_output) && $prev_output eq $subject); + # recovery email + $send_email = 1 if ($status eq 'ok' && defined($prev_status) && $prev_status ne 'ok'); + } + + my $smtp_to = ''; + $smtp_to = $self->{option_results}->{email_warning} if ($status eq 'warning' && defined($self->{option_results}->{email_warning} && $self->{option_results}->{email_warning}) ne ''); + $smtp_to = $self->{option_results}->{email_critical} if ($status eq 'critical' && defined($self->{option_results}->{email_critical} && $self->{option_results}->{email_critical}) ne ''); + if ($send_email == 1 && $status eq 'ok') { + my $append = ''; + foreach (('email_warning', 'email_critical')) { + if (defined($self->{option_results}->{$_}) && $self->{option_results}->{$_} ne '') { + $smtp_to .= $append . $self->{option_results}->{$_}; + $append .= ','; + } + } + } + + if ($send_email == 0) { + $self->{output}->add_option_msg(severity => 'OK', short_msg => "No email to send"); + return ; + } + + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Email::Send::SMTP::Gmail', + error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'."); + my ($mail, $error) = Email::Send::SMTP::Gmail->new(-smtp => $self->{option_results}->{email_smtp_host}, + %smtp_options); + if ($mail == -1) { + $self->{output}->add_option_msg(short_msg => "session error: " . $error); + $self->{output}->option_exit(); + } + my $result = $mail->send(-to => $smtp_to, + -from => $self->{option_results}->{email_smtp_from}, + -subject => $subject, + -body => $stdout, + -attachments => $self->{option_results}->{file_health_env}); + $mail->bye(); + if ($result == -1) { + $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); + } else { + $self->{output}->add_option_msg(severity => 'OK', short_msg => "email sent"); + } +} + +1; + +__END__ + +=head1 MODE + +Check hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'director', 'xcm', 'disk', 'memory', 'config', 'environment', 'test' + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=director --filter=xcm) +Can also exclude specific instance: --filter=director,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='director,CRITICAL,^(?!(online)$)' + +=item B<--warning> + +Set warning threshold for disk (syntax: type,regexp,threshold) +Example: --warning='disk,.*,5:' + +=item B<--critical> + +Set critical threshold for disk (syntax: type,regexp,threshold) +Example: --critical='disk,.*,3:' + +=item B<--file-health> + +The location of the global storage file status (Should be something like: C:/xxxx/HealthCheck.log). + +=item B<--file-health-env> + +The location of the environment storage file status (Should be something like: C:/xxxx/HealthCheck_ENV.log). + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/plugin.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/plugin.pm new file mode 100644 index 000000000..366220252 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::emc::symmetrix::dmx34::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'hardware' => 'storage::emc::symmetrix::dmx34::local::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check symmetrix DMX 3 and 4. The plugin needs to be installed on Windows Management. + +=cut From edbfa03d1cd6456264833e196cc9fa79fa8c131f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 23 Apr 2016 18:13:29 +0200 Subject: [PATCH 151/346] + remove file --- .../dmx34/local/mode/components/directors.pm | 70 ------------------- 1 file changed, 70 deletions(-) delete mode 100644 centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm deleted file mode 100644 index c8a79299f..000000000 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/components/directors.pm +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright 2016 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::mode::components::communication; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -my %map_com_states = ( - 1 => 'initializing', - 2 => 'transitioning', - 3 => 'active', - 4 => 'inactive', - 5 => 'reconfiguring', - 6 => 'nonexistent', -); -my $oid_enclChannelShelfAddr = '.1.3.6.1.4.1.789.1.21.1.2.1.3'; -my $oid_enclContactState = '.1.3.6.1.4.1.789.1.21.1.2.1.2'; - -sub load { - my ($self) = @_; - - push @{$self->{request}}, { oid => $oid_enclContactState }; -} - -sub check { - my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking communications"); - $self->{components}->{communication} = {name => 'communications', total => 0, skip => 0}; - return if ($self->check_filter(section => 'communication')); - - for (my $i = 1; $i <= $self->{number_shelf}; $i++) { - my $shelf_addr = $self->{shelf_addr}->{$oid_enclChannelShelfAddr . '.' . $i}; - my $com_state = $map_com_states{$self->{results}->{$oid_enclContactState}->{$oid_enclContactState . '.' . $i}}; - - next if ($self->check_filter(section => 'communication', instance => $shelf_addr)); - - $self->{components}->{communication}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Shelve '%s' communication state is '%s'", - $shelf_addr, $com_state)); - my $exit = $self->get_severity(section => 'communication', value => $com_state); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Shelve '%s' communication state is '%s'", - $shelf_addr, $com_state)); - } - } -} - -1; From fc60c627bc3f43231213aaa0615c88a2957b5c5c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 23 Apr 2016 18:43:38 +0200 Subject: [PATCH 152/346] + add callback --- centreon-plugins/centreon/plugins/templates/hardware.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/centreon-plugins/centreon/plugins/templates/hardware.pm b/centreon-plugins/centreon/plugins/templates/hardware.pm index 0c16369fe..d01a5e600 100644 --- a/centreon-plugins/centreon/plugins/templates/hardware.pm +++ b/centreon-plugins/centreon/plugins/templates/hardware.pm @@ -39,6 +39,7 @@ sub set_system { #$self->{cb_hook1} = 'callbackname'; # before the loads #$self->{cb_hook2} = 'callbackname'; # between loads and requests #$self->{cb_hook3} = 'callbackname'; # after requests + #$self->{cb_hook4} = 'callbackname'; # after output # Example for threshold: #$self->{thresholds} = { @@ -283,6 +284,8 @@ sub run { short_msg => 'No components are checked.'); } + $self->call_object_callback(method_name => $self->{cb_hook4}, %options); + $self->{output}->display(); $self->{output}->exit(); } From 869a335816189a491c56a30e0cea43e28d2ac6a2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 23 Apr 2016 18:54:50 +0200 Subject: [PATCH 153/346] + fix help --- centreon-plugins/apps/protocols/smtp/mode/message.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/protocols/smtp/mode/message.pm b/centreon-plugins/apps/protocols/smtp/mode/message.pm index 41665455b..db8857c56 100644 --- a/centreon-plugins/apps/protocols/smtp/mode/message.pm +++ b/centreon-plugins/apps/protocols/smtp/mode/message.pm @@ -113,7 +113,7 @@ Check send a message to a SMTP Server. =item B<--hostname> -IP Addr/FQDN of the ftp host +IP Addr/FQDN of the smtp host =item B<--port> From 9e56f407cc1b9dffe96234c186fc1bc5ccb7c6f5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sat, 23 Apr 2016 20:17:13 +0200 Subject: [PATCH 154/346] + fix option smtp --- .../storage/emc/symmetrix/dmx34/local/mode/hardware.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm index be3fcab6d..f2667401b 100644 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -131,7 +131,7 @@ sub read_files { sub send_email { my ($self, %options) = @_; - + ####### # Check SMTP options return if (!((defined($self->{option_results}->{email_warning}) && $self->{option_results}->{email_warning} ne '') @@ -154,7 +154,7 @@ sub send_email { if (defined($self->{option_results}->{email_smtp_username}) && defined($self->{option_results}->{email_smtp_password})) { $smtp_options{-pass} = $self->{option_results}->{email_smtp_password}; } - foreach my $option (@{$self->{option_results}->{smtp_options}}) { + foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { next if ($option !~ /^(.+?)=(.+)$/); $smtp_options{-$1} = $2; } From 5feec8eb748c874033e0ab32d134ea168e1643ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duret?= Date: Tue, 26 Apr 2016 09:04:09 +0200 Subject: [PATCH 155/346] =?UTF-8?q?Probl=C3=A8me=20avec=20la=20gestion=20d?= =?UTF-8?q?es=20seuils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: on comparait le timestamp avec les seuils alors qu'il faut comparer la différence (timestamp - localtime) --- centreon-plugins/database/postgres/mode/timesync.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/database/postgres/mode/timesync.pm b/centreon-plugins/database/postgres/mode/timesync.pm index 2da789d90..94b3bb798 100644 --- a/centreon-plugins/database/postgres/mode/timesync.pm +++ b/centreon-plugins/database/postgres/mode/timesync.pm @@ -74,7 +74,7 @@ SELECT extract(epoch FROM now()) AS epok } my $diff = $result - $ltime; - my $exit_code = $self->{perfdata}->threshold_check(value => $result, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my $exit_code = $self->{perfdata}->threshold_check(value => $diff, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); $self->{output}->output_add(severity => $exit_code, short_msg => sprintf("%.3fs time diff between servers", $diff)); From e73da47373e84db808fa796f5e2be4bb6387bff7 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 27 Apr 2016 22:41:17 +0200 Subject: [PATCH 156/346] + enhance tablespaceusage.pm mode + return used and free (use --filter-perfdata if needed) + add possibility to use regex as tablespace filter + counter template used https://github.com/centreon/centreon-plugins/issues/387 --- .../database/oracle/mode/tablespaceusage.pm | 162 ++++++++---------- 1 file changed, 73 insertions(+), 89 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index f751d6d67..f3b2042d9 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -20,11 +20,48 @@ package database::oracle::mode::tablespaceusage; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max_absolute}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used_absolute}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free_absolute}); + + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used_absolute}, + $total_free_value . " " . $total_free_unit, 100 - $self->{result_values}->{prct_used_absolute}); + return $msg; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'tablespace', type => 1, cb_prefix_output => 'prefix_tablespace_output', message_multiple => 'All tablespaces are OK' }, + ]; + + $self->{maps_counters}->{tablespace} = [ + { label => 'tablespace', set => { + key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'max' }, { name => 'display' } ], + closure_custom_output => $self->can('custom_usage_output'), + threshold_use => 'prct_used_absolute', + perfdatas => [ + { label => 'used', value => 'used_absolute', template => '%s', + unit => 'B', min => 0, max => 'max_absolute', label_extra_instance => 1, instance_use => 'display_absolute' }, + { label => 'free', value => 'free_absolute', template => '%s', + unit => 'B', min => 0, max => 'max_absolute', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -33,39 +70,24 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - "filter:s" => { name => 'filter', }, - "skip:s" => { name => 'skip', }, - "free" => { name => 'free', }, + "filter-tablespace:s" => { name => 'filter_tablespace' }, + "skip" => { name => 'skip' }, }); - return $self; } -sub check_options { +sub prefix_tablespace_output { my ($self, %options) = @_; - $self->SUPER::init(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } + return "Tablespace '" . $options{instance_value}->{display} . "' "; } -sub run { +sub manage_selection { my ($self, %options) = @_; # $options{sql} = sqlmode object $self->{sql} = $options{sql}; - - $self->{output}->output_add(severity => 'OK', - short_msg => "All tablespaces are ok."); - $self->{sql}->connect(); + my $query; if ($self->{sql}->is_version_minimum(version => '11')) { $query = q{ @@ -276,75 +298,41 @@ sub run { $self->{sql}->query(query => $query); my $result = $self->{sql}->fetchall_arrayref(); - foreach my $row (@$result) { - my ($name, $status, $type, $extentmgmt, $bytes, $bytes_max, $bytes_free) = @$row; - next if (defined($self->{option_results}->{filter}) && $name !~ /$self->{option_results}->{filter}/); - next if (defined($self->{option_results}->{skip}) && $status =~ /offline/i); + $self->{tablespace} = {}; + foreach my $row (@$result) { + my ($name, $status, $type, $extentmgmt, $bytes, $bytes_max) = @$row; + my $bytes_free = defined($bytes_max) ? $bytes_max - $bytes : -1; if (!defined($bytes)) { # seems corrupted, cannot get value - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("tbs '%s' cannot get data", $name)); + $self->{output}->output_add(long_msg => sprintf("tbs '%s' cannot get data", $name), debug => 1); next; } - $status = lc $status; - $type = lc $type; - my ($percent_used, $percent_free, $used, $free, $size); - if ($self->{sql}->is_version_minimum(version => '11')) { - $percent_used = $bytes / $bytes_max * 100; - $size = $bytes_max; - $free = $bytes_max - $bytes; - $used = $bytes; - } elsif ((!defined($bytes_max)) || ($bytes_max == 0)) { - $percent_used = ($bytes - $bytes_free) / $bytes * 100; - $size = $bytes; - $free = $bytes_free; - $used = $size - $free; - } else { - $percent_used = ($bytes - $bytes_free) / $bytes_max * 100; - $size = $bytes_max; - $free = $bytes_free + ($bytes_max - $bytes); - $used = $size - $free; + if (defined($self->{option_results}->{filter_tablespace}) && $self->{option_results}->{filter_tablespace} ne '' && + $name !~ /$self->{option_results}->{filter_tablespace}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + next; } - $percent_free = 100 - $percent_used; - my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $used); - my ($free_value, $free_unit) = $self->{perfdata}->change_bytes(value => $free); - my ($size_value, $size_unit) = $self->{perfdata}->change_bytes(value => $size); - $self->{output}->output_add(long_msg => sprintf("tbs '%s' Used: %.2f%s (%.2f%%) Free: %.2f%s (%.2f%%) Size: %.2f%s", - $name, $used_value, $used_unit, $percent_used, $free_value, $free_unit, $percent_free, $size_value, $size_unit)); - - if (defined($self->{option_results}->{free})) { - my $exit_code = $self->{perfdata}->threshold_check(value => $percent_free, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("tbs '%s' Free: %.2f%s (%.2f%%) Size: %.2f%s", $name, $free_value, $free_unit, $percent_free, $size_value, $size_unit)); - } - $self->{output}->perfdata_add(label => sprintf("tbs_%s_free",lc $name), - unit => 'B', - value => $free, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $size, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $size, cast_int => 1), - min => 0, - max => $size); - } else { - my $exit_code = $self->{perfdata}->threshold_check(value => $percent_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("tbs '%s' Used: %.2f%s (%.2f%%) Size: %.2f%s", $name, $used_value, $used_unit, $percent_used, $size_value, $size_unit)); - } - $self->{output}->perfdata_add(label => sprintf("tbs_%s_usage",lc $name), - unit => 'B', - value => $used, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $size, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $size, cast_int => 1), - min => 0, - max => $size); + if (defined($self->{option_results}->{skip}) && $status eq 'OFFLINE') { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': tbs is offline", debug => 1); + next; } + $self->{output}->output_add(long_msg => sprintf("tbs '%s' status '%s' type '%s' extent '%s' used:'%i' max:'%i'", + $name, $status, $type, $extentmgmt, $bytes, $bytes_max), + debug => 1); + if (!defined($bytes)) { + # seems corrupted, cannot get value + $self->{output}->output_add(long_msg => sprintf("tbs '%s' cannot get data", $name), debug => 1); + next; + } + $self->{tablespace}->{$name} = { used => $bytes, + free => $bytes_free, + max => defined($bytes_max) ? $bytes_max : 0, + prct_used => ($bytes/$bytes_max*100), + display => $name }; } - $self->{output}->display(); - $self->{output}->exit(); } 1; @@ -357,26 +345,22 @@ Check Oracle tablespaces usage. =over 8 -=item B<--warning> +=item B<--warning-tablespace> Threshold warning. -=item B<--critical> +=item B<--critical-tablespace> Threshold critical. -=item B<--filter> +=item B<--filter-tablespace> -Filter tablespace. +Filter tablespace by name. Can be a regex =item B<--skip> Skip offline tablespaces. -=item B<--free> - -Check free space instead of used space. - =back =cut From 3e7ff67e2dc91ec9daf570917ad38074c36854cc Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 2 May 2016 18:12:23 +0200 Subject: [PATCH 157/346] + fix little mistype on filters https://github.com/centreon/centreon-plugins/issues/383 --- centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm index 29bb881e2..b80f8309e 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm @@ -406,7 +406,7 @@ sub manage_selection { my $bssid = join('.', unpack('C*', $result2->{nUserApBSSID})); next if (defined($self->{option_results}->{filter_ip_address}) && $self->{option_results}->{filter_ip_address} ne '' && $map_ap{$bssid}->{ip} !~ /$self->{option_results}->{filter_ip_address}/); - next if (defined($self->{option_results}->{filter_ip_address}) && $self->{option_results}->{filter_ip_address} ne '' && + next if (defined($self->{option_results}->{filter_essid}) && $self->{option_results}->{filter_essid} ne '' && $map_ap{$bssid}->{essid} !~ /$self->{option_results}->{filter_essid}/); $self->{ap_selected}->{$bssid} = { users => 0, bssid => $bssid } if (!defined($self->{ap_selected}->{$bssid})); From 245c86f2457217c87e677c3f15f9a130d8d3a5fa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 2 May 2016 21:04:46 +0200 Subject: [PATCH 158/346] Fix #392 --- centreon-plugins/snmp_standard/mode/uptime.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/uptime.pm b/centreon-plugins/snmp_standard/mode/uptime.pm index debe77f5b..f2fda5626 100644 --- a/centreon-plugins/snmp_standard/mode/uptime.pm +++ b/centreon-plugins/snmp_standard/mode/uptime.pm @@ -25,6 +25,7 @@ use base qw(centreon::plugins::mode); use strict; use warnings; use POSIX; +use centreon::plugins::misc; sub new { my ($class, %options) = @_; @@ -36,7 +37,6 @@ sub new { { "warning:s" => { name => 'warning', }, "critical:s" => { name => 'critical', }, - "seconds" => { name => 'seconds', }, "force-oid:s" => { name => 'force_oid', }, }); @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # To be used first for OS @@ -89,8 +88,8 @@ sub run { min => 0); $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("System uptime is: %s", - defined($self->{option_results}->{seconds}) ? floor($value / 100) . " seconds" : floor($value / 86400 / 100) . " days" )); + short_msg => sprintf("System uptime is: %s", + centreon::plugins::misc::change_seconds(value => floor($value / 100)))); $self->{output}->display(); $self->{output}->exit(); @@ -114,10 +113,6 @@ Threshold warning in seconds. Threshold critical in seconds. -=item B<--seconds> - -Display uptime in seconds. - =item B<--force-oid> Can choose your oid (numeric format only). From 35d6507fc30f69053e74068d4bf1924248c78b22 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 2 May 2016 21:06:27 +0200 Subject: [PATCH 159/346] + Fix #380 --- centreon-plugins/centreon/plugins/misc.pm | 8 +++++--- centreon-plugins/centreon/plugins/script.pm | 5 +++-- centreon-plugins/centreon/plugins/script_custom.pm | 4 ++-- centreon-plugins/centreon/plugins/script_simple.pm | 4 ++-- centreon-plugins/centreon/plugins/script_snmp.pm | 4 ++-- centreon-plugins/centreon/plugins/script_sql.pm | 4 ++-- centreon-plugins/centreon/plugins/script_wsman.pm | 4 ++-- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/centreon-plugins/centreon/plugins/misc.pm b/centreon-plugins/centreon/plugins/misc.pm index 13e8377cb..1a1086c21 100644 --- a/centreon-plugins/centreon/plugins/misc.pm +++ b/centreon-plugins/centreon/plugins/misc.pm @@ -214,11 +214,13 @@ sub unix_execute { sub mymodule_load { my (%options) = @_; my $file; - ($file = $options{module} . ".pm") =~ s{::}{/}g; - + ($file = ($options{module} =~ /\.pm$/ ? $options{module} : $options{module} . ".pm")) =~ s{::}{/}g; + eval { local $SIG{__DIE__} = 'IGNORE'; require $file; + $file =~ s{/}{::}g; + $file =~ s/\.pm$//; }; if ($@) { return 1 if (defined($options{no_quit}) && $options{no_quit} == 1); @@ -226,7 +228,7 @@ sub mymodule_load { $options{output}->add_option_msg(short_msg => $options{error_msg}); $options{output}->option_exit(); } - return 0; + return wantarray ? (0, $file) : 0; } sub backtick { diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index eba9379e6..39b1f053c 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -273,8 +273,9 @@ sub run { $self->check_relaunch(); - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{plugin}, - error_msg => "Cannot load module --plugin."); + (undef, $self->{plugin}) = + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{plugin}, + error_msg => "Cannot load module --plugin."); my $plugin = $self->{plugin}->new(options => $self->{options}, output => $self->{output}); $plugin->init(help => $self->{help}, version => $self->{version}); diff --git a/centreon-plugins/centreon/plugins/script_custom.pm b/centreon-plugins/centreon/plugins/script_custom.pm index b7b122acf..92e1672db 100644 --- a/centreon-plugins/centreon/plugins/script_custom.pm +++ b/centreon-plugins/centreon/plugins/script_custom.pm @@ -115,8 +115,8 @@ sub init { error_msg => "Cannot load module --mode."); $self->{mode} = $self->{modes}{$self->{mode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name}); } elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') { - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, - error_msg => "Cannot load module --dyn-mode."); + (undef, $self->{dynmode_name}) = centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, + error_msg => "Cannot load module --dyn-mode."); $self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name}); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option."); diff --git a/centreon-plugins/centreon/plugins/script_simple.pm b/centreon-plugins/centreon/plugins/script_simple.pm index 7d0b4c23b..208a5ece5 100644 --- a/centreon-plugins/centreon/plugins/script_simple.pm +++ b/centreon-plugins/centreon/plugins/script_simple.pm @@ -86,8 +86,8 @@ sub init { error_msg => "Cannot load module --mode."); $self->{mode} = $self->{modes}{$self->{mode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name}); } elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') { - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, - error_msg => "Cannot load module --dyn-mode."); + (undef, $self->{dynmode_name}) = centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, + error_msg => "Cannot load module --dyn-mode."); $self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name}); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option."); diff --git a/centreon-plugins/centreon/plugins/script_snmp.pm b/centreon-plugins/centreon/plugins/script_snmp.pm index d07470a0e..d04dbb017 100644 --- a/centreon-plugins/centreon/plugins/script_snmp.pm +++ b/centreon-plugins/centreon/plugins/script_snmp.pm @@ -91,8 +91,8 @@ sub init { error_msg => "Cannot load module --mode."); $self->{mode} = $self->{modes}{$self->{mode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name}); } elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') { - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, - error_msg => "Cannot load module --dyn-mode."); + (undef, $self->{dynmode_name}) = centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, + error_msg => "Cannot load module --dyn-mode."); $self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name}); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option."); diff --git a/centreon-plugins/centreon/plugins/script_sql.pm b/centreon-plugins/centreon/plugins/script_sql.pm index 57bd0522e..bce150a78 100644 --- a/centreon-plugins/centreon/plugins/script_sql.pm +++ b/centreon-plugins/centreon/plugins/script_sql.pm @@ -107,8 +107,8 @@ sub init { error_msg => "Cannot load module --mode."); $self->{mode} = $self->{modes}{$self->{mode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name}); } elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') { - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, - error_msg => "Cannot load module --dyn-mode."); + (undef, $self->{dynmode_name}) = centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, + error_msg => "Cannot load module --dyn-mode."); $self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name}); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option."); diff --git a/centreon-plugins/centreon/plugins/script_wsman.pm b/centreon-plugins/centreon/plugins/script_wsman.pm index 5d6697fe8..f4734d205 100644 --- a/centreon-plugins/centreon/plugins/script_wsman.pm +++ b/centreon-plugins/centreon/plugins/script_wsman.pm @@ -91,8 +91,8 @@ sub init { error_msg => "Cannot load module --mode."); $self->{mode} = $self->{modes}{$self->{mode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name}); } elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') { - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, - error_msg => "Cannot load module --dyn-mode."); + (undef, $self->{dynmode_name}) = centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name}, + error_msg => "Cannot load module --dyn-mode."); $self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name}); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option."); From c18c32245bdb50d349a2ca187dfe725ddac21f78 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 2 May 2016 21:06:44 +0200 Subject: [PATCH 160/346] + typo code style --- .../dell/compellent/local/mode/volumeusage.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm index 0cdcc0830..8da5629ab 100644 --- a/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm +++ b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm @@ -37,10 +37,10 @@ sub set_counters { $self->{maps_counters}->{sc} = [ { label => 'sc-total', set => { key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' }, { name => 'type' } ], - closure_custom_calc => \&custom_usage_calc, - closure_custom_output => \&custom_usage_output, - closure_custom_perfdata => \&custom_usage_perfdata, - closure_custom_threshold_check => \&custom_usage_threshold, + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), } }, ]; @@ -48,10 +48,10 @@ sub set_counters { $self->{maps_counters}->{volume} = [ { label => 'volume-usage', set => { key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' }, { name => 'type' } ], - closure_custom_calc => \&custom_usage_calc, - closure_custom_output => \&custom_usage_output, - closure_custom_perfdata => \&custom_usage_perfdata, - closure_custom_threshold_check => \&custom_usage_threshold, + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), } }, { label => 'volume-overhead', set => { From b8126497a3b2c73612a3e4b7c73f5ba2f6a6cf8a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 2 May 2016 21:21:15 +0200 Subject: [PATCH 161/346] + enhance output for aruba (can manage an error if no ap associated) --- .../centreon/common/airespace/snmp/mode/apstatus.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm index 0034f233a..9fca60b16 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apstatus.pm @@ -149,7 +149,7 @@ sub check_options { sub skip_global { my ($self, %options) = @_; - scalar(keys %{$self->{ap}}) > 1 ? return(0) : return(1); + scalar(keys %{$self->{ap}}) == 1 ? return(1) : return(0); } sub prefix_ap_output { @@ -208,7 +208,7 @@ sub manage_selection { my $result3 = $options{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{ $mapping3->{bsnAPAdminStatus}->{oid} }, instance => $instance); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $result->{bsnAPName} !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $result->{bsnAPName} . "': no matching filter.", debug => 1); + $self->{output}->output_add(long_msg => "skipping '" . $result->{bsnAPName} . "': no matching filter.", debug => 1); next; } @@ -220,8 +220,7 @@ sub manage_selection { } if (scalar(keys %{$self->{ap}}) <= 0) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'No AP associated (can be: slave wireless controller or your filter)'); + $self->{output}->output_add(long_msg => 'no AP associated (can be: slave wireless controller or your filter)'); } } From 90d2141c8829360082f083245e7222ec9fd587a2 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 2 May 2016 21:43:12 +0200 Subject: [PATCH 162/346] + Add possibilities to tablespaceusage mode --- .../database/oracle/mode/tablespaceusage.pm | 148 ++++++++++++++---- 1 file changed, 117 insertions(+), 31 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index f3b2042d9..724ba843f 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -25,19 +25,7 @@ use base qw(centreon::plugins::templates::counter); use strict; use warnings; -sub custom_usage_output { - my ($self, %options) = @_; - - my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max_absolute}); - my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used_absolute}); - my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free_absolute}); - - my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", - $total_size_value . " " . $total_size_unit, - $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used_absolute}, - $total_free_value . " " . $total_free_unit, 100 - $self->{result_values}->{prct_used_absolute}); - return $msg; -} +my $instance_mode; sub set_counters { my ($self, %options) = @_; @@ -62,6 +50,77 @@ sub set_counters { ]; } +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = $self->{result_values}->{display} . '_used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = $self->{result_values}->{display} . '_free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label = + critical => $self->{perfdata}->get_perfdata_for_output(label + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_resul + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{opt + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { labe}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self-> + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self-> + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self-> + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_us + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_fr + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}-> + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + # snapshot can be over 100% + if ($self->{result_values}->{free} < 0) { + $self->{result_values}->{free} = 0; + $self->{result_values}->{prct_free} = 0; + } + + return 0; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -71,6 +130,8 @@ sub new { $options{options}->add_options(arguments => { "filter-tablespace:s" => { name => 'filter_tablespace' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, "skip" => { name => 'skip' }, }); return $self; @@ -82,6 +143,13 @@ sub prefix_tablespace_output { return "Tablespace '" . $options{instance_value}->{display} . "' "; } +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; +} + sub manage_selection { my ($self, %options) = @_; # $options{sql} = sqlmode object @@ -301,35 +369,45 @@ sub manage_selection { $self->{tablespace} = {}; foreach my $row (@$result) { - my ($name, $status, $type, $extentmgmt, $bytes, $bytes_max) = @$row; - my $bytes_free = defined($bytes_max) ? $bytes_max - $bytes : -1; - if (!defined($bytes)) { - # seems corrupted, cannot get value - $self->{output}->output_add(long_msg => sprintf("tbs '%s' cannot get data", $name), debug => 1); - next; - } + my ($name, $status, $type, $extentmgmt, $bytes, $bytes_max, $bytes_free) = @$row; if (defined($self->{option_results}->{filter_tablespace}) && $self->{option_results}->{filter_tablespace} ne '' && $name !~ /$self->{option_results}->{filter_tablespace}/) { $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); next; } - if (defined($self->{option_results}->{skip}) && $status eq 'OFFLINE') { - $self->{output}->output_add(long_msg => "Skipping '" . $name . "': tbs is offline", debug => 1); - next; - } - $self->{output}->output_add(long_msg => sprintf("tbs '%s' status '%s' type '%s' extent '%s' used:'%i' max:'%i'", - $name, $status, $type, $extentmgmt, $bytes, $bytes_max), - debug => 1); if (!defined($bytes)) { # seems corrupted, cannot get value $self->{output}->output_add(long_msg => sprintf("tbs '%s' cannot get data", $name), debug => 1); next; } - $self->{tablespace}->{$name} = { used => $bytes, - free => $bytes_free, - max => defined($bytes_max) ? $bytes_max : 0, - prct_used => ($bytes/$bytes_max*100), + if (defined($self->{option_results}->{skip}) && $status eq 'OFFLINE') { + $self->{output}->output_add(long_msg => "Skipping '" . $name . "': tbs is offline", debug => 1); + next; + } + + my ($percent_used, $percent_free, $used, $free, $size); + if ($self->{sql}->is_version_minimum(version => '11')) { + $percent_used = $bytes / $bytes_max * 100; + $size = $bytes_max; + $free = $bytes_max - $bytes; + $used = $bytes; + } elsif ((!defined($bytes_max)) || ($bytes_max == 0)) { + $percent_used = ($bytes - $bytes_free) / $bytes * 100; + $size = $bytes; + $free = $bytes_free; + $used = $size - $free; + } else { + $percent_used = ($bytes - $bytes_free) / $bytes_max * 100; + $size = $bytes_max; + $free = $bytes_free + ($bytes_max - $bytes); + $used = $size - $free; + } + + $self->{tablespace}->{$name} = { used => $used, + free => $free, + total => $size, + prct_used => $percent_used, display => $name }; } @@ -357,6 +435,14 @@ Threshold critical. Filter tablespace by name. Can be a regex +=item B<--units> + +Default is '%', can be 'B' + +=item B<--free> + +Perfdata show free space + =item B<--skip> Skip offline tablespaces. From 0f1c9b9d63020881960ca70b17b4110ba3a2f415 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 3 May 2016 14:03:06 +0200 Subject: [PATCH 163/346] + Ref #392 --- centreon-plugins/centreon/plugins/misc.pm | 2 ++ centreon-plugins/snmp_standard/mode/uptime.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/misc.pm b/centreon-plugins/centreon/plugins/misc.pm index 1a1086c21..a32abb0b7 100644 --- a/centreon-plugins/centreon/plugins/misc.pm +++ b/centreon-plugins/centreon/plugins/misc.pm @@ -374,8 +374,10 @@ sub change_seconds { { unit => 'm', value => 60 }, { unit => 's', value => 1 }, ]; + my %values = ('y' => 1, 'M' => 2, 'w' => 3, 'd' => 4, 'h' => 5, 'm' => 6, 's' => 7); foreach (@$periods) { + next if (defined($options{start}) && $values{$_->{unit}} < $values{$options{start}}); my $count = int($options{value} / $_->{value}); next if ($count == 0); diff --git a/centreon-plugins/snmp_standard/mode/uptime.pm b/centreon-plugins/snmp_standard/mode/uptime.pm index f2fda5626..0264c7c24 100644 --- a/centreon-plugins/snmp_standard/mode/uptime.pm +++ b/centreon-plugins/snmp_standard/mode/uptime.pm @@ -89,7 +89,7 @@ sub run { $self->{output}->output_add(severity => $exit_code, short_msg => sprintf("System uptime is: %s", - centreon::plugins::misc::change_seconds(value => floor($value / 100)))); + centreon::plugins::misc::change_seconds(value => floor($value / 100), start => 'd'))); $self->{output}->display(); $self->{output}->exit(); From cc803bc85bb4f5840ecebf1675d78e8ebe3f2eeb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 3 May 2016 15:05:00 +0200 Subject: [PATCH 164/346] + Fix #368 --- .../apps/cluster/mscs/local/mode/listresources.pm | 6 ++++-- .../apps/cluster/mscs/local/mode/networkstatus.pm | 3 ++- .../apps/cluster/mscs/local/mode/resourcegroupstatus.pm | 8 +++++--- .../apps/cluster/mscs/local/mode/resourcestatus.pm | 6 ++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm index 504c36e76..da61a9b98 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm @@ -80,6 +80,8 @@ sub manage_selection { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; my $class = $map_class{$obj->{ResourceClass}}; + my $id = defined($obj->{Id}) ? $obj->{Id} : $name; + my $owner_node = defined($obj->{OwnerNode}) ? $obj->{OwnerNode} : '-'; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { @@ -87,8 +89,8 @@ sub manage_selection { next; } - $self->{resources}->{$obj->{Id}} = { name => $name, state => $state, owner_node => $obj->{OwnerNode}, - class => $class }; + $self->{resources}->{$id} = { name => $name, state => $state, owner_node => $owner_node, + class => $class }; } } diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm index f14298e97..b3a6c907a 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/networkstatus.pm @@ -154,6 +154,7 @@ sub manage_selection { foreach my $obj (in $resultset) { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; + my $id = defined($obj->{ID}) ? $obj->{ID} : $name; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { @@ -161,7 +162,7 @@ sub manage_selection { next; } - $self->{network}->{$obj->{ID}} = { display => $name, state => $state }; + $self->{network}->{$id} = { display => $name, state => $state }; } } diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm index 6731475da..bdf277526 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcegroupstatus.pm @@ -196,15 +196,17 @@ sub manage_selection { foreach my $obj (in $resultset) { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; + my $id = defined($obj->{Id}) ? $obj->{Id} : $name; + my $owner_node = defined($obj->{OwnerNode}) ? $obj->{OwnerNode} : '-'; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); next; } - $self->{rg}->{$obj->{Id}} = { display => $name, state => $state, owner_node => $obj->{OwnerNode}, - preferred_owners => defined($preferred_nodes->{$name}) ? $preferred_nodes->{$name} : [] }; + $self->{rg}->{$id} = { display => $name, state => $state, owner_node => $owner_node, + preferred_owners => defined($preferred_nodes->{$name}) ? $preferred_nodes->{$name} : [] }; } } diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm index 381535539..28ed41a42 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/resourcestatus.pm @@ -159,14 +159,16 @@ sub manage_selection { foreach my $obj (in $resultset) { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; + my $id = defined($obj->{Id}) ? $obj->{Id} : $name; + my $owner_node = defined($obj->{OwnerNode}) ? $obj->{OwnerNode} : '-'; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter.", debug => 1); + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); next; } - $self->{resource}->{$obj->{Id}} = { display => $name, state => $state, owner_node => $obj->{OwnerNode} }; + $self->{resource}->{$id} = { display => $name, state => $state, owner_node => $owner_node }; } } From d1b0292f68e9725f6c10dfcac5afcd36fd8d256f Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 3 May 2016 16:18:36 +0200 Subject: [PATCH 165/346] + fix copy/paste deletion --- .../database/oracle/mode/tablespaceusage.pm | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index 724ba843f..ef5c1bda1 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -36,15 +36,11 @@ sub set_counters { $self->{maps_counters}->{tablespace} = [ { label => 'tablespace', set => { - key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'max' }, { name => 'display' } ], - closure_custom_output => $self->can('custom_usage_output'), - threshold_use => 'prct_used_absolute', - perfdatas => [ - { label => 'used', value => 'used_absolute', template => '%s', - unit => 'B', min => 0, max => 'max_absolute', label_extra_instance => 1, instance_use => 'display_absolute' }, - { label => 'free', value => 'free_absolute', template => '%s', - unit => 'B', min => 0, max => 'max_absolute', label_extra_instance => 1, instance_use => 'display_absolute' }, - ], + key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'total' }, { name => 'display' } ], + closure_custom_calc => \&custom_usage_calc, + closure_custom_output => \&custom_usage_output, + closure_custom_perfdata => \&custom_usage_perfdata, + closure_custom_threshold_check => \&custom_usage_threshold, } }, ]; @@ -60,7 +56,7 @@ sub custom_usage_perfdata { $value_perf = $self->{result_values}->{free}; } my $extra_label = ''; - $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); my %total_options = (); if ($instance_mode->{option_results}->{units} eq '%') { $total_options{total} = $self->{result_values}->{total}; @@ -69,8 +65,8 @@ sub custom_usage_perfdata { $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', value => $value_perf, - warning => $self->{perfdata}->get_perfdata_for_output(label = - critical => $self->{perfdata}->get_perfdata_for_output(label + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), min => 0, max => $self->{result_values}->{total}); } @@ -79,25 +75,25 @@ sub custom_usage_threshold { my ($exit, $threshold_value); $threshold_value = $self->{result_values}->{used}; - $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_resul + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); if ($instance_mode->{option_results}->{units} eq '%') { $threshold_value = $self->{result_values}->{prct_used}; - $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{opt + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); } - $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { labe}, exit_litteral => 'warning' } ]); + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); return $exit; } sub custom_usage_output { my ($self, %options) = @_; - my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self-> - my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self-> - my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self-> + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", $total_size_value . " " . $total_size_unit, - $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_us - $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_fr + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); return $msg; } @@ -109,8 +105,8 @@ sub custom_usage_calc { $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; - $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result - $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}-> + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; # snapshot can be over 100% if ($self->{result_values}->{free} < 0) { From a5191c4710197f50d98aa5320633f8c9c6645762 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 3 May 2016 16:34:02 +0200 Subject: [PATCH 166/346] + Ref #368 --- centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm index da61a9b98..47ad9e578 100644 --- a/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm +++ b/centreon-plugins/apps/cluster/mscs/local/mode/listresources.pm @@ -79,7 +79,7 @@ sub manage_selection { foreach my $obj (in $resultset) { my $name = $obj->{Name}; my $state = $map_state{$obj->{State}}; - my $class = $map_class{$obj->{ResourceClass}}; + my $class = defined($obj->{ResourceClass}) ? $map_class{$obj->{ResourceClass}} : '-'; my $id = defined($obj->{Id}) ? $obj->{Id} : $name; my $owner_node = defined($obj->{OwnerNode}) ? $obj->{OwnerNode} : '-'; From 322ef6f46ffc9d462adeb3c9a71ff27f389d0e2f Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 3 May 2016 16:40:19 +0200 Subject: [PATCH 167/346] + preserve perfdata format --- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index ef5c1bda1..5c417f5b1 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -49,10 +49,10 @@ sub set_counters { sub custom_usage_perfdata { my ($self, %options) = @_; - my $label = $self->{result_values}->{display} . '_used'; + my $label = 'tbs_' . $self->{result_values}->{display} . '_used'; my $value_perf = $self->{result_values}->{used}; if (defined($instance_mode->{option_results}->{free})) { - $label = $self->{result_values}->{display} . '_free'; + $label = 'tbs_' . $self->{result_values}->{display} . '_free'; $value_perf = $self->{result_values}->{free}; } my $extra_label = ''; @@ -404,7 +404,7 @@ sub manage_selection { free => $free, total => $size, prct_used => $percent_used, - display => $name }; + display => lc $name }; } } From 3d5fbdc2cab2e712c9885a09e9b0afd62a01eae6 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 4 May 2016 16:37:07 +0200 Subject: [PATCH 168/346] + correct few things after quentin feeback thanks Quentin --- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index 5c417f5b1..840c313be 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -49,7 +49,7 @@ sub set_counters { sub custom_usage_perfdata { my ($self, %options) = @_; - my $label = 'tbs_' . $self->{result_values}->{display} . '_used'; + my $label = 'tbs_' . $self->{result_values}->{display} . '_usage'; my $value_perf = $self->{result_values}->{used}; if (defined($instance_mode->{option_results}->{free})) { $label = 'tbs_' . $self->{result_values}->{display} . '_free'; @@ -108,12 +108,7 @@ sub custom_usage_calc { $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; - # snapshot can be over 100% - if ($self->{result_values}->{free} < 0) { - $self->{result_values}->{free} = 0; - $self->{result_values}->{prct_free} = 0; - } - + return 0; } From e298239ec64775c3a83cb169c86e41e9f50168d1 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 4 May 2016 17:15:30 +0200 Subject: [PATCH 169/346] + Fix useless operations --- centreon-plugins/database/oracle/mode/tablespaceusage.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/tablespaceusage.pm b/centreon-plugins/database/oracle/mode/tablespaceusage.pm index 840c313be..0c5ce8ef3 100644 --- a/centreon-plugins/database/oracle/mode/tablespaceusage.pm +++ b/centreon-plugins/database/oracle/mode/tablespaceusage.pm @@ -103,10 +103,9 @@ sub custom_usage_calc { $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; - $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_type'}; + $self->{result_values}->{prct_used} = $options{new_datas}->{$self->{instance} . '_prct_used'}; + $self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'}; - $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; - $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; return 0; From fe87756249f80a677d1a34513620730be342bd0b Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 10 May 2016 22:33:43 +0200 Subject: [PATCH 170/346] + add constraints mode to plugin.pm --- centreon-plugins/apps/pacemaker/local/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/apps/pacemaker/local/plugin.pm b/centreon-plugins/apps/pacemaker/local/plugin.pm index 960c15d3b..8d5c56c76 100644 --- a/centreon-plugins/apps/pacemaker/local/plugin.pm +++ b/centreon-plugins/apps/pacemaker/local/plugin.pm @@ -33,6 +33,7 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( 'crm' => 'apps::pacemaker::local::mode::crm', + 'constraints' => 'apps::pacemaker::local::mode::constraints', ); return $self; From 4aa6150ae24d5a3c9821f98de05217766af0c696 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Tue, 10 May 2016 22:43:21 +0200 Subject: [PATCH 171/346] + check if resource needs "unmigrate" https://github.com/centreon/centreon-plugins/issues/29 --- .../apps/pacemaker/local/mode/constraints.pm | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 centreon-plugins/apps/pacemaker/local/mode/constraints.pm diff --git a/centreon-plugins/apps/pacemaker/local/mode/constraints.pm b/centreon-plugins/apps/pacemaker/local/mode/constraints.pm new file mode 100644 index 000000000..840db9134 --- /dev/null +++ b/centreon-plugins/apps/pacemaker/local/mode/constraints.pm @@ -0,0 +1,171 @@ +# +# Copyright 2016 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 apps::pacemaker::local::mode::constraints; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "remote" => { name => 'remote' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command', default => 'crm_resource' }, + "command-path:s" => { name => 'command_path', default => '/usr/sbin' }, + "command-options:s" => { name => 'command_options', default => ' --constraints -r' }, + "resource:s" => { name => 'resource' }, + "warning" => { name => 'warning' }, + }); + $self->{threshold} = 'CRITICAL'; + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (!defined($self->{option_results}->{resource}) || $self->{option_results}->{resource} eq '') { + $self->{output}->add_option_msg(short_msg => "Please set the resource name with --resource option"); + $self->{output}->option_exit(); + } + + $self->{threshold} = 'WARNING' if (defined $self->{option_results}->{warning}); +} + +sub parse_output { + my ($self, %options) = @_; + + $self->{output}->output_add(severity => 'OK', + short_msg => sprintf("Resource '%s' constraint location is OK", $self->{option_results}->{resource})); + + my @lines = split /\n/, $options{output}; + foreach my $line (@lines) { + next if $line !~ /^\s+:\sNode/; + if ($line =~ /Connection to cluster failed\:(.*)/i ) { + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => "Connection to cluster FAILED: $1"); + return ; + } elsif ($line =~ /^\s+:\sNode/) { + $self->{output}->output_add(long_msg => sprintf('Processed %s', $line)); + $line =~ /^\s+:\sNode\s([a-zA-Z0-9-_]+)\s+\(score=([a-zA-Z0-9-_]+),\sid=([a-zA-Z0-9-_]+)/; + my ($node, $score, $rule) = ($1, $2, $3); + if ($score eq '-INFINITY' && $rule =~ /^cli-ban/) { + $self->{output}->output_add(severity => $self->{threshold}, + short_msg => sprintf("Resource '%s' is locked on node '%s' ('%s')", $self->{option_results}->{resource}, $node, $rule)); + } + } else { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => "ERROR: $line"); + } + } +} + +sub run { + my ($self, %options) = @_; + + my $stdout = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}." ".$self->{option_results}->{resource}); + + $self->parse_output(output => $stdout); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check that a resource has no location constraint (migrate without unmigrate) +Can be executed from any cluster node. + +=over 8 + +=item B<--resource> + +Set the resource name you want to check + +=item B<--warning> + +Return a warning instead of a critical + +=item B<--remote> + +Execute command remotely in 'ssh'. + +=item B<--hostname> + +Hostname to query (need --remote). + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine" --ssh-option='-p=52"). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information (Default: 'crm_resource'). +Can be changed if you have output in a file. + +=item B<--command-path> + +Command path (Default: '/usr/sbin'). + +=item B<--command-options> + +Command options (Default: ' --constraints -r'). + +=back + +=cut From 84f6853d69d3eb5636868b53e50bc3631385370b Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 16 May 2016 12:49:25 +0200 Subject: [PATCH 172/346] +enhance error catching & long output debug only --- .../apps/pacemaker/local/mode/constraints.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/apps/pacemaker/local/mode/constraints.pm b/centreon-plugins/apps/pacemaker/local/mode/constraints.pm index 840db9134..bdd4c8354 100644 --- a/centreon-plugins/apps/pacemaker/local/mode/constraints.pm +++ b/centreon-plugins/apps/pacemaker/local/mode/constraints.pm @@ -68,15 +68,17 @@ sub parse_output { $self->{output}->output_add(severity => 'OK', short_msg => sprintf("Resource '%s' constraint location is OK", $self->{option_results}->{resource})); - my @lines = split /\n/, $options{output}; - foreach my $line (@lines) { - next if $line !~ /^\s+:\sNode/; - if ($line =~ /Connection to cluster failed\:(.*)/i ) { + if ($options{output} =~ /Connection to cluster failed\:(.*)/i ) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => "Connection to cluster FAILED: $1"); return ; - } elsif ($line =~ /^\s+:\sNode/) { - $self->{output}->output_add(long_msg => sprintf('Processed %s', $line)); + } + + my @lines = split /\n/, $options{output}; + foreach my $line (@lines) { + next if $line !~ /^\s+:\sNode/; + if ($line =~ /^\s+:\sNode/) { + $self->{output}->output_add(long_msg => sprintf('Processed %s', $line), debug => 1); $line =~ /^\s+:\sNode\s([a-zA-Z0-9-_]+)\s+\(score=([a-zA-Z0-9-_]+),\sid=([a-zA-Z0-9-_]+)/; my ($node, $score, $rule) = ($1, $2, $3); if ($score eq '-INFINITY' && $rule =~ /^cli-ban/) { From aa0500f3c3b7c8860e4c319fb6a9b27681e75a90 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 16 May 2016 13:06:45 +0200 Subject: [PATCH 173/346] + add vpn statistics and link state https://github.com/centreon/centreon-plugins/issues/261 --- .../common/fortinet/fortigate/mode/vpn.pm | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm new file mode 100644 index 000000000..09fe2b34a --- /dev/null +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm @@ -0,0 +1,236 @@ +# +# Copyright 2016 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 centreon::common::fortinet::fortigate::mode::vpn; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_state_output { + my ($self, %options) = @_; + + my $msg = sprintf("state is '%s'", $self->{result_values}->{state}); + return $msg; +} + +sub custom_state_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'vpn', type => 1, cb_prefix_output => 'prefix_vpn_output', message_multiple => 'All VPNs states are OK' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'users', set => { + key_values => [ { name => 'users' } ], + output_template => 'Logged users: %s', + perfdatas => [ + { label => 'users', value => 'users_absolute', template => '%d', + min => 0, unit => 'users' }, + ], + } + }, + { label => 'sessions', set => { + key_values => [ { name => 'sessions' } ], + output_template => 'Active web sessions: %s', + perfdatas => [ + { label => 'sessions', value => 'sessions_absolute', template => '%d', + min => 0, unit => 'sessions' }, + ], + } + }, + { label => 'tunnels', set => { + key_values => [ { name => 'tunnels' } ], + output_template => 'Active Tunnels: %s', + perfdatas => [ + { label => 'active_tunnels', value => 'tunnels_absolute', template => '%d', + min => 0, unit => 'tunnels' }, + ], + } + }, + ]; + + $self->{maps_counters}->{vpn} = [ + { label => 'state', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => \&custom_state_calc, + closure_custom_output => \&custom_state_output, + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => \&custom_threshold_output, + } + }, + ]; +} + +sub prefix_vpn_output { + my ($self, %options) = @_; + + return "Link '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter:s" => { name => 'filter' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} eq "down"' }, + }); + return $self; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->change_macros(); + $instance_mode = $self; +} + +my %map_status = ( + 1 => 'down', + 2 => 'up', +); + +my $mapping = { + fgVpnTunEntPhase2Name => '.1.3.6.1.4.1.12356.101.12.2.2.1.3', + fgVpnTunEntStatus => '.1.3.6.1.4.1.12356.101.12.2.2.1.20', + + fgVpnSslStatsLoginUsers => '.1.3.6.1.4.1.12356.101.12.2.3.1.2.1', + fgVpnSslStatsActiveWebSessions => '.1.3.6.1.4.1.12356.101.12.2.3.1.4.1', + fgVpnSslStatsActiveTunnels => '.1.3.6.1.4.1.12356.101.12.2.3.1.6.1', +}; + +my $oid_fgVpnTunTable = '.1.3.6.1.4.1.12356.101.12.2.2'; +my $oid_fgVpnSslStatsTable = '.1.3.6.1.4.1.12356.101.12.2.3'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{results} = $options{snmp}->get_multiple_table(oids => [ + { oid => $oid_fgVpnTunTable }, + { oid => $oid_fgVpnSslStatsTable }, + ], + , nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}->{$oid_fgVpnTunTable}}) { + next if ($oid !~ /^$mapping->{fgVpnTunEntPhase2Name}\.(.*)$/); + my $instance = $1; + my $vpn_name = $self->{results}->{$oid_fgVpnTunTable}->{$mapping->{fgVpnTunEntPhase2Name} . '.' . $instance}; + my $vpn_state = $map_status{$self->{results}->{$oid_fgVpnTunTable}->{$mapping->{fgVpnTunEntStatus} . '.' . $instance}}; + if (defined($self->{option_results}->{filter}) && $self->{option_results}->{filter} ne '' && + $vpn_name !~ /$self->{option_results}->{filter}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $vpn_name . "': no matching filter.", debug => 1); + next; + } + $self->{vpn}->{$vpn_name} = { state => $vpn_state, display => $vpn_name }; + } + + $self->{global} = { users => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsLoginUsers}}, + sessions => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsActiveWebSessions}}, + tunnels => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsActiveTunnels}} + }; +} + +1; + +__END__ + +=head1 MODE + +Check global VPN utilization statistics and VPN link state + +=over 8 + +=item B<--filter-counters> + +Warning on statistics. Can be ('users', 'sessions', 'tunnels', 'state') + +=item B<--warning-*> + +Warning on statistics. Can be ('users', 'sessions', 'tunnels') + +=item B<--critical-*> + +Warning on statistics. Can be ('users', 'sessions', 'tunnels') + +=item B<--warning-status> + +Set warning threshold for status. Use "%{state}" as a special variable. +Useful to be notified when tunnel is up "%{state} eq 'up'" + +=item B<--critical-status> + +Set critical threshold for status. Use "%{state}" as a special variable. +Useful to be notified when tunnel is up "%{state} eq 'up'" + +=back + +=cut From b1137acd96965821dce598366966c7c998d20574 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 16 May 2016 13:07:58 +0200 Subject: [PATCH 174/346] +add vpn mode to plugin https://github.com/centreon/centreon-plugins/issues/261 --- centreon-plugins/network/fortinet/fortigate/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/network/fortinet/fortigate/plugin.pm b/centreon-plugins/network/fortinet/fortigate/plugin.pm index 7139cf0a6..61918f05b 100644 --- a/centreon-plugins/network/fortinet/fortigate/plugin.pm +++ b/centreon-plugins/network/fortinet/fortigate/plugin.pm @@ -42,6 +42,7 @@ sub new { 'memory' => 'centreon::common::fortinet::fortigate::mode::memory', 'sessions' => 'centreon::common::fortinet::fortigate::mode::sessions', 'virus' => 'centreon::common::fortinet::fortigate::mode::virus', + 'vpn' => 'centreon::common::fortinet::fortigate::mode::vpn', ); return $self; From 95ce2026a16f3434a19f5f180d1d0d3a30ff6427 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 18 May 2016 13:44:17 +0200 Subject: [PATCH 175/346] + Fix #403 --- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index ac8508919..8b7db9daf 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -96,9 +96,9 @@ sub set_counters { }, { label => 'time', set => { key_values => [ { name => 'upsAdvBatteryRunTimeRemaining' } ], - output_template => 'Remaining time : %s minutes', + output_template => 'Remaining time : %.2f minutes', perfdatas => [ - { label => 'load_time', value => 'upsAdvBatteryRunTimeRemaining_absolute', template => '%s', + { label => 'load_time', value => 'upsAdvBatteryRunTimeRemaining_absolute', template => '%.2f', min => 0, unit => 'm' }, ], } From 8dac7dbe932b75eea09cd0af24c75380671eafc4 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:12:46 +0200 Subject: [PATCH 176/346] + fix typo threshold --- centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm index d9daa844e..ca3d4a6ae 100644 --- a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm +++ b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm @@ -73,12 +73,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 505c6292d88ce7d206b0beb219f2de0001b1c4af Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:15:32 +0200 Subject: [PATCH 177/346] + fix little mistype on filters --- centreon-plugins/apps/github/mode/status.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/github/mode/status.pm b/centreon-plugins/apps/github/mode/status.pm index 73cdfea3d..59cbd290a 100644 --- a/centreon-plugins/apps/github/mode/status.pm +++ b/centreon-plugins/apps/github/mode/status.pm @@ -65,12 +65,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ('status', $1, $2); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 35af473bcc5550062a044cd8f680a14f19dcf322 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:17:05 +0200 Subject: [PATCH 178/346] + fix little mistype on filters --- centreon-plugins/apps/elasticsearch/mode/indices.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/elasticsearch/mode/indices.pm b/centreon-plugins/apps/elasticsearch/mode/indices.pm index 34ddfa63e..c805d8b6b 100644 --- a/centreon-plugins/apps/elasticsearch/mode/indices.pm +++ b/centreon-plugins/apps/elasticsearch/mode/indices.pm @@ -72,12 +72,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 0a7af3e97829bb71bcd576ebfcbc35055b39d3ac Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:17:53 +0200 Subject: [PATCH 179/346] + fix little mistype on filters --- centreon-plugins/apps/elasticsearch/mode/cluster.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/elasticsearch/mode/cluster.pm b/centreon-plugins/apps/elasticsearch/mode/cluster.pm index 891150ae2..868be4134 100644 --- a/centreon-plugins/apps/elasticsearch/mode/cluster.pm +++ b/centreon-plugins/apps/elasticsearch/mode/cluster.pm @@ -65,12 +65,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 8f1feec2ee0de64942f4559df449cfcb17e191d0 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:19:19 +0200 Subject: [PATCH 180/346] + fix typo threshold --- centreon-plugins/centreon/common/fastpath/mode/environment.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/fastpath/mode/environment.pm b/centreon-plugins/centreon/common/fastpath/mode/environment.pm index ff20bc743..d0d25fd97 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/environment.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/environment.pm @@ -111,12 +111,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 1b7052de7e1d227fc10218dedb420807249f7546 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:21:22 +0200 Subject: [PATCH 181/346] + fix typo threshold (help) --- .../centreon/common/cisco/standard/snmp/mode/environment.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm index 9c04cdb08..21908824b 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm @@ -369,14 +369,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(up|normal)$)' =item B<--warning> -Set warning threshold for temperatures, voltages, sensors (syntax: type,regexp,treshold) +Set warning threshold for temperatures, voltages, sensors (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperatures, voltages, sensors (syntax: type,regexp,treshold) +Set critical threshold for temperatures, voltages, sensors (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut From 3902c2ea71e0d6394178132f6b52502a6447c6cd Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:22:56 +0200 Subject: [PATCH 182/346] + fix typo threshold --- centreon-plugins/centreon/common/radlan/mode/environment.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/common/radlan/mode/environment.pm b/centreon-plugins/centreon/common/radlan/mode/environment.pm index 98fe0d118..27c567ce0 100644 --- a/centreon-plugins/centreon/common/radlan/mode/environment.pm +++ b/centreon-plugins/centreon/common/radlan/mode/environment.pm @@ -95,12 +95,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); @@ -303,4 +303,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)' =back -=cut \ No newline at end of file +=cut From 15881922927db718f8ca1879a3513640f042371d Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:23:44 +0200 Subject: [PATCH 183/346] + fix typo threshold --- centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index 9bd8cbada..d5c7b1fcf 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -209,13 +209,13 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($filter, $threshold) = ($1, $2); if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$filter} = $threshold; From a61a52e12fe8611e7fefaa8bdf73e097359ce9b8 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:24:26 +0200 Subject: [PATCH 184/346] + fix typo threshold --- centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm index 6714a0fce..d926609c3 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm @@ -81,13 +81,13 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /(.*?):(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($label, $filter, $threshold) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$label} = {} if (!defined($self->{overload_th}->{$label})); From a8d06a70004412b50637c7d59fb7544ec1f857f6 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:27:12 +0200 Subject: [PATCH 185/346] + fix typo threshold --- centreon-plugins/cloud/docker/mode/containerstate.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/docker/mode/containerstate.pm b/centreon-plugins/cloud/docker/mode/containerstate.pm index 1ffea8639..8d38e896c 100644 --- a/centreon-plugins/cloud/docker/mode/containerstate.pm +++ b/centreon-plugins/cloud/docker/mode/containerstate.pm @@ -84,12 +84,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From e53d3d2025f7ed4fd0dc86507e38ad3d4e8d3741 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:28:03 +0200 Subject: [PATCH 186/346] + fix typo threshold (help) --- .../hardware/sensors/sensorip/snmp/mode/sensors.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm index a2e3d7fd4..01da26f5f 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm @@ -290,12 +290,12 @@ Example: --threshold-overload='temperature,CRITICAL,^(?!(normal)$)' =item B<--warning> -Set warning threshold for temperatures and humidity (syntax: type,regexp,treshold) +Set warning threshold for temperatures and humidity (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' --warning='humidity,.*,90' =item B<--critical> -Set critical threshold for temperature and humidity (syntax: type,regexp,treshold) +Set critical threshold for temperature and humidity (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back From e5136763ba2f92bba327d6beaabad90e2adf8a26 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:32:36 +0200 Subject: [PATCH 187/346] + fix typo threshold (help) --- .../sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm index 11118a30c..8090d056d 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm @@ -257,12 +257,12 @@ Example: --threshold-overload='output,CRITICAL,^(?!(off)$)' =item B<--warning> -Set warning threshold for temperatures and humidity (syntax: type,regexp,treshold) +Set warning threshold for temperatures and humidity (syntax: type,regexp,threshold) Example: --warning='sensors,Int. Temp,30' --warning='sensors,Fuel Level,50:' =item B<--critical> -Set critical threshold for temperature and humidity (syntax: type,regexp,treshold) +Set critical threshold for temperature and humidity (syntax: type,regexp,threshold) Example: --warning='sensors,Int. Temp,35' --warning='sensors,Fuel Level,40:' =back From 7158924608e3f2dab862bc7ac613d4397300ce9e Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:35:22 +0200 Subject: [PATCH 188/346] + fix typo threshold --- .../hardware/ups/powerware/snmp/mode/outputsource.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm index 9f12397ee..cebbd2fb0 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm @@ -69,12 +69,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ('osource', $1, $2); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 07be74c115081a07b0d909e2c480ded934457542 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:37:45 +0200 Subject: [PATCH 189/346] + fix typo threshold --- .../hardware/server/hp/bladechassis/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm index c0d709e3d..49fde1f80 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm @@ -104,12 +104,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); @@ -283,4 +283,4 @@ Example: --threshold-overload='temperature,OK,other' =back =cut - \ No newline at end of file + From d3fe61152d8e570ec4f94f4892a2ea109d8dfb27 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:39:13 +0200 Subject: [PATCH 190/346] + fix typo threshold --- .../hardware/server/sun/mgmt_cards/mode/showenvironment.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm index 33f3f43f7..8cb60f72b 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showenvironment.pm @@ -91,12 +91,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From d03f2efe5575a4682b628b54c6562ee2a5fdf3e8 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:40:11 +0200 Subject: [PATCH 191/346] + fix typo threshold --- .../hardware/server/sun/mgmt_cards/mode/showstatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm index 997fc6ca5..33d9d0a6b 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/mode/showstatus.pm @@ -73,12 +73,12 @@ sub check_options { $self->{overload_th} = []; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($status, $filter) = ($1, $2); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } push @{$self->{overload_th}}, {filter => $filter, status => $status}; From 82d657cc1029f0d66a5d47fda13c149e0fbdca21 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:41:27 +0200 Subject: [PATCH 192/346] + fix typo threshold (help) --- .../hardware/server/dell/cmc/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm index c4e75a5fe..5a7569509 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm @@ -293,14 +293,14 @@ Example: --threshold-overload='health,CRITICAL,^(?!(ok)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold for temperatures (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,treshold) +Set critical threshold for temperatures (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut From ccf0349d823a303c618ef5b8d1c724312e29de83 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:42:19 +0200 Subject: [PATCH 193/346] + fix typo threshold (help) --- .../hardware/server/dell/idrac/snmp/mode/hardware.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm index e5914295a..e542b3346 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -141,12 +141,12 @@ Example: --threshold-overload='temperature.state,CRITICAL,^(?!(enabled)$)' =item B<--warning> -Set warning threshold (syntax: type,regexp,treshold) +Set warning threshold (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold (syntax: type,regexp,treshold) +Set critical threshold (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back From 44e422d1466652c358b99ced92086195cbdd012b Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:43:36 +0200 Subject: [PATCH 194/346] + fix typo threshold --- centreon-plugins/network/ruggedcom/mode/hardware.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/ruggedcom/mode/hardware.pm b/centreon-plugins/network/ruggedcom/mode/hardware.pm index ce920cd10..b7267ad9f 100644 --- a/centreon-plugins/network/ruggedcom/mode/hardware.pm +++ b/centreon-plugins/network/ruggedcom/mode/hardware.pm @@ -100,12 +100,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From ca73ae80b5dcc3057bf3cf7e0deb8a0edaed3472 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:44:49 +0200 Subject: [PATCH 195/346] + fix typo threshold (help) --- .../network/hirschmann/standard/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm index 7203b21e0..25d148fdd 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/hardware.pm @@ -114,14 +114,14 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(ok)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold for temperatures (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,treshold) +Set critical threshold for temperatures (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut From 0eaa2fb8a794c035a2e92a3de9939ed15ff730f0 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:46:12 +0200 Subject: [PATCH 196/346] + fix typo threshold --- .../network/citrix/netscaler/common/mode/vserverstatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm index be3e857bb..ba459818e 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm @@ -167,12 +167,12 @@ sub check_options { } foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ('vs', $1, $2); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $overload_th->{$section} = [] if (!defined($overload_th->{$section})); From 9f1676c2fc2a42b5cfe8d41cb39d2f0f0c484ce3 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:47:24 +0200 Subject: [PATCH 197/346] + fix typo threshold --- .../network/citrix/netscaler/common/mode/health.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm index 647423f16..5123dcc74 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm @@ -78,12 +78,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ('psu', $1, $2); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); @@ -356,4 +356,4 @@ Example: --threshold-overload='CRITICAL,^(?!(normal)$)' =back -=cut \ No newline at end of file +=cut From 117df34500b3bf219b3ce01980ddab2624fe9dd9 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:48:18 +0200 Subject: [PATCH 198/346] + fix typo threshold --- .../network/citrix/netscaler/common/mode/hastate.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm index cd02c96de..b3fac2b74 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm @@ -84,12 +84,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); @@ -162,4 +162,4 @@ Example: --threshold-overload='hastate,CRITICAL,^(?!(up)$)' =back =cut - \ No newline at end of file + From 26b1dc57212cf1054298f507b4a4098a0e6fa538 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:49:26 +0200 Subject: [PATCH 199/346] + fix typo threshold (sub) --- centreon-plugins/network/paloalto/snmp/mode/panorama.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm index 670b3817d..989576489 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm @@ -47,7 +47,7 @@ sub new { return $self; } -sub check_treshold_overload { +sub check_threshold_overload { my ($self, %options) = @_; $self->{overload_th} = {}; @@ -69,7 +69,7 @@ sub check_treshold_overload { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - $self->check_treshold_overload(); + $self->check_threshold_overload(); } sub check_exclude { @@ -163,4 +163,4 @@ Can also exclude specific instance: --exclude=panorama#2# =back =cut - \ No newline at end of file + From cfb69812b7f9eb7d1c0c69592dadea6b8b1add0b Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:50:22 +0200 Subject: [PATCH 200/346] + fix typo threshold (sub) --- .../network/paloalto/snmp/mode/clusterstatus.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm index 005217b1e..f28e1c60b 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm @@ -50,7 +50,7 @@ sub new { return $self; } -sub check_treshold_overload { +sub check_threshold_overload { my ($self, %options) = @_; $self->{overload_th} = {}; @@ -72,7 +72,7 @@ sub check_treshold_overload { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - $self->check_treshold_overload(); + $self->check_threshold_overload(); } sub get_severity { @@ -168,4 +168,4 @@ Example: --threshold-overload='peer,critical,active' --threshold-overload='curre =back -=cut \ No newline at end of file +=cut From 5a3b361ac53d5a1ba70027e05b497176ce2ecdff Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:51:19 +0200 Subject: [PATCH 201/346] + fix typo threshold (help) --- centreon-plugins/network/redback/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/network/redback/snmp/mode/hardware.pm b/centreon-plugins/network/redback/snmp/mode/hardware.pm index 4421f31ce..e8bfca4a4 100644 --- a/centreon-plugins/network/redback/snmp/mode/hardware.pm +++ b/centreon-plugins/network/redback/snmp/mode/hardware.pm @@ -115,14 +115,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold for temperatures (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,treshold) +Set critical threshold for temperatures (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut From 976a724311d136c0a1b64efc0ee718342c6b8417 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:52:00 +0200 Subject: [PATCH 202/346] + fix typo threshold --- .../snmp_standard/mode/hardwarefibrealliance.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm index b330fa66f..fdfbfb7e1 100644 --- a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm +++ b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm @@ -119,12 +119,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); @@ -322,4 +322,4 @@ Example: --threshold-overload='sensors,CRITICAL,^(?!(ok)$)' =back -=cut \ No newline at end of file +=cut From bb859960d39e3503f305a806aa9e64024e63d8e8 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:53:45 +0200 Subject: [PATCH 203/346] + fix typo threshold --- centreon-plugins/storage/qnap/snmp/mode/hardware.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm index 7bc227cea..9aa58aed3 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm @@ -77,12 +77,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From e892ea2613a50d80f5866428cc133dc9e22d73ba Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 14:55:25 +0200 Subject: [PATCH 204/346] + fix typo threshold --- centreon-plugins/storage/hp/msl/snmp/mode/status.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm index d33d487d7..d1a15ca6b 100644 --- a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm +++ b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm @@ -68,12 +68,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 9f7d5cbd5fb10cb23ae7f7abee4a79b49b321be4 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:04:49 +0200 Subject: [PATCH 205/346] + fix typo threshold (sub) & add missing call --- centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm index 5d0cb48d6..1f4a13020 100644 --- a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm @@ -48,18 +48,18 @@ sub new { return $self; } -sub check_treshold_overload { +sub check_threshold_overload { my ($self, %options) = @_; $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($filter, $threshold) = ($1, $2); if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$filter} = $threshold; @@ -69,6 +69,7 @@ sub check_treshold_overload { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + $self->check_threshold_overload(); } sub get_severity { From ec7e2831c8c738126fa7bd5218d7bf951d422953 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:11:24 +0200 Subject: [PATCH 206/346] + fix typo threshold (sub) & add missing call --- centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm index e338bd617..12eba93ad 100644 --- a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm @@ -48,18 +48,18 @@ sub new { return $self; } -sub check_treshold_overload { +sub check_threshold_overload { my ($self, %options) = @_; $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($filter, $threshold) = ($1, $2); if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$filter} = $threshold; @@ -69,6 +69,7 @@ sub check_treshold_overload { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + $self->check_threshold_overload(); } sub get_severity { From ebf2396f39ad66d0f0c9d26e403533cf67f7b15e Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:12:21 +0200 Subject: [PATCH 207/346] + fix typo threshold (help) --- centreon-plugins/storage/emc/DataDomain/mode/hardware.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm index a2cde981d..1c1ab4152 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/hardware.pm @@ -151,12 +151,12 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(ok)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold for temperatures (syntax: type,regexp,threshold) Example: --warning='temperature,.*,20' =item B<--critical> -Set critical threshold for temperatures and battery charge (syntax: type,regexp,treshold) +Set critical threshold for temperatures and battery charge (syntax: type,regexp,threshold) Example: --critical='temperature,1.1,25' --critical='battery,.*,20:' =back From e7070372c20489b313eec0367babd0a6f6beef38 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:14:56 +0200 Subject: [PATCH 208/346] + fix typo threshold --- centreon-plugins/storage/synology/snmp/mode/components.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/synology/snmp/mode/components.pm b/centreon-plugins/storage/synology/snmp/mode/components.pm index aba195b8d..8c4d2e6c8 100644 --- a/centreon-plugins/storage/synology/snmp/mode/components.pm +++ b/centreon-plugins/storage/synology/snmp/mode/components.pm @@ -143,12 +143,12 @@ sub check_options { $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($section, $status, $filter) = ($1, $2, $3); if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); From 6f95d94022da7a7b9ea43a45501a39e7b15bc06e Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:16:51 +0200 Subject: [PATCH 209/346] + fix typo threshold (help) --- .../storage/dell/equallogic/snmp/mode/hardware.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm index 3fe8a7ef8..25ae74f97 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm @@ -313,14 +313,14 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(normal)$)' =item B<--warning> -Set warning threshold for temperatures (syntax: type,regexp,treshold) +Set warning threshold for temperatures (syntax: type,regexp,threshold) Example: --warning='temperature,.*,30' =item B<--critical> -Set critical threshold for temperatures (syntax: type,regexp,treshold) +Set critical threshold for temperatures (syntax: type,regexp,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut From 7b67e64a52d02a8f8a0e453b64abcdecbcaa1397 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 23 May 2016 15:21:51 +0200 Subject: [PATCH 210/346] + fix typo threshold (sub) --- .../storage/dell/TL2000/mode/globalstatus.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm index c9fdcaa71..5c055f623 100644 --- a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm +++ b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm @@ -48,18 +48,18 @@ sub new { return $self; } -sub check_treshold_overload { +sub check_threshold_overload { my ($self, %options) = @_; $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload option '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); $self->{output}->option_exit(); } my ($filter, $threshold) = ($1, $2); if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong treshold-overload status '" . $val . "'."); + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } $self->{overload_th}->{$filter} = $threshold; @@ -69,7 +69,7 @@ sub check_treshold_overload { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - $self->check_treshold_overload(); + $self->check_threshold_overload(); } sub get_severity { @@ -118,4 +118,4 @@ Example: --threshold-overload='(unknown|non critical)=critical' =back =cut - \ No newline at end of file + From 555c8007d472faa5e0d30249cd65b88d8e1819f8 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 24 May 2016 14:41:09 +0200 Subject: [PATCH 211/346] + Fix #375 --- .../common/airespace/snmp/mode/apusers.pm | 59 +++++++++++++++++-- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm index 4608c274d..4bee5bdc6 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm @@ -30,7 +30,8 @@ sub set_counters { $self->{maps_counters_type} = [ { name => 'global', type => 0 }, - { name => 'ssid', type => 1, cb_prefix_output => 'prefix_ssid_output', message_multiple => 'All users by SSID are ok' } + { name => 'ssid', type => 1, cb_prefix_output => 'prefix_ssid_output', message_multiple => 'All users by SSID are ok' }, + { name => 'ap', type => 1, cb_prefix_output => 'prefix_ap_output', message_multiple => 'All users by AP are ok' }, ]; $self->{maps_counters}->{global} = [ { label => 'total', set => { @@ -136,6 +137,18 @@ sub set_counters { } }, ]; + + $self->{maps_counters}->{ap} = [ + { label => 'ap', set => { + key_values => [ { name => 'total' }, { name => 'display' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ap', value => 'total_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; } sub prefix_ssid_output { @@ -144,6 +157,12 @@ sub prefix_ssid_output { return "SSID '" . $options{instance_value}->{display} . "' "; } +sub prefix_ap_output { + my ($self, %options) = @_; + + return "AP '" . $options{instance_value}->{display} . "' "; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -152,7 +171,8 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "filter-ssid:s" => { name => 'filter_ssid' }, + "filter-ssid:s" => { name => 'filter_ssid' }, + "filter-ap:s" => { name => 'filter_ap' }, }); return $self; @@ -181,6 +201,8 @@ my $mapping3 = { my $oid_agentInventoryMachineModel = '.1.3.6.1.4.1.14179.1.1.1.3'; my $oid_bsnDot11EssSsid = '.1.3.6.1.4.1.14179.2.1.1.1.2'; +my $oid_bsnAPName = '.1.3.6.1.4.1.14179.2.2.1.1.3 '; +my $oid_bsnAPIfLoadNumOfClients = '.1.3.6.1.4.1.14179.2.2.13.1.4'; sub manage_selection { my ($self, %options) = @_; @@ -193,6 +215,8 @@ sub manage_selection { { oid => $mapping2->{bsnMobileStationSsid}->{oid} }, { oid => $oid_bsnDot11EssSsid }, { oid => $mapping3->{bsnDot11EssNumberOfMobileStations}->{oid} }, + { oid => $oid_bsnAPName }, + { oid => $oid_bsnAPIfLoadNumOfClients }, ], nothing_quit => 1); $self->{output}->output_add(long_msg => "Model: " . $self->{results}->{$oid_agentInventoryMachineModel}->{$oid_agentInventoryMachineModel . '.0'}); @@ -219,13 +243,32 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{ $mapping3->{bsnDot11EssNumberOfMobileStations}->{oid} }, instance => $instance); if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && $ssid_name !~ /$self->{option_results}->{filter_ssid}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $ssid_name . "': no matching filter.", debug => 1); + $self->{output}->output_add(long_msg => "skipping ssid '" . $ssid_name . "': no matching filter.", debug => 1); next; } $self->{ssid}->{$ssid_name} = { display => $ssid_name, total => 0 } if (!defined($self->{ssid}->{$ssid_name})); $self->{ssid}->{$ssid_name}->{total} += $result->{bsnDot11EssNumberOfMobileStations}; } + + # check by ap + $self->{ap} = {}; + foreach my $oid (keys %{$self->{results}->{ $oid_bsnAPName }}) { + $oid =~ /^$oid_bsnAPName\.(.*)/; + my $instance = $1; + my $ap_name = $self->{results}->{$oid_bsnAPName}->{$oid}; + if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && + $ap_name !~ /$self->{option_results}->{filter_ap}/) { + $self->{output}->output_add(long_msg => "skipping ap '" . $ap_name . "': no matching filter.", debug => 1); + next; + } + + foreach my $oid2 (keys %{$self->{results}->{ $oid_bsnAPIfLoadNumOfClients }}) { + next if ($oid2 !~ /^$oid_bsnAPIfLoadNumOfClients\.$instance\./); + $self->{ap}->{$instance} = { display => $ap_name, total => 0 } if (!defined($self->{ap}->{$instance})); + $self->{ap}->{$instance} += $self->{results}->{$oid_bsnAPIfLoadNumOfClients}->{$oid2}; + } + } } 1; @@ -234,7 +277,7 @@ __END__ =head1 MODE -Check total users connected and status on AP. +Check users connected (total, by SSID, by AP). =over 8 @@ -248,19 +291,23 @@ Example: --filter-counters='^total|total-idle$' Threshold warning. Can be: 'total', 'total-idle', 'total-aaapending', 'total-authenticated', 'total-associated', 'total-powersave', 'total-disassociated', 'total-tobedeleted', -'total-probing', 'total-blacklisted', 'ssid'. +'total-probing', 'total-blacklisted', 'ssid', 'ap'. =item B<--critical-*> Threshold critical. Can be: 'total', 'total-idle', 'total-aaapending', 'total-authenticated', 'total-associated', 'total-powersave', 'total-disassociated', 'total-tobedeleted', -'total-probing', 'total-blacklisted', 'ssid'. +'total-probing', 'total-blacklisted', 'ssid', 'ap'. =item B<--filter-ssid> Filter by SSID (can be a regexp). +=item B<--filter-ap> + +Filter by AP (can be a regexp). + =back =cut From ebd6682e5aa75958a96baeaa5094b51c12b09210 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 24 May 2016 14:51:36 +0200 Subject: [PATCH 212/346] + Fix #408 --- centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm b/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm index 78665cb87..828a23217 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/mode/load.pm @@ -158,6 +158,7 @@ sub run { } if (defined($result->{rPDULoadStatusLoad}) && $result->{rPDULoadStatusLoad} =~ /[0-9]/) { + $result->{rPDULoadStatusLoad} /= 10; my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'load', instance => $instance, value => $result->{rPDULoadStatusLoad}); if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit2, From bf2e72b11735a10a477793d23fb958cbd1ac4815 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 24 May 2016 15:13:06 +0200 Subject: [PATCH 213/346] + prepare tag version --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index 39b1f053c..ce5fa7c04 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160324; +my $global_version = 20160524; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index c5ac6ddb6..816435aeb 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,19 @@ +2016-05-24 Quentin Garnier + * Can use '/' instead '::' for plugin option (#380) + * Mode added: [pacemaker] 'constraints' + * Mode added: [netbackup] 'tape-usage' + * Mode added: [oracle] 'data-files-status' + * Mode added: [netasq] 'connections' + * Enhancement: [cisco wlc]{ap-users} get users by AP (#375) + * Enhancement: [oracle]{tablespace} can use free size left + * Fix: [pdu apc]{load} incorrect values (#408) + * Fix: [mscs] Issue with old versions + * Fix: [postgres]{timesync} threshold issue + * Fix: [ntp]{offset} time formula issue + * Fix: [github]{issues} Get only issue + * Fix: [netasq]{memory} Use BSD memory check + * Fix: [tomcat]{applications} Issue on Windows (#356) + 2016-03-24 Quentin Garnier * Plugin added: to check AKCP SensorProbe * Plugin added: to check Juniper ISG From 164004be573c18a6f25e33e92bd89004bfc0da71 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 25 May 2016 14:46:24 +0200 Subject: [PATCH 214/346] + add mode hba usage for dell compellent (WIP) --- .../powershell/dell/compellent/hbausage.pm | 108 ++++++ .../dell/compellent/local/mode/hbausage.pm | 318 ++++++++++++++++++ .../storage/dell/compellent/local/plugin.pm | 1 + 3 files changed, 427 insertions(+) create mode 100644 centreon-plugins/centreon/common/powershell/dell/compellent/hbausage.pm create mode 100644 centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm diff --git a/centreon-plugins/centreon/common/powershell/dell/compellent/hbausage.pm b/centreon-plugins/centreon/common/powershell/dell/compellent/hbausage.pm new file mode 100644 index 000000000..2105b539b --- /dev/null +++ b/centreon-plugins/centreon/common/powershell/dell/compellent/hbausage.pm @@ -0,0 +1,108 @@ +# +# Copyright 2016 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 centreon::common::powershell::dell::compellent::hbausage; + +use strict; +use warnings; +use centreon::plugins::misc; + +sub get_powershell { + my (%options) = @_; + my $no_ps = (defined($options{no_ps})) ? 1 : 0; + + return '' if ($no_ps == 1); + + my $ps = ' +$culture = new-object "System.Globalization.CultureInfo" "en-us" +[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture +$ProgressPreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" + +$scuser = "' . $options{cem_user} . '" +$scpass = ConvertTo-SecureString "' . $options{cem_password} . '" -AsPlainText -Force +$schost = "' . $options{cem_host} . '" +$scport = "' . $options{cem_port} . '" +$connName = "EMDefault" + +Function display_hba_information { + $conn = Connect-DellApiConnection -HostName $schost -Port $scport -User $scuser -password $scpass -Save $connName +'; + if (defined($options{filter_sc}) && $options{filter_sc} ne '') { + $ps .= '$storageCenters = Get-DellStorageCenter -ConnectionName $connName -Name "' . $options{filter_sc} . '" +'; + } else { + $ps .= '$storageCenters = Get-DellStorageCenter -ConnectionName $connName +'; + } + + $ps .= ' + $historical = New-DellHistoricalFilter -FilterTime "Other" -StartTime "' . $options{start_time} . '" -EndTime "' . $options{end_time} . '" + foreach ($sc in $storageCenters) { + $hbaList = Get-DellScServerHba -ConnectionName $connName -StorageCenter $sc + + foreach ($hba in $hbaList) { + $usageList = Get-DellScServerHbaHistoricalIoUsage -ConnectionName $connName -Instance $hba -HistoricalFilter $historical + + write-host ("[sc={0}]" -f $hba.ScName) -NoNewline + write-host ("[name={0}]" -f $hba.Name) -NoNewline + + $attrs = @{ReadKbPerSecond = 0; WriteKbPerSecond = 0; ReadIops = 0; WriteIops = 0; ReadLatency = 0; WriteLatency = 0; } + $count = 0 + foreach ($usage in $usageList) { + foreach ($item in $($attrs.GetEnumerator() | sort -Property Key)) { + $attrs[$item.Key] += ($usage | Select -ExpandProperty $item.Key) + } + $count++ + } + + foreach ($item in $attrs.GetEnumerator() | sort -Property Key) { + write-host ("[{0}={1}]" -f $item.Key, ($item.Value / $count)) -NoNewline + } + write-host + } + } +} + +Try { + Import-Module "' . $options{sdk_path_dll} . '" + display_hba_information +} Catch { + Write-Host $Error[0].Exception + $ret = Remove-DellSavedApiConnection -Name $connName + exit 1 +} + +$ret = Remove-DellSavedApiConnection -Name $connName +exit 0 +'; + + return centreon::plugins::misc::powershell_encoded($ps); +} + +1; + +__END__ + +=head1 DESCRIPTION + +Method to get compellent hba informations. + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm new file mode 100644 index 000000000..e66ac0877 --- /dev/null +++ b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm @@ -0,0 +1,318 @@ +# +# Copyright 2016 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::dell::compellent::local::mode::hbausage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::misc; +use centreon::common::powershell::dell::compellent::volumeusage; +use DateTime; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'hba', type => 1, cb_prefix_output => 'prefix_hba_output', message_multiple => 'All HBA are ok' } + ]; + + $self->{maps_counters}->{hba} = [ + { label => 'read-iops', set => { + key_values => [ { name => 'read_iops' }, { name => 'display' } ], + output_template => 'Read IOPs : %s', + perfdatas => [ + { label => 'read_iops', value => 'read_iops_absolute', template => '%d', + unit => 'iops', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'read-usage', set => { + key_values => [ { name => 'read_bps' }, { name => 'display' } ], + output_template => 'Read usage : %s %s', + output_change_bytes => 2, + perfdatas => [ + { label => 'read_usage', value => 'read_bps_absolute', template => '%d', + unit => 'b/s', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'read-latency', set => { + key_values => [ { name => 'read_latency' }, { name => 'display' } ], + output_template => 'Read latency : %s ms', + perfdatas => [ + { label => 'read_latency', value => 'read_latency_absolute', template => '%d', + unit => 'ms', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'write-iops', set => { + key_values => [ { name => 'write_iops' }, { name => 'display' } ], + output_template => 'Write IOPs : %s', + perfdatas => [ + { label => 'write_iops', value => 'write_iops_absolute', template => '%d', + unit => 'iops', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'write-usage', set => { + key_values => [ { name => 'write_bps' }, { name => 'display' } ], + output_template => 'Write Usage : %s %s', + output_change_bytes => 2, + perfdatas => [ + { label => 'write_usage', value => 'read_bps_absolute', template => '%d', + unit => 'b/s', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'write-latency', set => { + key_values => [ { name => 'write_latency' }, { name => 'display' } ], + output_template => 'Write Latency : %s ms', + perfdatas => [ + { label => 'write_latency', value => 'write_latency_absolute', template => '%d', + unit => 'ms', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_hba_output { + my ($self, %options) = @_; + + return "HBA '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "cem-host:s" => { name => 'cem_host' }, + "cem-user:s" => { name => 'cem_user' }, + "cem-password:s" => { name => 'cem_password' }, + "cem-port:s" => { name => 'cem_port', default => 3033 }, + "sdk-path-dll:s" => { name => 'sdk_path_dll' }, + "timeout:s" => { name => 'timeout', default => 50 }, + "command:s" => { name => 'command', default => 'powershell.exe' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' }, + "no-ps" => { name => 'no_ps' }, + "ps-exec-only" => { name => 'ps_exec_only' }, + "ps-sc-filter:s" => { name => 'ps_sc_filter' }, + "start-time:s" => { name => 'start_time' }, + "end-time:s" => { name => 'end_time' }, + "timezone:s" => { name => 'timezone' }, + }); + return $self; +} + +sub get_iso8601 { + my ($self, %options) = @_; + my $value = $options{date}->datetime . '.' . sprintf("%03d", $options{date}->millisecond()); + my $offset = $options{date}->offset(); + + $value .= "-" if ($offset < 0); + $value .= "+" if ($offset >= 0); + $offset = abs($offset); + $value .= sprintf("%02d:%02d", $offset / 3600, $offset % 3600); + + return $value; +} + +sub parse_date { + my ($self, %options) = @_; + + if ($options{date} !~ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/) { + $self->{output}->add_option_msg(short_msg => "Wrong time option '" . $options{date} . "'."); + $self->{output}->option_exit(); + } + + my $dt = DateTime->new(year => $1, month => $2, day => $3, hour => $4, minute => $5, second => $6, + time_zone => $self->{option_results}->{timezone}); + return $dt; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + foreach my $label (('cem_host', 'cem_user', 'cem_password', 'cem_port', 'sdk_path_dll')) { + if (!defined($self->{option_results}->{$label}) || $self->{option_results}->{$label} eq '') { + my ($label_opt) = $label; + $label_opt =~ tr/_/-/; + $self->{output}->add_option_msg(short_msg => "Need to specify --" . $label_opt . " option."); + $self->{output}->option_exit(); + } + } + + my ($dt_start, $dt_end); + if (defined($self->{option_results}->{end_time}) && $self->{option_results}->{end_time} ne '') { + $dt_end = $self->parse_date(date => $self->{option_results}->{end_time}); + } else { + $dt_end = DateTime->now(time_zone => $self->{option_results}->{timezone}); + } + $self->{end_time} = $self->get_iso8601(date => $dt_end); + + if (defined($self->{option_results}->{start_time}) && $self->{option_results}->{start_time} ne '') { + $dt_start = $self->parse_date(date => $self->{option_results}->{start_time}); + } else { + $dt_start = $dt_end->subtract(minutes => 30); + } + $self->{start_time} = $self->get_iso8601(date => $dt_start); +} + +sub manage_selection { + my ($self, %options) = @_; + + my $ps = centreon::common::powershell::dell::compellent::volumeusage::get_powershell(cem_host => $self->{option_results}->{cem_host}, + cem_user => $self->{option_results}->{cem_user}, + cem_password => $self->{option_results}->{cem_password}, + cem_port => $self->{option_results}->{cem_port}, + sdk_path_dll => $self->{option_results}->{sdk_path_dll}, + no_ps => $self->{option_results}->{no_ps}, + filter_sc => $self->{option_results}->{ps_sc_filter}, + end_time => $self->{end_time}, start_time => $self->{start_time}); + + $self->{option_results}->{command_options} .= " " . $ps; + my ($stdout) = centreon::plugins::misc::windows_execute(output => $self->{output}, + timeout => $self->{option_results}->{timeout}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options}); + if (defined($self->{option_results}->{ps_exec_only})) { + $self->{output}->output_add(severity => 'OK', + short_msg => $stdout); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + } + + # microseconds for latencies + #[sc=PRD-SAN-01][name=xxxx][ReadIops=39,5][ReadKbPerSecond=1220,75][ReadLatency=3997][WriteIops=95,75][WriteKbPerSecond=1217][WriteLatency=3903,25] + $self->{hba} = {}; + $self->{sc} = {}; + $stdout =~ s/,/\./msg; + while ($stdout =~ /^\[sc=(.*?)\]\[name=(.*?)\]\[ReadIops=(.*?)\]\[ReadKbPerSecond=(.*?)\]\[ReadLatency=(.*?)\]\[WriteIops=(.*?)\]\[WriteKbPerSecond=(.*?)\]\[WriteLatency=(.*?)\]/mig) { + my ($sc, $volume, $read_iops, $read_kbps, $read_latency, $write_iops, $write_kbps, $write_latency) = + ($1, $2, $3, $4, $5, $6, $7, $8); + my $name = $sc . '/' . $name; + + $self->{hba}->{$name} = { display => $name, read_iops => $read_iops, read_bps => $read_kbps * 1000, read_latency => $read_latency / 1000, + write_iops => $write_iops, write_bps => $write_kbps * 1000, write_latency => $write_latency / 1000 }; + } +} + +1; + +__END__ + +=head1 MODE + +Check hba usages. + +=over 8 + +=item B<--cem-host> + +Compellent Entreprise Manager hostname (Required). + +=item B<--cem-user> + +Compellent Entreprise Manager username (Required). + +=item B<--cem-password> + +Compellent Entreprise Manager password (Required). + +=item B<--cem-port> + +Compellent Entreprise Manager port (Default: 3033). + +=item B<--sdk-path-dll> + +Path to 'DellStorage.ApiCommandSet.dll' (Required). + +=item B<--timeout> + +Set timeout time for command execution (Default: 50 sec) + +=item B<--no-ps> + +Don't encode powershell. To be used with --command and 'type' command. + +=item B<--command> + +Command to get information (Default: 'powershell.exe'). +Can be changed if you have output in a file. To be used with --no-ps option!!! + +=item B<--command-path> + +Command path (Default: none). + +=item B<--command-options> + +Command options (Default: '-InputFormat none -NoLogo -EncodedCommand'). + +=item B<--ps-exec-only> + +Print powershell output. + +=item B<--ps-sc-filter> + +Filter Storage Center (only wilcard '*' can be used. In Powershell). + +=item B<--start-time> + +Begin time for counters sampling. If not set, 30 minutes before the end-time option or current time +Format: 2016-05-25T10:30:00 + +=item B<--end-time> + +End time for counters sampling. If not set, the current execution time. +Format: 2016-05-25T15:30:00 + +=item B<--timezone> + +Timezone of time options. + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^read-iops$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'read-iops', 'read-usage', 'read-latency', +'write-iops', 'write-usage', 'write-latency'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'read-iops', 'read-usage', 'read-latency', +'write-iops', 'write-usage', 'write-latency'. + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/dell/compellent/local/plugin.pm b/centreon-plugins/storage/dell/compellent/local/plugin.pm index 4605f328b..64e94e7aa 100644 --- a/centreon-plugins/storage/dell/compellent/local/plugin.pm +++ b/centreon-plugins/storage/dell/compellent/local/plugin.pm @@ -31,6 +31,7 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( + 'hba-usage' => 'storage::dell::compellent::local::mode::hbausage', 'volume-usage' => 'storage::dell::compellent::local::mode::volumeusage', ); From 3e1db12ad81a40a9908e32ec8bd0efc61c137483 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 25 May 2016 15:14:41 +0200 Subject: [PATCH 215/346] + Fix compellent mode --- .../dell/compellent/local/mode/hbausage.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm index e66ac0877..7c07d3cec 100644 --- a/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm +++ b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm @@ -25,7 +25,7 @@ use base qw(centreon::plugins::templates::counter); use strict; use warnings; use centreon::plugins::misc; -use centreon::common::powershell::dell::compellent::volumeusage; +use centreon::common::powershell::dell::compellent::hbausage; use DateTime; sub set_counters { @@ -47,7 +47,7 @@ sub set_counters { }, { label => 'read-usage', set => { key_values => [ { name => 'read_bps' }, { name => 'display' } ], - output_template => 'Read usage : %s %s', + output_template => 'Read usage : %s %s/s', output_change_bytes => 2, perfdatas => [ { label => 'read_usage', value => 'read_bps_absolute', template => '%d', @@ -75,7 +75,7 @@ sub set_counters { }, { label => 'write-usage', set => { key_values => [ { name => 'write_bps' }, { name => 'display' } ], - output_template => 'Write Usage : %s %s', + output_template => 'Write Usage : %s %s/s', output_change_bytes => 2, perfdatas => [ { label => 'write_usage', value => 'read_bps_absolute', template => '%d', @@ -158,6 +158,7 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); + $self->{option_results}->{timezone} = 'GMT' if (!defined($self->{option_results}->{timezone}) || $self->{option_results}->{timezone} eq ''); foreach my $label (('cem_host', 'cem_user', 'cem_password', 'cem_port', 'sdk_path_dll')) { if (!defined($self->{option_results}->{$label}) || $self->{option_results}->{$label} eq '') { my ($label_opt) = $label; @@ -186,7 +187,7 @@ sub check_options { sub manage_selection { my ($self, %options) = @_; - my $ps = centreon::common::powershell::dell::compellent::volumeusage::get_powershell(cem_host => $self->{option_results}->{cem_host}, + my $ps = centreon::common::powershell::dell::compellent::hbausage::get_powershell(cem_host => $self->{option_results}->{cem_host}, cem_user => $self->{option_results}->{cem_user}, cem_password => $self->{option_results}->{cem_password}, cem_port => $self->{option_results}->{cem_port}, @@ -211,14 +212,13 @@ sub manage_selection { # microseconds for latencies #[sc=PRD-SAN-01][name=xxxx][ReadIops=39,5][ReadKbPerSecond=1220,75][ReadLatency=3997][WriteIops=95,75][WriteKbPerSecond=1217][WriteLatency=3903,25] $self->{hba} = {}; - $self->{sc} = {}; $stdout =~ s/,/\./msg; while ($stdout =~ /^\[sc=(.*?)\]\[name=(.*?)\]\[ReadIops=(.*?)\]\[ReadKbPerSecond=(.*?)\]\[ReadLatency=(.*?)\]\[WriteIops=(.*?)\]\[WriteKbPerSecond=(.*?)\]\[WriteLatency=(.*?)\]/mig) { - my ($sc, $volume, $read_iops, $read_kbps, $read_latency, $write_iops, $write_kbps, $write_latency) = + my ($sc, $name, $read_iops, $read_kbps, $read_latency, $write_iops, $write_kbps, $write_latency) = ($1, $2, $3, $4, $5, $6, $7, $8); - my $name = $sc . '/' . $name; + my $display = $sc . '/' . $name; - $self->{hba}->{$name} = { display => $name, read_iops => $read_iops, read_bps => $read_kbps * 1000, read_latency => $read_latency / 1000, + $self->{hba}->{$name} = { display => $display, read_iops => $read_iops, read_bps => $read_kbps * 1000, read_latency => $read_latency / 1000, write_iops => $write_iops, write_bps => $write_kbps * 1000, write_latency => $write_latency / 1000 }; } } @@ -294,7 +294,7 @@ Format: 2016-05-25T15:30:00 =item B<--timezone> -Timezone of time options. +Timezone of time options. Default is 'GMT'. =item B<--filter-counters> From f24315f11079791a16e130e3e9e94b7dbe261d84 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 26 May 2016 10:22:39 +0200 Subject: [PATCH 216/346] + Fix dell compellent mode --- centreon-plugins/centreon/plugins/values.pm | 2 +- centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/plugins/values.pm b/centreon-plugins/centreon/plugins/values.pm index 4c9283815..55c5f9a32 100644 --- a/centreon-plugins/centreon/plugins/values.pm +++ b/centreon-plugins/centreon/plugins/values.pm @@ -139,7 +139,7 @@ sub output { return $self->{closure_custom_output}->($self); } my $first = ${${$self->{key_values}}[0]}{name}; - my ($value, $unit) = ($self->{result_values}->{$first . '_absolute'}, $self->{result_values}->{output_absolute_unit}); + my ($value, $unit) = ($self->{result_values}->{$first . '_absolute'}, $self->{output_absolute_unit}); if (!defined($self->{output_use})) { if ($self->{per_second} == 1) { diff --git a/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm index 7c07d3cec..0b91419d1 100644 --- a/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm +++ b/centreon-plugins/storage/dell/compellent/local/mode/hbausage.pm @@ -78,7 +78,7 @@ sub set_counters { output_template => 'Write Usage : %s %s/s', output_change_bytes => 2, perfdatas => [ - { label => 'write_usage', value => 'read_bps_absolute', template => '%d', + { label => 'write_usage', value => 'write_bps_absolute', template => '%d', unit => 'b/s', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, ], } From 5b0874d437a8a25b067476f2a2bf8f47e17f58df Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 26 May 2016 11:29:52 +0200 Subject: [PATCH 217/346] + Fix problem of redundant warning --- centreon-plugins/centreon/plugins/values.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/plugins/values.pm b/centreon-plugins/centreon/plugins/values.pm index 55c5f9a32..a0bddcd01 100644 --- a/centreon-plugins/centreon/plugins/values.pm +++ b/centreon-plugins/centreon/plugins/values.pm @@ -22,9 +22,9 @@ package centreon::plugins::values; use strict; use warnings; - -# le label de perfdata: on peut le surcharger (au lieu du label) -# le warning/critical: on peut surcharger +# Warning message with sprintf and too much arguments. +# Really annoying. Need to disable that warning +no if ($^V gt v5.22.0), 'warnings' => 'redundant'; sub new { my ($class, %options) = @_; From a3769e29f6755859ae06216394a8128dfd36fa39 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 26 May 2016 15:51:54 +0200 Subject: [PATCH 218/346] + add max total latency option --- .../apps/vmware/connector/mode/datastorevm.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm b/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm index e9db8667b..99ecde259 100644 --- a/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm +++ b/centreon-plugins/apps/vmware/connector/mode/datastorevm.pm @@ -44,8 +44,10 @@ sub new { "display-description" => { name => 'display_description' }, "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, - "datastore-name:s" => { name => 'datastore_name' }, - "filter-datastore:s" => { name => 'filter_datastore' }, + "warning-max-total-latency:s" => { name => 'warning_max_total_latency' }, + "critical-max-total-latency:s" => { name => 'critical_max_total_latency' }, + "datastore-name:s" => { name => 'datastore_name' }, + "filter-datastore:s" => { name => 'filter_datastore' }, }); return $self; } @@ -54,7 +56,7 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - foreach my $label (('warning', 'critical')) { + foreach my $label (('warning', 'critical', 'warning_max_total_latency', 'critical_max_total_latency')) { if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) { my ($label_opt) = $label; $label_opt =~ tr/_/-/; @@ -146,6 +148,14 @@ Threshold warning in IOPs. Threshold critical in IOPs. +=item B<--warning-max-total-latency> + +Threshold warning in ms. + +=item B<--critical-max-total-latency> + +Threshold critical in ms. + =back =cut From d3f1d3397b3df724bff3e0868c190a98d4ceb6b4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 27 May 2016 14:24:28 +0200 Subject: [PATCH 219/346] + enhance extra-oids option --- .../snmp_standard/mode/listinterfaces.pm | 74 +++++++++++++------ 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index c8634f78b..c7cc292a0 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -125,12 +125,13 @@ sub check_options { $self->{extra_oids} = {}; foreach (@{$self->{option_results}->{add_extra_oid}}) { next if ($_ eq ''); - my ($name, $oid) = split /,/; + my ($name, $oid, $matching) = split /,/; + $matching = '%{instance}' if (!defined($matching)); if (!defined($oid) || $oid !~ /^(\.\d+){1,}$/ || $name eq '') { $self->{output}->add_option_msg(short_msg => "Wrong syntax for add-extra-oid '" . $_ . "' option."); $self->{output}->option_exit(); } - $self->{extra_oids}->{$name} = $oid; + $self->{extra_oids}->{$name} = { oid => $oid, matching => $matching }; } } @@ -168,10 +169,12 @@ sub run { $self->{output}->output_add(long_msg => "Skipping interface '" . $display_value . "': adminstatus is not 'up' and option --use-adminstatus is set"); next; } + + my $extra_values = $self->get_extra_values_by_instance(instance => $_); my $extra_display = ''; my $extra_display_append = ' '; - foreach my $name (keys %{$self->{extra_oids}}) { - $extra_display .= $extra_display_append . $name . ' = ' . (defined($result->{$self->{extra_oids}->{$name} . "." . $_}) ? $result->{$self->{extra_oids}->{$name} . "." . $_} : ''); + foreach my $name (keys %{$extra_values}) { + $extra_display .= $extra_display_append . $name . ' = ' . $extra_values->{$name}; $extra_display_append = ', '; } @@ -194,9 +197,6 @@ sub get_additional_information { push @$oids, $self->{oid_opstatus} if (defined($self->{oid_opstatus})); push @$oids, $oid_speed32 if ($self->{no_speed} == 0); push @$oids, $oid_speed64 if (!$self->{snmp}->is_snmpv1() && $self->{no_speed} == 0); - if (scalar(keys %{$self->{extra_oids}}) > 0) { - push @$oids, values %{$self->{extra_oids}}; - } $self->{snmp}->load(oids => $oids, instances => $self->{interface_id_selected}); return $self->{snmp}->get_leef(); @@ -216,12 +216,22 @@ sub get_display_value { sub manage_selection { my ($self, %options) = @_; + my $oids = [{ oid => $self->{oids_label}->{$self->{option_results}->{oid_filter}} }]; + if ($self->{option_results}->{oid_filter} ne $self->{option_results}->{oid_display}) { + push @$oids, { oid => $self->{oids_label}->{$self->{option_results}->{oid_display}} }; + } + if (scalar(keys %{$self->{extra_oids}}) > 0) { + foreach (keys %{$self->{extra_oids}}) { + push @$oids, { oid => $self->{extra_oids}->{$_}->{oid} }; + } + } + $self->{datas} = {}; - my $result = $self->{snmp}->get_table(oid => $self->{oids_label}->{$self->{option_results}->{oid_filter}}); + $self->{results} = $self->{snmp}->get_multiple_table(oids => $oids); $self->{datas}->{all_ids} = []; - foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) { + foreach my $key ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{ $self->{oids_label}->{$self->{option_results}->{oid_filter}} }})) { next if ($key !~ /^$self->{oids_label}->{$self->{option_results}->{oid_filter}}\.(.*)$/); - $self->{datas}->{$self->{option_results}->{oid_filter} . "_" . $1} = $self->{output}->to_utf8($result->{$key}); + $self->{datas}->{$self->{option_results}->{oid_filter} . "_" . $1} = $self->{output}->to_utf8($self->{results}->{$self->{oids_label}->{ $self->{option_results}->{oid_filter}} }->{$key}); push @{$self->{datas}->{all_ids}}, $1; } @@ -231,11 +241,10 @@ sub manage_selection { } if ($self->{option_results}->{oid_filter} ne $self->{option_results}->{oid_display}) { - $result = $self->{snmp}->get_table(oid => $self->{oids_label}->{$self->{option_results}->{oid_display}}); - foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) { + foreach my $key ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{ $self->{oids_label}->{$self->{option_results}->{oid_display}} }})) { next if ($key !~ /^$self->{oids_label}->{$self->{option_results}->{oid_display}}\.(.*)$/); - $self->{datas}->{$self->{option_results}->{oid_display} . "_" . $1} = $self->{output}->to_utf8($result->{$key}); - } + $self->{datas}->{$self->{option_results}->{oid_display} . "_" . $1} = $self->{output}->to_utf8($self->{results}->{$self->{oids_label}->{ $self->{option_results}->{oid_display}} }->{$key}); + } } if (!defined($self->{option_results}->{use_name}) && defined($self->{option_results}->{interface})) { @@ -265,6 +274,27 @@ sub manage_selection { } } +sub get_extra_values_by_instance { + my ($self, %options) = @_; + + my $extra_values = {}; + foreach my $name (keys %{$self->{extra_oids}}) { + my $matching = $self->{extra_oids}->{$name}->{matching}; + $matching =~ s/%\{instance\}/$options{instance}/g; + next if (!defined($self->{results}->{ $self->{extra_oids}->{$name}->{oid} })); + + my $append = ''; + foreach (keys %{$self->{results}->{ $self->{extra_oids}->{$name}->{oid} }}) { + if (/^$self->{extra_oids}->{$name}->{oid}\.$matching/) { + $extra_values->{$name} = '' if (!defined($extra_values->{$name})); + $extra_values->{$name} .= $append . $self->{results}->{$self->{extra_oids}->{$name}->{oid}}->{$_}; + $append = ','; + } + } + } + return $extra_values; +} + sub disco_format { my ($self, %options) = @_; @@ -299,18 +329,13 @@ sub disco_show { next if (defined($self->{option_results}->{filter_status}) && defined($result->{$self->{oid_opstatus} . "." . $_}) && $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}} !~ /$self->{option_results}->{filter_status}/i); next if ($self->is_admin_status_down(admin_status => $result->{$self->{oid_adminstatus} . "." . $_})); - - my %extra_values = (); - foreach my $name (keys %{$self->{extra_oids}}) { - $extra_values{$name} = defined($result->{$self->{extra_oids}->{$name} . "." . $_}) ? - $result->{$self->{extra_oids}->{$name} . "." . $_} : ''; - } - + + my $extra_values = $self->get_extra_values_by_instance(instance => $_); $self->{output}->add_disco_entry(name => $display_value, total => $interface_speed, status => defined($result->{$self->{oid_opstatus} . "." . $_}) ? $self->{oid_opstatus_mapping}->{$result->{$self->{oid_opstatus} . "." . $_}} : '', interfaceid => $_, - %extra_values); + %$extra_values); } } @@ -364,7 +389,10 @@ Regexp dst to transform display value. (security risk!!!) =item B<--add-extra-oid> -Display an OID. Example: --add-extra-oid='alias,.1.3.6.1.2.1.31.1.1.1.18' +Display an OID. +Example: --add-extra-oid='alias,.1.3.6.1.2.1.31.1.1.1.18' +or --add-extra-oid='vlan,.1.3.6.1.2.1.31.19,%{instance}\..*' + =back From 6a5613dd4320a5f21c4ce8ebf26e883433a33388 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 27 May 2016 14:57:51 +0200 Subject: [PATCH 220/346] + Fix extra-oid display --- centreon-plugins/snmp_standard/mode/listinterfaces.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index c7cc292a0..66985c012 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -172,10 +172,8 @@ sub run { my $extra_values = $self->get_extra_values_by_instance(instance => $_); my $extra_display = ''; - my $extra_display_append = ' '; foreach my $name (keys %{$extra_values}) { - $extra_display .= $extra_display_append . $name . ' = ' . $extra_values->{$name}; - $extra_display_append = ', '; + $extra_display .= ', ' . $name . ' = ' . $extra_values->{$name}; } $self->{output}->output_add(long_msg => "'" . $display_value . "' [speed = $interface_speed, status = " . From 7d7887d8df31ff8db1a7f204030ac04596230d4b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 30 May 2016 12:38:11 +0200 Subject: [PATCH 221/346] + Ref #334 --- .../hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm index 579e594c7..1c55054e8 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm @@ -109,7 +109,7 @@ sub manage_selection { next if ($oid !~ /^(.*)\.(.*?)\.(.*?)$/); my ($base, $instance) = ($1 . '.' . $2, $3); next if (!defined($oids->{$base})); - next if ($results->{$oid} !~ /\d/ || $results->{$oid} == 0); + next if ($results->{$oid} !~ /\d/); $self->{line}->{$instance} = { display => $instance } if (!defined($self->{line}->{$instance})); $self->{line}->{$instance}->{$oids->{$base}->{name}} = $results->{$oid} * $oids->{$base}->{factor}; From be7b455cca1cad7419f7d2339a2091f911b60d06 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 30 May 2016 13:15:09 +0200 Subject: [PATCH 222/346] + revert commit --- .../hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm index 1c55054e8..579e594c7 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/inputlines.pm @@ -109,7 +109,7 @@ sub manage_selection { next if ($oid !~ /^(.*)\.(.*?)\.(.*?)$/); my ($base, $instance) = ($1 . '.' . $2, $3); next if (!defined($oids->{$base})); - next if ($results->{$oid} !~ /\d/); + next if ($results->{$oid} !~ /\d/ || $results->{$oid} == 0); $self->{line}->{$instance} = { display => $instance } if (!defined($self->{line}->{$instance})); $self->{line}->{$instance}->{$oids->{$base}->{name}} = $results->{$oid} * $oids->{$base}->{factor}; From 43f2ac236da3ba96d6c5b03dbd379c60ced998c8 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 30 May 2016 21:15:46 +0200 Subject: [PATCH 223/346] + Ref #415 --- .../storage/netapp/snmp/mode/filesys.pm | 213 ++++++------------ 1 file changed, 75 insertions(+), 138 deletions(-) diff --git a/centreon-plugins/storage/netapp/snmp/mode/filesys.pm b/centreon-plugins/storage/netapp/snmp/mode/filesys.pm index 50c4baa2f..27082c385 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/filesys.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/filesys.pm @@ -20,32 +20,56 @@ package storage::netapp::snmp::mode::filesys; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::values; -my $maps_counters = { - '000_usage' => { set => { - key_values => [ { name => 'name' }, { name => 'used' }, { name => 'total' }, - { name => 'dfCompressSavedPercent' }, { name => 'dfDedupeSavedPercent' } ], - closure_custom_calc => \&custom_usage_calc, - closure_custom_output => \&custom_usage_output, - closure_custom_perfdata => \&custom_usage_perfdata, - closure_custom_threshold_check => \&custom_usage_threshold, - } - }, - '001_inodes' => { set => { - key_values => [ { name => 'dfPerCentInodeCapacity' }, { name => 'name' } ], - output_template => 'Inodes Used : %s %%', output_error_template => "Inodes : %s", - perfdatas => [ - { label => 'inodes', value => 'dfPerCentInodeCapacity_absolute', template => '%d', - unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'name_absolute' }, - ], - } - }, -}; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'fs', type => 1, cb_prefix_output => 'prefix_fs_output', message_multiple => 'All filesystems are ok.' }, + ]; + + $self->{maps_counters}->{fs} = [ + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + { label => 'inodes', set => { + key_values => [ { name => 'dfPerCentInodeCapacity' }, { name => 'display' } ], + output_template => 'Inodes Used : %s %%', output_error_template => "Inodes : %s", + perfdatas => [ + { label => 'inodes', value => 'dfPerCentInodeCapacity_absolute', template => '%d', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'compresssaved', set => { + key_values => [ { name => 'dfCompressSavedPercent' }, { name => 'display' } ], + output_template => 'Compress Saved : %s %%', output_error_template => "Compress Saved : %s", + perfdatas => [ + { label => 'compresssaved', value => 'dfCompressSavedPercent_absolute', template => '%d', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'dedupsaved', set => { + key_values => [ { name => 'dfDedupeSavedPercent' }, { name => 'display' } ], + output_template => 'Dedupe Saved : %s %%', output_error_template => "Dedupe Saved : %s", + perfdatas => [ + { label => 'dedupsaved', value => 'dfDedupeSavedPercent_absolute', template => '%d', + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} my $instance_mode; @@ -60,7 +84,7 @@ sub custom_usage_perfdata { $value_perf = $self->{result_values}->{free}; } my $extra_label = ''; - $extra_label = '_' . $self->{result_values}->{name} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); my %total_options = (); if ($instance_mode->{option_results}->{units} eq '%') { $total_options{total} = $self->{result_values}->{total}; @@ -72,18 +96,6 @@ sub custom_usage_perfdata { warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), min => 0, max => $self->{result_values}->{total}); - if (defined($self->{result_values}->{dfCompressSavedPercent}) && $self->{result_values}->{dfCompressSavedPercent} ne '' && - $self->{result_values}->{dfCompressSavedPercent} >= 0) { - $self->{output}->perfdata_add(label => 'compresssaved' . $extra_label, unit => '%', - value => $self->{result_values}->{dfCompressSavedPercent}, - min => 0, max => 100); - } - if (defined($self->{result_values}->{dfDedupeSavedPercent}) && $self->{result_values}->{dfDedupeSavedPercent} ne '' && - $self->{result_values}->{dfDedupeSavedPercent} >= 0) { - $self->{output}->perfdata_add(label => 'dedupsaved' . $extra_label, unit => '%', - value => $self->{result_values}->{dfDedupeSavedPercent}, - min => 0, max => 100); - } } sub custom_usage_threshold { @@ -124,11 +136,9 @@ sub custom_usage_output { sub custom_usage_calc { my ($self, %options) = @_; - $self->{result_values}->{name} = $options{new_datas}->{$self->{instance} . '_name'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; - $self->{result_values}->{dfCompressSavedPercent} = $options{new_datas}->{$self->{instance} . '_dfCompressSavedPercent'}; - $self->{result_values}->{dfDedupeSavedPercent} = $options{new_datas}->{$self->{instance} . '_dfDedupeSavedPercent'}; return 0 if ($options{new_datas}->{$self->{instance} . '_total'} == 0); $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; @@ -144,6 +154,12 @@ sub custom_usage_calc { return 0; } +sub prefix_fs_output { + my ($self, %options) = @_; + + return "Filesys '" . $options{instance_value}->{display} . "' "; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -156,96 +172,17 @@ sub new { "free" => { name => 'free' }, "filter-name:s" => { name => 'filter_name' }, "filter-type:s" => { name => 'filter_type' }, - }); - - foreach (keys %{$maps_counters}) { - my ($id, $name) = split /_/; - if (!defined($maps_counters->{$_}->{threshold}) || $maps_counters->{$_}->{threshold} != 0) { - $options{options}->add_options(arguments => { - 'warning-' . $name . ':s' => { name => 'warning-' . $name }, - 'critical-' . $name . ':s' => { name => 'critical-' . $name }, - }); - } - $maps_counters->{$_}->{obj} = centreon::plugins::values->new(output => $self->{output}, perfdata => $self->{perfdata}, - label => $name); - $maps_counters->{$_}->{obj}->set(%{$maps_counters->{$_}->{set}}); - } - + }); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); - - foreach (keys %{$maps_counters}) { - $maps_counters->{$_}->{obj}->init(option_results => $self->{option_results}); - } + $self->SUPER::check_options(%options); $instance_mode = $self; } -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - $self->manage_selection(); - - my $multiple = 1; - if (scalar(keys %{$self->{filesys_selected}}) == 1) { - $multiple = 0; - } - - if ($multiple == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'All filesys usages are ok'); - } - - foreach my $id (sort keys %{$self->{filesys_selected}}) { - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits; - foreach (sort keys %{$maps_counters}) { - $maps_counters->{$_}->{obj}->set(instance => $id); - - my ($value_check) = $maps_counters->{$_}->{obj}->execute(values => $self->{filesys_selected}->{$id}); - - if ($value_check != 0) { - $long_msg .= $long_msg_append . $maps_counters->{$_}->{obj}->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $maps_counters->{$_}->{obj}->threshold_check(); - push @exits, $exit2; - - my $output = $maps_counters->{$_}->{obj}->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $maps_counters->{$_}->{obj}->perfdata(extra_instance => $multiple); - } - - $self->{output}->output_add(long_msg => "Filesys '" . $self->{filesys_selected}->{$id}->{name} . "' $long_msg"); - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "Filesys '" . $self->{filesys_selected}->{$id}->{name} . "' $short_msg" - ); - } - - if ($multiple == 0) { - $self->{output}->output_add(short_msg => "Filesys '" . $self->{filesys_selected}->{$id}->{name} . "' $long_msg"); - } - } - - $self->{output}->display(); - $self->{output}->exit(); -} - my %map_types = ( 1 => 'traditionalVolume', 2 => 'flexibleVolume', @@ -279,45 +216,45 @@ sub manage_selection { { oid => $mapping2->{dfCompressSavedPercent}->{oid} }, { oid => $mapping2->{dfDedupeSavedPercent}->{oid} }, ]; - if (!$self->{snmp}->is_snmpv1()) { + if (!$options{snmp}->is_snmpv1()) { push @{$oids}, { oid => $mapping2->{df64TotalKBytes}->{oid} }, { oid => $mapping2->{df64UsedKBytes}->{oid} }; } - my $results = $self->{snmp}->get_multiple_table(oids => $oids, return_type => 1, nothing_quit => 1); - $self->{filesys_selected} = {}; + my $results = $options{snmp}->get_multiple_table(oids => $oids, return_type => 1, nothing_quit => 1); + $self->{fs} = {}; foreach my $oid (keys %{$results}) { next if ($oid !~ /^$mapping2->{dfFileSys}->{oid}\.(\d+)/); my $instance = $1; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $results, instance => $instance); - my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $results, instance => $instance); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $results, instance => $instance); + my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $results, instance => $instance); my $name = $result2->{dfFileSys}; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $name . "': no matching filter name."); + $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter name.", debug => 1); next; } if (defined($self->{option_results}->{filter_type}) && $self->{option_results}->{filter_type} ne '' && $result->{dfType} !~ /$self->{option_results}->{filter_type}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $result->{dfType} . "': no matching filter type."); + $self->{output}->output_add(long_msg => "skipping '" . $result->{dfType} . "': no matching filter type.", debug => 1); next; } - $self->{filesys_selected}->{$instance} = { name => $name }; - $self->{filesys_selected}->{$instance}->{total} = $result2->{dfKBytesTotal} * 1024; - $self->{filesys_selected}->{$instance}->{used} = $result2->{dfKBytesUsed} * 1024; + $self->{fs}->{$instance} = { display => $name }; + $self->{fs}->{$instance}->{total} = $result2->{dfKBytesTotal} * 1024; + $self->{fs}->{$instance}->{used} = $result2->{dfKBytesUsed} * 1024; if (defined($result2->{df64TotalKBytes}) && $result2->{df64TotalKBytes} > 0) { - $self->{filesys_selected}->{$instance}->{total} = $result2->{df64TotalKBytes} * 1024; - $self->{filesys_selected}->{$instance}->{used} = $result2->{df64UsedKBytes} * 1024; + $self->{fs}->{$instance}->{total} = $result2->{df64TotalKBytes} * 1024; + $self->{fs}->{$instance}->{used} = $result2->{df64UsedKBytes} * 1024; } - $self->{filesys_selected}->{$instance}->{dfCompressSavedPercent} = $result2->{dfCompressSavedPercent}; - $self->{filesys_selected}->{$instance}->{dfDedupeSavedPercent} = $result2->{dfDedupeSavedPercent}; - if ($self->{filesys_selected}->{$instance}->{total} > 0) { - $self->{filesys_selected}->{$instance}->{dfPerCentInodeCapacity} = $result2->{dfPerCentInodeCapacity}; + $self->{fs}->{$instance}->{dfCompressSavedPercent} = $result2->{dfCompressSavedPercent}; + $self->{fs}->{$instance}->{dfDedupeSavedPercent} = $result2->{dfDedupeSavedPercent}; + if ($self->{fs}->{$instance}->{total} > 0) { + $self->{fs}->{$instance}->{dfPerCentInodeCapacity} = $result2->{dfPerCentInodeCapacity}; } } - if (scalar(keys %{$self->{filesys_selected}}) <= 0) { + if (scalar(keys %{$self->{fs}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No entry found."); $self->{output}->option_exit(); } @@ -336,12 +273,12 @@ Check filesystem usage (volumes, snapshots and aggregates also). =item B<--warning-*> Threshold warning. -Can be: usage, inodes (%). +Can be: usage, inodes (%), compresssaved (%), dedupsaved (%). =item B<--critical-*> Threshold critical. -Can be: usage, inodes (%). +Can be: usage, inodes (%), compresssaved (%), dedupsaved (%). =item B<--units> From 49bf44bf13d2dcf9dc42b8c1059357fc591b25fa Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 30 May 2016 22:14:30 +0200 Subject: [PATCH 224/346] + add filter on vdomain - add vpn traffic #261 --- .../common/fortinet/fortigate/mode/vpn.pm | 119 +++++++++++++----- 1 file changed, 85 insertions(+), 34 deletions(-) diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm index 09fe2b34a..cd6ae4cff 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/vpn.pm @@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter); use strict; use warnings; +use Digest::MD5 qw(md5_hex); my $instance_mode; @@ -70,34 +71,34 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'global', type => 0 }, + { name => 'vdstats', type => 1, cb_prefix_output => 'prefix_vd_output', message_multiple => 'All virtual domains are OK' }, { name => 'vpn', type => 1, cb_prefix_output => 'prefix_vpn_output', message_multiple => 'All VPNs states are OK' }, ]; - $self->{maps_counters}->{global} = [ + $self->{maps_counters}->{vdstats} = [ { label => 'users', set => { - key_values => [ { name => 'users' } ], + key_values => [ { name => 'users' }, { name => 'display' } ], output_template => 'Logged users: %s', perfdatas => [ { label => 'users', value => 'users_absolute', template => '%d', - min => 0, unit => 'users' }, + min => 0, unit => 'users', label_extra_instance => 1, instance_use => 'display_absolute' }, ], } }, { label => 'sessions', set => { - key_values => [ { name => 'sessions' } ], + key_values => [ { name => 'sessions' }, { name => 'display' } ], output_template => 'Active web sessions: %s', perfdatas => [ { label => 'sessions', value => 'sessions_absolute', template => '%d', - min => 0, unit => 'sessions' }, + min => 0, unit => 'sessions', label_extra_instance => 1, instance_use => 'display_absolute' }, ], } }, { label => 'tunnels', set => { - key_values => [ { name => 'tunnels' } ], + key_values => [ { name => 'tunnels' }, { name => 'display' } ], output_template => 'Active Tunnels: %s', perfdatas => [ { label => 'active_tunnels', value => 'tunnels_absolute', template => '%d', - min => 0, unit => 'tunnels' }, + min => 0, unit => 'tunnels', label_extra_instance => 1, instance_use => 'display_absolute' }, ], } }, @@ -112,9 +113,35 @@ sub set_counters { closure_custom_threshold_check => \&custom_threshold_output, } }, + { label => 'traffic-in', set => { + key_values => [ { name => 'traffic_in', diff => 1 }, { name => 'display' } ], + per_second => 1, output_change_bytes => 1, + output_template => 'Traffic In: %s %s/s', + perfdatas => [ + { label => 'traffic_in', value => 'traffic_in_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'traffic-out', set => { + key_values => [ { name => 'traffic_out', diff => 1 }, { name => 'display' } ], + per_second => 1, output_change_bytes => 1, + output_template => 'Traffic Out: %s %s/s', + perfdatas => [ + { label => 'traffic_out', value => 'traffic_out_per_second', template => '%.2f', + min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + } ]; } +sub prefix_vd_output { + my ($self, %options) = @_; + + return "Virtual domain '" . $options{instance_value}->{display} . "' "; +} + sub prefix_vpn_output { my ($self, %options) = @_; @@ -123,13 +150,14 @@ sub prefix_vpn_output { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "filter:s" => { name => 'filter' }, + "filter-vpn:s" => { name => 'filter_vpn' }, + "filter-vdomain:s" => { name => 'filter_vdomain' }, "warning-status:s" => { name => 'warning_status', default => '' }, "critical-status:s" => { name => 'critical_status', default => '%{state} eq "down"' }, }); @@ -160,43 +188,66 @@ my %map_status = ( ); my $mapping = { - fgVpnTunEntPhase2Name => '.1.3.6.1.4.1.12356.101.12.2.2.1.3', - fgVpnTunEntStatus => '.1.3.6.1.4.1.12356.101.12.2.2.1.20', - - fgVpnSslStatsLoginUsers => '.1.3.6.1.4.1.12356.101.12.2.3.1.2.1', - fgVpnSslStatsActiveWebSessions => '.1.3.6.1.4.1.12356.101.12.2.3.1.4.1', - fgVpnSslStatsActiveTunnels => '.1.3.6.1.4.1.12356.101.12.2.3.1.6.1', + fgVpnTunEntPhase2Name => { oid => '.1.3.6.1.4.1.12356.101.12.2.2.1.3' }, + fgVpnTunEntInOctets => { oid => '.1.3.6.1.4.1.12356.101.12.2.2.1.18' }, + fgVpnTunEntOutOctets => { oid => '.1.3.6.1.4.1.12356.101.12.2.2.1.19' }, + fgVpnTunEntStatus => { oid => '.1.3.6.1.4.1.12356.101.12.2.2.1.20', map => \%map_status }, }; -my $oid_fgVpnTunTable = '.1.3.6.1.4.1.12356.101.12.2.2'; +my $mapping2 = { + fgVpnSslStatsLoginUsers => { oid => '.1.3.6.1.4.1.12356.101.12.2.3.1.2' }, + fgVpnSslStatsActiveWebSessions => { oid => '.1.3.6.1.4.1.12356.101.12.2.3.1.4' }, + fgVpnSslStatsActiveTunnels => { oid => '.1.3.6.1.4.1.12356.101.12.2.3.1.6' }, +}; + +my $oid_fgVpnTunTable = '.1.3.6.1.4.1.12356.101.12.2.2.1'; my $oid_fgVpnSslStatsTable = '.1.3.6.1.4.1.12356.101.12.2.3'; +my $oid_fgVdEntName = '.1.3.6.1.4.1.12356.101.3.2.1.1.2'; sub manage_selection { my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + $self->{cache_name} = "fortigate_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + $self->{results} = $options{snmp}->get_multiple_table(oids => [ + { oid => $oid_fgVdEntName }, { oid => $oid_fgVpnTunTable }, { oid => $oid_fgVpnSslStatsTable }, ], , nothing_quit => 1); - foreach my $oid (keys %{$self->{results}->{$oid_fgVpnTunTable}}) { - next if ($oid !~ /^$mapping->{fgVpnTunEntPhase2Name}\.(.*)$/); + foreach my $oid (keys %{$self->{results}->{ $oid_fgVdEntName }}) { + $oid =~ /^$oid_fgVdEntName\.(.*)$/; my $instance = $1; - my $vpn_name = $self->{results}->{$oid_fgVpnTunTable}->{$mapping->{fgVpnTunEntPhase2Name} . '.' . $instance}; - my $vpn_state = $map_status{$self->{results}->{$oid_fgVpnTunTable}->{$mapping->{fgVpnTunEntStatus} . '.' . $instance}}; - if (defined($self->{option_results}->{filter}) && $self->{option_results}->{filter} ne '' && - $vpn_name !~ /$self->{option_results}->{filter}/) { - $self->{output}->output_add(long_msg => "Skipping '" . $vpn_name . "': no matching filter.", debug => 1); + my $result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_fgVpnSslStatsTable}, instance => $instance); + my $vdomain_name = $self->{results}->{$oid_fgVdEntName}->{$oid_fgVdEntName.'.'.$instance}; + if (defined($self->{option_results}->{filter_vdomain}) && $self->{option_results}->{filter_vdomain} ne '' && + $vdomain_name !~ /$self->{option_results}->{filter_vdomain}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $vdomain_name . "': no matching filter.", debug => 1); next; } - $self->{vpn}->{$vpn_name} = { state => $vpn_state, display => $vpn_name }; + $self->{vdstats}->{$vdomain_name} = { users => $result->{fgVpnSslStatsLoginUsers}, + sessions => $result->{fgVpnSslStatsActiveWebSessions}, + tunnels => $result->{fgVpnSslStatsActiveTunnels}, + display => $vdomain_name }; } - $self->{global} = { users => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsLoginUsers}}, - sessions => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsActiveWebSessions}}, - tunnels => $self->{results}->{$oid_fgVpnSslStatsTable}->{$mapping->{fgVpnSslStatsActiveTunnels}} - }; + foreach my $oid (sort keys %{$self->{results}->{$oid_fgVpnTunTable}}) { + next if ($oid !~ /^$mapping->{fgVpnTunEntStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fgVpnTunTable}, instance => $instance); + if (defined($self->{option_results}->{filter_vpn}) && $self->{option_results}->{filter_vpn} ne '' && + $result->{fgVpnTunEntPhase2Name} !~ /$self->{option_results}->{filter_vpn}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $result->{fgVpnTunEntPhase2Name} . "': no matching filter.", debug => 1); + next; + } + $self->{vpn}->{$result->{fgVpnTunEntPhase2Name}} = { state => $result->{fgVpnTunEntStatus}, + traffic_in => $result->{fgVpnTunEntInOctets}, + traffic_out => $result->{fgVpnTunEntOutOctets}, + display => $result->{fgVpnTunEntPhase2Name} }; + } } 1; @@ -205,21 +256,21 @@ __END__ =head1 MODE -Check global VPN utilization statistics and VPN link state +Check Vdomain statistics and VPN state and traffic =over 8 -=item B<--filter-counters> +=item B<--filter-*> -Warning on statistics. Can be ('users', 'sessions', 'tunnels', 'state') +Filter name with regexp. Can be ('vdomain', 'vpn') =item B<--warning-*> -Warning on statistics. Can be ('users', 'sessions', 'tunnels') +Warning on counters. Can be ('users', 'sessions', 'tunnels', 'traffic-in', 'traffic-out') =item B<--critical-*> -Warning on statistics. Can be ('users', 'sessions', 'tunnels') +Warning on counters. Can be ('users', 'sessions', 'tunnels', 'traffic-in', 'traffic-out') =item B<--warning-status> From dbe42c1e529213202da65215683794e65e126dc2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 1 Jun 2016 14:28:24 +0200 Subject: [PATCH 225/346] + Fix problem with java 8 --- .../centreon/common/jvm/mode/memory.pm | 168 ++++++++++++------ 1 file changed, 113 insertions(+), 55 deletions(-) diff --git a/centreon-plugins/centreon/common/jvm/mode/memory.pm b/centreon-plugins/centreon/common/jvm/mode/memory.pm index 190a3d125..e2a09b1fa 100644 --- a/centreon-plugins/centreon/common/jvm/mode/memory.pm +++ b/centreon-plugins/centreon/common/jvm/mode/memory.pm @@ -20,11 +20,110 @@ package centreon::common::jvm::mode::memory; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'heap', type => 0 }, + { name => 'nonheap', type => 0 }, + ]; + + $self->{maps_counters}->{heap} = [ + { label => 'heap', set => { + key_values => [ { name => 'used' }, { name => 'max' }, { name => 'label' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; + $self->{maps_counters}->{nonheap} = [ + { label => 'nonheap', set => { + key_values => [ { name => 'used' }, { name => 'max' }, { name => 'label' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $use_th = 1; + $use_th = 0 if ($instance_mode->{option_results}->{units} eq '%' && $self->{result_values}->{max} <= 0); + + my $value_perf = $self->{result_values}->{used}; + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%' && $self->{result_values}->{max} > 0) { + $total_options{total} = $self->{result_values}->{max}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $self->{result_values}->{label}, unit => 'B', + value => $value_perf, + warning => $use_th == 1 ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options) : undef, + critical => $use_th == 1 ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options) : undef, + min => 0, max => $self->{result_values}->{max} > 0 ? $self->{result_values}->{max} : undef); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + # Cannot use percent without total + return 'ok' if ($self->{result_values}->{max} <= 0 && $instance_mode->{option_results}->{units} eq '%'); + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my $msg; + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + if ($self->{result_values}->{max} > 0) { + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max} - $self->{result_values}->{used}); + $msg = sprintf("%s Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", $self->{result_values}->{label}, + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, 100 - $self->{result_values}->{prct_used}); + } else { + $msg = sprintf("%s Used: %s", $self->{result_values}->{label}, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}); + } + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{label} = $options{new_datas}->{$self->{label} . '_label'}; + $self->{result_values}->{max} = $options{new_datas}->{$self->{instance} . '_max'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + + if ($self->{result_values}->{max} > 0) { + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{max}; + } + + return 0; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); @@ -32,75 +131,30 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "warning-heap:s" => { name => 'warning_heap' }, - "critical-heap:s" => { name => 'critical_heap' }, - "warning-nonheap:s" => { name => 'warning_nonheap' }, - "critical-nonheap:s" => { name => 'critical_nonheap' }, + { + "units:s" => { name => 'units', default => '%' }, }); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning-heap', value => $self->{option_results}->{warning_heap})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-heap threshold '" . $self->{option_results}->{warning_heap} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-heap', value => $self->{option_results}->{critical_heap})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-heap threshold '" . $self->{option_results}->{critical_heap} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning-nonheap', value => $self->{option_results}->{warning_nonheap})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-nonheap threshold '" . $self->{option_results}->{warning_nonheap} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical-nonheap', value => $self->{option_results}->{critical_nonheap})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-nonheap threshold '" . $self->{option_results}->{critical_nonheap} . "'."); - $self->{output}->option_exit(); - } + $self->SUPER::check_options(%options); + + $instance_mode = $self; } -sub run { +sub manage_selection { my ($self, %options) = @_; - $self->{connector} = $options{custom}; $self->{request} = [ { mbean => "java.lang:type=Memory" } ]; - my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 1); + my $result = $options{custom}->get_attributes(request => $self->{request}, nothing_quit => 1); - my $prct_heap = $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used} / $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{max} * 100; - my $prct_nonheap = $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used} / $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{max} * 100; - - my $exit1 = $self->{perfdata}->threshold_check(value => $prct_heap, - threshold => [ { label => 'critical-heap', exit_litteral => 'critical' }, { label => 'warning-heap', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $prct_nonheap, - threshold => [ { label => 'critical-nonheap', exit_litteral => 'critical' }, { label => 'warning-nonheap', exit_litteral => 'warning'} ]); - my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); - - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("HeapMemory Usage: %.2f%% - NonHeapMemoryUsage : %.2f%%", - $prct_heap, $prct_nonheap)); - - $self->{output}->perfdata_add(label => 'HeapMemoryUsage', unit => 'B', - value => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-heap', total => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used}, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-heap', total => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used}, cast_int => 1), - min => 0, max => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{max}); - - $self->{output}->perfdata_add(label => 'NonHeapMemoryUsage', unit => 'B', - value => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-nonheap', total => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used}, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-nonheap', total => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used}, cast_int => 1), - min => 0, max => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{max}); - - $self->{output}->display(); - $self->{output}->exit(); - + $self->{heap} = { label => 'HeapMemory', used => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used}, max => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{max} }; + $self->{nonheap} = { label => 'NonHeapMemoryUsage', used => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used}, max => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{max} }; } 1; @@ -132,6 +186,10 @@ Threshold warning of NonHeap memory usage Threshold critical of NonHeap memory usage +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + =back =cut From 03a45fb683674bb08c2c4a32016743679cfbaa32 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 1 Jun 2016 16:15:53 +0200 Subject: [PATCH 226/346] + Fix ap-users (thx to niclem) --- .../centreon/common/airespace/snmp/mode/apusers.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm index 4bee5bdc6..89d756d16 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/apusers.pm @@ -201,7 +201,7 @@ my $mapping3 = { my $oid_agentInventoryMachineModel = '.1.3.6.1.4.1.14179.1.1.1.3'; my $oid_bsnDot11EssSsid = '.1.3.6.1.4.1.14179.2.1.1.1.2'; -my $oid_bsnAPName = '.1.3.6.1.4.1.14179.2.2.1.1.3 '; +my $oid_bsnAPName = '.1.3.6.1.4.1.14179.2.2.1.1.3'; my $oid_bsnAPIfLoadNumOfClients = '.1.3.6.1.4.1.14179.2.2.13.1.4'; sub manage_selection { @@ -266,7 +266,7 @@ sub manage_selection { foreach my $oid2 (keys %{$self->{results}->{ $oid_bsnAPIfLoadNumOfClients }}) { next if ($oid2 !~ /^$oid_bsnAPIfLoadNumOfClients\.$instance\./); $self->{ap}->{$instance} = { display => $ap_name, total => 0 } if (!defined($self->{ap}->{$instance})); - $self->{ap}->{$instance} += $self->{results}->{$oid_bsnAPIfLoadNumOfClients}->{$oid2}; + $self->{ap}->{$instance}->{total} += $self->{results}->{$oid_bsnAPIfLoadNumOfClients}->{$oid2}; } } } From 1e223badb364d47a07f8aa482ede43241dfa8cd0 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 2 Jun 2016 09:46:20 +0200 Subject: [PATCH 227/346] + add ha-nodes mode Ref https://github.com/centreon/centreon-plugins/issues/99 --- centreon-plugins/network/netasq/snmp/plugin.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index 751fb4acf..a77fcd082 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -39,6 +39,7 @@ sub new { 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'load' => 'snmp_standard::mode::loadaverage', 'ha-status' => 'network::netasq::snmp::mode::hastatus', + 'ha-nodes' => 'network::netasq::snmp::mode::hanodes', 'memory' => 'os::freebsd::snmp::mode::memory', 'storage' => 'snmp_standard::mode::storage', 'swap' => 'snmp_standard::mode::swap', From d73285618e623ecd4cfbf2394fe16c6dfd63d11a Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 2 Jun 2016 09:48:08 +0200 Subject: [PATCH 228/346] + add ha-nodes mode Ref https://github.com/centreon/centreon-plugins/issues/99 --- .../network/netasq/snmp/mode/hanodes.pm | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 centreon-plugins/network/netasq/snmp/mode/hanodes.pm diff --git a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm new file mode 100644 index 000000000..d12d6c8fd --- /dev/null +++ b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm @@ -0,0 +1,205 @@ +# +# Copyright 2016 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::netasq::snmp::mode::hanodes; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_state}) && $instance_mode->{option_results}->{critical_state} ne '' && + eval "$instance_mode->{option_results}->{critical_state}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_state}) && $instance_mode->{option_results}->{warning_state} ne '' && + eval "$instance_mode->{option_results}->{warning_state}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_state_output { + my ($self, %options) = @_; + + my $msg = sprintf("state is '%s'", $self->{result_values}->{state}); + return $msg; +} + +sub custom_state_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'nodes', type => 1, cb_prefix_output => 'prefix_node_output', message_multiple => 'All HA nodes are OK' }, + ]; + + $self->{maps_counters}->{nodes} = [ + { label => 'state', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => \&custom_state_calc, + closure_custom_output => \&custom_state_output, + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => \&custom_threshold_output, + } + }, + { label => 'health', set => { + key_values => [ { name => 'health' }, { name => 'display' } ], + output_template => 'node Health: %s%%', + perfdatas => [ + { label => 'health', value => 'health_absolute', template => '%d', + min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + } + ]; +} + +sub prefix_node_output { + my ($self, %options) = @_; + + return "Node '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-node:s" => { name => 'filter_node' }, + "warning-state:s" => { name => 'warning_state', default => '' }, + "critical-state:s" => { name => 'critical_state', default => '%{state} eq "offline"' }, + }); + return $self; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_state', 'critical_state')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->change_macros(); + $instance_mode = $self; +} + +my %map_status = ( + 1 => 'online', + 2 => 'offline', +); + +my $mapping = { + ntqFwSerial => { oid => '.1.3.6.1.4.1.11256.1.11.7.1.2' }, + ntqHAQuality => { oid => '.1.3.6.1.4.1.11256.1.11.7.1.7' }, + ntqOnline => { oid => '.1.3.6.1.4.1.11256.1.11.7.1.3', map => \%map_status }, +}; + +my $oid_ntqNodeTable = '.1.3.6.1.4.1.11256.1.11.7'; + +sub manage_selection { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + $self->{results} = $options{snmp}->get_table(oid => $oid_ntqNodeTable, + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}}) { + $oid =~ /^$mapping->{ntqOnline}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + if (defined($self->{option_results}->{filter_nodes}) && $self->{option_results}->{filter_nodes} ne '' && + $result->{ntqFwSerial} !~ /$self->{option_results}->{filter_nodes}/) { + $self->{output}->output_add(long_msg => "Skipping '" . $result->{ntqFwSerial} . "': no matching filter.", debug => 1); + next; + } + $self->{nodes}->{$result->{ntqFwSerial}} = { state => $result->{ntqOnline}, + health => $result->{ntqHAQuality}, + display => $result->{ntqFwSerial} }; + } +} + +1; + +__END__ + +=head1 MODE + +Check Netasq node state and health + +=over 8 + +=item B<--filter-node> + +Filter name with regexp. + +=item B<--warning-health> + +Warning on health level. (e.g --warning 90:) + +=item B<--critical-health> + +Critical on health level. (e.g --critical 80:) + +=item B<--warning-state> + +Set warning threshold for status. Use "%{state}" as a special variable. +Value can be 'online' or 'offline'. + +=item B<--critical-state> + +Set critical threshold for status. Use "%{state}" as a special variable. +Value can be 'online' or 'offline'. + +=back + +=cut From 7cbbbfd0748664f368d0a09029a2249541d29245 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 3 Jun 2016 12:00:49 +0200 Subject: [PATCH 229/346] + Fix subject for x509 --- .../apps/protocols/x509/mode/validity.pm | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/apps/protocols/x509/mode/validity.pm b/centreon-plugins/apps/protocols/x509/mode/validity.pm index 30639a39d..1061fa6f3 100644 --- a/centreon-plugins/apps/protocols/x509/mode/validity.pm +++ b/centreon-plugins/apps/protocols/x509/mode/validity.pm @@ -113,17 +113,28 @@ sub run { #Subject Name } elsif ($self->{option_results}->{validity_mode} eq 'subject') { my @subject_matched = (); - my @subject_name = Net::SSLeay::X509_get_subjectAltNames($cert); - foreach my $subject_name (@subject_name) { - if ($subject_name =~ /$self->{option_results}->{subjectname}/mi) { - push @subject_matched, $subject_name; + + my $subject = Net::SSLeay::X509_NAME_get_text_by_NID( + Net::SSLeay::X509_get_subject_name($cert), 13); # NID_CommonName + $subject =~s{\0$}{}; # work around Bug in Net::SSLeay <1.33 + if ($subject =~ /$self->{option_results}->{subjectname}/mi) { + push @subject_matched, $subject; + } else { + $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject), debug => 1); + } + + my @subject_alt_names = Net::SSLeay::X509_get_subjectAltNames($cert); + for (my $i = 0; $i < $#subject_alt_names; $i++) { + next if ($i % 2 == 0); + if ($subject_alt_names[$i] =~ /$self->{option_results}->{subjectname}/mi) { + push @subject_matched, $subject_alt_names[$i]; } else { - if ($subject_name =~ /[\w\-]+(\.[\w\-]+)*\.\w+/) { - $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_name), debug => 1); - } + $self->{output}->output_add(long_msg => sprintf("Subject Name '%s' is also present in Certificate", $subject_alt_names[$i]), debug => 1); } } + + if (@subject_matched == 0) { $self->{output}->output_add(severity => 'CRITICAL', short_msg => sprintf("No Subject Name matched '%s' in Certificate", $self->{option_results}->{subjectname})); From d58451776aadcd079240fa8f5785cc08da30a357 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 6 Jun 2016 11:26:35 +0200 Subject: [PATCH 230/346] + Fix header in http lib --- centreon-plugins/centreon/plugins/http.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/http.pm b/centreon-plugins/centreon/plugins/http.pm index 59e5fb41b..4f540d675 100644 --- a/centreon-plugins/centreon/plugins/http.pm +++ b/centreon-plugins/centreon/plugins/http.pm @@ -306,7 +306,7 @@ sub request { $self->{output}->exit(); } - $self->{headers} = $response->{headers}; + $self->{headers} = $response->headers(); $self->{response} = $response; return $response->content; } From 970fe26d54d1fa2ad5bb06db1b2ec7d27c810331 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Mon, 6 Jun 2016 12:56:14 +0200 Subject: [PATCH 231/346] + add plugin for Sonus https://github.com/centreon/centreon-plugins/issues/20 --- .../network/sonus/sbc/1000/snmp/plugin.pm | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm diff --git a/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm b/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm new file mode 100644 index 000000000..349e54551 --- /dev/null +++ b/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm @@ -0,0 +1,57 @@ +# +# Copyright 2016 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::sonus::sbc::1000::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; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'cpu' => 'snmp_standard::mode::cpu', + 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', + 'dsp-stats' => 'network::sonus::sbc::1000::snmp::mode::dspstats', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'load' => 'snmp_standard::mode::loadaverage', + 'memory' => 'snmp_standard::mode::memory', + 'storage' => 'snmp_standard::mode::storage', + 'swap' => 'snmp_standard::mode::swap', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Sonus UX SBC 1000 SNMP + +=cut From f38813552f57a06e6a0e8d2c5651ad36d3f25f80 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Mon, 6 Jun 2016 14:44:45 +0200 Subject: [PATCH 232/346] Api token with get_header method --- .../openstack/restapi/mode/floatingips.pm | 244 +++++++++++++++ .../openstack/restapi/mode/infoinstance.pm | 242 +++++++++++++++ .../openstack/restapi/mode/listhypervisors.pm | 272 +++++++++++++++++ .../openstack/restapi/mode/listinstances.pm | 285 ++++++++++++++++++ .../cloud/openstack/restapi/mode/volumes.pm | 244 +++++++++++++++ .../cloud/openstack/restapi/plugin.pm | 52 ++++ 6 files changed, 1339 insertions(+) create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/volumes.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/plugin.pm diff --git a/centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm b/centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm new file mode 100644 index 000000000..940f08f82 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm @@ -0,0 +1,244 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::floatingips; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; +use Data::Dumper; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{instance_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-floating-ips"; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + print Dumper($webcontent); + exit 1; +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{instance_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + $instancename, + $self->{instance_infos}->{$instancename}->{id}, + $self->{instance_infos}->{$instancename}->{compute}, + $self->{instance_infos}->{$instancename}->{osname}, + $self->{instance_infos}->{$instancename}->{state})); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List instances:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm b/centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm new file mode 100644 index 000000000..58b05eab0 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm @@ -0,0 +1,242 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::infoinstance; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; +use Data::Dumper; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "server-response:s" => { name => 'server_response', default => 'full' }, + "tenant-id:s" => { name => 'tenant_id' }, + "server-id:s" => { name => 'server_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{instance_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + + eval { + $self->{header} = $response->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/".$self->{option_results}->{server_id}; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{option_results}->{server_response} = 'content'; + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + print Dumper($webcontent); + + #foreach my $val (@{$webcontent->{servers}}) { + # $self->{instance_infos}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; + # $self->{instance_infos}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; + # $self->{instance_infos}->{state} = $val->{status}; + #} +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + #foreach my $instancename (keys %{$self->{instance_infos}}) { + # $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + # $instancename, + # $self->{instance_infos}->{$instancename}->{id}, + # $self->{instance_infos}->{$instancename}->{compute}, + # $self->{instance_infos}->{$instancename}->{osname}, + # $self->{instance_infos}->{$instancename}->{state})); + #} + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List instances:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm new file mode 100644 index 000000000..5165c872e --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm @@ -0,0 +1,272 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::listhypervisors; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{hypervisor_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-hypervisors/detail"; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + foreach my $val (@{$webcontent->{hypervisors}}) { + my $hypervisorname = $val->{hypervisor_hostname}; + $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress} = $val->{host_ip}; + $self->{hypervisor_infos}->{$hypervisorname}->{type} = $val->{hypervisor_type}; + $self->{hypervisor_infos}->{$hypervisorname}->{status} = $val->{status}; + $self->{hypervisor_infos}->{$hypervisorname}->{state} = $val->{state}; + } +} + +sub disco_format { + my ($self, %options) = @_; + + my $names = ['name', 'ip', 'type', 'status', 'state']; + $self->{output}->add_disco_format(elements => $names); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { + $self->{output}->add_disco_entry(name => $hypervisorname, + ip => $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, + type => $self->{hypervisor_infos}->{$hypervisorname}->{type}, + status => $self->{hypervisor_infos}->{$hypervisorname}->{statuse}, + state => $self->{hypervisor_infos}->{$hypervisorname}->{state}, + ); + } +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [ip = %s, type = %s, status = %s, state = %s]", + $hypervisorname, + $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, + $self->{hypervisor_infos}->{$hypervisorname}->{type}, + $self->{hypervisor_infos}->{$hypervisorname}->{status}, + $self->{hypervisor_infos}->{$hypervisorname}->{state},)); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List hypervisors:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack hypervisors through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm new file mode 100644 index 000000000..25decf343 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm @@ -0,0 +1,285 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::listinstances; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{instance_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/detail"; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + foreach my $val (@{$webcontent->{servers}}) { + my $instancestate; + if ($val->{status} eq "ACTIVE") { + next if ($self->check_exclude(status => 'Running')); + $instancestate = $val->{status}; + } elsif ($val->{status} eq "SUSPENDED" || $val->{status} eq "PAUSED") { + next if ($self->check_exclude(status => 'Paused')); + $instancestate = $val->{status}; + } elsif ($val->{status} eq "SHUTOFF") { + next if ($self->check_exclude(status => 'Off')); + $instancestate = $val->{status}; + } elsif ($val->{status} eq "REBUILD" || $val->{status} eq "HARD_REBOOT") { + next if ($self->check_exclude(status => 'Reboot')); + $instancestate = $val->{status}; + } + my $instancename = $val->{name}; + $self->{instance_infos}->{$instancename}->{id} = $val->{id}; + $self->{instance_infos}->{$instancename}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; + $self->{instance_infos}->{$instancename}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; + $self->{instance_infos}->{$instancename}->{state} = $instancestate; + } +} + +sub disco_format { + my ($self, %options) = @_; + + my $names = ['name', 'id', 'compute', 'osname', 'state']; + $self->{output}->add_disco_format(elements => $names); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{instance_infos}}) { + $self->{output}->add_disco_entry(name => $instancename, + id => $self->{instance_infos}->{$instancename}->{id}, + compute => $self->{instance_infos}->{$instancename}->{compute}, + osname => $self->{instance_infos}->{$instancename}->{osname}, + state => $self->{instance_infos}->{$instancename}->{state}, + ); + } +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{instance_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + $instancename, + $self->{instance_infos}->{$instancename}->{id}, + $self->{instance_infos}->{$instancename}->{compute}, + $self->{instance_infos}->{$instancename}->{osname}, + $self->{instance_infos}->{$instancename}->{state})); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List instances:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/volumes.pm new file mode 100644 index 000000000..7ba580f91 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/volumes.pm @@ -0,0 +1,244 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::volumes; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; +use Data::Dumper; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{instance_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/detail"; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + print Dumper($webcontent); + exit 1; +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{instance_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + $instancename, + $self->{instance_infos}->{$instancename}->{id}, + $self->{instance_infos}->{$instancename}->{compute}, + $self->{instance_infos}->{$instancename}->{osname}, + $self->{instance_infos}->{$instancename}->{state})); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List instances:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/plugin.pm b/centreon-plugins/cloud/openstack/restapi/plugin.pm new file mode 100644 index 000000000..0b0edb844 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/plugin.pm @@ -0,0 +1,52 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + # $options->{options} = options object + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'info-instance' => 'cloud::openstack::restapi::mode::infoinstance', + 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', + 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', + 'floatingips' => 'cloud::openstack::restapi::mode::floatingips', + 'volumes' => 'cloud::openstack::restapi::mode::volumes', + ); + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Openstack Components with their API. + +=cut From e4ceafd93279531e480f9ecd62ef7597c26ddb6b Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 16:05:17 +0200 Subject: [PATCH 233/346] add monitoring for hypervisor/instance/network/port --- .../mode/{floatingips.pm => hypervisor.pm} | 121 +++++--- .../cloud/openstack/restapi/mode/instance.pm | 285 ++++++++++++++++++ .../openstack/restapi/mode/listhypervisors.pm | 7 +- .../cloud/openstack/restapi/mode/network.pm | 278 +++++++++++++++++ .../restapi/mode/{infoinstance.pm => port.pm} | 121 +++++--- .../restapi/mode/{volumes.pm => volume.pm} | 128 +++++--- .../cloud/openstack/restapi/plugin.pm | 8 +- 7 files changed, 812 insertions(+), 136 deletions(-) rename centreon-plugins/cloud/openstack/restapi/mode/{floatingips.pm => hypervisor.pm} (55%) create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/instance.pm create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/network.pm rename centreon-plugins/cloud/openstack/restapi/mode/{infoinstance.pm => port.pm} (53%) rename centreon-plugins/cloud/openstack/restapi/mode/{volumes.pm => volume.pm} (54%) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm similarity index 55% rename from centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm rename to centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm index 940f08f82..0e0235556 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/floatingips.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package cloud::openstack::restapi::mode::floatingips; +package cloud::openstack::restapi::mode::hypervisor; use base qw(centreon::plugins::mode); @@ -26,7 +26,13 @@ use strict; use warnings; use centreon::plugins::http; use JSON; -use Data::Dumper; + +my $thresholds = { + status => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ], +}; sub new { my ($class, %options) = @_; @@ -36,26 +42,28 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + "hypervisor-id:s" => { name => 'hypervisor_id' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, }); $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{instance_infos} = (); + $self->{hypervisor_infos} = (); return $self; } @@ -63,17 +71,22 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; + $self->{overload_th} = {}; + foreach my $val (@{$self->{option_results}->{threshold_overload}}) { + if ($val !~ /^(.*?),(.*?),(.*)$/) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); + $self->{output}->option_exit(); + } + my ($section, $status, $filter) = ($1, $2, $3); + if ($self->{output}->is_litteral_status(status => $status) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); + $self->{output}->option_exit(); + } + $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); + push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } - return 0; + + $self->{http}->set_options(%{$self->{option_results}}) } sub token_request { @@ -95,6 +108,7 @@ sub token_request { my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); my $headers = $self->{http}->get_header(); + eval { $self->{header} = $headers->header('X-Subject-Token'); }; @@ -109,7 +123,7 @@ sub api_request { my ($self, %options) = @_; $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-floating-ips"; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-hypervisors/".$self->{option_results}->{hypervisor_id}; $self->{option_results}->{port} = '8774'; @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); $self->{http}->set_options(%{$self->{option_results}}); @@ -123,8 +137,32 @@ sub api_request { $webcontent = $json->decode($jsoncontent); }; - print Dumper($webcontent); - exit 1; + $self->{hypervisor_infos}->{name} = $webcontent->{hypervisor}->{hypervisor_hostname}; + $self->{hypervisor_infos}->{state} = $webcontent->{hypervisor}->{state}; + $self->{hypervisor_infos}->{status} = $webcontent->{hypervisor}->{status}; +} + + +sub get_severity { + my ($self, %options) = @_; + my $status = 'UNKNOWN'; # default + + if (defined($self->{overload_th}->{$options{section}})) { + foreach (@{$self->{overload_th}->{$options{section}}}) { + if ($options{value} =~ /$_->{filter}/i) { + $status = $_->{status}; + return $status; + } + } + } + foreach (@{$thresholds->{$options{section}}}) { + if ($options{value} =~ /$$_[0]/i) { + $status = $$_[1]; + return $status; + } + } + + return $status; } sub run { @@ -133,19 +171,14 @@ sub run { $self->token_request(); $self->api_request(); - foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", - $instancename, - $self->{instance_infos}->{$instancename}->{id}, - $self->{instance_infos}->{$instancename}->{compute}, - $self->{instance_infos}->{$instancename}->{osname}, - $self->{instance_infos}->{$instancename}->{state})); - } + my $exit = $self->get_severity(section => 'status', value => $self->{hypervisor_infos}->{state}); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Hypervisor %s is %s (status: %s)", + $self->{hypervisor_infos}->{name}, + $self->{hypervisor_infos}->{state}, + $self->{hypervisor_infos}->{status})); - $self->{output}->output_add(severity => 'OK', - short_msg => 'List instances:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->display(); $self->{output}->exit(); exit 0; diff --git a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm new file mode 100644 index 000000000..c2d04433c --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm @@ -0,0 +1,285 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::instance; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +my $thresholds = { + status => [ + ['ACTIVE', 'OK'], + ['PAUSED', 'WARNING'], + ['SUSPENDED', 'WARNING'], + ['SHUTOFF', 'CRITICAL'], + ['REBUILD', 'WARNING'], + ['HARD_REBOOT', 'WARNING'], + ['ERROR', 'CRITCAL'], + ['BUILDING', 'OK'], + ['STOPPED', 'WARNING'], + ['DELETED', 'OK'], + ], +}; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + "instance-id:s" => { name => 'instance_id' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{instance_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{overload_th} = {}; + foreach my $val (@{$self->{option_results}->{threshold_overload}}) { + if ($val !~ /^(.*?),(.*?),(.*)$/) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); + $self->{output}->option_exit(); + } + my ($section, $status, $filter) = ($1, $2, $3); + if ($self->{output}->is_litteral_status(status => $status) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); + $self->{output}->option_exit(); + } + $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); + push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; + } + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/".$self->{option_results}->{instance_id}; + $self->{option_results}->{port} = '8774'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + $self->{instance_infos}->{name} = $webcontent->{server}->{name}; + $self->{instance_infos}->{vm_state} = $webcontent->{server}->{'OS-EXT-STS:vm_state'}; + $self->{instance_infos}->{state} = $webcontent->{server}->{status}; +} + + +sub get_severity { + my ($self, %options) = @_; + my $status = 'UNKNOWN'; # default + + if (defined($self->{overload_th}->{$options{section}})) { + foreach (@{$self->{overload_th}->{$options{section}}}) { + if ($options{value} =~ /$_->{filter}/i) { + $status = $_->{status}; + return $status; + } + } + } + foreach (@{$thresholds->{$options{section}}}) { + if ($options{value} =~ /$$_[0]/i) { + $status = $$_[1]; + return $status; + } + } + + return $status; +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + my $exit = $self->get_severity(section => 'status', value => $self->{instance_infos}->{state}); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Instance %s is in %s state (vm_state: %s)", + $self->{instance_infos}->{name}, + $self->{instance_infos}->{state}, + $self->{instance_infos}->{vm_state})); + + $self->{output}->display(); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm index 5165c872e..5e0e250a9 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm @@ -125,6 +125,7 @@ sub api_request { foreach my $val (@{$webcontent->{hypervisors}}) { my $hypervisorname = $val->{hypervisor_hostname}; + $self->{hypervisor_infos}->{$hypervisorname}->{id} = $val->{id}; $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress} = $val->{host_ip}; $self->{hypervisor_infos}->{$hypervisorname}->{type} = $val->{hypervisor_type}; $self->{hypervisor_infos}->{$hypervisorname}->{status} = $val->{status}; @@ -147,9 +148,10 @@ sub disco_show { foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { $self->{output}->add_disco_entry(name => $hypervisorname, + id => $self->{hypervisor_infos}->{$hypervisorname}->{id}, ip => $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, type => $self->{hypervisor_infos}->{$hypervisorname}->{type}, - status => $self->{hypervisor_infos}->{$hypervisorname}->{statuse}, + status => $self->{hypervisor_infos}->{$hypervisorname}->{status}, state => $self->{hypervisor_infos}->{$hypervisorname}->{state}, ); } @@ -162,8 +164,9 @@ sub run { $self->api_request(); foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [ip = %s, type = %s, status = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, ip = %s, type = %s, status = %s, state = %s]", $hypervisorname, + $self->{hypervisor_infos}->{$hypervisorname}->{id}, $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, $self->{hypervisor_infos}->{$hypervisorname}->{type}, $self->{hypervisor_infos}->{$hypervisorname}->{status}, diff --git a/centreon-plugins/cloud/openstack/restapi/mode/network.pm b/centreon-plugins/cloud/openstack/restapi/mode/network.pm new file mode 100644 index 000000000..71dde5f42 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/network.pm @@ -0,0 +1,278 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::network; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +my $thresholds = { + status => [ + ['ACTIVE', 'OK'], + ['BUILD', 'OK'], + ['DOWN', 'CRITICAL'], + ['ERROR', 'CRITICAL'], + ], +}; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "network-id:s" => { name => 'network_id' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{network_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{overload_th} = {}; + foreach my $val (@{$self->{option_results}->{threshold_overload}}) { + if ($val !~ /^(.*?),(.*?),(.*)$/) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); + $self->{output}->option_exit(); + } + my ($section, $status, $filter) = ($1, $2, $3); + if ($self->{output}->is_litteral_status(status => $status) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); + $self->{output}->option_exit(); + } + $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); + push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; + } + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2.0/networks/".$self->{option_results}->{network_id}; + $self->{option_results}->{port} = '9696'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + $self->{network_infos}->{name} = $webcontent->{network}->{name}; + $self->{network_infos}->{admin_state} = $webcontent->{network}->{admin_state_up}; + $self->{network_infos}->{status} = $webcontent->{network}->{status}; +} + + +sub get_severity { + my ($self, %options) = @_; + my $status = 'UNKNOWN'; # default + + if (defined($self->{overload_th}->{$options{section}})) { + foreach (@{$self->{overload_th}->{$options{section}}}) { + if ($options{value} =~ /$_->{filter}/i) { + $status = $_->{status}; + return $status; + } + } + } + foreach (@{$thresholds->{$options{section}}}) { + if ($options{value} =~ /$$_[0]/i) { + $status = $$_[1]; + return $status; + } + } + + return $status; +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + my $exit = $self->get_severity(section => 'status', value => $self->{network_infos}->{status}); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Network %s is in %s state (admin_state: %s)", + $self->{network_infos}->{name}, + $self->{network_infos}->{status}, + $self->{network_infos}->{admin_state})); + + $self->{output}->display(); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm similarity index 53% rename from centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm rename to centreon-plugins/cloud/openstack/restapi/mode/port.pm index 58b05eab0..fe5265924 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/infoinstance.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package cloud::openstack::restapi::mode::infoinstance; +package cloud::openstack::restapi::mode::port; use base qw(centreon::plugins::mode); @@ -26,7 +26,14 @@ use strict; use warnings; use centreon::plugins::http; use JSON; -use Data::Dumper; + +my $thresholds = { + status => [ + ['ACTIVE', 'OK'], + ['DOWN', 'CRITICAL'], + ['N/A', 'UNKNOWN'], + ], +}; sub new { my ($class, %options) = @_; @@ -36,28 +43,27 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "server-response:s" => { name => 'server_response', default => 'full' }, - "tenant-id:s" => { name => 'tenant_id' }, - "server-id:s" => { name => 'server_id' }, + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "port-id:s" => { name => 'port_id' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, }); $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{instance_infos} = (); + $self->{port_infos} = (); return $self; } @@ -65,6 +71,21 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + $self->{overload_th} = {}; + foreach my $val (@{$self->{option_results}->{threshold_overload}}) { + if ($val !~ /^(.*?),(.*?),(.*)$/) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); + $self->{output}->option_exit(); + } + my ($section, $status, $filter) = ($1, $2, $3); + if ($self->{output}->is_litteral_status(status => $status) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); + $self->{output}->option_exit(); + } + $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); + push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; + } + $self->{http}->set_options(%{$self->{option_results}}) } @@ -86,9 +107,10 @@ sub token_request { } my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); eval { - $self->{header} = $response->header('X-Subject-Token'); + $self->{header} = $headers->header('X-Subject-Token'); }; if ($@) { @@ -101,10 +123,9 @@ sub api_request { my ($self, %options) = @_; $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/".$self->{option_results}->{server_id}; - $self->{option_results}->{port} = '8774'; + $self->{option_results}->{url_path} = "/v2.0/ports/".$self->{option_results}->{port_id}; + $self->{option_results}->{port} = '9696'; @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{option_results}->{server_response} = 'content'; $self->{http}->set_options(%{$self->{option_results}}); my $webcontent; @@ -116,13 +137,32 @@ sub api_request { $webcontent = $json->decode($jsoncontent); }; - print Dumper($webcontent); + $self->{port_infos}->{name} = $webcontent->{port}->{name}; + $self->{port_infos}->{admin_state} = $webcontent->{port}->{admin_state_up}; + $self->{port_infos}->{status} = $webcontent->{port}->{status}; +} - #foreach my $val (@{$webcontent->{servers}}) { - # $self->{instance_infos}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; - # $self->{instance_infos}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; - # $self->{instance_infos}->{state} = $val->{status}; - #} + +sub get_severity { + my ($self, %options) = @_; + my $status = 'UNKNOWN'; # default + + if (defined($self->{overload_th}->{$options{section}})) { + foreach (@{$self->{overload_th}->{$options{section}}}) { + if ($options{value} =~ /$_->{filter}/i) { + $status = $_->{status}; + return $status; + } + } + } + foreach (@{$thresholds->{$options{section}}}) { + if ($options{value} =~ /$$_[0]/i) { + $status = $$_[1]; + return $status; + } + } + + return $status; } sub run { @@ -131,19 +171,14 @@ sub run { $self->token_request(); $self->api_request(); - #foreach my $instancename (keys %{$self->{instance_infos}}) { - # $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", - # $instancename, - # $self->{instance_infos}->{$instancename}->{id}, - # $self->{instance_infos}->{$instancename}->{compute}, - # $self->{instance_infos}->{$instancename}->{osname}, - # $self->{instance_infos}->{$instancename}->{state})); - #} + my $exit = $self->get_severity(section => 'status', value => $self->{port_infos}->{status}); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Port %s is in %s state (admin_state: %s)", + $self->{port_infos}->{name}, + $self->{port_infos}->{status}, + $self->{port_infos}->{admin_state})); - $self->{output}->output_add(severity => 'OK', - short_msg => 'List instances:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->display(); $self->{output}->exit(); exit 0; diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm similarity index 54% rename from centreon-plugins/cloud/openstack/restapi/mode/volumes.pm rename to centreon-plugins/cloud/openstack/restapi/mode/volume.pm index 7ba580f91..102c3315b 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/volumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package cloud::openstack::restapi::mode::volumes; +package cloud::openstack::restapi::mode::volume; use base qw(centreon::plugins::mode); @@ -26,7 +26,22 @@ use strict; use warnings; use centreon::plugins::http; use JSON; -use Data::Dumper; + +my $thresholds = { + status => [ + ['creating', 'OK'], + ['available', 'OK'], + ['attaching', 'OK'], + ['in-use', 'OK'], + ['deleting', 'OK'], + ['backing-up', 'WARNING'], + ['restoring-backup', 'WARNING'], + ['error', 'CRITICAL'], + ['error_deleting', 'CRITICAL'], + ['error_restoring', 'CRITICAL'], + ['error_extending', 'CRITICAL'], + ], +}; sub new { my ($class, %options) = @_; @@ -36,26 +51,28 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + "volume-id:s" => { name => 'volume_id' }, + "threshold-overload:s@" => { name => 'threshold_overload' }, }); $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{instance_infos} = (); + $self->{volume_infos} = (); return $self; } @@ -63,17 +80,22 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; + $self->{overload_th} = {}; + foreach my $val (@{$self->{option_results}->{threshold_overload}}) { + if ($val !~ /^(.*?),(.*?),(.*)$/) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); + $self->{output}->option_exit(); + } + my ($section, $status, $filter) = ($1, $2, $3); + if ($self->{output}->is_litteral_status(status => $status) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); + $self->{output}->option_exit(); + } + $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); + push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } - return 0; + + $self->{http}->set_options(%{$self->{option_results}}) } sub token_request { @@ -95,6 +117,7 @@ sub token_request { my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); my $headers = $self->{http}->get_header(); + eval { $self->{header} = $headers->header('X-Subject-Token'); }; @@ -109,7 +132,7 @@ sub api_request { my ($self, %options) = @_; $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/detail"; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volume/".$self->{option_results}->{volume_id}; $self->{option_results}->{port} = '8774'; @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); $self->{http}->set_options(%{$self->{option_results}}); @@ -123,8 +146,31 @@ sub api_request { $webcontent = $json->decode($jsoncontent); }; - print Dumper($webcontent); - exit 1; + $self->{volume_infos}->{name} = $webcontent->{volume}->{name}; + $self->{volume_infos}->{status} = $webcontent->{volume}->{status}; +} + + +sub get_severity { + my ($self, %options) = @_; + my $status = 'UNKNOWN'; # default + + if (defined($self->{overload_th}->{$options{section}})) { + foreach (@{$self->{overload_th}->{$options{section}}}) { + if ($options{value} =~ /$_->{filter}/i) { + $status = $_->{status}; + return $status; + } + } + } + foreach (@{$thresholds->{$options{section}}}) { + if ($options{value} =~ /$$_[0]/i) { + $status = $$_[1]; + return $status; + } + } + + return $status; } sub run { @@ -133,19 +179,13 @@ sub run { $self->token_request(); $self->api_request(); - foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", - $instancename, - $self->{instance_infos}->{$instancename}->{id}, - $self->{instance_infos}->{$instancename}->{compute}, - $self->{instance_infos}->{$instancename}->{osname}, - $self->{instance_infos}->{$instancename}->{state})); - } + my $exit = $self->get_severity(section => 'status', value => $self->{volume_infos}->{status}); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Volume %s is in %s state", + $self->{volume_infos}->{name}, + $self->{volume_infos}->{status}, - $self->{output}->output_add(severity => 'OK', - short_msg => 'List instances:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->display(); $self->{output}->exit(); exit 0; diff --git a/centreon-plugins/cloud/openstack/restapi/plugin.pm b/centreon-plugins/cloud/openstack/restapi/plugin.pm index 0b0edb844..02472d562 100644 --- a/centreon-plugins/cloud/openstack/restapi/plugin.pm +++ b/centreon-plugins/cloud/openstack/restapi/plugin.pm @@ -32,11 +32,13 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( - 'info-instance' => 'cloud::openstack::restapi::mode::infoinstance', + 'instance' => 'cloud::openstack::restapi::mode::instance', 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', - 'floatingips' => 'cloud::openstack::restapi::mode::floatingips', - 'volumes' => 'cloud::openstack::restapi::mode::volumes', + 'volume' => 'cloud::openstack::restapi::mode::volume', + 'hypervisor' => 'cloud::openstack::restapi::mode::hypervisor', + 'network' => 'cloud::openstack::restapi::mode::network', + 'port' => 'cloud::openstack::restapi::mode::port', ); return $self; } From b8e40db3f69a1fbd25d45fc5e224eb5eb8694501 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 16:36:37 +0200 Subject: [PATCH 234/346] fix typo and bad port --- centreon-plugins/cloud/openstack/restapi/mode/volume.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm index 102c3315b..219e87771 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm @@ -132,8 +132,8 @@ sub api_request { my ($self, %options) = @_; $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volume/".$self->{option_results}->{volume_id}; - $self->{option_results}->{port} = '8774'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/".$self->{option_results}->{volume_id}; + $self->{option_results}->{port} = '8776'; @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); $self->{http}->set_options(%{$self->{option_results}}); @@ -183,7 +183,7 @@ sub run { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Volume %s is in %s state", $self->{volume_infos}->{name}, - $self->{volume_infos}->{status}, + $self->{volume_infos}->{status})); $self->{output}->display(); $self->{output}->exit(); From f7084fd4f50b5f45e65d356550387022b5eb0e66 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 16:55:23 +0200 Subject: [PATCH 235/346] add volumes listing --- .../openstack/restapi/mode/listvolumes.pm | 271 ++++++++++++++++++ .../cloud/openstack/restapi/plugin.pm | 9 +- 2 files changed, 276 insertions(+), 4 deletions(-) create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm new file mode 100644 index 000000000..62ca59e42 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -0,0 +1,271 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::listvolumes; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + "tenant-id:s" => { name => 'tenant_id' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{volumes_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/detail"; + $self->{option_results}->{port} = '8776'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + foreach my $val (@{$webcontent->{volumes}}) { + my $volumename = $val->{name}; + $self->{volumes_infos}->{$instancename}->{id} = $val->{id}; + $self->{volumes_infos}->{$instancename}->{size} = $val->{size}; + $self->{volumes_infos}->{$instancename}->{type} = $val->{ivolume_type}; + $self->{volumes_infos}->{$instancename}->{state} = $val->{status}; + } +} + +sub disco_format { + my ($self, %options) = @_; + + my $names = ['name', 'id', 'type', 'size', 'state']; + $self->{output}->add_disco_format(elements => $names); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{volumes_infos}}) { + $self->{output}->add_disco_entry(name => $volumename, + id => $self->{volumes_infos}->{$volumename}->{id}, + size => $self->{volumes_infos}->{$volumename}->{size}, + type => $self->{volumes_infos}->{$volumename}->{type}, + state => $self->{volumes_infos}->{$volumename}->{state}, + ); + } +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $instancename (keys %{$self->{volumes_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %s, type = %s, state = %s]", + $volumename, + $self->{volumes_infos}->{$volumename}->{id}, + $self->{volumes_infos}->{$volumename}->{size}, + $self->{volumes_infos}->{$volumename}->{type}, + $self->{volumes_infos}->{$volumename}->{state})); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List volumes:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack instances through Compute API V2 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +OPENSTACK OPTIONS: + +=over 8 + +=item B<--tenant-id> + +Set Tenant's ID + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/plugin.pm b/centreon-plugins/cloud/openstack/restapi/plugin.pm index 02472d562..6fddcf884 100644 --- a/centreon-plugins/cloud/openstack/restapi/plugin.pm +++ b/centreon-plugins/cloud/openstack/restapi/plugin.pm @@ -32,13 +32,14 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( - 'instance' => 'cloud::openstack::restapi::mode::instance', - 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', - 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', - 'volume' => 'cloud::openstack::restapi::mode::volume', 'hypervisor' => 'cloud::openstack::restapi::mode::hypervisor', + 'instance' => 'cloud::openstack::restapi::mode::instance', + 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', + 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', + 'list-volumes' => 'cloud::openstack::restapi::mode::listvolumes', 'network' => 'cloud::openstack::restapi::mode::network', 'port' => 'cloud::openstack::restapi::mode::port', + 'volume' => 'cloud::openstack::restapi::mode::volume', ); return $self; } From 1bd5cd2b9836b5cd8284f34223a1e624693a1e88 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 16:59:25 +0200 Subject: [PATCH 236/346] fix bad remplacement --- .../cloud/openstack/restapi/mode/listvolumes.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index 62ca59e42..e6c77f86b 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -124,10 +124,10 @@ sub api_request { foreach my $val (@{$webcontent->{volumes}}) { my $volumename = $val->{name}; - $self->{volumes_infos}->{$instancename}->{id} = $val->{id}; - $self->{volumes_infos}->{$instancename}->{size} = $val->{size}; - $self->{volumes_infos}->{$instancename}->{type} = $val->{ivolume_type}; - $self->{volumes_infos}->{$instancename}->{state} = $val->{status}; + $self->{volumes_infos}->{$volumename}->{id} = $val->{id}; + $self->{volumes_infos}->{$volumename}->{size} = $val->{size}; + $self->{volumes_infos}->{$volumename}->{type} = $val->{ivolume_type}; + $self->{volumes_infos}->{$volumename}->{state} = $val->{status}; } } @@ -160,7 +160,7 @@ sub run { $self->token_request(); $self->api_request(); - foreach my $instancename (keys %{$self->{volumes_infos}}) { + foreach my $volumename (keys %{$self->{volumes_infos}}) { $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %s, type = %s, state = %s]", $volumename, $self->{volumes_infos}->{$volumename}->{id}, From 63bf35ed1cf283cee3fed1296de9b598d4d07a9a Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:00:29 +0200 Subject: [PATCH 237/346] fix bad remplacement again --- centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index e6c77f86b..f20f89fe1 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -144,7 +144,7 @@ sub disco_show { $self->token_request(); $self->api_request(); - foreach my $instancename (keys %{$self->{volumes_infos}}) { + foreach my $volumename (keys %{$self->{volumes_infos}}) { $self->{output}->add_disco_entry(name => $volumename, id => $self->{volumes_infos}->{$volumename}->{id}, size => $self->{volumes_infos}->{$volumename}->{size}, From 55869b7fc88ffd0fb2a791a307cc767826f0bea4 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:20:22 +0200 Subject: [PATCH 238/346] port can be exist without name --- centreon-plugins/cloud/openstack/restapi/mode/port.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index fe5265924..a1c90da35 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -136,8 +136,11 @@ sub api_request { eval { $webcontent = $json->decode($jsoncontent); }; - - $self->{port_infos}->{name} = $webcontent->{port}->{name}; + if ($self->{port_infos}->{name} eq '') { + $self->{port_infos}->{name} = "unknown"; + else { + $self->{port_infos}->{name} = $webcontent->{port}->{name}; + } $self->{port_infos}->{admin_state} = $webcontent->{port}->{admin_state_up}; $self->{port_infos}->{status} = $webcontent->{port}->{status}; } From 490293d627f0f2865e827d7b3578365e80e31d9d Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:23:13 +0200 Subject: [PATCH 239/346] add unit --- centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index f20f89fe1..7bd5b31f7 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -147,7 +147,7 @@ sub disco_show { foreach my $volumename (keys %{$self->{volumes_infos}}) { $self->{output}->add_disco_entry(name => $volumename, id => $self->{volumes_infos}->{$volumename}->{id}, - size => $self->{volumes_infos}->{$volumename}->{size}, + size => $self->{volumes_infos}->{$volumename}->{size}."Gb", type => $self->{volumes_infos}->{$volumename}->{type}, state => $self->{volumes_infos}->{$volumename}->{state}, ); @@ -161,7 +161,7 @@ sub run { $self->api_request(); foreach my $volumename (keys %{$self->{volumes_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %s, type = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %sGb, type = %s, state = %s]", $volumename, $self->{volumes_infos}->{$volumename}->{id}, $self->{volumes_infos}->{$volumename}->{size}, From 5e9e350e53b58124e19ac9beb0103b4075e016fb Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:25:16 +0200 Subject: [PATCH 240/346] bad syntax for if condition --- centreon-plugins/cloud/openstack/restapi/mode/port.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index a1c90da35..ca076c1ea 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -138,7 +138,7 @@ sub api_request { }; if ($self->{port_infos}->{name} eq '') { $self->{port_infos}->{name} = "unknown"; - else { + } else { $self->{port_infos}->{name} = $webcontent->{port}->{name}; } $self->{port_infos}->{admin_state} = $webcontent->{port}->{admin_state_up}; From 5018d0d82c35aeb3da0e71301aef46ccd82cd25f Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:26:55 +0200 Subject: [PATCH 241/346] bug day... --- centreon-plugins/cloud/openstack/restapi/mode/port.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index ca076c1ea..1adc57e55 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -136,7 +136,7 @@ sub api_request { eval { $webcontent = $json->decode($jsoncontent); }; - if ($self->{port_infos}->{name} eq '') { + if ($webcontent->{port}->{name} eq '') { $self->{port_infos}->{name} = "unknown"; } else { $self->{port_infos}->{name} = $webcontent->{port}->{name}; From 904cde0223d1d4220e22587d7091909a005cbca3 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Tue, 7 Jun 2016 17:29:37 +0200 Subject: [PATCH 242/346] change unknow to id for no name port --- centreon-plugins/cloud/openstack/restapi/mode/port.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index 1adc57e55..6cb6ab783 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -137,7 +137,7 @@ sub api_request { $webcontent = $json->decode($jsoncontent); }; if ($webcontent->{port}->{name} eq '') { - $self->{port_infos}->{name} = "unknown"; + $self->{port_infos}->{name} = $webcontent->{port}->{id}; } else { $self->{port_infos}->{name} = $webcontent->{port}->{name}; } From bf1a0ea5cebf39e2f014b93f1ad64eb10ad50a75 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 11:27:00 +0200 Subject: [PATCH 243/346] add list networks --- .../openstack/restapi/mode/listnetworks.pm | 260 ++++++++++++++++++ .../cloud/openstack/restapi/plugin.pm | 1 + 2 files changed, 261 insertions(+) create mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm new file mode 100644 index 000000000..2f55dcdc0 --- /dev/null +++ b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm @@ -0,0 +1,260 @@ +# +# Copyright 2015 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and application monitoring for +# service performance. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +package cloud::openstack::restapi::mode::listnetworks; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::http; +use JSON; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "data:s" => { name => 'data' }, + "hostname:s" => { name => 'hostname' }, + "http-peer-addr:s" => { name => 'http_peer_addr' }, + "port:s" => { name => 'port', default => '5000' }, + "proto:s" => { name => 'proto' }, + "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, + "proxyurl:s" => { name => 'proxyurl' }, + "proxypac:s" => { name => 'proxypac' }, + "credentials" => { name => 'credentials' }, + "username:s" => { name => 'username' }, + "password:s" => { name => 'password' }, + "ssl:s" => { name => 'ssl', }, + "header:s@" => { name => 'header' }, + "exclude:s" => { name => 'exclude' }, + "timeout:s" => { name => 'timeout' }, + }); + + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + $self->{networks_infos} = (); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + $self->{http}->set_options(%{$self->{option_results}}) +} + +sub check_exclude { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { + $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); + return 1; + } + return 0; +} + +sub token_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + if (defined($self->{option_results}->{data})) { + local $/ = undef; + if (!open(FILE, "<", $self->{option_results}->{data})) { + $self->{output}->output_add(severity => 'UNKNOWN', + short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); + $self->{output}->display(); + $self->{output}->exit(); + } + $self->{json_request} = ; + close FILE; + $self->{method} = 'POST'; + } + + my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); + my $headers = $self->{http}->get_header(); + eval { + $self->{header} = $headers->header('X-Subject-Token'); + }; + + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); + $self->{output}->option_exit(); + } +} + +sub api_request { + my ($self, %options) = @_; + + $self->{method} = 'GET'; + $self->{option_results}->{url_path} = "/v2.O/networks"; + $self->{option_results}->{port} = '9696'; + @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); + $self->{http}->set_options(%{$self->{option_results}}); + + my $webcontent; + my $jsoncontent = $self->{http}->request(method => $self->{method}); + + my $json = JSON->new; + + eval { + $webcontent = $json->decode($jsoncontent); + }; + + foreach my $val (@{$webcontent->{networks}}) { + my $networkname = $val->{name}; + $self->{networks_infos}->{$networkname}->{id} = $val->{id}; + $self->{networks_infos}->{$networkname}->{tenant_id} = $val->{tenant_id}; + $self->{networks_infos}->{$networkname}->{state} = $val->{status}; + $self->{networks_infos}->{$networkname}->{admin_state} = $val->{admin_state_up}; + } +} + +sub disco_format { + my ($self, %options) = @_; + + my $names = ['name', 'id', 'tenant', 'state', 'admin_state']; + $self->{output}->add_disco_format(elements => $names); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $networkname (keys %{$self->{networks_infos}}) { + $self->{output}->add_disco_entry(name => $networkname, + id => $self->{networks_infos}->{$networkname}->{id}, + tenant => $self->{networks_infos}->{$networkname}->{tenant}, + state => $self->{networks_infos}->{$networkname}->{state}, + admin_state => $self->{networks_infos}->{$networkname}->{admin_state}, + ); + } +} + +sub run { + my ($self, %options) = @_; + + $self->token_request(); + $self->api_request(); + + foreach my $networkname (keys %{$self->{networks_infos}}) { + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, tenant = %s, state = %sGb, admin_state = %s]", + $networkname, + $self->{networks_infos}->{$networkname}->{id}, + $self->{networks_infos}->{$networkname}->{tenant}, + $self->{networks_infos}->{$networkname}->{state}, + $self->{networks_infos}->{$networkname}->{admin_state})); + } + + $self->{output}->output_add(severity => 'OK', + short_msg => 'List networks:'); + + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); + + exit 0; +} + +1; + +__END__ + +=head1 MODE + +List OpenStack networks through Networking API V2.0 + +JSON OPTIONS: + +=over 8 + +=item B<--data> + +Set file with JSON request + +=back + +HTTP OPTIONS: + +=over 8 + +=item B<--hostname> + +IP Addr/FQDN of OpenStack Compute's API + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--port> + +Port used by OpenStack Keystone's API (Default: '5000') + +=item B<--proto> + +Specify https if needed (Default: 'http') + +=item B<--urlpath> + +Set path to get API's Token (Default: '/v3/auth/tokens') + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--credentials> + +Specify this option if you access webpage over basic authentification + +=item B<--username> + +Specify username + +=item B<--password> + +Specify password + +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + +=item B<--header> + +Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') + +=item B<--exlude> + +Exclude specific instance's state (comma seperated list) (Example: --exclude=ACTIVE) + +=item B<--timeout> + +Threshold for HTTP timeout (Default: 3) + +=back + +=cut diff --git a/centreon-plugins/cloud/openstack/restapi/plugin.pm b/centreon-plugins/cloud/openstack/restapi/plugin.pm index 6fddcf884..ed9951b1c 100644 --- a/centreon-plugins/cloud/openstack/restapi/plugin.pm +++ b/centreon-plugins/cloud/openstack/restapi/plugin.pm @@ -36,6 +36,7 @@ sub new { 'instance' => 'cloud::openstack::restapi::mode::instance', 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', + 'list-networks' => 'cloud::openstack::restapi::mode::listnetworks', 'list-volumes' => 'cloud::openstack::restapi::mode::listvolumes', 'network' => 'cloud::openstack::restapi::mode::network', 'port' => 'cloud::openstack::restapi::mode::port', From aafc47368ff64cc5520c3760a5f51f68fdad7f1e Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 11:29:31 +0200 Subject: [PATCH 244/346] update doc --- .../cloud/openstack/restapi/mode/hypervisor.pm | 15 ++++++++++----- .../cloud/openstack/restapi/mode/instance.pm | 17 +++++++++++------ .../openstack/restapi/mode/listhypervisors.pm | 2 +- .../openstack/restapi/mode/listinstances.pm | 7 +++++-- .../openstack/restapi/mode/listvolumes.pm | 9 ++++++--- .../cloud/openstack/restapi/mode/network.pm | 15 ++++++++------- .../cloud/openstack/restapi/mode/port.pm | 17 ++++++++++------- .../cloud/openstack/restapi/mode/volume.pm | 18 +++++++++++++----- 8 files changed, 64 insertions(+), 36 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm index 0e0235556..8f1ad7284 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm @@ -55,7 +55,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "hypervisor-id:s" => { name => 'hypervisor_id' }, @@ -254,14 +253,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,WARNING,^down$)' + =back OPENSTACK OPTIONS: @@ -272,6 +273,10 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--hypervisor-id> + +Set Hypervisor's ID + =back =cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm index c2d04433c..1057cae41 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm @@ -63,7 +63,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "instance-id:s" => { name => 'instance_id' }, @@ -198,7 +197,7 @@ __END__ =head1 MODE -List OpenStack instances through Compute API V2 +Monitor instance status through Compute API V2 JSON OPTIONS: @@ -262,14 +261,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^STOPPED$)' + =back OPENSTACK OPTIONS: @@ -280,6 +281,10 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--instance-id> + +Set Instance's ID + =back =cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm index 5e0e250a9..658e1910a 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm @@ -254,7 +254,7 @@ Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') =item B<--exlude> -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) +Exclude specific instance's state (comma seperated list) (Example: --exclude=disabled) =item B<--timeout> diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm index 25decf343..a3836c5ff 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm @@ -139,6 +139,7 @@ sub api_request { } my $instancename = $val->{name}; $self->{instance_infos}->{$instancename}->{id} = $val->{id}; + $self->{instance_infos}->{$instancename}->{zone} = $val->{'OS-EXT-AZ:availability_zone'}; $self->{instance_infos}->{$instancename}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; $self->{instance_infos}->{$instancename}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; $self->{instance_infos}->{$instancename}->{state} = $instancestate; @@ -148,7 +149,7 @@ sub api_request { sub disco_format { my ($self, %options) = @_; - my $names = ['name', 'id', 'compute', 'osname', 'state']; + my $names = ['name', 'id', 'zone', 'compute', 'osname', 'state']; $self->{output}->add_disco_format(elements => $names); } @@ -161,6 +162,7 @@ sub disco_show { foreach my $instancename (keys %{$self->{instance_infos}}) { $self->{output}->add_disco_entry(name => $instancename, id => $self->{instance_infos}->{$instancename}->{id}, + zone => $self->{instance_infos}->{$instancename}->{zone}, compute => $self->{instance_infos}->{$instancename}->{compute}, osname => $self->{instance_infos}->{$instancename}->{osname}, state => $self->{instance_infos}->{$instancename}->{state}, @@ -175,9 +177,10 @@ sub run { $self->api_request(); foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, compute = %s, osname = %s, state = %s]", $instancename, $self->{instance_infos}->{$instancename}->{id}, + $self->{instance_infos}->{$instancename}->{zone}, $self->{instance_infos}->{$instancename}->{compute}, $self->{instance_infos}->{$instancename}->{osname}, $self->{instance_infos}->{$instancename}->{state})); diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index 7bd5b31f7..530a2c424 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -125,6 +125,7 @@ sub api_request { foreach my $val (@{$webcontent->{volumes}}) { my $volumename = $val->{name}; $self->{volumes_infos}->{$volumename}->{id} = $val->{id}; + $self->{volumes_infos}->{$volumename}->{zone} = $val->{availability_zone}; $self->{volumes_infos}->{$volumename}->{size} = $val->{size}; $self->{volumes_infos}->{$volumename}->{type} = $val->{ivolume_type}; $self->{volumes_infos}->{$volumename}->{state} = $val->{status}; @@ -134,7 +135,7 @@ sub api_request { sub disco_format { my ($self, %options) = @_; - my $names = ['name', 'id', 'type', 'size', 'state']; + my $names = ['name', 'id', 'zone', 'type', 'size', 'state']; $self->{output}->add_disco_format(elements => $names); } @@ -147,6 +148,7 @@ sub disco_show { foreach my $volumename (keys %{$self->{volumes_infos}}) { $self->{output}->add_disco_entry(name => $volumename, id => $self->{volumes_infos}->{$volumename}->{id}, + zone => $self->{volumes_infos}->{$volumename}->{zone}, size => $self->{volumes_infos}->{$volumename}->{size}."Gb", type => $self->{volumes_infos}->{$volumename}->{type}, state => $self->{volumes_infos}->{$volumename}->{state}, @@ -161,9 +163,10 @@ sub run { $self->api_request(); foreach my $volumename (keys %{$self->{volumes_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %sGb, type = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, size = %sGb, type = %s, state = %s]", $volumename, $self->{volumes_infos}->{$volumename}->{id}, + $self->{volumes_infos}->{$volumename}->{zone}, $self->{volumes_infos}->{$volumename}->{size}, $self->{volumes_infos}->{$volumename}->{type}, $self->{volumes_infos}->{$volumename}->{state})); @@ -184,7 +187,7 @@ __END__ =head1 MODE -List OpenStack instances through Compute API V2 +List OpenStack volumes through Block Storage API V2 JSON OPTIONS: diff --git a/centreon-plugins/cloud/openstack/restapi/mode/network.pm b/centreon-plugins/cloud/openstack/restapi/mode/network.pm index 71dde5f42..b97807980 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/network.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/network.pm @@ -57,7 +57,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "network-id:s" => { name => 'network_id' }, "threshold-overload:s@" => { name => 'threshold_overload' }, @@ -255,23 +254,25 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^BUILD$)' + =back OPENSTACK OPTIONS: =over 8 -=item B<--tenant-id> +=item B<--network-id> -Set Tenant's ID +Set Network's ID =back diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index 6cb6ab783..ac17a3aa1 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -257,24 +257,27 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) =back +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^N\/A$)' + +=back + OPENSTACK OPTIONS: =over 8 -=item B<--tenant-id> +=item B<--port-id> -Set Tenant's ID +Set Port's ID =back -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm index 219e87771..7f9fb8b3d 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm @@ -64,7 +64,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "volume-id:s" => { name => 'volume_id' }, @@ -261,16 +260,20 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) =back +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^deleting$)' + +=back + OPENSTACK OPTIONS: =over 8 @@ -279,6 +282,11 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--volume-id> + +Set Volume's ID + =back =cut + From 82b8cb0a5e2c6da0b9428d5cf1404ca1ff713147 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 13:57:55 +0200 Subject: [PATCH 245/346] fix bad copy/paste --- centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm index 2f55dcdc0..f341f8600 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm @@ -107,7 +107,7 @@ sub api_request { my ($self, %options) = @_; $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2.O/networks"; + $self->{option_results}->{url_path} = "/v2.0/networks"; $self->{option_results}->{port} = '9696'; @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); $self->{http}->set_options(%{$self->{option_results}}); @@ -160,7 +160,7 @@ sub run { $self->api_request(); foreach my $networkname (keys %{$self->{networks_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s, tenant = %s, state = %sGb, admin_state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, tenant = %s, state = %s, admin_state = %s]", $networkname, $self->{networks_infos}->{$networkname}->{id}, $self->{networks_infos}->{$networkname}->{tenant}, From 29b004b0ec721f04d2406c524a1239becdbf56c8 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 14:02:13 +0200 Subject: [PATCH 246/346] tenant instead of tenant_id --- centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm index f341f8600..5cd37c8e4 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm @@ -124,7 +124,7 @@ sub api_request { foreach my $val (@{$webcontent->{networks}}) { my $networkname = $val->{name}; $self->{networks_infos}->{$networkname}->{id} = $val->{id}; - $self->{networks_infos}->{$networkname}->{tenant_id} = $val->{tenant_id}; + $self->{networks_infos}->{$networkname}->{tenant} = $val->{tenant_id}; $self->{networks_infos}->{$networkname}->{state} = $val->{status}; $self->{networks_infos}->{$networkname}->{admin_state} = $val->{admin_state_up}; } From 055abc35a212a55b8a48a52b61326076c330dcc3 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 14:12:19 +0200 Subject: [PATCH 247/346] fix typo --- centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index 530a2c424..76cbac987 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -127,7 +127,7 @@ sub api_request { $self->{volumes_infos}->{$volumename}->{id} = $val->{id}; $self->{volumes_infos}->{$volumename}->{zone} = $val->{availability_zone}; $self->{volumes_infos}->{$volumename}->{size} = $val->{size}; - $self->{volumes_infos}->{$volumename}->{type} = $val->{ivolume_type}; + $self->{volumes_infos}->{$volumename}->{type} = $val->{volume_type}; $self->{volumes_infos}->{$volumename}->{state} = $val->{status}; } } From 7dd46019d5dd29fb1c4a9c594e5c87c7635ce1a7 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 15:17:07 +0200 Subject: [PATCH 248/346] add check options --- .../openstack/restapi/mode/hypervisor.pm | 21 +++++++++++++++++++ .../cloud/openstack/restapi/mode/instance.pm | 21 +++++++++++++++++++ .../openstack/restapi/mode/listhypervisors.pm | 17 +++++++++++++++ .../openstack/restapi/mode/listinstances.pm | 17 +++++++++++++++ .../openstack/restapi/mode/listnetworks.pm | 13 ++++++++++++ .../openstack/restapi/mode/listvolumes.pm | 17 +++++++++++++++ .../cloud/openstack/restapi/mode/network.pm | 17 +++++++++++++++ .../cloud/openstack/restapi/mode/port.pm | 17 +++++++++++++++ .../cloud/openstack/restapi/mode/volume.pm | 21 +++++++++++++++++++ 9 files changed, 161 insertions(+) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm index 8f1ad7284..7655a153e 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm @@ -85,6 +85,27 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hypervisor_id}) || $self->{option_results}->{hypervisor_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hypervisor-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm index 1057cae41..6cd5b5bc6 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm @@ -93,6 +93,27 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{instance_id}) || $self->{option_results}->{instance_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --instance-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm index 658e1910a..f6763f998 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm @@ -62,6 +62,23 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm index a3836c5ff..323589ad7 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm @@ -62,6 +62,23 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm index 5cd37c8e4..162f0f6b1 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm @@ -61,6 +61,19 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index 76cbac987..1ad82ef90 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -62,6 +62,23 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/network.pm b/centreon-plugins/cloud/openstack/restapi/mode/network.pm index b97807980..f1b4ba91c 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/network.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/network.pm @@ -86,6 +86,23 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{network_id}) || $self->{option_results}->{network_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --network-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index ac17a3aa1..51c51e703 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -86,6 +86,23 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{port_id}) || $self->{option_results}->{port_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --port-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm index 7f9fb8b3d..3ca349c5d 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm @@ -94,6 +94,27 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } + if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{volume_id}) || $self->{option_results}->{volume_id} eq '') { + $self->{output}->add_option_msg(short_msg => "You need to specify --volume-id option."); + $self->{output}->option_exit(); + } + $self->{http}->set_options(%{$self->{option_results}}) } From 501c89480cbf41b169779625e2a77b9ebc6fa078 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 8 Jun 2016 23:24:35 +0200 Subject: [PATCH 249/346] + Fix #422 --- .../storage/netapp/snmp/mode/cacheage.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm index 604711be2..396e30cc0 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cacheage.pm @@ -44,18 +44,17 @@ sub check_options { $self->SUPER::init(%options); if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); } } sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cacheAge = ".1.3.6.1.4.1.789.1.2.2.23.0"; @@ -63,13 +62,13 @@ sub run { my $result = $self->{snmp}->get_leef(oids => [$oid_cacheAge], nothing_quit => 1); - my $exit = $self->{perfdata}->threshold_check(value => $results->{$oid_cacheAge}, + my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_cacheAge}, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Cache age is '%s' minutes", $results->{$oid_cacheAge})); + short_msg => sprintf("Cache age is '%s' minutes", $result->{$oid_cacheAge})); $self->{output}->perfdata_add(label => 'cache_age', unit => 'm', - value => $results->{$oid_cacheAge}, + value => $result->{$oid_cacheAge}, warning => $self->{option_results}->{warning}, critical => $self->{option_results}->{critical}, min => 0); From 0b323be568171f42296361a2929614d84e19e973 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Thu, 9 Jun 2016 23:01:00 +0200 Subject: [PATCH 250/346] Revert "Openstack" --- .../openstack/restapi/mode/hypervisor.pm | 303 ----------------- .../cloud/openstack/restapi/mode/instance.pm | 311 ----------------- .../openstack/restapi/mode/listhypervisors.pm | 292 ---------------- .../openstack/restapi/mode/listinstances.pm | 305 ----------------- .../openstack/restapi/mode/listnetworks.pm | 273 --------------- .../openstack/restapi/mode/listvolumes.pm | 291 ---------------- .../cloud/openstack/restapi/mode/network.pm | 296 ----------------- .../cloud/openstack/restapi/mode/port.pm | 300 ----------------- .../cloud/openstack/restapi/mode/volume.pm | 313 ------------------ .../cloud/openstack/restapi/plugin.pm | 56 ---- 10 files changed, 2740 deletions(-) delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/instance.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/network.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/port.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/mode/volume.pm delete mode 100644 centreon-plugins/cloud/openstack/restapi/plugin.pm diff --git a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm deleted file mode 100644 index 7655a153e..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm +++ /dev/null @@ -1,303 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::hypervisor; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -my $thresholds = { - status => [ - ['up', 'OK'], - ['down', 'CRITICAL'], - ], -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - "hypervisor-id:s" => { name => 'hypervisor_id' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{hypervisor_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hypervisor_id}) || $self->{option_results}->{hypervisor_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hypervisor-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-hypervisors/".$self->{option_results}->{hypervisor_id}; - $self->{option_results}->{port} = '8774'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - $self->{hypervisor_infos}->{name} = $webcontent->{hypervisor}->{hypervisor_hostname}; - $self->{hypervisor_infos}->{state} = $webcontent->{hypervisor}->{state}; - $self->{hypervisor_infos}->{status} = $webcontent->{hypervisor}->{status}; -} - - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - my $exit = $self->get_severity(section => 'status', value => $self->{hypervisor_infos}->{state}); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Hypervisor %s is %s (status: %s)", - $self->{hypervisor_infos}->{name}, - $self->{hypervisor_infos}->{state}, - $self->{hypervisor_infos}->{status})); - - $self->{output}->display(); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack instances through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=item B<--threshold-overload> - -Set to overload default threshold values (syntax: section,status,regexp) -It used before default thresholds (order stays). -Example: --threshold-overload='status,WARNING,^down$)' - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=item B<--hypervisor-id> - -Set Hypervisor's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm deleted file mode 100644 index 6cd5b5bc6..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm +++ /dev/null @@ -1,311 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::instance; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -my $thresholds = { - status => [ - ['ACTIVE', 'OK'], - ['PAUSED', 'WARNING'], - ['SUSPENDED', 'WARNING'], - ['SHUTOFF', 'CRITICAL'], - ['REBUILD', 'WARNING'], - ['HARD_REBOOT', 'WARNING'], - ['ERROR', 'CRITCAL'], - ['BUILDING', 'OK'], - ['STOPPED', 'WARNING'], - ['DELETED', 'OK'], - ], -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - "instance-id:s" => { name => 'instance_id' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{instance_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{instance_id}) || $self->{option_results}->{instance_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --instance-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/".$self->{option_results}->{instance_id}; - $self->{option_results}->{port} = '8774'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - $self->{instance_infos}->{name} = $webcontent->{server}->{name}; - $self->{instance_infos}->{vm_state} = $webcontent->{server}->{'OS-EXT-STS:vm_state'}; - $self->{instance_infos}->{state} = $webcontent->{server}->{status}; -} - - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - my $exit = $self->get_severity(section => 'status', value => $self->{instance_infos}->{state}); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Instance %s is in %s state (vm_state: %s)", - $self->{instance_infos}->{name}, - $self->{instance_infos}->{state}, - $self->{instance_infos}->{vm_state})); - - $self->{output}->display(); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -Monitor instance status through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=item B<--threshold-overload> - -Set to overload default threshold values (syntax: section,status,regexp) -It used before default thresholds (order stays). -Example: --threshold-overload='status,CRITICAL,^STOPPED$)' - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=item B<--instance-id> - -Set Instance's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm deleted file mode 100644 index f6763f998..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm +++ /dev/null @@ -1,292 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::listhypervisors; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{hypervisor_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; - } - return 0; -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/os-hypervisors/detail"; - $self->{option_results}->{port} = '8774'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - foreach my $val (@{$webcontent->{hypervisors}}) { - my $hypervisorname = $val->{hypervisor_hostname}; - $self->{hypervisor_infos}->{$hypervisorname}->{id} = $val->{id}; - $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress} = $val->{host_ip}; - $self->{hypervisor_infos}->{$hypervisorname}->{type} = $val->{hypervisor_type}; - $self->{hypervisor_infos}->{$hypervisorname}->{status} = $val->{status}; - $self->{hypervisor_infos}->{$hypervisorname}->{state} = $val->{state}; - } -} - -sub disco_format { - my ($self, %options) = @_; - - my $names = ['name', 'ip', 'type', 'status', 'state']; - $self->{output}->add_disco_format(elements => $names); -} - -sub disco_show { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { - $self->{output}->add_disco_entry(name => $hypervisorname, - id => $self->{hypervisor_infos}->{$hypervisorname}->{id}, - ip => $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, - type => $self->{hypervisor_infos}->{$hypervisorname}->{type}, - status => $self->{hypervisor_infos}->{$hypervisorname}->{status}, - state => $self->{hypervisor_infos}->{$hypervisorname}->{state}, - ); - } -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $hypervisorname (keys %{$self->{hypervisor_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s, ip = %s, type = %s, status = %s, state = %s]", - $hypervisorname, - $self->{hypervisor_infos}->{$hypervisorname}->{id}, - $self->{hypervisor_infos}->{$hypervisorname}->{ipaddress}, - $self->{hypervisor_infos}->{$hypervisorname}->{type}, - $self->{hypervisor_infos}->{$hypervisorname}->{status}, - $self->{hypervisor_infos}->{$hypervisorname}->{state},)); - } - - $self->{output}->output_add(severity => 'OK', - short_msg => 'List hypervisors:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack hypervisors through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=disabled) - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm deleted file mode 100644 index 323589ad7..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm +++ /dev/null @@ -1,305 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::listinstances; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{instance_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; - } - return 0; -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/servers/detail"; - $self->{option_results}->{port} = '8774'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - foreach my $val (@{$webcontent->{servers}}) { - my $instancestate; - if ($val->{status} eq "ACTIVE") { - next if ($self->check_exclude(status => 'Running')); - $instancestate = $val->{status}; - } elsif ($val->{status} eq "SUSPENDED" || $val->{status} eq "PAUSED") { - next if ($self->check_exclude(status => 'Paused')); - $instancestate = $val->{status}; - } elsif ($val->{status} eq "SHUTOFF") { - next if ($self->check_exclude(status => 'Off')); - $instancestate = $val->{status}; - } elsif ($val->{status} eq "REBUILD" || $val->{status} eq "HARD_REBOOT") { - next if ($self->check_exclude(status => 'Reboot')); - $instancestate = $val->{status}; - } - my $instancename = $val->{name}; - $self->{instance_infos}->{$instancename}->{id} = $val->{id}; - $self->{instance_infos}->{$instancename}->{zone} = $val->{'OS-EXT-AZ:availability_zone'}; - $self->{instance_infos}->{$instancename}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; - $self->{instance_infos}->{$instancename}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; - $self->{instance_infos}->{$instancename}->{state} = $instancestate; - } -} - -sub disco_format { - my ($self, %options) = @_; - - my $names = ['name', 'id', 'zone', 'compute', 'osname', 'state']; - $self->{output}->add_disco_format(elements => $names); -} - -sub disco_show { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->add_disco_entry(name => $instancename, - id => $self->{instance_infos}->{$instancename}->{id}, - zone => $self->{instance_infos}->{$instancename}->{zone}, - compute => $self->{instance_infos}->{$instancename}->{compute}, - osname => $self->{instance_infos}->{$instancename}->{osname}, - state => $self->{instance_infos}->{$instancename}->{state}, - ); - } -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, compute = %s, osname = %s, state = %s]", - $instancename, - $self->{instance_infos}->{$instancename}->{id}, - $self->{instance_infos}->{$instancename}->{zone}, - $self->{instance_infos}->{$instancename}->{compute}, - $self->{instance_infos}->{$instancename}->{osname}, - $self->{instance_infos}->{$instancename}->{state})); - } - - $self->{output}->output_add(severity => 'OK', - short_msg => 'List instances:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack instances through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm b/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm deleted file mode 100644 index 162f0f6b1..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/listnetworks.pm +++ /dev/null @@ -1,273 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::listnetworks; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{networks_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; - } - return 0; -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2.0/networks"; - $self->{option_results}->{port} = '9696'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - foreach my $val (@{$webcontent->{networks}}) { - my $networkname = $val->{name}; - $self->{networks_infos}->{$networkname}->{id} = $val->{id}; - $self->{networks_infos}->{$networkname}->{tenant} = $val->{tenant_id}; - $self->{networks_infos}->{$networkname}->{state} = $val->{status}; - $self->{networks_infos}->{$networkname}->{admin_state} = $val->{admin_state_up}; - } -} - -sub disco_format { - my ($self, %options) = @_; - - my $names = ['name', 'id', 'tenant', 'state', 'admin_state']; - $self->{output}->add_disco_format(elements => $names); -} - -sub disco_show { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $networkname (keys %{$self->{networks_infos}}) { - $self->{output}->add_disco_entry(name => $networkname, - id => $self->{networks_infos}->{$networkname}->{id}, - tenant => $self->{networks_infos}->{$networkname}->{tenant}, - state => $self->{networks_infos}->{$networkname}->{state}, - admin_state => $self->{networks_infos}->{$networkname}->{admin_state}, - ); - } -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $networkname (keys %{$self->{networks_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s, tenant = %s, state = %s, admin_state = %s]", - $networkname, - $self->{networks_infos}->{$networkname}->{id}, - $self->{networks_infos}->{$networkname}->{tenant}, - $self->{networks_infos}->{$networkname}->{state}, - $self->{networks_infos}->{$networkname}->{admin_state})); - } - - $self->{output}->output_add(severity => 'OK', - short_msg => 'List networks:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack networks through Networking API V2.0 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=ACTIVE) - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm deleted file mode 100644 index 1ad82ef90..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ /dev/null @@ -1,291 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::listvolumes; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{volumes_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{status}}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping ${options{status}} instance.")); - return 1; - } - return 0; -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/detail"; - $self->{option_results}->{port} = '8776'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - foreach my $val (@{$webcontent->{volumes}}) { - my $volumename = $val->{name}; - $self->{volumes_infos}->{$volumename}->{id} = $val->{id}; - $self->{volumes_infos}->{$volumename}->{zone} = $val->{availability_zone}; - $self->{volumes_infos}->{$volumename}->{size} = $val->{size}; - $self->{volumes_infos}->{$volumename}->{type} = $val->{volume_type}; - $self->{volumes_infos}->{$volumename}->{state} = $val->{status}; - } -} - -sub disco_format { - my ($self, %options) = @_; - - my $names = ['name', 'id', 'zone', 'type', 'size', 'state']; - $self->{output}->add_disco_format(elements => $names); -} - -sub disco_show { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $volumename (keys %{$self->{volumes_infos}}) { - $self->{output}->add_disco_entry(name => $volumename, - id => $self->{volumes_infos}->{$volumename}->{id}, - zone => $self->{volumes_infos}->{$volumename}->{zone}, - size => $self->{volumes_infos}->{$volumename}->{size}."Gb", - type => $self->{volumes_infos}->{$volumename}->{type}, - state => $self->{volumes_infos}->{$volumename}->{state}, - ); - } -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - foreach my $volumename (keys %{$self->{volumes_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, size = %sGb, type = %s, state = %s]", - $volumename, - $self->{volumes_infos}->{$volumename}->{id}, - $self->{volumes_infos}->{$volumename}->{zone}, - $self->{volumes_infos}->{$volumename}->{size}, - $self->{volumes_infos}->{$volumename}->{type}, - $self->{volumes_infos}->{$volumename}->{state})); - } - - $self->{output}->output_add(severity => 'OK', - short_msg => 'List volumes:'); - - $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack volumes through Block Storage API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/network.pm b/centreon-plugins/cloud/openstack/restapi/mode/network.pm deleted file mode 100644 index f1b4ba91c..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/network.pm +++ /dev/null @@ -1,296 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::network; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -my $thresholds = { - status => [ - ['ACTIVE', 'OK'], - ['BUILD', 'OK'], - ['DOWN', 'CRITICAL'], - ['ERROR', 'CRITICAL'], - ], -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "timeout:s" => { name => 'timeout' }, - "network-id:s" => { name => 'network_id' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{network_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{network_id}) || $self->{option_results}->{network_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --network-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2.0/networks/".$self->{option_results}->{network_id}; - $self->{option_results}->{port} = '9696'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - $self->{network_infos}->{name} = $webcontent->{network}->{name}; - $self->{network_infos}->{admin_state} = $webcontent->{network}->{admin_state_up}; - $self->{network_infos}->{status} = $webcontent->{network}->{status}; -} - - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - my $exit = $self->get_severity(section => 'status', value => $self->{network_infos}->{status}); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Network %s is in %s state (admin_state: %s)", - $self->{network_infos}->{name}, - $self->{network_infos}->{status}, - $self->{network_infos}->{admin_state})); - - $self->{output}->display(); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack instances through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=item B<--threshold-overload> - -Set to overload default threshold values (syntax: section,status,regexp) -It used before default thresholds (order stays). -Example: --threshold-overload='status,CRITICAL,^BUILD$)' - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--network-id> - -Set Network's ID - -=back - -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm deleted file mode 100644 index 51c51e703..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ /dev/null @@ -1,300 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::port; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -my $thresholds = { - status => [ - ['ACTIVE', 'OK'], - ['DOWN', 'CRITICAL'], - ['N/A', 'UNKNOWN'], - ], -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, - "timeout:s" => { name => 'timeout' }, - "port-id:s" => { name => 'port_id' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{port_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{port_id}) || $self->{option_results}->{port_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --port-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2.0/ports/".$self->{option_results}->{port_id}; - $self->{option_results}->{port} = '9696'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - if ($webcontent->{port}->{name} eq '') { - $self->{port_infos}->{name} = $webcontent->{port}->{id}; - } else { - $self->{port_infos}->{name} = $webcontent->{port}->{name}; - } - $self->{port_infos}->{admin_state} = $webcontent->{port}->{admin_state_up}; - $self->{port_infos}->{status} = $webcontent->{port}->{status}; -} - - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - my $exit = $self->get_severity(section => 'status', value => $self->{port_infos}->{status}); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Port %s is in %s state (admin_state: %s)", - $self->{port_infos}->{name}, - $self->{port_infos}->{status}, - $self->{port_infos}->{admin_state})); - - $self->{output}->display(); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack instances through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -=item B<--threshold-overload> - -Set to overload default threshold values (syntax: section,status,regexp) -It used before default thresholds (order stays). -Example: --threshold-overload='status,CRITICAL,^N\/A$)' - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--port-id> - -Set Port's ID - -=back - diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm deleted file mode 100644 index 3ca349c5d..000000000 --- a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm +++ /dev/null @@ -1,313 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::mode::volume; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; -use centreon::plugins::http; -use JSON; - -my $thresholds = { - status => [ - ['creating', 'OK'], - ['available', 'OK'], - ['attaching', 'OK'], - ['in-use', 'OK'], - ['deleting', 'OK'], - ['backing-up', 'WARNING'], - ['restoring-backup', 'WARNING'], - ['error', 'CRITICAL'], - ['error_deleting', 'CRITICAL'], - ['error_restoring', 'CRITICAL'], - ['error_extending', 'CRITICAL'], - ], -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "data:s" => { name => 'data' }, - "hostname:s" => { name => 'hostname' }, - "http-peer-addr:s" => { name => 'http_peer_addr' }, - "port:s" => { name => 'port', default => '5000' }, - "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path', default => '/v3/auth/tokens' }, - "proxyurl:s" => { name => 'proxyurl' }, - "proxypac:s" => { name => 'proxypac' }, - "credentials" => { name => 'credentials' }, - "username:s" => { name => 'username' }, - "password:s" => { name => 'password' }, - "ssl:s" => { name => 'ssl', }, - "header:s@" => { name => 'header' }, - "timeout:s" => { name => 'timeout' }, - "tenant-id:s" => { name => 'tenant_id' }, - "volume-id:s" => { name => 'volume_id' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); - - $self->{http} = centreon::plugins::http->new(output => $self->{output}); - $self->{volume_infos} = (); - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } - - if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --header option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --data option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --hostname option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option."); - $self->{output}->option_exit(); - } - if (!defined($self->{option_results}->{volume_id}) || $self->{option_results}->{volume_id} eq '') { - $self->{output}->add_option_msg(short_msg => "You need to specify --volume-id option."); - $self->{output}->option_exit(); - } - - $self->{http}->set_options(%{$self->{option_results}}) -} - -sub token_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - if (defined($self->{option_results}->{data})) { - local $/ = undef; - if (!open(FILE, "<", $self->{option_results}->{data})) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => sprintf("Could not read file '%s': %s", $self->{option_results}->{data}, $!)); - $self->{output}->display(); - $self->{output}->exit(); - } - $self->{json_request} = ; - close FILE; - $self->{method} = 'POST'; - } - - my $response = $self->{http}->request(method => $self->{method}, query_form_post => $self->{json_request}); - my $headers = $self->{http}->get_header(); - - eval { - $self->{header} = $headers->header('X-Subject-Token'); - }; - - if ($@) { - $self->{output}->add_option_msg(short_msg => "Cannot retrieve API Token"); - $self->{output}->option_exit(); - } -} - -sub api_request { - my ($self, %options) = @_; - - $self->{method} = 'GET'; - $self->{option_results}->{url_path} = "/v2/".$self->{option_results}->{tenant_id}."/volumes/".$self->{option_results}->{volume_id}; - $self->{option_results}->{port} = '8776'; - @{$self->{option_results}->{header}} = ('X-Auth-Token:' . $self->{header}, 'Accept:application/json'); - $self->{http}->set_options(%{$self->{option_results}}); - - my $webcontent; - my $jsoncontent = $self->{http}->request(method => $self->{method}); - - my $json = JSON->new; - - eval { - $webcontent = $json->decode($jsoncontent); - }; - - $self->{volume_infos}->{name} = $webcontent->{volume}->{name}; - $self->{volume_infos}->{status} = $webcontent->{volume}->{status}; -} - - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - - $self->token_request(); - $self->api_request(); - - my $exit = $self->get_severity(section => 'status', value => $self->{volume_infos}->{status}); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Volume %s is in %s state", - $self->{volume_infos}->{name}, - $self->{volume_infos}->{status})); - - $self->{output}->display(); - $self->{output}->exit(); - - exit 0; -} - -1; - -__END__ - -=head1 MODE - -List OpenStack instances through Compute API V2 - -JSON OPTIONS: - -=over 8 - -=item B<--data> - -Set file with JSON request - -=back - -HTTP OPTIONS: - -=over 8 - -=item B<--hostname> - -IP Addr/FQDN of OpenStack Compute's API - -=item B<--http-peer-addr> - -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) - -=item B<--port> - -Port used by OpenStack Keystone's API (Default: '5000') - -=item B<--proto> - -Specify https if needed (Default: 'http') - -=item B<--urlpath> - -Set path to get API's Token (Default: '/v3/auth/tokens') - -=item B<--proxyurl> - -Proxy URL - -=item B<--proxypac> - -Proxy pac file (can be an url or local file) - -=item B<--credentials> - -Specify this option if you access webpage over basic authentification - -=item B<--username> - -Specify username - -=item B<--password> - -Specify password - -=item B<--ssl> - -Specify SSL version (example : 'sslv3', 'tlsv1'...) - -=item B<--header> - -Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') - -=item B<--timeout> - -Threshold for HTTP timeout (Default: 3) - -=back - -=item B<--threshold-overload> - -Set to overload default threshold values (syntax: section,status,regexp) -It used before default thresholds (order stays). -Example: --threshold-overload='status,CRITICAL,^deleting$)' - -=back - -OPENSTACK OPTIONS: - -=over 8 - -=item B<--tenant-id> - -Set Tenant's ID - -=item B<--volume-id> - -Set Volume's ID - -=back - -=cut - diff --git a/centreon-plugins/cloud/openstack/restapi/plugin.pm b/centreon-plugins/cloud/openstack/restapi/plugin.pm deleted file mode 100644 index ed9951b1c..000000000 --- a/centreon-plugins/cloud/openstack/restapi/plugin.pm +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2015 Centreon (http://www.centreon.com/) -# -# Centreon is a full-fledged industry-strength solution that meets -# the needs in IT infrastructure and application monitoring for -# service performance. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package cloud::openstack::restapi::plugin; - -use strict; -use warnings; -use base qw(centreon::plugins::script_simple); - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - # $options->{options} = options object - - $self->{version} = '0.1'; - %{$self->{modes}} = ( - 'hypervisor' => 'cloud::openstack::restapi::mode::hypervisor', - 'instance' => 'cloud::openstack::restapi::mode::instance', - 'list-hypervisors' => 'cloud::openstack::restapi::mode::listhypervisors', - 'list-instances' => 'cloud::openstack::restapi::mode::listinstances', - 'list-networks' => 'cloud::openstack::restapi::mode::listnetworks', - 'list-volumes' => 'cloud::openstack::restapi::mode::listvolumes', - 'network' => 'cloud::openstack::restapi::mode::network', - 'port' => 'cloud::openstack::restapi::mode::port', - 'volume' => 'cloud::openstack::restapi::mode::volume', - ); - return $self; -} - -1; - -__END__ - -=head1 PLUGIN DESCRIPTION - -Check Openstack Components with their API. - -=cut From 83893d92fc42d8df48cd706ff38ebf9884234d3a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 15 Jun 2016 15:49:52 +0200 Subject: [PATCH 251/346] + fix emc dmx --- .../storage/emc/symmetrix/dmx34/local/mode/hardware.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm index f2667401b..9018474ed 100644 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -185,6 +185,7 @@ sub send_email { $send_email = 0 if ($status ne 'ok' && defined($prev_output) && $prev_output eq $subject); # recovery email $send_email = 1 if ($status eq 'ok' && defined($prev_status) && $prev_status ne 'ok'); + $self->{statefile_cache}->write(data => $self->{new_datas}); } my $smtp_to = ''; From ca5c77a37003dfc39f32330999c7aedb2fc7c651 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 16 Jun 2016 16:47:44 +0200 Subject: [PATCH 252/346] + Add symmetrix vmax --- .../vmax/local/mode/components/cabling.pm | 70 +++++ .../vmax/local/mode/components/director.pm | 72 +++++ .../vmax/local/mode/components/fabric.pm | 91 ++++++ .../vmax/local/mode/components/module.pm | 71 +++++ .../vmax/local/mode/components/power.pm | 95 ++++++ .../vmax/local/mode/components/sparedisk.pm | 62 ++++ .../vmax/local/mode/components/temperature.pm | 74 +++++ .../vmax/local/mode/components/voltage.pm | 55 ++++ .../emc/symmetrix/vmax/local/mode/hardware.pm | 273 ++++++++++++++++++ .../emc/symmetrix/vmax/local/plugin.pm | 48 +++ 10 files changed, 911 insertions(+) create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/cabling.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/director.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/fabric.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/module.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/power.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/sparedisk.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/temperature.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/voltage.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm create mode 100644 centreon-plugins/storage/emc/symmetrix/vmax/local/plugin.pm diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/cabling.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/cabling.pm new file mode 100644 index 000000000..c904cdd3a --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/cabling.pm @@ -0,0 +1,70 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::cabling; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Ethernet cabling: OK +# +#+--------------------------------------------------+--------+----------------------+--------------------+----------------------+----------------------+------------+--------------+ +#| Cable Name | Status | Expected 'From' Port | Actual 'From' Port | Expected 'To' Port | Actual 'To' Port | Error Code | Error string | +#+--------------------------------------------------+--------+----------------------+--------------------+----------------------+----------------------+------------+--------------+ +#| Cable from SRV A Adapter to MM-A ES-4 Lower port | OK | SRV A Adapter | SRV A Adapter | MM-A ES-4 Lower port | MM-A ES-4 Lower port | None | | +#| Cable from SRV B Adapter to MM-B ES-4 Lower port | OK | SRV B Adapter | SRV B Adapter | MM-B ES-4 Lower port | MM-B ES-4 Lower port | None | | +#+--------------------------------------------------+--------+----------------------+--------------------+----------------------+----------------------+------------+--------------+ +#| Cable Name | Status | Expected 'From' Port | Actual 'From' Port | Expected 'To' Port | Actual 'To' Port | Error Code | Error string | +#+--------------------------------------------------+--------+----------------------+--------------------+----------------------+----------------------+------------+--------------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking cabling"); + $self->{components}->{cabling} = {name => 'cabling', total => 0, skip => 0}; + return if ($self->check_filter(section => 'cabling')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Ethernet cabling.*?---------.*?Cable Name.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find cabling'); + return ; + } + + my $content = $1; + while ($content =~ /^\|(.*?)\|(.*?)\|.*?\n/msig) { + my ($cabling, $status) = (centreon::plugins::misc::trim($1), centreon::plugins::misc::trim($2)); + + next if ($self->check_filter(section => 'cabling', instance => $cabling)); + $self->{components}->{cabling}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("cabling '%s' status is '%s'", + $cabling, $status)); + my $exit = $self->get_severity(label => 'default', section => 'cabling', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Cabling '%s' status is '%s'", + $cabling, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/director.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/director.pm new file mode 100644 index 000000000..93ab9d296 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/director.pm @@ -0,0 +1,72 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::director; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Directors status: OK +# +#+----------+--------+---------+-------------+---------+-----------------+-------------+ +#| Director | Type | State | Flags | Version | Address | Last Update | +#+----------+--------+---------+-------------+---------+-----------------+-------------+ +#| 07A | DA_4x1 | Online | [ON] (0x80) | 05 | 192.168.177.7 | 1110 | +#| 07B | DA_4x1 | Online | [ON] (0x80) | 05 | 192.168.177.23 | 1110 | +#| 07C | DA_4x1 | Online | [ON] (0x80) | 05 | 192.168.177.39 | 1110 | +#| 07D | DA_4x1 | Online | [ON] (0x80) | 05 | 192.168.177.55 | 1110 | +#+----------+--------+---------+-------------+---------+-----------------+-------------+ +#| Director | Type | State | Flags | Version | Address | Last Update | +#+----------+--------+---------+-------------+---------+-----------------+-------------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking directors"); + $self->{components}->{director} = {name => 'directors', total => 0, skip => 0}; + return if ($self->check_filter(section => 'director')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Directors status.*?---------.*?Director.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find directors'); + return ; + } + + my $content = $1; + while ($content =~ /^\|(.*?)\|.*?\|(.*?)\|.*?\n/msig) { + my ($director, $status) = (centreon::plugins::misc::trim($1), centreon::plugins::misc::trim($2)); + + next if ($self->check_filter(section => 'director', instance => $director)); + $self->{components}->{director}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("director '%s' status is '%s'", + $director, $status)); + my $exit = $self->get_severity(label => 'default', section => 'director', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Director '%s' status is '%s'", + $director, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/fabric.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/fabric.pm new file mode 100644 index 000000000..b2b3df797 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/fabric.pm @@ -0,0 +1,91 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::fabric; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Fabric system: OK +# +#+-------------------------------------------------+---------------------------------+ +#| Item | Status | +#+-------------------------------------------------+---------------------------------+ +#| Fabric System General Status | OK | +#| Usage Mode | Full usage - BOSCO and Ethernet | +#| Initialization Status | OK | +#| Configuration Status | OK | +#| Fabric A Availability | Available | +#| Fabric B Availability | Available | +#| Directors' Fabric Links Status | OK | +#| Dir 7 (RIO 0x0C) | All links are up | +#| Link A status | Up | +#| Link B status | Up | +#+-------------------------------------------------+---------------------------------+ +#| Item | Status | +#+-------------------------------------------------+---------------------------------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fabrics"); + $self->{components}->{fabric} = {name => 'fabrics', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fabric')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Fabric system.*?---------.*?Item.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find fabrics'); + return ; + } + + my $content = $1; + + my $total_components = 0; + my @stack = ({ indent => 0, long_instance => '' }); + while ($content =~ /^\|([ \t]+)(.*?)\|(.*?)\|\n/msig) { + my ($indent, $name, $status) = (length($1), centreon::plugins::misc::trim($2), centreon::plugins::misc::trim($3)); + + pop @stack while ($indent <= $stack[$#stack]->{indent}); + + my $long_instance = $stack[$#stack]->{long_instance} . '>' . $name; + if ($indent > $stack[$#stack]->{indent}) { + push @stack, { indent => $indent, + long_instance => $stack[$#stack]->{long_instance} . '>' . $name }; + } + + next if ($name !~ /status/i); + + next if ($self->check_filter(section => 'fabric', instance => $long_instance)); + $self->{components}->{fabric}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fabric '%s' status is '%s'", + $long_instance, $status)); + my $exit = $self->get_severity(label => 'default', section => 'fabric', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fabric '%s' status is '%s'", + $long_instance, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/module.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/module.pm new file mode 100644 index 000000000..f9b1b4667 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/module.pm @@ -0,0 +1,71 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::module; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Modules status (alarms): OK +#+-------------------------------------------------------------------+-----------+----------+--------+------------+ +#| Module | Ctrl dirs | Rep dirs | Status | Rel Status | +#+-------------------------------------------------------------------+-----------+----------+--------+------------+ +#| Engine 4 | 07A,08A | 07A,08A | OK | | +#| Engine SPS 4A | 07A | 07A | OK | | +#| Engine SPS 4B | 08A | 08A | OK | | +#| Engine Power Supply A of ES-4 | 07A | 07A | OK | | +#+-------------------------------------------------------------------+-----------+----------+--------+------------+ +#| Module | Ctrl dirs | Rep dirs | Status | Rel Status | +#+-------------------------------------------------------------------+-----------+----------+--------+------------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking modules"); + $self->{components}->{module} = {name => 'modules', total => 0, skip => 0}; + return if ($self->check_filter(section => 'module')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Modules status.*?---------.*?Module.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find modules'); + return ; + } + + my $content = $1; + while ($content =~ /^\|(.*?)\|.*?\|.*?\|(.*?)\|.*?\n/msig) { + my ($module, $status) = (centreon::plugins::misc::trim($1), centreon::plugins::misc::trim($2)); + + next if ($self->check_filter(section => 'module', instance => $module)); + $self->{components}->{module}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("module '%s' status is '%s'", + $module, $status)); + my $exit = $self->get_severity(label => 'default', section => 'module', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Module '%s' status is '%s'", + $module, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/power.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/power.pm new file mode 100644 index 000000000..5bba09a19 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/power.pm @@ -0,0 +1,95 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::power; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Power system: OK +# +#+--------------------------------------------------------+--------------------------------------+ +#| Item | Status | +#+--------------------------------------------------------+--------------------------------------+ +#| Power input type | Three Phases | +#| System Bay AC Zones Status | OK | +#| AC Status Zone A | Zone AC OK | +#| AC Status Zone B | Zone AC OK | +#| Power modules status | OK | +#| System Bay 1 | OK | +#| Engine SPS 4A | OK | +#| General Status | OK | +#| Detailed Status | OK | +#| Condition Register | OK | +#| Battery Life (sec) | 600 | +#| Days of Operation | Unknown | +#| Slot | Slot B | +#| Manufacturer Information | ASTEC,AA23540,7E, 04/11/2008 | +#+--------------------------------------------------------+--------------------------------------+ +#| Item | Status | +#+--------------------------------------------------------+--------------------------------------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking powers"); + $self->{components}->{power} = {name => 'powers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'power')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Power system.*?---------.*?Item.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find powers'); + return ; + } + + my $content = $1; + + my $total_components = 0; + my @stack = ({ indent => 0, long_instance => '' }); + while ($content =~ /^\|([ \t]+)(.*?)\|(.*?)\|\n/msig) { + my ($indent, $name, $status) = (length($1), centreon::plugins::misc::trim($2), centreon::plugins::misc::trim($3)); + + pop @stack while ($indent <= $stack[$#stack]->{indent}); + + my $long_instance = $stack[$#stack]->{long_instance} . '>' . $name; + if ($indent > $stack[$#stack]->{indent}) { + push @stack, { indent => $indent, + long_instance => $stack[$#stack]->{long_instance} . '>' . $name }; + } + + next if ($name !~ /status/i); + + next if ($self->check_filter(section => 'power', instance => $long_instance)); + $self->{components}->{power}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power '%s' status is '%s'", + $long_instance, $status)); + my $exit = $self->get_severity(label => 'default', section => 'power', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power '%s' status is '%s'", + $long_instance, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/sparedisk.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/sparedisk.pm new file mode 100644 index 000000000..62834a546 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/sparedisk.pm @@ -0,0 +1,62 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::sparedisk; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +#06/15/2016 09:26:42.015 Verify Spare Status Test +#There are 1 non available Spare[s], deferred service is ON. +#06/15/2016 09:26:42.046 Verify Spare Status: Test Succeeded. + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking spare disks"); + $self->{components}->{sparedisk} = {name => 'spare disks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'sparedisk')); + + if ($self->{content_file_health} !~ /There are (\d+) non available Spare/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find spare disks'); + return ; + } + + my $value = $1; + $self->{components}->{sparedisk}->{total}++; + + my ($exit, $warn, $crit) = $self->get_severity_numeric(section => 'sparedisk', instance => '1', value => $value); + $self->{output}->output_add(long_msg => sprintf("'%s' spare disk non availabled", + $value)); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("'%s' spare disk non availabled", + $value)); + } + + $self->{output}->perfdata_add(label => "disk_spare_non_available", + value => $value, + warning => $warn, + critical => $crit, min => 0); +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/temperature.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/temperature.pm new file mode 100644 index 000000000..b1e561074 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/temperature.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::temperature; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Temperatures check: OK +# +#+-------------------+------------+------------+------------------+--------+ +#| Module | Temp [°C] | Temp [°F] | High Limit [°C] | Status | +#+-------------------+------------+------------+------------------+--------+ +#| ES-PWS-A ES-4 | 24 | 75 | | OK | +#| ES-PWS-B ES-4 | 22 | 71 | | OK | +#| DIR-7 ES-4 | 34 | 93 | | OK | +#| DIR-8 ES-4 | 36 | 96 | | OK | +#| DIMM-0 DIR-7 ES-4 | 43 | 109 | 88 | OK | +#| DIMM-1 DIR-7 ES-4 | 48 | 118 | 91 | OK | +#+-------------------+------------+------------+------------------+--------+ +#| Module | Temp [°C] | Temp [°F] | High Limit [°C] | Status | +#+-------------------+------------+------------+------------------+--------+ + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + if ($self->{content_file_health_env} !~ /Ethernet cabling.*?Temperatures check.*?---------.*?Module.*?---------.*?\n(.*?\n)\+---------/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find temperatures'); + return ; + } + + my $content = $1; + while ($content =~ /^\|(.*?)\|.*?\|.*?\|.*?\|(.*?)\|.*?\n/msig) { + my ($temperature, $status) = (centreon::plugins::misc::trim($1), centreon::plugins::misc::trim($2)); + + next if ($self->check_filter(section => 'temperature', instance => $temperature)); + $self->{components}->{temperature}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s'", + $temperature, $status)); + my $exit = $self->get_severity(label => 'default', section => 'temperature', value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' status is '%s'", + $temperature, $status)); + } + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/voltage.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/voltage.pm new file mode 100644 index 000000000..195f17ddf --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/components/voltage.pm @@ -0,0 +1,55 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::components::voltage; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use centreon::plugins::misc; + +#Voltages check: OK +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking voltage"); + $self->{components}->{voltage} = {name => 'voltage', total => 0, skip => 0}; + return if ($self->check_filter(section => 'voltage')); + + if ($self->{content_file_health_env} !~ /Voltages check:(.*?)\n/msi) { + $self->{output}->output_add(long_msg => 'skipping: cannot find voltage'); + return ; + } + + my $content = centreon::plugins::misc::trim($1); + $self->{components}->{voltage}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("voltage status is '%s'", + $content)); + my $exit = $self->get_severity(label => 'default', section => 'voltage', value => $content); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Voltage status is '%s'", + $content)); + } +} + +1; diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm new file mode 100644 index 000000000..8f2b7429a --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm @@ -0,0 +1,273 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; +use centreon::plugins::misc; +use centreon::plugins::statefile; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_numeric_check_section_option} = '^(sparedisk)$'; + + $self->{cb_hook1} = 'read_files'; + $self->{cb_hook4} = 'send_email'; + + $self->{thresholds} = { + default => [ + ['Recoverable Error', 'OK'], # Fabric + ['Online', 'OK'], + ['Up', 'OK'], + ['OK', 'OK'], + ['.*', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'storage::emc::symmetrix::vmax::local::mode::components'; + $self->{components_module} = ['module', 'temperature', 'director', 'cabling', 'power', 'fabric', 'voltage', 'sparedisk']; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->{statefile_cache}->check_options(%options); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "file-health:s" => { name => 'file_health' }, + "file-health-env:s" => { name => 'file_health_env' }, + # Email + "email-warning:s" => { name => 'email_warning' }, + "email-critical:s" => { name => 'email_critical' }, + "email-smtp-host:s" => { name => 'email_smtp_host' }, + "email-smtp-username:s" => { name => 'email_smtp_username' }, + "email-smtp-password:s" => { name => 'email_smtp_password' }, + "email-smtp-from:s" => { name => 'email_smtp_from' }, + "email-smtp-options:s@" => { name => 'email_smtp_options' }, + "email-memory" => { name => 'email_memory' }, + }); + + $self->{statefile_cache} = centreon::plugins::statefile->new(%options); + $self->{components_exec_load} = 0; + return $self; +} + +sub read_files { + my ($self, %options) = @_; + + if (!defined($self->{option_results}->{file_health}) || !defined($self->{option_results}->{file_health_env})) { + $self->{output}->add_option_msg(short_msg => "Please set option --file-health and --file-health-env."); + $self->{output}->option_exit(); + } + + foreach (('file_health', 'file_health_env')) { + $self->{'content_' . $_} = do { + local $/ = undef; + if (!open my $fh, "<", $self->{option_results}->{$_}) { + $self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{$_} : $!"); + $self->{output}->option_exit(); + } + <$fh>; + }; + # We remove color syntax + $self->{'content_' . $_} =~ s/\x{1b}\[.*?m|\r//msg; + } + + #Health Check Results Log: + #Service Processor Date: 06/15/2016 09:26:41 + #Symmetrix Date from director 07c: 06/15/2016 09:33:45 + #The time difference between Service Processor and Symmetrix is : 00:07:03.672 + #System SN: 000292602920 + #System Model: VMAX20K + #mCode Level: 5876.288 + my ($serial) = ('unknown'); + $serial = $1 if ($self->{content_file_health} =~ /System SN:\s*(\S+)/msi); + + $self->{output}->output_add(long_msg => sprintf('serial number: %s', $serial)); +} + +# +# maybe we should add it in core (with cleaner code ;) +# + +sub send_email { + my ($self, %options) = @_; + + ####### + # Check SMTP options + return if (!((defined($self->{option_results}->{email_warning}) && $self->{option_results}->{email_warning} ne '') + || (defined($self->{option_results}->{email_critical}) && $self->{option_results}->{email_critical} ne ''))); + + if (!defined($self->{option_results}->{email_smtp_host})) { + $self->{output}->add_option_msg(short_msg => "Please set the --email-smtp-host option"); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{email_smtp_from})) { + $self->{output}->add_option_msg(short_msg => "Please set --email-smtp-from option"); + $self->{output}->option_exit(); + } + + my %smtp_options = ('-auth' => 'none'); + if (defined($self->{option_results}->{email_smtp_username}) && $self->{option_results}->{email_smtp_username} ne '') { + $smtp_options{-login} = $self->{option_results}->{email_smtp_username}; + delete $smtp_options{-auth}; + } + if (defined($self->{option_results}->{email_smtp_username}) && defined($self->{option_results}->{email_smtp_password})) { + $smtp_options{-pass} = $self->{option_results}->{email_smtp_password}; + } + foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { + next if ($option !~ /^(.+?)=(.+)$/); + $smtp_options{-$1} = $2; + } + + ####### + # Get current data + my $stdout; + { + local *STDOUT; + open STDOUT, '>', \$stdout; + $self->{output}->display(force_long_output => 1); + } + + $stdout =~ /^(.*?)(\||\n)/msi; + my $subject = $1; + my $status = lc($self->{output}->get_litteral_status()); + + my $send_email = 0; + $send_email = 1 if ($status ne 'ok'); + ####### + # Check memory file + if (defined($self->{option_results}->{email_memory})) { + $self->{new_datas} = { status => $status, output => $subject }; + $self->{statefile_cache}->read(statefile => "cache_emc_symmetrix_vmax_email"); + my $prev_status = $self->{statefile_cache}->get(name => 'status'); + my $prev_output = $self->{statefile_cache}->get(name => 'output'); + # non-ok output is the same + $send_email = 0 if ($status ne 'ok' && defined($prev_output) && $prev_output eq $subject); + # recovery email + $send_email = 1 if ($status eq 'ok' && defined($prev_status) && $prev_status ne 'ok'); + $self->{statefile_cache}->write(data => $self->{new_datas}); + } + + my $smtp_to = ''; + $smtp_to = $self->{option_results}->{email_warning} if ($status eq 'warning' && defined($self->{option_results}->{email_warning} && $self->{option_results}->{email_warning}) ne ''); + $smtp_to = $self->{option_results}->{email_critical} if ($status eq 'critical' && defined($self->{option_results}->{email_critical} && $self->{option_results}->{email_critical}) ne ''); + if ($send_email == 1 && $status eq 'ok') { + my $append = ''; + foreach (('email_warning', 'email_critical')) { + if (defined($self->{option_results}->{$_}) && $self->{option_results}->{$_} ne '') { + $smtp_to .= $append . $self->{option_results}->{$_}; + $append .= ','; + } + } + } + + if ($send_email == 0) { + $self->{output}->add_option_msg(severity => 'OK', short_msg => "No email to send"); + return ; + } + + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Email::Send::SMTP::Gmail', + error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'."); + my ($mail, $error) = Email::Send::SMTP::Gmail->new(-smtp => $self->{option_results}->{email_smtp_host}, + %smtp_options); + if ($mail == -1) { + $self->{output}->add_option_msg(short_msg => "session error: " . $error); + $self->{output}->option_exit(); + } + my $result = $mail->send(-to => $smtp_to, + -from => $self->{option_results}->{email_smtp_from}, + -subject => $subject, + -body => $stdout, + -attachments => $self->{option_results}->{file_health_env}); + $mail->bye(); + if ($result == -1) { + $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); + } else { + $self->{output}->add_option_msg(severity => 'OK', short_msg => "email sent"); + } +} + +1; + +__END__ + +=head1 MODE + +Check hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'module', 'temperature', 'director, 'cabling', 'power', 'voltage', 'sparedisk'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=temperature --filter=module) +Can also exclude specific instance: --filter=temperature,ES-PWS-A ES-4 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='director,WARNING,^(?!(OK)$)' + +=item B<--warning> + +Set warning threshold for disk (syntax: type,regexp,threshold) +Example: --warning='sparedisk,.*,5:' + +=item B<--critical> + +Set critical threshold for disk (syntax: type,regexp,threshold) +Example: --critical='sparedisk,.*,3:' + +=item B<--file-health> + +The location of the global storage file status (Should be something like: C:/xxxx/HealthCheck.log). + +=item B<--file-health-env> + +The location of the environment storage file status (Should be something like: C:/xxxx/sumpl_env_health.log). + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/plugin.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/plugin.pm new file mode 100644 index 000000000..18fc9a995 --- /dev/null +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::emc::symmetrix::vmax::local::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'hardware' => 'storage::emc::symmetrix::vmax::local::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check vmax storage. The plugin needs to be installed on Windows Management. + +=cut From b7249a99be2dcd501013318fdf2cedbfac75dff7 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 16 Jun 2016 16:52:47 +0200 Subject: [PATCH 253/346] + merge hanodes.pm and hastates.pm --- .../network/netasq/snmp/mode/hanodes.pm | 82 +++++++++++++++++-- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm index d12d6c8fd..3734a0fdd 100644 --- a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm +++ b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm @@ -27,6 +27,31 @@ use warnings; my $instance_mode; +sub custom_node_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = defined($instance_mode->{option_results}->{percent}) ? $self->{result_values}->{prct_dead} : $self->{result_values}->{dead_nodes} ; + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_node_output { + my ($self, %options) = @_; + + my $msg = sprintf("Dead nodes: absolute: %d - percentage: %.2f%% ", $self->{result_values}->{dead_nodes}, $self->{result_values}->{prct_dead}); + return $msg; +} + +sub custom_node_calc { + my ($self, %options) = @_; + + $self->{result_values}->{dead_nodes} = $options{new_datas}->{$self->{instance} . '_dead_nodes'}; + $self->{result_values}->{prct_dead} = $options{new_datas}->{$self->{instance} . '_prct_dead'}; + + return 0; +} + sub custom_threshold_output { my ($self, %options) = @_; my $status = 'ok'; @@ -70,9 +95,25 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, { name => 'nodes', type => 1, cb_prefix_output => 'prefix_node_output', message_multiple => 'All HA nodes are OK' }, ]; + $self->{maps_counters}->{global} = [ + { label => 'dead-nodes', set => { + key_values => [ { name => 'dead_nodes' }, { name => 'prct_dead' } ], + closure_custom_calc => \&custom_node_calc, + closure_custom_output => \&custom_node_output, + closure_custom_threshold_check => \&custom_node_threshold, + perfdatas => [ + { label => 'dead_nodes', value => 'dead_nodes', template => '%d', + min => 0, unit => 'nodes' }, + { label => 'prct_dead', value => 'prct_dead', template => '%.2f', + min => 0, unit => '%' }, + ], + } + } + ]; $self->{maps_counters}->{nodes} = [ { label => 'state', threshold => 0, set => { key_values => [ { name => 'state' }, { name => 'display' } ], @@ -84,7 +125,7 @@ sub set_counters { }, { label => 'health', set => { key_values => [ { name => 'health' }, { name => 'display' } ], - output_template => 'node Health: %s%%', + output_template => 'node health: %s%%', perfdatas => [ { label => 'health', value => 'health_absolute', template => '%d', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, @@ -109,6 +150,7 @@ sub new { $options{options}->add_options(arguments => { "filter-node:s" => { name => 'filter_node' }, + "percent" => { name => 'percent' }, "warning-state:s" => { name => 'warning_state', default => '' }, "critical-state:s" => { name => 'critical_state', default => '%{state} eq "offline"' }, }); @@ -145,20 +187,25 @@ my $mapping = { }; my $oid_ntqNodeTable = '.1.3.6.1.4.1.11256.1.11.7'; +my $oid_ntqNbNode = '.1.3.6.1.4.1.11256.1.11.1'; +my $oid_ntqNbDeadNode = '.1.3.6.1.4.1.11256.1.11.2'; sub manage_selection { my ($self, %options) = @_; $self->{snmp} = $options{snmp}; - $self->{results} = $options{snmp}->get_table(oid => $oid_ntqNodeTable, - nothing_quit => 1); - foreach my $oid (keys %{$self->{results}}) { + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_ntqNodeTable }, + { oid => $oid_ntqNbNode }, + { oid => $oid_ntqNbDeadNode } ], + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}->{$oid_ntqNodeTable}}) { $oid =~ /^$mapping->{ntqOnline}->{oid}\.(.*)$/; my $instance = $1; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_ntqNodeTable}, instance => $instance); - if (defined($self->{option_results}->{filter_nodes}) && $self->{option_results}->{filter_nodes} ne '' && - $result->{ntqFwSerial} !~ /$self->{option_results}->{filter_nodes}/) { + if (defined($self->{option_results}->{filter_node}) && $self->{option_results}->{filter_node} ne '' && + $result->{ntqFwSerial} !~ /$self->{option_results}->{filter_node}/) { $self->{output}->output_add(long_msg => "Skipping '" . $result->{ntqFwSerial} . "': no matching filter.", debug => 1); next; } @@ -166,6 +213,11 @@ sub manage_selection { health => $result->{ntqHAQuality}, display => $result->{ntqFwSerial} }; } + + my $prct_dead = $self->{results}->{$oid_ntqNbDeadNode}->{$oid_ntqNbDeadNode . '.' . '0'}/$self->{results}->{$oid_ntqNbNode}->{$oid_ntqNbNode . '.' . '0'}*100; + + $self->{global} = { dead_nodes => $self->{results}->{$oid_ntqNbDeadNode}->{$oid_ntqNbDeadNode . '.' . '0'}, + prct_dead => $prct_dead }; } 1; @@ -174,13 +226,13 @@ __END__ =head1 MODE -Check Netasq node state and health +Check Netasq dead nodes and state and health of nodes =over 8 =item B<--filter-node> -Filter name with regexp. +Filter name with regexp (based on serial) =item B<--warning-health> @@ -190,6 +242,14 @@ Warning on health level. (e.g --warning 90:) Critical on health level. (e.g --critical 80:) +=item B<--warning-dead-nodes> + +Warning on deadnode (absolute unless --percent is used) + +=item B<--critical-dead-nodes> + +Critical on deadnode (absolute unless --percent is used) + =item B<--warning-state> Set warning threshold for status. Use "%{state}" as a special variable. @@ -200,6 +260,10 @@ Value can be 'online' or 'offline'. Set critical threshold for status. Use "%{state}" as a special variable. Value can be 'online' or 'offline'. +=item B<--percent> + +Set this option if you want to warn on percent + =back =cut From 9d3145756b72c6c235a6be5e5961c03205cdcef9 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 17 Jun 2016 08:38:11 +0200 Subject: [PATCH 254/346] + remove ambigous perfdata for prct_dead --- centreon-plugins/network/netasq/snmp/mode/hanodes.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm index 3734a0fdd..8a11e801f 100644 --- a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm +++ b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm @@ -108,8 +108,6 @@ sub set_counters { perfdatas => [ { label => 'dead_nodes', value => 'dead_nodes', template => '%d', min => 0, unit => 'nodes' }, - { label => 'prct_dead', value => 'prct_dead', template => '%.2f', - min => 0, unit => '%' }, ], } } From 763e44b450085b811d9a0c2c5ab78a83c578d57a Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 17 Jun 2016 08:38:49 +0200 Subject: [PATCH 255/346] + delete hastatus.pm Deprecated - now part of hanodes.pm --- .../network/netasq/snmp/mode/hastatus.pm | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 centreon-plugins/network/netasq/snmp/mode/hastatus.pm diff --git a/centreon-plugins/network/netasq/snmp/mode/hastatus.pm b/centreon-plugins/network/netasq/snmp/mode/hastatus.pm deleted file mode 100644 index 41eb97e6b..000000000 --- a/centreon-plugins/network/netasq/snmp/mode/hastatus.pm +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright 2016 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::netasq::snmp::mode::hastatus; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, - }); - - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $oid_ntqNbNode = '.1.3.6.1.4.1.11256.1.11.1.0'; - my $oid_ntqNbDeadNode = '.1.3.6.1.4.1.11256.1.11.2.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_ntqNbNode, $oid_ntqNbDeadNode], nothing_quit => 1); - - if ($result->{$oid_ntqNbNode} == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => "Only one node. No ha."); - } else { - my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_ntqNbDeadNode}, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("%d dead nodes on %d nodes", - $result->{$oid_ntqNbDeadNode}, $result->{$oid_ntqNbNode})); - $self->{output}->perfdata_add(label => 'dead_nodes', - value => $result->{$oid_ntqNbDeadNode}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0, max => $result->{$oid_ntqNbNode}); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check ha status. - -=over 8 - -=item B<--warning> - -Threshold warning (number of dead nodes). - -=item B<--critical> - -Threshold critical (number of dead nodes). - -=back - -=cut From 69c05593c37b6d4bb5ac1cb3b72070e873a301d5 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 17 Jun 2016 09:32:55 +0200 Subject: [PATCH 256/346] + remove deprecated mode ha-status --- centreon-plugins/network/netasq/snmp/plugin.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index a77fcd082..8152bc355 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -38,7 +38,6 @@ sub new { 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'load' => 'snmp_standard::mode::loadaverage', - 'ha-status' => 'network::netasq::snmp::mode::hastatus', 'ha-nodes' => 'network::netasq::snmp::mode::hanodes', 'memory' => 'os::freebsd::snmp::mode::memory', 'storage' => 'snmp_standard::mode::storage', From 3af7c3c50ecece7ad967052664c9729b677b8790 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 17 Jun 2016 09:35:34 +0200 Subject: [PATCH 257/346] + Add total number of nodes --- centreon-plugins/network/netasq/snmp/mode/hanodes.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm index 8a11e801f..4936330d2 100644 --- a/centreon-plugins/network/netasq/snmp/mode/hanodes.pm +++ b/centreon-plugins/network/netasq/snmp/mode/hanodes.pm @@ -39,7 +39,8 @@ sub custom_node_threshold { sub custom_node_output { my ($self, %options) = @_; - my $msg = sprintf("Dead nodes: absolute: %d - percentage: %.2f%% ", $self->{result_values}->{dead_nodes}, $self->{result_values}->{prct_dead}); + my $msg = sprintf("Dead nodes: absolute: %d/%d - percentage: %.2f%% ", + $self->{result_values}->{dead_nodes}, $self->{result_values}->{total_nodes}, $self->{result_values}->{prct_dead}); return $msg; } @@ -47,6 +48,7 @@ sub custom_node_calc { my ($self, %options) = @_; $self->{result_values}->{dead_nodes} = $options{new_datas}->{$self->{instance} . '_dead_nodes'}; + $self->{result_values}->{total_nodes} = $options{new_datas}->{$self->{instance} . '_total_nodes'}; $self->{result_values}->{prct_dead} = $options{new_datas}->{$self->{instance} . '_prct_dead'}; return 0; @@ -101,7 +103,7 @@ sub set_counters { $self->{maps_counters}->{global} = [ { label => 'dead-nodes', set => { - key_values => [ { name => 'dead_nodes' }, { name => 'prct_dead' } ], + key_values => [ { name => 'dead_nodes' }, { name => 'prct_dead' }, { name => 'total_nodes' } ], closure_custom_calc => \&custom_node_calc, closure_custom_output => \&custom_node_output, closure_custom_threshold_check => \&custom_node_threshold, @@ -215,6 +217,7 @@ sub manage_selection { my $prct_dead = $self->{results}->{$oid_ntqNbDeadNode}->{$oid_ntqNbDeadNode . '.' . '0'}/$self->{results}->{$oid_ntqNbNode}->{$oid_ntqNbNode . '.' . '0'}*100; $self->{global} = { dead_nodes => $self->{results}->{$oid_ntqNbDeadNode}->{$oid_ntqNbDeadNode . '.' . '0'}, + toatl_nodes => $self->{results}->{$oid_ntqNbDeadNode}->{$oid_ntqNbNode . '.' . '0'}, prct_dead => $prct_dead }; } From bd8328de2b9d5bccdba1a0830a7505a629b95937 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jun 2016 10:18:20 +0200 Subject: [PATCH 258/346] + update vmax emc --- .../emc/symmetrix/vmax/local/mode/hardware.pm | 66 +++++++++++++++---- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm index 8f2b7429a..05facf3c5 100644 --- a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm @@ -49,11 +49,48 @@ sub set_system { $self->{components_module} = ['module', 'temperature', 'director', 'cabling', 'power', 'fabric', 'voltage', 'sparedisk']; } +sub find_files { + my ($self, %options) = @_; + + if (!opendir(DIR, $self->{option_results}->{health_directory})) { + $self->{output}->add_option_msg(short_msg => "Cannot open directory: $!"); + $self->{output}->option_exit(); + } + + my $save_value = 0; + while (my $file = readdir(DIR)) { + next if (! -d $self->{option_results}->{health_directory} . '/' . $file || + $file !~ /$self->{option_results}->{health_directory_pattern}/); + if (hex($1) > $save_value) { + $self->{option_results}->{file_health} = $self->{option_results}->{health_directory} . '/' . $file . '/' . $self->{option_results}->{file_health_name}; + $self->{option_results}->{file_health_env} = $self->{option_results}->{health_directory} . '/' . $file . '/' . $self->{option_results}->{file_health_env_name}; + $save_value = hex($1); + } + } + + closedir(DIR); +} + sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); $self->{statefile_cache}->check_options(%options); + + if (!defined($self->{option_results}->{file_health_name}) || !defined($self->{option_results}->{file_health_env_name})) { + $self->{output}->add_option_msg(short_msg => "Please set option --file-health-name and --file-health-env-name."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{health_directory}) || ! -d $self->{option_results}->{health_directory}) { + $self->{output}->add_option_msg(short_msg => "Please set right option for --health-directory."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{health_directory_pattern})) { + $self->{output}->add_option_msg(short_msg => "Please set option for --health-directory-pattern."); + $self->{output}->option_exit(); + } + + $self->find_files(); } sub new { @@ -64,8 +101,10 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "file-health:s" => { name => 'file_health' }, - "file-health-env:s" => { name => 'file_health_env' }, + "health-directory:s" => { name => 'health_directory' }, + "health-directory-pattern:s" => { name => 'health_directory_pattern' }, + "file-health-name:s" => { name => 'file_health_name', default => 'HealthCheck.log' }, + "file-health-env-name:s" => { name => 'file_health_env_name', default => 'sympl_env_health.log' }, # Email "email-warning:s" => { name => 'email_warning' }, "email-critical:s" => { name => 'email_critical' }, @@ -84,11 +123,6 @@ sub new { sub read_files { my ($self, %options) = @_; - - if (!defined($self->{option_results}->{file_health}) || !defined($self->{option_results}->{file_health_env})) { - $self->{output}->add_option_msg(short_msg => "Please set option --file-health and --file-health-env."); - $self->{output}->option_exit(); - } foreach (('file_health', 'file_health_env')) { $self->{'content_' . $_} = do { @@ -176,7 +210,7 @@ sub send_email { $send_email = 0 if ($status ne 'ok' && defined($prev_output) && $prev_output eq $subject); # recovery email $send_email = 1 if ($status eq 'ok' && defined($prev_status) && $prev_status ne 'ok'); - $self->{statefile_cache}->write(data => $self->{new_datas}); + $self->{statefile_cache}->write(data => $self->{new_datas}); } my $smtp_to = ''; @@ -259,13 +293,21 @@ Example: --warning='sparedisk,.*,5:' Set critical threshold for disk (syntax: type,regexp,threshold) Example: --critical='sparedisk,.*,3:' -=item B<--file-health> +=item B<--health-directory> -The location of the global storage file status (Should be something like: C:/xxxx/HealthCheck.log). +Location of health files. -=item B<--file-health-env> +=item B<--health-directory-pattern> -The location of the environment storage file status (Should be something like: C:/xxxx/sumpl_env_health.log). +Set pattern to match the most recent directory (getting the hexa value). + +=item B<--file-health-name> + +Name of the global storage file status (Default: HealthCheck.log). + +=item B<--file-health-env-name> + +Name of the environment storage file status (Default: sympl_env_health.log). =back From 4c1aceb7e45fac3d73a339819cdc45f07707fc69 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jun 2016 10:35:15 +0200 Subject: [PATCH 259/346] + update emc symmetrics --- .../storage/emc/symmetrix/dmx34/local/mode/hardware.pm | 2 +- .../storage/emc/symmetrix/vmax/local/mode/hardware.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm index 9018474ed..7e08ede6b 100644 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -218,7 +218,7 @@ sub send_email { -from => $self->{option_results}->{email_smtp_from}, -subject => $subject, -body => $stdout, - -attachments => $self->{option_results}->{file_health_env}); + -attachments => $self->{option_results}->{file_health} . ',' . $self->{option_results}->{file_health_env}); $mail->bye(); if ($result == -1) { $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm index 05facf3c5..fb9a893be 100644 --- a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm @@ -243,7 +243,7 @@ sub send_email { -from => $self->{option_results}->{email_smtp_from}, -subject => $subject, -body => $stdout, - -attachments => $self->{option_results}->{file_health_env}); + -attachments => $self->{option_results}->{file_health} . "," . $self->{option_results}->{file_health_env}); $mail->bye(); if ($result == -1) { $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); From d2e2591d7598228e0edc095b2df8f22564b52e11 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jun 2016 14:47:44 +0200 Subject: [PATCH 260/346] + enhance emc symmetrix --- .../emc/symmetrix/dmx34/local/mode/hardware.pm | 17 ++++++++++++----- .../emc/symmetrix/vmax/local/mode/hardware.pm | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm index 7e08ede6b..010a6a303 100644 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -153,10 +153,6 @@ sub send_email { } if (defined($self->{option_results}->{email_smtp_username}) && defined($self->{option_results}->{email_smtp_password})) { $smtp_options{-pass} = $self->{option_results}->{email_smtp_password}; - } - foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { - next if ($option !~ /^(.+?)=(.+)$/); - $smtp_options{-$1} = $2; } ####### @@ -172,6 +168,17 @@ sub send_email { my $subject = $1; my $status = lc($self->{output}->get_litteral_status()); + foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { + next if ($option !~ /^(.+?)=(.+)$/); + my ($label, $value) = ($1, $2); + if ($label =~ /subject/i) { + $value =~ s/%\{status\}/$status/g; + $value =~ s/%\{short_msg\}/$subject/g; + $label = lc($label); + } + $smtp_options{-$label} = $value; + } + my $send_email = 0; $send_email = 1 if ($status ne 'ok'); ####### @@ -216,7 +223,7 @@ sub send_email { } my $result = $mail->send(-to => $smtp_to, -from => $self->{option_results}->{email_smtp_from}, - -subject => $subject, + -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, -body => $stdout, -attachments => $self->{option_results}->{file_health} . ',' . $self->{option_results}->{file_health_env}); $mail->bye(); diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm index fb9a893be..e8134bf2a 100644 --- a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm @@ -179,10 +179,6 @@ sub send_email { if (defined($self->{option_results}->{email_smtp_username}) && defined($self->{option_results}->{email_smtp_password})) { $smtp_options{-pass} = $self->{option_results}->{email_smtp_password}; } - foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { - next if ($option !~ /^(.+?)=(.+)$/); - $smtp_options{-$1} = $2; - } ####### # Get current data @@ -197,6 +193,17 @@ sub send_email { my $subject = $1; my $status = lc($self->{output}->get_litteral_status()); + foreach my $option (@{$self->{option_results}->{email_smtp_options}}) { + next if ($option !~ /^(.+?)=(.+)$/); + my ($label, $value) = ($1, $2); + if ($label =~ /subject/i) { + $value =~ s/%\{status\}/$status/g; + $value =~ s/%\{short_msg\}/$subject/g; + $label = lc($label); + } + $smtp_options{-$label} = $value; + } + my $send_email = 0; $send_email = 1 if ($status ne 'ok'); ####### @@ -241,7 +248,7 @@ sub send_email { } my $result = $mail->send(-to => $smtp_to, -from => $self->{option_results}->{email_smtp_from}, - -subject => $subject, + -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, -body => $stdout, -attachments => $self->{option_results}->{file_health} . "," . $self->{option_results}->{file_health_env}); $mail->bye(); From 7b88149c33f6dc0d37037fffc79f8e2e35a2d210 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jun 2016 16:13:08 +0200 Subject: [PATCH 261/346] + update emc clariion disk --- .../common/emc/navisphere/mode/disk.pm | 385 ++++++------------ 1 file changed, 134 insertions(+), 251 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index d5c7b1fcf..23a215467 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -20,133 +20,14 @@ package centreon::common::emc::navisphere::mode::disk; -sub get_absolute { - my ($self, %options) = @_; - my $name = $options{instance} . '_' . $options{label}; - my $value; - - $self->{new_datas}->{$name} = $1; - - $self->{old_datas}->{$name} = $self->{statefile_value}->get(name => $name); - return undef if (!defined($self->{old_datas}->{$name})); - - # Reward... put to 0 - if ($self->{old_datas}->{$name} > $self->{new_datas}->{$name}) { - $self->{old_datas}->{$name} = 0; - } - - $value = ($self->{new_datas}->{$name} - $self->{old_datas}->{$name}); - - return ($value, $value); -} - -sub get_bytes_per_seconds { - my ($self, %options) = @_; - my $name = $options{instance} . '_' . $options{label}; - my $value; - - $self->{new_datas}->{$name} = $1; - if (!defined($self->{old_datas}->{last_timestamp})) { - $self->{old_datas}->{last_timestamp} = $self->{statefile_value}->get(name => 'last_timestamp'); - } - $self->{old_datas}->{$name} = $self->{statefile_value}->get(name => $name); - return undef if (!defined($self->{old_datas}->{last_timestamp}) || !defined($self->{old_datas}->{$name})); - - # Reward... put to 0 - if ($self->{old_datas}->{$name} > $self->{new_datas}->{$name}) { - $self->{old_datas}->{$name} = 0; - } - # At least one second - my $delta_time = $self->{new_datas}->{last_timestamp} - $self->{old_datas}->{last_timestamp}; - if ($delta_time <= 0) { - $delta_time = 1; - } - - $value = ($self->{new_datas}->{$name} - $self->{old_datas}->{$name}) / $delta_time; - my ($scale_value, $scale_unit) = $self->{perfdata}->change_bytes(value => $value); - - return ($value, $scale_value . ' ' . $scale_unit); -} - -sub get_utils { - my ($self, %options) = @_; - my $name = $options{instance} . '_' . $options{label}; - my $value; - - $self->{new_datas}->{$name . '_busy'} = $1; - $self->{new_datas}->{$name . '_idle'} = $2; - - $self->{old_datas}->{$name . '_busy'} = $self->{statefile_value}->get(name => $name . '_busy'); - $self->{old_datas}->{$name . '_idle'} = $self->{statefile_value}->get(name => $name . '_idle'); - return undef if (!defined($self->{old_datas}->{$name . '_busy'}) || !defined($self->{old_datas}->{$name . '_idle'})); - - # Reward... put to 0 - if ($self->{old_datas}->{$name . '_busy'} > $self->{new_datas}->{$name . '_busy'}) { - $self->{old_datas}->{$name . '_busy'} = 0; - } - if ($self->{old_datas}->{$name . '_idle'} > $self->{new_datas}->{$name . '_idle'}) { - $self->{old_datas}->{$name . '_idle'} = 0; - } - - my $total_ticks = ($self->{new_datas}->{$name . '_idle'} - $self->{old_datas}->{$name . '_idle'}) + - ($self->{new_datas}->{$name . '_busy'} - $self->{old_datas}->{$name . '_busy'}); - if ($total_ticks <= 0) { - return (0, 0); - } - $value = ($self->{new_datas}->{$name . '_busy'} - $self->{old_datas}->{$name . '_busy'}) * 100 / $total_ticks; - - return ($value, $value); -} - -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::statefile; use centreon::plugins::misc; +use Digest::MD5 qw(md5_hex); -my $maps_counters = { - hard_read_errors => { thresholds => { - warning_hard_read_errors => { label => 'warning-hard-read-errors', exit_value => 'warning' }, - critical_hard_read_errors => { label => 'critical-hard-read-errors', exit_value => 'critical' }, - }, - matching => 'Hard Read Errors:\s+(\d+)', closure => \&get_absolute, - output_msg => 'Hard Read Errors : %d', perfdata => '%s', - unit => '', - }, - hard_write_errors => { thresholds => { - warning_hard_write_errors => { label => 'warning-hard-write-errors', exit_value => 'warning' }, - critical_hard_write_errors => { label => 'critical-hard-write-errors', exit_value => 'critical' }, - }, - matching => 'Hard Write Errors:\s+(\d+)', closure => \&get_absolute, - output_msg => 'Hard Write Errors : %d', perfdata => '%s', - unit => '', - }, - write_io => { thresholds => { - warning_write_io => { label => 'warning-write-io', exit_value => 'warning' }, - critical_write_io => { label => 'critical-write-io', exit_value => 'critical' }, - }, - matching => 'Kbytes Written:\s+(\d+)', closure => \&get_bytes_per_seconds, - output_msg => 'Write I/O : %s', perfdata => '%d', - unit => 'B', - }, - read_io => { thresholds => { - warning_read_io => { label => 'warning-read-io', exit_value => 'warning' }, - critical_read_io => { label => 'critical-read-io', exit_value => 'critical' }, - }, - matching => 'Kbytes Read:\s+(\d+)', closure => \&get_bytes_per_seconds, - output_msg => 'Read I/O : %s', perfdata => '%d', - unit => 'B', - }, - utils => { thresholds => { - warning_utils => { label => 'warning-utils', exit_value => 'warning' }, - critical_utils => { label => 'critical-utils', exit_value => 'critical' }, - }, - matching => 'Busy Ticks:\s+(\d+).*Idle Ticks:\s+(\d+)', closure => \&get_utils, - output_msg => 'Utils : %.2f %%', perfdata => '%.2f', - unit => '%', - }, -}; +my $instance_mode; my @states = ( ['^enabled$' , 'OK'], @@ -168,92 +49,144 @@ my @states = ( ['^.*$' , 'CRITICAL'], ); +sub custom_threshold_output { + my ($self, %options) = @_; + + foreach (@states) { + if ($self->{result_values}->{state} =~ /$_->[0]/) { + return $_->[1]; + } + } + + return 'ok'; +} + +sub custom_state_output { + my ($self, %options) = @_; + + my $msg = sprintf("state is '%s'", $self->{result_values}->{state}); + return $msg; +} + +sub custom_state_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_utils_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'disk', type => 1, cb_prefix_output => 'prefix_disk_output', message_multiple => 'All disks are OK', skipped_code => { -10 => 1 } }, + ]; + + $self->{maps_counters}->{disk} = [ + { label => 'state', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_state_calc'), + closure_custom_output => $self->can('custom_state_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'hard-read-errors', set => { + key_values => [ { name => 'hard_read_errors', diff => 1 }, { name => 'display' } ], + output_template => 'Hard Read Errors : %d', + perfdatas => [ + { label => 'hard_read_errors', value => 'hard_read_errors_absolute', template => '%d', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'hard-write-errors', set => { + key_values => [ { name => 'hard_write_errors', diff => 1 }, { name => 'display' } ], + output_template => 'Hard Write Errors : %d', + perfdatas => [ + { label => 'hard_write_errors', value => 'hard_write_errors_absolute', template => '%d', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'read-io', set => { + key_values => [ { name => 'read_io', diff => 1 }, { name => 'display' } ], + output_template => 'Read I/O : %s %s/s', + per_second => 1, output_change_bytes => 1, + perfdatas => [ + { label => 'read_io', value => 'read_io_absolute', template => '%s', + min => 0, unit => 'B/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'write-io', set => { + key_values => [ { name => 'write_io', diff => 1 }, { name => 'display' } ], + output_template => 'Write I/O : %s %s/s', + per_second => 1, output_change_bytes => 1, + perfdatas => [ + { label => 'write_io', value => 'write_io_absolute', template => '%s', + min => 0, unit => 'B/s', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'utils', set => { + key_values => [ { name => 'busy_ticks', diff => 1 }, { name => 'idle_ticks', diff => 1 }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_utils_calc'), + output_template => 'Utils : %s %%', output_use => 'utils', + perfdatas => [ + { label => 'utils', value => 'utils', template => '%s', + min => 0, max => 100, unit => '%%', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_disk_output { + my ($self, %options) = @_; + + return "Disk '" . $options{instance_value}->{display} . "' "; +} + sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "threshold-overload:s@" => { name => 'threshold_overload' }, "filter-raidgroupid:s" => { name => 'filter_raidgroupid', }, "filter-disk:s" => { name => 'filter_disk', }, }); - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - $options{options}->add_options(arguments => { - $maps_counters->{$_}->{thresholds}->{$name}->{label} . ':s' => { name => $name }, - }); - } - } - - $self->{statefile_value} = centreon::plugins::statefile->new(%options); return $self; } sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); - - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - if (($self->{perfdata}->threshold_validate(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, value => $self->{option_results}->{$name})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong " . $maps_counters->{$_}->{thresholds}->{$name}->{label} . " threshold '" . $self->{option_results}->{$name} . "'."); - $self->{output}->option_exit(); - } - } - } + $self->SUPER::check_options(%options); - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /(.*?)=(.*)/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - - my ($filter, $threshold) = ($1, $2); - if ($self->{output}->is_litteral_status(status => $threshold) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$filter} = $threshold; - } - - $self->{statefile_value}->check_options(%options); + $instance_mode = $self; } -sub get_severity { +sub manage_selection { my ($self, %options) = @_; - my $status = 'unknown'; - foreach my $entry (@states) { - if ($options{value} =~ /${$entry}[0]/i) { - $status = ${$entry}[1]; - foreach my $filter (keys %{$self->{overload_th}}) { - if (${$entry}[0] =~ /$filter/i) { - $status = $self->{overload_th}->{$filter}; - last; - } - } - last; - } - } - - return $status; -} - -sub run { - my ($self, %options) = @_; - my $clariion = $options{custom}; - - my $response = $clariion->execute_command(cmd => 'getdisk -state -bytrd -bytwrt -hw -hr -busyticks -idleticks -rg'); - - my ($total_num_disks, $skip_num_disks) = (0, 0); - $self->{new_datas} = {}; - $self->{statefile_value}->read(statefile => "cache_clariion_" . $clariion->{hostname} . '_' . $self->{mode}); - $self->{new_datas}->{last_timestamp} = time(); + $self->{disk} = {}; + $self->{cache_name} = "cache_clariion_" . $options{custom}->{hostname} . '_' . $options{custom}->{mode} . '_' . + (defined($self->{option_results}->{filter_disk}) ? md5_hex($self->{option_results}->{filter_disk}) : md5_hex('all')); + + my $response = $options{custom}->execute_command(cmd => 'getdisk -state -bytrd -bytwrt -hw -hr -busyticks -idleticks -rg'); #Bus 1 Enclosure 7 Disk 13 #State: Enabled @@ -275,76 +208,31 @@ sub run { if (defined($self->{option_results}->{filter_disk}) && $self->{option_results}->{filter_disk} ne '' && $disk_instance !~ /$self->{option_results}->{filter_disk}/) { $skip_num_disks++; - $self->{output}->output_add(long_msg => "Skipping disk '" . $disk_instance . "': no matching filter disk"); + $self->{output}->output_add(long_msg => "skipping disk '" . $disk_instance . "': no matching filter disk", debug => 1); next; } if (defined($self->{option_results}->{filter_raidgroupid}) && $self->{option_results}->{filter_raidgroupid} ne '' && $values =~ /^Raid Group ID:\s+(\S+)/mi && $1 !~ /$self->{option_results}->{filter_raidgroupid}/) { $skip_num_disks++; - $self->{output}->output_add(long_msg => "Skipping disk '" . $disk_instance . "': no matching filter raid group id"); + $self->{output}->output_add(long_msg => "skipping disk '" . $disk_instance . "': no matching filter raid group id", debug => 1); next; } - $total_num_disks++; - $values =~ /^State:\s+(.*?)(\n|$)/msi; - - my $state = centreon::plugins::misc::trim($1); - my $exit = $self->get_severity(value => $state); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Disk '%s' state is %s", - $disk_instance, $state)); - # Don't check values if in critical/warning - next; + my $datas = {}; + while ($value =~ /^(.*?:)(.*?)\n/msgi) { + $datas->{centreon::plugins::misc:trim(lc($1))} = centreon::plugins::misc:trim($2); } - # Work on values. No check if in 'Hot Spare Ready' or 'Unbound' - next if ($state =~ /^(Hot Spare Ready|Unbound)$/i); - - my ($short_msg, $long_msg) = ('', ''); - my @exits; - foreach (keys %{$maps_counters}) { - next if ($values !~ /$maps_counters->{$_}->{matching}/msi); - my ($value_check, $value_output) = &{$maps_counters->{$_}->{closure}}($self, - instance => $disk_instance, label => $_); - next if (!defined($value_check)); - my ($warning, $critical); - - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - my $exit2 = $self->{perfdata}->threshold_check(value => $value_check, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]); - $long_msg .= ' ' . sprintf($maps_counters->{$_}->{output_msg}, $value_output); - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= ' ' . sprintf($maps_counters->{$_}->{output_msg}, $value_output); - } - push @exits, $exit2; - - $warning = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'warning'); - $critical = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'critical'); - } - - $self->{output}->perfdata_add(label => $_ . '_' . $disk_instance, unit => $maps_counters->{$_}->{unit}, - value => sprintf($maps_counters->{$_}->{perfdata}, $value_check), - warning => $warning, - critical => $critical, - min => 0); - } - - $self->{output}->output_add(long_msg => "Disk '$disk_instance':$long_msg"); - $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "Disk '$disk_instance':$short_msg" - ); - } + $self->{disk}->{$disk_instance} = { + display => $disk_instance, + hard_read_errors => $datas->{'hard read errors'}, + hard_write_errors => $datas->{'hard write errors'}, + read_io => $datas->{'kbytes read'} * 1024, + write_io => $datas->{'kbytes write'} * 1024, + busy_ticks => $datas->{'busy ticks'}, + idle_ticks => $datas->{'idle ticks'}, + }; } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s disks are ok.", - $total_num_disks . '/' . $skip_num_disks) - ); - $self->{statefile_value}->write(data => $self->{new_datas}); - $self->{output}->display(); - $self->{output}->exit(); } 1; @@ -367,11 +255,6 @@ Can be: 'read-errors', 'write-errors', 'read-io', 'write-io', 'utils'. Threshold critical. Can be: 'read-errors', 'write-errors', 'read-io', 'write-io', 'utils'. -=item B<--threshold-overload> - -Set to overload default threshold value. -Example: --threshold-overload='(enabled)=critical' - =item B<--filter-disk> Filter Disk (regexp can be used). From 4e0fa3bd6cb95ca746e4d09b41f508360f6c346d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jun 2016 16:39:18 +0200 Subject: [PATCH 262/346] + update emc clariion disk (need to add option to configure state threshold) --- .../common/emc/navisphere/mode/disk.pm | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index 23a215467..676b9f4bd 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -49,11 +49,11 @@ my @states = ( ['^.*$' , 'CRITICAL'], ); -sub custom_threshold_output { +sub custom_threshold_check { my ($self, %options) = @_; foreach (@states) { - if ($self->{result_values}->{state} =~ /$_->[0]/) { + if ($self->{result_values}->{state} =~ /$_->[0]/i) { return $_->[1]; } } @@ -79,8 +79,11 @@ sub custom_state_calc { sub custom_utils_calc { my ($self, %options) = @_; - $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; - $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + my $diff_busy = $options{new_datas}->{$self->{instance} . '_busy_ticks'} - $options{old_datas}->{$self->{instance} . '_busy_ticks'}; + my $diff_idle = $options{new_datas}->{$self->{instance} . '_idle_ticks'} - $options{old_datas}->{$self->{instance} . '_idle_ticks'}; + + $self->{result_values}->{utils} = $diff_busy * 100 / ($diff_busy + $diff_idle); + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; return 0; } @@ -97,7 +100,7 @@ sub set_counters { closure_custom_calc => $self->can('custom_state_calc'), closure_custom_output => $self->can('custom_state_output'), closure_custom_perfdata => sub { return 0; }, - closure_custom_threshold_check => $self->can('custom_threshold_output'), + closure_custom_threshold_check => $self->can('custom_threshold_check'), } }, { label => 'hard-read-errors', set => { @@ -141,10 +144,10 @@ sub set_counters { { label => 'utils', set => { key_values => [ { name => 'busy_ticks', diff => 1 }, { name => 'idle_ticks', diff => 1 }, { name => 'display' } ], closure_custom_calc => $self->can('custom_utils_calc'), - output_template => 'Utils : %s %%', output_use => 'utils', + output_template => 'Utils : %.2f %%', output_use => 'utils', perfdatas => [ - { label => 'utils', value => 'utils', template => '%s', - min => 0, max => 100, unit => '%%', label_extra_instance => 1, instance_use => 'display_absolute' }, + { label => 'utils', value => 'utils', template => '%.2f', + min => 0, max => 100, unit => '%%', label_extra_instance => 1, instance_use => 'display' }, ], } }, @@ -207,28 +210,27 @@ sub manage_selection { # First Filters if (defined($self->{option_results}->{filter_disk}) && $self->{option_results}->{filter_disk} ne '' && $disk_instance !~ /$self->{option_results}->{filter_disk}/) { - $skip_num_disks++; $self->{output}->output_add(long_msg => "skipping disk '" . $disk_instance . "': no matching filter disk", debug => 1); next; } if (defined($self->{option_results}->{filter_raidgroupid}) && $self->{option_results}->{filter_raidgroupid} ne '' && $values =~ /^Raid Group ID:\s+(\S+)/mi && $1 !~ /$self->{option_results}->{filter_raidgroupid}/) { - $skip_num_disks++; $self->{output}->output_add(long_msg => "skipping disk '" . $disk_instance . "': no matching filter raid group id", debug => 1); next; } my $datas = {}; - while ($value =~ /^(.*?:)(.*?)\n/msgi) { - $datas->{centreon::plugins::misc:trim(lc($1))} = centreon::plugins::misc:trim($2); + while ($values =~ /^([^\n]*?):(.*?)\n/msgi) { + $datas->{centreon::plugins::misc::trim(lc($1))} = centreon::plugins::misc::trim($2); } $self->{disk}->{$disk_instance} = { display => $disk_instance, + state => $datas->{state}, hard_read_errors => $datas->{'hard read errors'}, hard_write_errors => $datas->{'hard write errors'}, - read_io => $datas->{'kbytes read'} * 1024, - write_io => $datas->{'kbytes write'} * 1024, + read_io => defined($datas->{'kbytes read'}) ? $datas->{'kbytes read'} * 1024 : undef, + write_io => defined($datas->{'kbytes write'}) ? $datas->{'kbytes write'} * 1024 : undef, busy_ticks => $datas->{'busy ticks'}, idle_ticks => $datas->{'idle ticks'}, }; From bfced6e2cb09d04ca7a476bf867fabfdcea9db06 Mon Sep 17 00:00:00 2001 From: THEPAUT Date: Fri, 24 Jun 2016 11:36:47 +0200 Subject: [PATCH 263/346] Add option credentials in help description --- centreon-plugins/apps/jenkins/mode/jobstate.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/centreon-plugins/apps/jenkins/mode/jobstate.pm b/centreon-plugins/apps/jenkins/mode/jobstate.pm index 88fbaab76..3db09d98c 100644 --- a/centreon-plugins/apps/jenkins/mode/jobstate.pm +++ b/centreon-plugins/apps/jenkins/mode/jobstate.pm @@ -157,6 +157,10 @@ Specify https if needed (Default: 'http') Set path to get Jenkins information +=item B <--credentials> + +Required to use username/password authentication method + =item B<--username> Specify username for API authentification From a9bce4dc1520e48fa7755774668ea01d39f3c0be Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 24 Jun 2016 11:57:28 +0200 Subject: [PATCH 264/346] - unwanted commit on master --- .../network/sonus/sbc/1000/snmp/plugin.pm | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm diff --git a/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm b/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm deleted file mode 100644 index 349e54551..000000000 --- a/centreon-plugins/network/sonus/sbc/1000/snmp/plugin.pm +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright 2016 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::sonus::sbc::1000::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; - # $options->{options} = options object - - $self->{version} = '1.0'; - %{$self->{modes}} = ( - 'cpu' => 'snmp_standard::mode::cpu', - 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', - 'dsp-stats' => 'network::sonus::sbc::1000::snmp::mode::dspstats', - 'interfaces' => 'snmp_standard::mode::interfaces', - 'list-interfaces' => 'snmp_standard::mode::listinterfaces', - 'load' => 'snmp_standard::mode::loadaverage', - 'memory' => 'snmp_standard::mode::memory', - 'storage' => 'snmp_standard::mode::storage', - 'swap' => 'snmp_standard::mode::swap', - ); - - return $self; -} - -1; - -__END__ - -=head1 PLUGIN DESCRIPTION - -Check Sonus UX SBC 1000 SNMP - -=cut From f14594bab54ebcf1bdbb8939b14943659566e9e8 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 24 Jun 2016 11:59:24 +0200 Subject: [PATCH 265/346] + enhance/refactor code mssql Fix https://github.com/centreon/centreon-plugins/issues/431 --- .../database/mssql/mode/databasessize.pm | 191 ++++++++++++------ 1 file changed, 124 insertions(+), 67 deletions(-) diff --git a/centreon-plugins/database/mssql/mode/databasessize.pm b/centreon-plugins/database/mssql/mode/databasessize.pm index 6e37a6627..4ec7bc34e 100644 --- a/centreon-plugins/database/mssql/mode/databasessize.pm +++ b/centreon-plugins/database/mssql/mode/databasessize.pm @@ -20,50 +20,130 @@ package database::mssql::mode::databasessize; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +my $instance_mode; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'database', type => 1, cb_prefix_output => 'prefix_database_output', message_multiple => 'All databases are OK' }, + ]; + + $self->{maps_counters}->{database} = [ + { label => 'database', set => { + key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'total' }, { name => 'display' } ], + closure_custom_calc => \&custom_usage_calc, + closure_custom_output => \&custom_usage_output, + closure_custom_perfdata => \&custom_usage_perfdata, + closure_custom_threshold_check => \&custom_usage_threshold, + } + }, + ]; +} + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'db_' . $self->{result_values}->{display} . '_used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'db_' . $self->{result_values}->{display} . '_free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{prct_used} = $options{new_datas}->{$self->{instance} . '_prct_used'}; + $self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'}; + + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $self->{version} = '1.0'; $options{options}->add_options(arguments => - { - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, - "filter:s" => { name => 'filter', }, - "free" => { name => 'free', }, + { + "filter-database:s" => { name => 'filter_database' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + "skip" => { name => 'skip' }, }); - return $self; } +sub prefix_database_output { + my ($self, %options) = @_; + + return "Database '" . $options{instance_value}->{display} . "' "; +} + sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); - } + $instance_mode = $self; } -sub run { +sub manage_selection { my ($self, %options) = @_; # $options{sql} = sqlmode object $self->{sql} = $options{sql}; - - $self->{output}->output_add(severity => 'OK', - short_msg => "All databases are ok."); - $self->{sql}->connect(); $self->{sql}->query(query => q{DBCC SQLPERF(LOGSPACE)}); @@ -71,7 +151,7 @@ sub run { my @databases_selected; foreach my $row (@$result) { - next if (defined($self->{option_results}->{filter}) && $$row[0] !~ /$self->{option_results}->{filter}/); + next if (defined($self->{option_results}->{filter_database}) && $$row[0] !~ /$self->{option_results}->{filter_database}/); push @databases_selected, $$row[0]; } @@ -83,44 +163,17 @@ sub run { my $size = convert_bytes($size_brut); my $free_brut = $$row[2]; my $free = convert_bytes($free_brut); - my $use = $size - $free; - my $percent_use = ($use / $size) * 100; - my $percent_free = 100 - $percent_use; - my ($use_value, $use_unit) = $self->{perfdata}->change_bytes(value => $use); - $self->{output}->output_add(long_msg => sprintf("DB '%s' Size: %s Used: %.2f %s (%.2f%%) Free: %s (%.2f%%)", $database, $size_brut, $use_value, $use_unit, $percent_use, $free_brut, $percent_free)); - if (defined($self->{option_results}->{free})) { - my $exit_code = $self->{perfdata}->threshold_check(value => $percent_free, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("DB '%s' Size: %s Free: %s (%.2f%%)", $database, $size_brut, $free_brut, $percent_use)); - } - $self->{output}->perfdata_add(label => sprintf("db_%s_free",$database), - unit => 'B', - value => int($free), - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $size, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $size, cast_int => 1), - min => 0, - max => int($size)); - } else { - my $exit_code = $self->{perfdata}->threshold_check(value => $percent_use, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit_code, - short_msg => sprintf("DB '%s' Size: %s Used: %.2f %s (%.2f%%)", $database, $size_brut, $use_value, $use_unit, $percent_use)); - } - $self->{output}->perfdata_add(label => sprintf("db_%s_used",$database), - unit => 'B', - value => int($use), - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $size, cast_int => 1), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $size, cast_int => 1), - min => 0, - max => int($size)); - } + my $used = $size - $free; + my $percent_used = ($used / $size) * 100; + + $self->{database}->{$database} = { used => $used, + free => $free, + total => $size, + prct_used => $percent_used, + display => lc $database }; + } } - - - $self->{output}->display(); - $self->{output}->exit(); } sub convert_bytes { @@ -144,25 +197,29 @@ __END__ =head1 MODE -Check MSSQL databases size. +Check MSSQL Database usage =over 8 -=item B<--warning> +=item B<--warning-database> -Threshold warning in percent used. +Threshold warning. -=item B<--critical> +=item B<--critical-database> -Threshold critical in percent used. +Threshold critical. -=item B<--filter> +=item B<--filter-database> -Filter database. +Filter database by name. Can be a regex + +=item B<--units> + +Default is '%', can be 'B' =item B<--free> -Check free space instead of used space. +Perfdata show free space =back From e32a549549bc39d4ed56e125ebb5cb72aeb114f3 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Fri, 24 Jun 2016 12:04:36 +0200 Subject: [PATCH 266/346] + remove unused option --- centreon-plugins/database/mssql/mode/databasessize.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/centreon-plugins/database/mssql/mode/databasessize.pm b/centreon-plugins/database/mssql/mode/databasessize.pm index 4ec7bc34e..8a0b5cd7d 100644 --- a/centreon-plugins/database/mssql/mode/databasessize.pm +++ b/centreon-plugins/database/mssql/mode/databasessize.pm @@ -122,7 +122,6 @@ sub new { "filter-database:s" => { name => 'filter_database' }, "units:s" => { name => 'units', default => '%' }, "free" => { name => 'free' }, - "skip" => { name => 'skip' }, }); return $self; } From bef5a141731020815ac71bacee12a1fea35297ad Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 26 Jun 2016 17:30:36 +0200 Subject: [PATCH 267/346] + Fix #397 --- .../common/fastpath/mode/components/fan.pm | 90 +++++ .../common/fastpath/mode/components/psu.pm | 78 ++++ .../fastpath/mode/components/temperature.pm | 99 +++++ .../common/fastpath/mode/environment.pm | 366 +++--------------- 4 files changed, 323 insertions(+), 310 deletions(-) create mode 100644 centreon-plugins/centreon/common/fastpath/mode/components/fan.pm create mode 100644 centreon-plugins/centreon/common/fastpath/mode/components/psu.pm create mode 100644 centreon-plugins/centreon/common/fastpath/mode/components/temperature.pm diff --git a/centreon-plugins/centreon/common/fastpath/mode/components/fan.pm b/centreon-plugins/centreon/common/fastpath/mode/components/fan.pm new file mode 100644 index 000000000..0309c741f --- /dev/null +++ b/centreon-plugins/centreon/common/fastpath/mode/components/fan.pm @@ -0,0 +1,90 @@ +# +# Copyright 2016 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 centreon::common::fastpath::mode::components::fan; + +use strict; +use warnings; + +my %map_fan_status = ( + 1 => 'notpresent', + 2 => 'operational', + 3 => 'failed', + 4 => 'powering', + 5 => 'nopower', + 6 => 'notpowering', + 7 => 'incompatible', +); + +my $mapping = { + boxServicesFanItemState => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1.3', map => \%map_fan_status }, + boxServicesFanSpeed => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1.4' }, +}; +my $oid_boxServicesFansEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_boxServicesFansEntry, begin => $mapping->{boxServicesFanItemState}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fans"); + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fan')); + + my ($exit, $warn, $crit, $checked); + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesFansEntry}})) { + next if ($oid !~ /^$mapping->{boxServicesFanItemState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_boxServicesFansEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fan', instance => $instance)); + if ($result->{boxServicesFanItemState} =~ /notPresent/i) { + $self->absent_problem(section => 'fan', instance => $instance); + next; + } + + $self->{components}->{fan}->{total}++; + $self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance = %s, speed = %s]", + $instance, $result->{boxServicesFanItemState}, $instance, defined($result->{boxServicesFanSpeed}) ? $result->{boxServicesFanSpeed} : 'unknown')); + $exit = $self->get_severity(label => 'default', section => 'fan', value => $result->{boxServicesFanItemState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' status is '%s'", $instance, $result->{boxServicesFanItemState})); + next; + } + + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{boxServicesFanSpeed}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' is '%s' rpm", $instance, $result->{boxServicesFanSpeed})); + } + $self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', + value => $result->{boxServicesFanSpeed}, + warning => $warn, + critical => $crit, min => 0 + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/fastpath/mode/components/psu.pm b/centreon-plugins/centreon/common/fastpath/mode/components/psu.pm new file mode 100644 index 000000000..5b3a7f1d1 --- /dev/null +++ b/centreon-plugins/centreon/common/fastpath/mode/components/psu.pm @@ -0,0 +1,78 @@ +# +# Copyright 2016 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 centreon::common::fastpath::mode::components::psu; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'notpresent', + 2 => 'operational', + 3 => 'failed', + 4 => 'powering', + 5 => 'nopower', + 6 => 'notpowering', + 7 => 'incompatible', +); + +my $mapping = { + boxServicesPowSupplyItemState => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.7.1.3', map => \%map_status }, +}; +my $oid_boxServicesPowSuppliesEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.7.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_boxServicesPowSuppliesEntry, begin => $mapping->{boxServicesPowSupplyItemState}->{oid} }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power supplies"); + $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'psu')); + + my ($exit, $warn, $crit, $checked); + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesPowSuppliesEntry}})) { + next if ($oid !~ /^$mapping->{boxServicesPowSupplyItemState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_boxServicesPowSuppliesEntry}, instance => $instance); + + next if ($self->check_filter(section => 'psu', instance => $instance)); + if ($result->{boxServicesPowSupplyItemState} =~ /notPresent/i) { + $self->absent_problem(section => 'psu', instance => $instance); + next; + } + + $self->{components}->{psu}->{total}++; + $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance = %s]", + $instance, $result->{boxServicesPowSupplyItemState}, $instance)); + $exit = $self->get_severity(label => 'default', section => 'psu', value => $result->{boxServicesPowSupplyItemState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power supply '%s' status is '%s'", $instance, $result->{boxServicesPowSupplyItemState})); + next; + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/fastpath/mode/components/temperature.pm b/centreon-plugins/centreon/common/fastpath/mode/components/temperature.pm new file mode 100644 index 000000000..10c5b98ab --- /dev/null +++ b/centreon-plugins/centreon/common/fastpath/mode/components/temperature.pm @@ -0,0 +1,99 @@ +# +# Copyright 2016 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 centreon::common::fastpath::mode::components::temperature; + +use strict; +use warnings; + +my %map_temp_status = ( + 0 => 'low', + 1 => 'normal', + 2 => 'warning', + 3 => 'critical', + 4 => 'shutdown', + 5 => 'notpresent', + 6 => 'notoperational', +); + +my $mapping1 = { + boxServicesTempSensorState => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.3', map => \%map_temp_status }, + boxServicesTempSensorTemperature => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.4' }, +}; +my $mapping2 = { + boxServicesTempSensorState => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.4', map => \%map_temp_status }, + boxServicesTempSensorTemperature => { oid => '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.5' }, +}; +my $oid_boxServicesTempSensorsEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_boxServicesTempSensorsEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + my ($result, $exit, $warn, $crit, $checked); + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesTempSensorsEntry}})) { + next if ($oid !~ /^$mapping2->{boxServicesTempSensorState}->{oid}\.(.*)$/); + my $instance = $1; + + if (defined($self->{results}->{$oid_boxServicesTempSensorsEntry}->{$mapping2->{boxServicesTempSensorTemperature}->{oid} . '.' . $instance})) { + $result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_boxServicesTempSensorsEntry}, instance => $instance); + } else { + $result = $self->{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{$oid_boxServicesTempSensorsEntry}, instance => $instance); + } + + next if ($self->check_filter(section => 'temperature', instance => $instance)); + if ($result->{boxServicesTempSensorState} =~ /notPresent/i) { + $self->absent_problem(section => 'temperature', instance => $instance); + next; + } + + $self->{components}->{temperature}->{total}++; + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s' [instance = %s, temperature = %s]", + $instance, $result->{boxServicesTempSensorState}, $instance, defined($result->{boxServicesTempSensorTemperature}) ? $result->{boxServicesTempSensorTemperature} : 'unknown')); + $exit = $self->get_severity(section => 'temperature', value => $result->{boxServicesTempSensorState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' status is '%s'", $instance, $result->{boxServicesTempSensorState})); + next; + } + + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{boxServicesTempSensorTemperature}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' is '%s' C", $instance, $result->{boxServicesTempSensorTemperature})); + } + $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', + value => $result->{boxServicesTempSensorTemperature}, + warning => $warn, + critical => $crit, min => 0 + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/fastpath/mode/environment.pm b/centreon-plugins/centreon/common/fastpath/mode/environment.pm index d0d25fd97..9c84c05e3 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/environment.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/environment.pm @@ -20,50 +20,50 @@ package centreon::common::fastpath::mode::environment; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -my $oid_boxServicesFansEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1'; -my $oid_boxServicesFanItemState = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1.3'; -my $oid_boxServicesFanSpeed = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.6.1.4'; -my $oid_boxServicesPowSuppliesEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.7.1'; -my $oid_boxServicesPowSupplyItemState = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.7.1.3'; -my $oid_boxServicesTempSensorsEntry = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1'; -my $oid_boxServicesTempSensorTemperature1 = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.4'; # oid for 6200 series -my $oid_boxServicesTempSensorTemperature2 = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.5'; +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + default => [ + ['notpresent', 'OK'], + ['operational', 'OK'], + ['failed', 'CRITICAL'], + ['powering', 'WARNING'], + ['nopower', 'CRITICAL'], + ['notpowering', 'CRITICAL'], + ['incompatible', 'CRITICAL'], + ], + temperature => [ + ['low', 'WARNING'], + ['normal', 'OK'], + ['warning', 'WARNING'], + ['critical', 'CRITICAL'], + ['shutdown', 'CRITICAL'], + ['notpresent', 'OK'], + ['notoperational', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'centreon::common::fastpath::mode::components'; + $self->{components_module} = ['fan', 'psu', 'temperature']; +} -my $thresholds = { - psu => [ - ['notpresent', 'OK'], - ['operational', 'OK'], - ['failed', 'CRITICAL'], - ['powering', 'WARNING'], - ['nopower', 'CRITICAL'], - ['notpowering', 'CRITICAL'], - ['incompatible', 'CRITICAL'], - ], - fan => [ - ['notpresent', 'OK'], - ['operational', 'OK'], - ['failed', 'CRITICAL'], - ['powering', 'WARNING'], - ['nopower', 'CRITICAL'], - ['notpowering', 'CRITICAL'], - ['incompatible', 'CRITICAL'], - ], -}; - -my %map_states = ( - 1 => 'notpresent', - 2 => 'operational', - 3 => 'failed', - 4 => 'powering', - 5 => 'nopower', - 6 => 'notpowering', - 7 => 'incompatible', -); +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} sub new { my ($class, %options) = @_; @@ -73,291 +73,35 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => 'all' }, - "absent-problem:s" => { name => 'absent' }, - "no-component:s" => { name => 'no_component' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "warning-temperature:s" => { name => 'warning_temperature' }, - "critical-temperature:s" => { name => 'critical_temperature' }, }); - - $self->{components} = {}; - $self->{no_components} = undef; + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning_temperature', value => $self->{option_results}->{warning_temperature})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning temperature threshold '" . $self->{option_results}->{warning_temperature} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_temperature', value => $self->{option_results}->{critical_temperature})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical temperature threshold '" . $self->{option_results}->{critical_temperature} . "'."); - $self->{output}->option_exit(); - } - - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; - } - } - - $self->{overload_th} = {}; - foreach my $val (@{$self->{option_results}->{threshold_overload}}) { - if ($val !~ /^(.*?),(.*?),(.*)$/) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload option '" . $val . "'."); - $self->{output}->option_exit(); - } - my ($section, $status, $filter) = ($1, $2, $3); - if ($self->{output}->is_litteral_status(status => $status) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); - $self->{output}->option_exit(); - } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - # There is a bug with get_leef and snmpv1. - $self->{results} = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oid_boxServicesFansEntry }, - { oid => $oid_boxServicesPowSuppliesEntry }, - { oid => $oid_boxServicesTempSensorsEntry }, - ]); - - if ($self->{option_results}->{component} eq 'all') { - $self->check_fan(); - $self->check_psu(); - $self->check_temperature(); - } elsif ($self->{option_results}->{component} eq 'fan') { - $self->check_fan(); - } elsif ($self->{option_results}->{component} eq 'psu') { - $self->check_psu(); - } elsif ($self->{option_results}->{component} eq 'temperature') { - $self->check_temperature(); - } else { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - my $count_by_components = $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $count_by_components . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components are ok [%s].", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -sub absent_problem { - my ($self, %options) = @_; - - if (defined($self->{option_results}->{absent}) && - $self->{option_results}->{absent} =~ /(^|\s|,)($options{section}(\s*,|$)|${options{section}}[^,]*#\Q$options{instance}\E#)/) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Component '%s' instance '%s' is not present", - $options{section}, $options{instance})); - } - - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance (not present)")); - $self->{components}->{$options{section}}->{skip}++; - return 1; -} - -sub get_severity { - my ($self, %options) = @_; - my $status = 'UNKNOWN'; # default - - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { - $status = $_->{status}; - return $status; - } - } - } - foreach (@{$thresholds->{$options{section}}}) { - if ($options{value} =~ /$$_[0]/i) { - $status = $$_[1]; - return $status; - } - } - - return $status; -} - -sub check_fan { - my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking fans"); - $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); - - foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesFansEntry}})) { - next if ($oid !~ /^$oid_boxServicesFanItemState\.(.*)/); - my $instance = $1; - my $fan_state = $self->{results}->{$oid_boxServicesFansEntry}->{$oid_boxServicesFanItemState . '.' . $instance}; - my $fan_speed = $self->{results}->{$oid_boxServicesFansEntry}->{$oid_boxServicesFanSpeed . '.' . $instance}; - - next if ($self->check_exclude(section => 'fan', instance => $instance)); - next if ($map_states{$fan_state} eq 'notPresent' && - $self->absent_problem(section => 'fan', instance => $instance)); - - $self->{components}->{fan}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Fan '%s' state is %s.", - $instance, $map_states{$fan_state})); - my $exit = $self->get_severity(section => 'fan', value => $map_states{$fan_state}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Fan '%s' state is %s.", $instance, $map_states{$fan_state})); - } - - $self->{output}->perfdata_add(label => "Fan_$instance", - unit => 'rpm', - value => $fan_speed, - min => 0); - } -} - -sub check_psu { - my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking power supplies"); - $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); - - foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesPowSuppliesEntry}})) { - next if ($oid !~ /^$oid_boxServicesPowSupplyItemState\.(.*)/); - my $instance = $1; - my $psu_state = $self->{results}->{$oid_boxServicesPowSuppliesEntry}->{$oid_boxServicesPowSupplyItemState . '.' . $instance}; - - next if ($self->check_exclude(section => 'psu', instance => $instance)); - next if ($map_states{$psu_state} eq 'notPresent' && - $self->absent_problem(section => 'psu', instance => $instance)); - - $self->{components}->{psu}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Power supply '%s' state is %s.", - $instance, $map_states{$psu_state})); - my $exit = $self->get_severity(section => 'psu', value => $map_states{$psu_state}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power supply '%s' state is %s.", $instance, $map_states{$psu_state})); - } - } -} - -sub check_temperature { - my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking temperature sensors"); - $self->{components}->{temperature} = {name => 'temperature sensors', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'temperature')); - - foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_boxServicesTempSensorsEntry}})) { - my $instance; - if ($oid =~ /^$oid_boxServicesTempSensorTemperature1\.(.*)/) { - $instance = $1; - } elsif ($oid =~ /^$oid_boxServicesTempSensorTemperature2\.(.*)\.(.*)/) { - $instance = $1 . '.' . $2; - } else { - next; - } - my $temperature; - - if (defined($self->{results}->{$oid_boxServicesTempSensorsEntry}->{$oid_boxServicesTempSensorTemperature1 . '.' . $instance})) { - $temperature = $self->{results}->{$oid_boxServicesTempSensorsEntry}->{$oid_boxServicesTempSensorTemperature1 . '.' . $instance}; - } else { - $temperature = $self->{results}->{$oid_boxServicesTempSensorsEntry}->{$oid_boxServicesTempSensorTemperature2 . '.' . $instance}; - } - - next if ($self->check_exclude(section => 'temperature', instance => $instance)); - - $instance =~ s/(\d+)\.//; - - $self->{components}->{temperature}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Temperature sensor '%s' : %sc.", - $instance, $temperature)); - my $exit = $self->{perfdata}->threshold_check(value => $temperature, threshold => [ { label => 'critical_temperature', 'exit_litteral' => 'critical' }, { label => 'warning_temperature', exit_litteral => 'warning' } ]); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Temperature sensor '%s' : %sc.", $instance, $temperature)); - } - - $self->{output}->perfdata_add(label => "Temperature_$instance", - unit => 'c', - value => $temperature); - } -} - 1; __END__ =head1 MODE -Check environment (FASTPATH-BOXSERVICES-MIB) (Fans, Power Supplies, Temperature). +Check Hardware (Fans, Power Supplies, Temperature) (FASTPATH-BOXSERVICES-MIB). =over 8 =item B<--component> -Which component to check (Default: 'all'). -Can be: 'psu', 'fan', 'temperature'. +Which component to check (Default: '.*'). +Can be: 'fan', 'psu', 'temperature'. -=item B<--exclude> +=item B<--filter> -Exclude some parts (comma seperated list) (Example: --exclude=psu) -Can also exclude specific instance: --exclude='fan#fan2_unit1#' +Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu) +Can also exclude specific instance: --filter=fan,1 =item B<--absent-problem> Return an error if an entity is not 'present' (default is skipping) (comma seperated list) -Can be specific or global: --absent-problem=psu +Can be specific or global: --absent-problem=psu,1 =item B<--no-component> @@ -366,18 +110,20 @@ If total (with skipped) is 0. (Default: 'critical' returns). =item B<--threshold-overload> -Set to overload default threshold values (syntax: section,status,regexp) +Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). -Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)' +Example: --threshold-overload='psu,CRITICAL,^(?!(operational)$)' -=item B<--warning-temperature> +=item B<--warning> -Warning threshold for temperature in celsius. +Set warning threshold for 'temperature', 'fan' (syntax: type,regexp,threshold) +Example: --warning='fan,1.1,5000' -=item B<--critical-temperature> +=item B<--critical> -Critical threshold for temperature in celsius. +Set critical threshold for 'temperature', 'fan' (syntax: type,regexp,threshold) +Example: --critical='fan,.*,2000' =back -=cut +=cut \ No newline at end of file From 8fcf5ad3f6a8cb941f5be9ecd8339a48559d1531 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 26 Jun 2016 18:32:26 +0200 Subject: [PATCH 268/346] + Fix #412 --- .../storage/lenovo/sseries/snmp/plugin.pm | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 centreon-plugins/storage/lenovo/sseries/snmp/plugin.pm diff --git a/centreon-plugins/storage/lenovo/sseries/snmp/plugin.pm b/centreon-plugins/storage/lenovo/sseries/snmp/plugin.pm new file mode 100644 index 000000000..f7eb9ec1f --- /dev/null +++ b/centreon-plugins/storage/lenovo/sseries/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::lenovo::sseries::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}} = ( + 'hardware' => 'snmp_standard::mode::hardwarefibrealliance', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Lenovo Storage S Series (S2200 and S3200) in SNMP. + +=cut From 6f214e8e486c690805058d548510483f25fc0068 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 26 Jun 2016 19:22:53 +0200 Subject: [PATCH 269/346] + Ref #371 : update FAQ --- centreon-plugins/docs/en/user/guide.rst | 54 ++++++++++++++++++++++++ centreon-plugins/docs/fr/user/guide.rst | 55 +++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/centreon-plugins/docs/en/user/guide.rst b/centreon-plugins/docs/en/user/guide.rst index d975b00ce..a6bca69b0 100644 --- a/centreon-plugins/docs/en/user/guide.rst +++ b/centreon-plugins/docs/en/user/guide.rst @@ -509,6 +509,8 @@ How can i check the plugin version ? You can check the version of plugins and modes with option ``--version``: :: + $ perl centreon_plugins.pl --version + Global Version: 20160524 $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --version Plugin Version: 0.1 $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=storage --version @@ -521,6 +523,58 @@ For example, we want to execute the mode only if the version >= 2.x: $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public --verbose --mode-version='2.x' UNKNOWN: Not good version for plugin mode. Excepted at least: 2.x. Get: 1.0 +------------------------------------- +Can i have one standalone Perl file ? +------------------------------------- + +We have done some tests and it will cost around 4% more of execution time. We are going to create a standalone Linux SNMP plugin. + +Download the Perl module ``App::FatPacker`` on metacpan: +:: + + # tar zxvf App-FatPacker-0.010005.tar.gz + # cd App-FatPacker-0.010005 + # perl Makefile.PL && make && make install + +Create a directory to build it: +:: + + # mkdir -p build/plugin + # cd build + +Clone ``centreon-plugins``: +:: + + # git clone https://github.com/centreon/centreon-plugins.git + +``fatpack`` includes ``pm`` files under the directory ``lib``: +:: + + # mkdir plugin/lib && cd centreon-plugins + +Copy the common files for all plugins: +:: + + # cp -R --parent centreon/plugins/{misc,mode,options,output,perfdata,script,statefile,values}.pm centreon/plugins/templates/ centreon/plugins/alternative/ ../plugin/lib/ + # cp centreon_plugins.pl ../plugin + # sed -i 's/alternative_fatpacker = 0/alternative_fatpacker = 1/' ../plugin/lib/centreon/plugins/script.pm + +Copy files for Linux SNMP plugin: +:: + + # cp -R --parent centreon/plugins/{script_snmp,snmp}.pm os/linux/snmp/ snmp_standard/mode/{cpu,cpudetailed,diskio,diskusage,inodes,interfaces,loadaverage,listdiskspath,listinterfaces,liststorages,memory,processcount,storage,swap,ntp,tcpcon,uptime}.pm ../plugin/lib/ + +Build the standalone Perl file: +:: + + # cd ../plugin + # fatpack file centreon_plugins.pl > centreon_linux_snmp.pl + +The plugin works in the same way: +:: + + # perl centreon_linux_snmp.pl --plugin os::linux::snmp::plugin --mode=processcount --snmp-community public --snmp-version 2c --hostname=127.0.0.1 --process-name='' --process-status='' --process-args='' + *************** Troubleshooting *************** diff --git a/centreon-plugins/docs/fr/user/guide.rst b/centreon-plugins/docs/fr/user/guide.rst index 287b67cf0..6bdc66be1 100644 --- a/centreon-plugins/docs/fr/user/guide.rst +++ b/centreon-plugins/docs/fr/user/guide.rst @@ -509,6 +509,8 @@ Comment puis-je vérifier la version du plugin ? Vous pouvez vérifier la version des plugins et des modes avec l'option ``--version`` : :: + $ perl centreon_plugins.pl --version + Global Version: 20160524 $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --version Plugin Version: 0.1 $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=storage --version @@ -521,6 +523,59 @@ Par exemple, nous voulons exécuter le mode seulement si sa version >= 2.x : $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=storage --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public --verbose --mode-version='2.x' UNKNOWN: Not good version for plugin mode. Excepted at least: 2.x. Get: 1.0 +-------------------------------------------- +Comment puis-je avoir un seul fichier Perl ? +-------------------------------------------- + +Nous avons réalisé des tests et le temps d'éxecution est augmenté d'environ 4%. Nous allons créer un fichier unique pour la sonde Linux SNMP. + +Télécharger le module Perl ``App::FatPacker`` sur metacpan: +:: + + # tar zxvf App-FatPacker-0.010005.tar.gz + # cd App-FatPacker-0.010005 + # perl Makefile.PL && make && make install + +Créer un répertoire de construction: +:: + + # mkdir -p build/plugin + # cd build + +Cloner ``centreon-plugins``: +:: + + # git clone https://github.com/centreon/centreon-plugins.git + +``fatpack`` inclut les fichiers ``pm`` présent dans le répertoire ``lib``: +:: + + # mkdir plugin/lib && cd centreon-plugins + +Copier les fichiers communs à l'ensemble des sondes: +:: + + # cp -R --parent centreon/plugins/{misc,mode,options,output,perfdata,script,statefile,values}.pm centreon/plugins/templates/ centreon/plugins/alternative/ ../plugin/lib/ + # cp centreon_plugins.pl ../plugin + # sed -i 's/alternative_fatpacker = 0/alternative_fatpacker = 1/' ../plugin/lib/centreon/plugins/script.pm + +Copier les fichiers pour la sonde Linux SNMP: +:: + + # cp -R --parent centreon/plugins/{script_snmp,snmp}.pm os/linux/snmp/ snmp_standard/mode/{cpu,cpudetailed,diskio,diskusage,inodes,interfaces,loadaverage,listdiskspath,listinterfaces,liststorages,memory,processcount,storage,swap,ntp,tcpcon,uptime}.pm ../plugin/lib/ + +Construire le fichier Perl unique: +:: + + # cd ../plugin + # fatpack file centreon_plugins.pl > centreon_linux_snmp.pl + +La sonde fonctionne de la même façon: +:: + + # perl centreon_linux_snmp.pl --plugin os::linux::snmp::plugin --mode=processcount --snmp-community public --snmp-version 2c --hostname=127.0.0.1 --process-name='' --process-status='' --process-args='' + + ********* Dépannage ********* From 4cd85f1d62403cbc427d968e8e53668cf4154503 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 10:19:18 +0200 Subject: [PATCH 270/346] + remove todo --- centreon-plugins/storage/emc/clariion/TODO | 77 ---------------------- 1 file changed, 77 deletions(-) delete mode 100644 centreon-plugins/storage/emc/clariion/TODO diff --git a/centreon-plugins/storage/emc/clariion/TODO b/centreon-plugins/storage/emc/clariion/TODO deleted file mode 100644 index b9601caa4..000000000 --- a/centreon-plugins/storage/emc/clariion/TODO +++ /dev/null @@ -1,77 +0,0 @@ -=============== -Mode Lun -=============== - -Command to test. All: getlun -uid -state -rg -type -drivetype -capacity -prb -bind - -LOGICAL UNIT NUMBER 3 -UID: 60:06:01:60:F8:C0:1E:00:A2:DC:41:39:8C:0F:E1:11 -State: Bound -RAIDGroup ID: 0 -RAID Type: RAID5 -Drive Type: SATAII -LUN Capacity(Megabytes): 1659491 -LUN Capacity(Blocks): 3398637568 -Prct Rebuilt: 100 -Prct Bound: 100 - -LOGICAL UNIT NUMBER 1 -UID: 60:06:01:60:F8:C0:1E:00:0E:A7:F5:5F:66:10:E1:11 -State: Bound -RAIDGroup ID: 101 -RAID Type: Hot Spare -Drive Type: SATAII -LUN Capacity(Megabytes): 704364 -LUN Capacity(Blocks): 1442538624 -Prct Rebuilt: N/A -Prct Bound: 100 - - -For one lun: getlun 1 -uid -state -rg -type -drivetype -capacity -prb -bind - -UID: 60:06:01:60:F8:C0:1E:00:0E:A7:F5:5F:66:10:E1:11 -State: Bound -RAIDGroup ID: 101 -RAID Type: Hot Spare -Drive Type: SATAII -LUN Capacity(Megabytes): 704364 -LUN Capacity(Blocks): 1442538624 -Prct Rebuilt: N/A -Prct Bound: 100 - -====================== -Mode pour les raid group -====================== - -La commande globale: getrg -type -tcap -ucap -prcntdf -prcntex -state - -RaidGroup ID: 40 -RaidGroup Type: r5 -Raw Capacity (Blocks): 5770154824 -Logical Capacity (Blocks): 4327616118 -Free Capacity (Blocks,non-contiguous): 246 -Percent defragmented: 100 -Percent expanded: 100 -RaidGroup State: Explicit_Remove - Valid_luns - -RaidGroup ID: 103 -RaidGroup Type: hot_spare -Raw Capacity (Blocks): 1442538706 -Logical Capacity (Blocks): 1442538706 -Free Capacity (Blocks,non-contiguous): 82 -Percent defragmented: 100 -Percent expanded: 100 -RaidGroup State: Valid_luns - - -Pour un seul: getrg 109 -type -tcap -ucap -prcntdf -prcntex -state - -RaidGroup ID: 109 -RaidGroup Type: hot_spare -Raw Capacity (Blocks): 1442538706 -Logical Capacity (Blocks): 0 -Free Capacity (Blocks,non-contiguous): 1442538706 -Percent defragmented: 100 -Percent expanded: 100 -RaidGroup State: Valid_luns From db43048a46c15ffd86ad55a948dc8c7a8bed5a68 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 10:19:37 +0200 Subject: [PATCH 271/346] + add plugin digi anywhere usb --- .../network/digi/anywhereusb/snmp/mode/cpu.pm | 99 +++++++++++++ .../digi/anywhereusb/snmp/mode/memory.pm | 132 ++++++++++++++++++ .../network/digi/anywhereusb/snmp/plugin.pm | 51 +++++++ 3 files changed, 282 insertions(+) create mode 100644 centreon-plugins/network/digi/anywhereusb/snmp/mode/cpu.pm create mode 100644 centreon-plugins/network/digi/anywhereusb/snmp/mode/memory.pm create mode 100644 centreon-plugins/network/digi/anywhereusb/snmp/plugin.pm diff --git a/centreon-plugins/network/digi/anywhereusb/snmp/mode/cpu.pm b/centreon-plugins/network/digi/anywhereusb/snmp/mode/cpu.pm new file mode 100644 index 000000000..79602f314 --- /dev/null +++ b/centreon-plugins/network/digi/anywhereusb/snmp/mode/cpu.pm @@ -0,0 +1,99 @@ +# +# Copyright 2016 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::digi::anywhereusb::snmp::mode::cpu; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + my $oid_diCpuUtilization = '.1.3.6.1.4.1.332.11.6.1.6.0'; + my $result = $self->{snmp}->get_leef(oids => [$oid_diCpuUtilization], nothing_quit => 1); + + my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_diCpuUtilization}, + threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("CPU Usage : %.2f", $result->{$oid_diCpuUtilization})); + $self->{output}->perfdata_add(label => "cpu", + value => $result->{$oid_diCpuUtilization}, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check current processor usage. + +=over 8 + +=item B<--warning> + +Threshold warning. + +=item B<--critical> + +Threshold critical. + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/network/digi/anywhereusb/snmp/mode/memory.pm b/centreon-plugins/network/digi/anywhereusb/snmp/mode/memory.pm new file mode 100644 index 000000000..e6a4270f0 --- /dev/null +++ b/centreon-plugins/network/digi/anywhereusb/snmp/mode/memory.pm @@ -0,0 +1,132 @@ +# +# Copyright 2016 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::digi::anywhereusb::snmp::mode::memory; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + $self->{output}->perfdata_add(label => 'used', unit => 'B', + value => $self->{result_values}->{used}, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my $exit = $self->{perfdata}->threshold_check(value => $self->{result_values}->{prct_used}, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-' . $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + + my $msg = sprintf("Memory Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_total'} - $options{new_datas}->{$self->{instance} . '_free'}; + $self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'}; + $self->{result_values}->{prct_free} = $self->{result_values}->{free} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'memory', type => 0 } + ]; + + $self->{maps_counters}->{memory} = [ + { label => 'usage', set => { + key_values => [ { name => 'free' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $oid_diTotalMemory = '.1.3.6.1.4.1.332.11.6.1.8.0'; + my $oid_diFreeMemory = '.1.3.6.1.4.1.332.11.6.1.9.0'; + my $result = $options{snmp}->get_leef(oids => [$oid_diTotalMemory, $oid_diFreeMemory], + nothing_quit => 1); + $self->{memory} = { free => $result->{$oid_diFreeMemory}, total => $result->{$oid_diTotalMemory} }; +} + +1; + +__END__ + +=head1 MODE + +Check memory usage. + +=over 8 + +=item B<--warning-usage> + +Threshold warning (in percent). + +=item B<--critical-usage> + +Threshold critical (in percent). + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/network/digi/anywhereusb/snmp/plugin.pm b/centreon-plugins/network/digi/anywhereusb/snmp/plugin.pm new file mode 100644 index 000000000..a965548c1 --- /dev/null +++ b/centreon-plugins/network/digi/anywhereusb/snmp/plugin.pm @@ -0,0 +1,51 @@ +# +# Copyright 2016 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::digi::anywhereusb::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' => 'network::digi::anywhereusb::snmp::mode::cpu', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'memory' => 'network::digi::anywhereusb::snmp::mode::memory', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Digi AnywhereUSB equipments in SNMP. + +=cut From e689a020f1a80db471726e04a2b51992a5262fdf Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 11:34:58 +0200 Subject: [PATCH 272/346] + Fix #425 --- centreon-plugins/network/h3c/snmp/mode/components/sensor.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm index 099ccbe85..1c4384fd2 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm @@ -81,6 +81,8 @@ sub check { short_msg => sprintf("Sensor '%s' status is '%s'", $name, $result->{EntityExtErrorStatus})); } + next if (defined($result2->{EntityExtTemperature}) && $result2->{EntityExtTemperature} <= 0); + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result2->{EntityExtTemperature}); if ($checked == 0) { my $crit_th = '~:' . $result2->{EntityExtTemperatureThreshold}; From 554a932a0776d45554b9b67b55349fdfc6408a1a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 11:41:40 +0200 Subject: [PATCH 273/346] + fix temperature sensor --- .../h3c/snmp/mode/components/sensor.pm | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm index 1c4384fd2..70598aa1d 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm @@ -71,40 +71,38 @@ sub check { my $name = $self->get_long_name(instance => $instance); $self->{components}->{sensor}->{total}++; - if (defined($result2->{EntityExtTemperatureThreshold}) && - $result2->{EntityExtTemperatureThreshold} > 0 && $result2->{EntityExtTemperatureThreshold} < 65535) { - $self->{output}->output_add(long_msg => sprintf("Sensor '%s' status is '%s' [instance = %s]", - $name, $result->{EntityExtErrorStatus}, $instance)); - $exit = $self->get_severity(section => 'sensor', value => $result->{EntityExtErrorStatus}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Sensor '%s' status is '%s'", $name, $result->{EntityExtErrorStatus})); - } - - next if (defined($result2->{EntityExtTemperature}) && $result2->{EntityExtTemperature} <= 0); - - ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result2->{EntityExtTemperature}); - if ($checked == 0) { - my $crit_th = '~:' . $result2->{EntityExtTemperatureThreshold}; - $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => undef); - $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); - - $exit = $self->{perfdata}->threshold_check(value => $result2->{EntityExtTemperature}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, - { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]); - $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); - $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); - } - - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Temperature sensor '%s' is %s degree centigrade", $name, $result2->{EntityExtTemperature})); - } - $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', - value => $result2->{EntityExtTemperature}, - warning => $warn, - critical => $crit, - ); + $self->{output}->output_add(long_msg => sprintf("Sensor '%s' status is '%s' [instance = %s]", + $name, $result->{EntityExtErrorStatus}, $instance)); + $exit = $self->get_severity(section => 'sensor', value => $result->{EntityExtErrorStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Sensor '%s' status is '%s'", $name, $result->{EntityExtErrorStatus})); } + + next if (defined($result2->{EntityExtTemperature}) && $result2->{EntityExtTemperature} <= 0); + + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result2->{EntityExtTemperature}); + if ($checked == 0 && defined($result2->{EntityExtTemperatureThreshold}) && + $result2->{EntityExtTemperatureThreshold} > 0 && $result2->{EntityExtTemperatureThreshold} < 65535) { + my $crit_th = '~:' . $result2->{EntityExtTemperatureThreshold}; + $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => undef); + $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result2->{EntityExtTemperature}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature sensor '%s' is %s degree centigrade", $name, $result2->{EntityExtTemperature})); + } + $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', + value => $result2->{EntityExtTemperature}, + warning => $warn, + critical => $crit, + ); } } From 50e055e1766b2b97ea2bf429dc79ef302e39a494 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 12:51:21 +0200 Subject: [PATCH 274/346] + Fix temperature sensor --- centreon-plugins/network/h3c/snmp/mode/components/sensor.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm index 70598aa1d..515c149cb 100644 --- a/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm +++ b/centreon-plugins/network/h3c/snmp/mode/components/sensor.pm @@ -65,9 +65,6 @@ sub check { next; } - next if (!(defined($result2->{EntityExtTemperatureThreshold}) && - $result2->{EntityExtTemperatureThreshold} > 0 && $result2->{EntityExtTemperatureThreshold} < 65535)); - my $name = $self->get_long_name(instance => $instance); $self->{components}->{sensor}->{total}++; From 38d7b8d63ebb2a3c45ab0e78550b3d0b87bde56e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 27 Jun 2016 16:28:42 +0200 Subject: [PATCH 275/346] + Update changelog and version --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index ce5fa7c04..1bd77cc03 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160524; +my $global_version = 20160627; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index 816435aeb..d4d08dcae 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,15 @@ +2016-06-27 Quentin Garnier + * Update FAQ: build a standalone perl script + * Plugin added: to check Lenovo S Series (#412) + * Plugin added: to check Digi AnywhereUSB + * Mode added: [netasq] 'ha-nodes' + * Mode removed: [netasq] 'ha-status' + * Fix: [dell n4000]{environment} wrong temperature (#397) + * Fix: [netapp]{cache-age} not working (#422) + * Fix: [cisco wlc]{ap-users} wrong total + * Fix: [tomcat]{memory} problem with java 8 + * Fix: [netapp]{filesys} no values (#415) + 2016-05-24 Quentin Garnier * Can use '/' instead '::' for plugin option (#380) * Mode added: [pacemaker] 'constraints' From 2f0aa9860e69550e9679dad7463f86f073def0a6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 6 Jul 2016 19:02:48 +0200 Subject: [PATCH 276/346] + Fix #438 --- .../ibm/storwize/ssh/mode/components/array.pm | 60 +++ .../ibm/storwize/ssh/mode/components/drive.pm | 60 +++ .../storwize/ssh/mode/components/enclosure.pm | 60 +++ .../ssh/mode/components/enclosurebattery.pm | 61 +++ .../ssh/mode/components/enclosurecanister.pm | 61 +++ .../ssh/mode/components/enclosurepsu.pm | 61 +++ .../ibm/storwize/ssh/mode/components/host.pm | 60 +++ .../ibm/storwize/ssh/mode/components/mdisk.pm | 60 +++ .../ibm/storwize/ssh/mode/components/node.pm | 60 +++ .../storwize/ssh/mode/components/portfc.pm | 61 +++ .../storwize/ssh/mode/components/portsas.pm | 61 +++ .../storwize/ssh/mode/components/quorum.pm | 60 +++ .../ssh/mode/components/systemstats.pm | 63 ++++ .../ibm/storwize/ssh/mode/components/vdisk.pm | 60 +++ .../storage/ibm/storwize/ssh/mode/eventlog.pm | 219 +++++++++++ .../storage/ibm/storwize/ssh/mode/hardware.pm | 214 +++++++++++ .../ibm/storwize/ssh/mode/poolusage.pm | 349 ++++++++++++++++++ .../storage/ibm/storwize/ssh/plugin.pm | 50 +++ 18 files changed, 1680 insertions(+) create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/array.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/drive.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosure.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurebattery.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurecanister.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurepsu.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/host.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/mdisk.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/node.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/portfc.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/portsas.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/quorum.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/systemstats.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/components/vdisk.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/eventlog.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm create mode 100644 centreon-plugins/storage/ibm/storwize/ssh/plugin.pm diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/array.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/array.pm new file mode 100644 index 000000000..f8c1eb39a --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/array.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::array; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsarray=========="; lsarray -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking arrays"); + $self->{components}->{array} = {name => 'arrays', total => 0, skip => 0}; + return if ($self->check_filter(section => 'array')); + + return if ($self->{results} !~ /==========lsarray==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'array', instance => $_->{mdisk_id})); + $self->{components}->{array}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("array '%s' status is '%s' [instance: %s].", + $_->{mdisk_name}, $_->{status}, + $_->{mdisk_id} + )); + my $exit = $self->get_severity(label => 'default', section => 'array', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Array '%s' status is '%s'", + $_->{mdisk_name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/drive.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/drive.pm new file mode 100644 index 000000000..e0afd26d8 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/drive.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::drive; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsdrive=========="; lsdrive -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking drives"); + $self->{components}->{drive} = {name => 'drives', total => 0, skip => 0}; + return if ($self->check_filter(section => 'drive')); + + return if ($self->{results} !~ /==========lsdrive==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'drive', instance => $_->{id})); + $self->{components}->{drive}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("drive '%s' status is '%s' [instance: %s].", + $_->{id}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(label => 'default', section => 'drive', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Drive '%s' status is '%s'", + $_->{id}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosure.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosure.pm new file mode 100644 index 000000000..c581613b0 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosure.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::enclosure; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsenclosure=========="; lsenclosure -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosures"); + $self->{components}->{enclosure} = {name => 'enclosures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclosure')); + + return if ($self->{results} !~ /==========lsenclosure==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'enclosure', instance => $_->{id})); + $self->{components}->{enclosure}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure '%s' status is '%s' [instance: %s].", + $_->{id}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(label => 'default', section => 'enclosure', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure '%s' status is '%s'", + $_->{id}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurebattery.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurebattery.pm new file mode 100644 index 000000000..75d38992a --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurebattery.pm @@ -0,0 +1,61 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::enclosurebattery; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsenclosurebattery=========="; lsenclosurebattery -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure batteries"); + $self->{components}->{enclosurebattery} = {name => 'enclosure batteries', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclosurebattery')); + + return if ($self->{results} !~ /==========lsenclosurebattery==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + my $instance = $_->{enclosure_id} . '.' . $_->{battery_id}; + next if ($self->check_filter(section => 'enclosurebattery', instance => $instance)); + $self->{components}->{enclosurebattery}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure battery '%s' status is '%s' [instance: %s].", + $instance, $_->{status}, + $instance + )); + my $exit = $self->get_severity(label => 'default', section => 'enclosurebattery', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure battery '%s' status is '%s'", + $instance, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurecanister.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurecanister.pm new file mode 100644 index 000000000..41c78f2a2 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurecanister.pm @@ -0,0 +1,61 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::enclosurecanister; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsenclosurecanister=========="; lsenclosurecanister -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure canisters"); + $self->{components}->{enclosurecanister} = {name => 'enclosure canisters', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclosurecanister')); + + return if ($self->{results} !~ /==========lsenclosurecanister==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + my $instance = $_->{enclosure_id} . '.' . $_->{canister_id}; + next if ($self->check_filter(section => 'enclosurecanister', instance => $instance)); + $self->{components}->{enclosurecanister}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure canister '%s' status is '%s' [instance: %s].", + $instance, $_->{status}, + $instance + )); + my $exit = $self->get_severity(label => 'default', section => 'enclosurecanister', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure canister '%s' status is '%s'", + $instance, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurepsu.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurepsu.pm new file mode 100644 index 000000000..6f56b3b03 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/enclosurepsu.pm @@ -0,0 +1,61 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::enclosurepsu; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsenclosurepsu=========="; lsenclosurepsu -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking enclosure psus"); + $self->{components}->{enclosurepsu} = {name => 'enclosure psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'enclosurepsu')); + + return if ($self->{results} !~ /==========lsenclosurepsu==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + my $instance = $_->{enclosure_id} . '.' . $_->{PSU_id}; + next if ($self->check_filter(section => 'enclosurepsu', instance => $instance)); + $self->{components}->{enclosurepsu}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("enclosure power supply '%s' status is '%s' [instance: %s].", + $instance, $_->{status}, + $instance + )); + my $exit = $self->get_severity(label => 'default', section => 'enclosurepsu', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Enclosure power supply '%s' status is '%s'", + $instance, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/host.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/host.pm new file mode 100644 index 000000000..d82f3ee8a --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/host.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::host; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lshost=========="; lshost -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking hosts"); + $self->{components}->{host} = {name => 'hosts', total => 0, skip => 0}; + return if ($self->check_filter(section => 'host')); + + return if ($self->{results} !~ /==========lshost==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'host', instance => $_->{id})); + $self->{components}->{host}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("host '%s' status is '%s' [instance: %s].", + $_->{name}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(label => 'default', section => 'host', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Host '%s' status is '%s'", + $_->{name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/mdisk.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/mdisk.pm new file mode 100644 index 000000000..fc6423cad --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/mdisk.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::mdisk; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsmdisk=========="; lsmdisk -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking mdisks"); + $self->{components}->{mdisk} = {name => 'mdisks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'mdisk')); + + return if ($self->{results} !~ /==========lsmdisk==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'mdisk', instance => $_->{id})); + $self->{components}->{mdisk}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("mdisk '%s' status is '%s' [instance: %s].", + $_->{name}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(section => 'mdisk', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("MDisk '%s' status is '%s'", + $_->{name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/node.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/node.pm new file mode 100644 index 000000000..cfef24c4b --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/node.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::node; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsnode=========="; lsnode -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking nodes"); + $self->{components}->{node} = {name => 'nodes', total => 0, skip => 0}; + return if ($self->check_filter(section => 'node')); + + return if ($self->{results} !~ /==========lsnode==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'node', instance => $_->{id})); + $self->{components}->{node}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("node '%s' status is '%s' [instance: %s].", + $_->{name}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(label => 'default', section => 'node', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Node '%s' status is '%s'", + $_->{name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portfc.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portfc.pm new file mode 100644 index 000000000..9d7d6c4e1 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portfc.pm @@ -0,0 +1,61 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::portfc; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsportfc=========="; lsportfc -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking portfc"); + $self->{components}->{portfc} = {name => 'portfc', total => 0, skip => 0}; + return if ($self->check_filter(section => 'portfc')); + + return if ($self->{results} !~ /==========lsportfc==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'portfc', instance => $_->{id})); + $self->{components}->{portfc}->{total}++; + + my $name = $_->{node_name} . "." . $_->{WWPN}; + $self->{output}->output_add(long_msg => sprintf("portfc '%s' status is '%s' [instance: %s].", + $name, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(section => 'portfc', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("PortFC '%s' status is '%s'", + $name, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portsas.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portsas.pm new file mode 100644 index 000000000..34b9f838f --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/portsas.pm @@ -0,0 +1,61 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::portsas; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsportsas=========="; lsportsas -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking portsas"); + $self->{components}->{portsas} = {name => 'portsas', total => 0, skip => 0}; + return if ($self->check_filter(section => 'portsas')); + + return if ($self->{results} !~ /==========lsportsas==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'portsas', instance => $_->{id})); + $self->{components}->{portsas}->{total}++; + + my $name = $_->{node_name} . "." . $_->{WWPN}; + $self->{output}->output_add(long_msg => sprintf("port sas '%s' status is '%s' [instance: %s].", + $name, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(section => 'portsas', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Port sas '%s' status is '%s'", + $name, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/quorum.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/quorum.pm new file mode 100644 index 000000000..bf01dcf97 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/quorum.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::quorum; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsquorum=========="; lsquorum -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking quorums"); + $self->{components}->{quorum} = {name => 'quorums', total => 0, skip => 0}; + return if ($self->check_filter(section => 'quorum')); + + return if ($self->{results} !~ /==========lsquorum==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'quorum', instance => $_->{quorum_index})); + $self->{components}->{quorum}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("quorum '%s' status is '%s' [instance: %s].", + $_->{controller_name}, $_->{status}, + $_->{quorum_index} + )); + my $exit = $self->get_severity(label => 'default', section => 'quorum', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Quorum '%s' status is '%s'", + $_->{controller_name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/systemstats.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/systemstats.pm new file mode 100644 index 000000000..180f460e4 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/systemstats.pm @@ -0,0 +1,63 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::systemstats; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lssystemstats=========="; lssystemstats ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking systemstats"); + $self->{components}->{systemstats} = {name => 'systemstats', total => 0, skip => 0}; + return if ($self->check_filter(section => 'systemstats')); + + return if ($self->{results} !~ /==========lssystemstats==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => '\s+'); + foreach (@$result) { + next if ($self->check_filter(section => 'systemstats', instance => $_->{stat_name})); + $self->{components}->{systemstats}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("system stat '%s' value is '%s' [instance: %s].", + $_->{stat_name}, $_->{stat_current}, + $_->{stat_name} + )); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'systemstats', instance => $_->{stat_name}, value => $_->{stat_current}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("System stat '%s' value is '%s'", $_->{stat_name}, $_->{stat_current})); + } + $self->{output}->perfdata_add(label => "sstat_" . $_->{stat_name}, + value => $_->{stat_current}, + warning => $warn, + critical => $crit); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/components/vdisk.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/vdisk.pm new file mode 100644 index 000000000..9fe8c51f3 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/components/vdisk.pm @@ -0,0 +1,60 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::components::vdisk; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + $self->{ssh_commands} .= 'echo "==========lsvdisk=========="; lsvdisk -delim : ; echo "===============";'; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking vdisks"); + $self->{components}->{vdisk} = {name => 'vdisks', total => 0, skip => 0}; + return if ($self->check_filter(section => 'vdisk')); + + return if ($self->{results} !~ /==========lsvdisk==.*?\n(.*?)==============/msi); + my $content = $1; + + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + next if ($self->check_filter(section => 'vdisk', instance => $_->{id})); + $self->{components}->{vdisk}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("vdisk '%s' status is '%s' [instance: %s].", + $_->{name}, $_->{status}, + $_->{id} + )); + my $exit = $self->get_severity(label => 'default', section => 'vdisk', value => $_->{status}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Vdisk '%s' status is '%s'", + $_->{name}, $_->{status})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/eventlog.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/eventlog.pm new file mode 100644 index 000000000..2ad93623a --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/eventlog.pm @@ -0,0 +1,219 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::eventlog; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use DateTime; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning', }, + "critical:s" => { name => 'critical', }, + "filter-event-id:s" => { name => 'filter_event_id' }, + "filter-message:s" => { name => 'filter_message' }, + "retention:s" => { name => 'retention' }, + "hostname:s" => { name => 'hostname' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } + if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { + $self->{option_results}->{remote} = 1; + } + + my $last_timestamp = ''; + if (defined($self->{option_results}->{retention}) && $self->{option_results}->{retention} =~ /^\d+$/) { + # by default UTC timezone used + my $dt = DateTime->from_epoch(epoch => time() - $self->{option_results}->{retention}); + my $dt_format = sprintf("%d%02d%02d%02d%02d%02d", substr($dt->year(), 2), $dt->month(), $dt->day(), $dt->hour(), $dt->minute(), $dt->second()); + $last_timestamp = 'last_timestamp>=' . $dt_format . ":"; + } + $self->{ls_command} = "lseventlog -message no -alert yes -filtervalue '${last_timestamp}fixed=no' -delim :"; +} + +sub get_hasharray { + my ($self, %options) = @_; + + my $result = []; + return $result if ($options{content} eq ''); + my ($header, @lines) = split /\n/, $options{content}; + my @header_names = split /$options{delim}/, $header; + + for (my $i = 0; $i <= $#lines; $i++) { + my @content = split /$options{delim}/, $lines[$i]; + my $data = {}; + for (my $j = 0; $j <= $#header_names; $j++) { + $data->{$header_names[$j]} = $content[$j]; + } + push @$result, $data; + } + + return $result; +} + +sub run { + my ($self, %options) = @_; + + my $content = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '' ? $self->{option_results}->{command} : $self->{ls_command} . " ; exit ;", + command_path => $self->{option_results}->{command_path}, + command_options => defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne '' ? $self->{option_results}->{command_options} : undef); + my $result = $self->get_hasharray(content => $content, delim => ':'); + + my ($num_eventlog_checked, $num_errors) = (0, 0); + foreach (@$result) { + $num_eventlog_checked++; + if (defined($self->{option_results}->{filter_message}) && $self->{option_results}->{filter_message} ne '' && + $_->{description} !~ /$self->{option_results}->{filter_message}/) { + $self->{output}->output_add(long_msg => "skipping '" . $_->{description} . "': no matching filter description.", debug => 1); + next; + } + if (defined($self->{option_results}->{filter_event_id}) && $self->{option_results}->{filter_event_id} ne '' && + $_->{event_id} !~ /$self->{option_results}->{filter_event_id}/) { + $self->{output}->output_add(long_msg => "skipping '" . $_->{event_id} . "': no matching filter event id.", debug => 1); + next; + } + + $self->{output}->output_add(long_msg => sprintf("%s : %s - %s", + scalar(localtime($_->{last_timestamp})), + $_->{event_id}, $_->{description} + ) + ); + $num_errors++; + } + + $self->{output}->output_add(long_msg => sprintf("Number of message checked: %s", $num_eventlog_checked)); + my $exit = $self->{perfdata}->threshold_check(value => $num_errors, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("%d problem detected (use verbose for more details)", $num_errors) + ); + $self->{output}->perfdata_add(label => 'problems', + value => $num_errors, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check eventlogs. + +=over 8 + +=item B<--warning> + +Threshold warning. + +=item B<--critical> + +Threshold critical. + +=item B<--filter-event-id> + +Filter on event id. + +=item B<--filter-message> + +Filter on event message. + +=item B<--retention> + +Get eventlog of X last seconds. For the last minutes: --retention=60 + +=item B<--hostname> + +Hostname to query. + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information. Used it you have output in a file. + +=item B<--command-path> + +Command path. + +=item B<--command-options> + +Command options. + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm new file mode 100644 index 000000000..89a1bb718 --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm @@ -0,0 +1,214 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = + '^(array|drive|enclosure|enclosurebattery|enclosurecanister|enclosurepsu|host|portfc|portsas|vdisk|node|quorum|mdisk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(systemstats)$'; + + $self->{cb_hook2} = 'ssh_execute'; + + $self->{thresholds} = { + default => [ + ['online', 'OK'], + ['offline', 'CRITICAL'], + ['degraded', 'WARNING'], + ['excluded', 'OK'], # lsarray + ['mask', 'OK'], # lshost + ], + portfc => [ + ['active', 'OK'], + ['inactive_unconfigured', 'OK'], + ['.*', 'CRITICAL'], + ], + portsas => [ + ['online', 'OK'], + ['offline_unconfigured', 'OK'], + ['excluded', 'OK'], + ['offline', 'CRITICAL'], + ['degraded', 'WARNING'], + ], + mdisk => [ + ['online', 'OK'], + ['excluded', 'OK'], + ['offline', 'CRITICAL'], + ['degraded_paths', 'WARNING'], + ['degraded_ports', 'WARNING'], + ['degraded', 'WARNING'], + ], + }; + + $self->{components_path} = 'storage::ibm::storwize::ssh::mode::components'; + $self->{components_module} = ['array', 'drive', 'enclosure', 'enclosurebattery', 'enclosurecanister', + 'enclosurepsu', 'host', 'portfc', 'portsas', 'vdisk', 'node', 'quorum', 'mdisk', 'systemstats']; +} + +sub ssh_execute { + my ($self, %options) = @_; + + $self->{results} = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '' ? $self->{option_results}->{command} : $self->{ssh_commands} . " exit ;", + command_path => $self->{option_results}->{command_path}, + command_options => defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne '' ? $self->{option_results}->{command_options} : undef); +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { + $self->{option_results}->{remote} = 1; + } +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options' }, + }); + + $self->{ssh_commands} = ''; + return $self; +} + +sub get_hasharray { + my ($self, %options) = @_; + + my $result = []; + return $result if ($options{content} eq ''); + my ($header, @lines) = split /\n/, $options{content}; + my @header_names = split /$options{delim}/, $header; + + for (my $i = 0; $i <= $#lines; $i++) { + my @content = split /$options{delim}/, $lines[$i]; + my $data = {}; + for (my $j = 0; $j <= $#header_names; $j++) { + $data->{$header_names[$j]} = $content[$j]; + } + push @$result, $data; + } + + return $result; +} + +1; + +__END__ + +=head1 MODE + +Check components. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'array', 'drive'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=host --filter=enclosurecanister) +Can also exclude specific instance: --filter=host,10 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: ---threshold-overload='host,.*,OK,degraded' + +=item B<--warning> + +Set warning threshold for temperatures (syntax: type,regexp,threshold) +Example: --warning='systemstats,cpu_pc,30' + +=item B<--critical> + +Set critical threshold for temperatures (syntax: type,regexp,threshold) +Example: --critical='systemstats,cpu_pc,40' + +=item B<--hostname> + +Hostname to query. + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information. Used it you have output in a file. + +=item B<--command-path> + +Command path. + +=item B<--command-options> + +Command options. + +=back + +=cut diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm new file mode 100644 index 000000000..19437b6be --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm @@ -0,0 +1,349 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::mode::poolusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'pool', type => 1, cb_prefix_output => 'prefix_pool_output', message_multiple => 'All pools are ok' } + ]; + + $self->{maps_counters}->{pool} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /degraded/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /offline/i' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + "hostname:s" => { name => 'hostname' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { + $self->{option_results}->{remote} = 1; + } + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_pool_output { + my ($self, %options) = @_; + + return "Pool '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub manage_selection { + my ($self, %options) = @_; + + $self->{pool} = {}; + my $content = centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '' ? $self->{option_results}->{command} : "lsmdiskgrp -delim : -bytes ; exit ;", + command_path => $self->{option_results}->{command_path}, + command_options => defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne '' ? $self->{option_results}->{command_options} : undef); + my $result = $self->get_hasharray(content => $content, delim => ':'); + foreach (@$result) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $_->{name} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $_->{name} . "': no matching filter.", debug => 1); + next; + } + + $self->{pool}->{$_->{id}} = { display => $_->{name}, + status => $_->{status}, + total => $_->{used_capacity} + $_->{free_capacity}, used => $_->{used_capacity} + }; + } + + if (scalar(keys %{$self->{pool}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No pool found."); + $self->{output}->option_exit(); + } +} + +sub get_hasharray { + my ($self, %options) = @_; + + my $result = []; + return $result if ($options{content} eq ''); + my ($header, @lines) = split /\n/, $options{content}; + my @header_names = split /$options{delim}/, $header; + + for (my $i = 0; $i <= $#lines; $i++) { + my @content = split /$options{delim}/, $lines[$i]; + my $data = {}; + for (my $j = 0; $j <= $#header_names; $j++) { + $data->{$header_names[$j]} = $content[$j]; + } + push @$result, $data; + } + + return $result; +} + +1; + +__END__ + +=head1 MODE + +Check pool usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter pool name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{status} =~ /degraded/i'). +Can used special variables like: %{status}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} =~ /offline/i'). +Can used special variables like: %{status}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage'. + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=item B<--hostname> + +Hostname to query. + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 30). + +=item B<--sudo> + +Use 'sudo' to execute the command. + +=item B<--command> + +Command to get information. Used it you have output in a file. + +=item B<--command-path> + +Command path. + +=item B<--command-options> + +Command options. + +=back + +=cut diff --git a/centreon-plugins/storage/ibm/storwize/ssh/plugin.pm b/centreon-plugins/storage/ibm/storwize/ssh/plugin.pm new file mode 100644 index 000000000..59d8ca86a --- /dev/null +++ b/centreon-plugins/storage/ibm/storwize/ssh/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::ibm::storwize::ssh::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'components' => 'storage::ibm::storwize::ssh::mode::hardware', + 'pool-usage' => 'storage::ibm::storwize::ssh::mode::poolusage', + 'eventlog' => 'storage::ibm::storwize::ssh::mode::eventlog', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check IBM Storwize (v3700, v5000, v7000, SAN Volume Controller) in SSH. + +=cut From 9e2d8d0f294233d07ff2981833a10dd13ba93b83 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 6 Jul 2016 19:04:34 +0200 Subject: [PATCH 277/346] + Fix #437 --- centreon-plugins/centreon/plugins/snmp.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/snmp.pm b/centreon-plugins/centreon/plugins/snmp.pm index 0219b1023..069d8b879 100644 --- a/centreon-plugins/centreon/plugins/snmp.pm +++ b/centreon-plugins/centreon/plugins/snmp.pm @@ -679,7 +679,7 @@ sub check_options { if (!defined($options{option_results}->{snmp_security_name})) { - $self->{output}->add_option_msg(short_msg => "Missing paramater Security Name."); + $self->{output}->add_option_msg(short_msg => "Missing parameter Security Name."); $self->{output}->option_exit(); } From 8efebf92e5e27a19803f1dcb1c5f680c910be8ec Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jul 2016 11:44:58 +0200 Subject: [PATCH 278/346] + enhance bluecoat --- .../bluecoat/snmp/mode/clientrequests.pm | 212 ++++++++---------- 1 file changed, 93 insertions(+), 119 deletions(-) diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm b/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm index fb2e1b0cc..18c53c8fe 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clientrequests.pm @@ -20,137 +20,112 @@ package network::bluecoat::snmp::mode::clientrequests; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::statefile; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, cb_prefix_output => 'prefix_output' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'hits', set => { + key_values => [ { name => 'client_http_requests', diff => 1 }, { name => 'client_http_hits', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'hits' }, + output_template => 'Hits = %.2f %%', output_use => 'hits_prct', + perfdatas => [ + { label => 'hits', value => 'hits_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'partial-hits', set => { + key_values => [ { name => 'client_http_requests', diff => 1 }, { name => 'client_http_partial_hits', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'partial_hits' }, + output_template => 'Partial Hits = %.2f %%', output_use => 'partial_hits_prct', + perfdatas => [ + { label => 'partial_hits', value => 'partial_hits_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'misses', set => { + key_values => [ { name => 'client_http_requests', diff => 1 }, { name => 'client_http_misses', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'misses' }, + output_template => 'Misses = %.2f %%', output_use => 'misses_prct', + perfdatas => [ + { label => 'misses', value => 'misses_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'errors', set => { + key_values => [ { name => 'client_http_requests', diff => 1 }, { name => 'client_http_errors', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'errors' }, + output_template => 'Errors = %.2f %%', output_use => 'errors_prct', + perfdatas => [ + { label => 'errors', value => 'errors_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + ]; +} + +sub prefix_output { + my ($self, %options) = @_; + + return "Client Requests: "; +} + +sub custom_data_calc { + my ($self, %options) = @_; + + my $label = $options{extra_options}->{label_ref}; + my $delta_value = $options{new_datas}->{$self->{instance} . '_client_http_' . $label} - $options{old_datas}->{$self->{instance} . '_client_http_' . $label}; + my $delta_total = $options{new_datas}->{$self->{instance} . '_client_http_requests'} - $options{old_datas}->{$self->{instance} . '_client_http_requests'}; + + $self->{result_values}->{$label . '_prct'} = 0; + if ($delta_total > 0) { + $self->{result_values}->{$label . '_prct'} = $delta_value * 100 / $delta_total; + } + return 0; +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "warning-errors:s" => { name => 'warning_errors' }, - "critical-errors:s" => { name => 'critical_errors' }, - "warning-misses:s" => { name => 'warning_misses' }, - "critical-misses:s" => { name => 'critical_misses' }, }); - $self->{statefile_value} = centreon::plugins::statefile->new(%options); - + return $self; } -sub check_options { +sub manage_selection { my ($self, %options) = @_; - $self->SUPER::init(%options); - - if (($self->{perfdata}->threshold_validate(label => 'warning_errors', value => $self->{option_results}->{warning_errors})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning 'errors' threshold '" . $self->{option_results}->{warning_errors} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_errors', value => $self->{option_results}->{critical_errors})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical 'errors' threshold '" . $self->{option_results}->{critical_errors} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'warning_misses', value => $self->{option_results}->{warning_misses})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning 'misses' threshold '" . $self->{option_results}->{warning_misses} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical_misses', value => $self->{option_results}->{critical_misses})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical 'misses' threshold '" . $self->{option_results}->{critical_misses} . "'."); - $self->{output}->option_exit(); - } - - $self->{statefile_value}->check_options(%options); -} -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - $self->{hostname} = $self->{snmp}->get_hostname(); - $self->{snmp_port} = $self->{snmp}->get_port(); - - if ($self->{snmp}->is_snmpv1()) { + if ($options{snmp}->is_snmpv1()) { $self->{output}->add_option_msg(short_msg => "Need to use SNMP v2c or v3."); $self->{output}->option_exit(); } + my $result = $options{snmp}->get_leef(oids => ['.1.3.6.1.4.1.3417.2.11.3.1.1.1.0', + '.1.3.6.1.4.1.3417.2.11.3.1.1.2.0', + '.1.3.6.1.4.1.3417.2.11.3.1.1.3.0', + '.1.3.6.1.4.1.3417.2.11.3.1.1.4.0', + '.1.3.6.1.4.1.3417.2.11.3.1.1.5.0'], nothing_quit => 1); - $self->{statefile_value}->read(statefile => 'bluecoat_' . $self->{hostname} . '_' . $self->{snmp_port} . '_' . $self->{mode}); - my $result = $self->{snmp}->get_leef(oids => ['.1.3.6.1.4.1.3417.2.11.3.1.1.1.0', - '.1.3.6.1.4.1.3417.2.11.3.1.1.2.0', - '.1.3.6.1.4.1.3417.2.11.3.1.1.3.0', - '.1.3.6.1.4.1.3417.2.11.3.1.1.4.0', - '.1.3.6.1.4.1.3417.2.11.3.1.1.5.0'], nothing_quit => 1); - - my $new_datas = {}; - my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp'); - my $old_client_http_requests = $self->{statefile_value}->get(name => 'client_http_requests'); - my $old_client_http_hits = $self->{statefile_value}->get(name => 'client_http_hits'); - my $old_client_http_partial_hits = $self->{statefile_value}->get(name => 'client_http_partial_hits'); - my $old_client_http_misses = $self->{statefile_value}->get(name => 'client_http_misses'); - my $old_client_http_errors = $self->{statefile_value}->get(name => 'client_http_errors'); - - $new_datas->{last_timestamp} = time(); - $new_datas->{client_http_requests} = $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.1.0'}; - $new_datas->{client_http_hits} = $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.2.0'}; - $new_datas->{client_http_partial_hits} = $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.3.0'}; - $new_datas->{client_http_misses} = $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.4.0'}; - $new_datas->{client_http_errors} = $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.5.0'}; + $self->{cache_name} = "bluecoat_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); - $self->{statefile_value}->write(data => $new_datas); - - if (!defined($old_timestamp) || !defined($old_client_http_misses)) { - $self->{output}->output_add(severity => 'OK', - short_msg => "Buffer creation..."); - $self->{output}->display(); - $self->{output}->exit(); - } - - if ($new_datas->{client_http_requests} < $old_client_http_requests) { - # We set 0. Has reboot. - $old_client_http_requests = 0; - $old_client_http_hits = 0; - $old_client_http_partial_hits = 0; - $old_client_http_misses = 0; - $old_client_http_errors = 0; - } - - my $delta_http_requests = $new_datas->{client_http_requests} - $old_client_http_requests; - my $prct_misses = sprintf("%.2f", ($new_datas->{client_http_misses} - $old_client_http_misses) * 100 / $delta_http_requests); - my $prct_hits = sprintf("%.2f", ($new_datas->{client_http_hits} - $old_client_http_hits) * 100 / $delta_http_requests); - my $prct_partial_hits = sprintf("%.2f", ($new_datas->{client_http_partial_hits} - $old_client_http_partial_hits) * 100 / $delta_http_requests); - my $prct_errors = sprintf("%.2f", ($new_datas->{client_http_errors} - $old_client_http_errors) * 100 / $delta_http_requests); - - my $exit1 = $self->{perfdata}->threshold_check(value => $prct_errors, threshold => [ { label => 'critical_errors', 'exit_litteral' => 'critical' }, { label => 'warning_errors', exit_litteral => 'warning' } ]); - my $exit2 = $self->{perfdata}->threshold_check(value => $prct_misses, threshold => [ { label => 'critical_misses', 'exit_litteral' => 'critical' }, { label => 'warning_misses', exit_litteral => 'warning' } ]); - my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); - - $self->{output}->output_add(severity => $exit, - short_msg => "Client Requests: Hits = $prct_hits%, Partial Hits = $prct_partial_hits%, Misses = $prct_misses%, Errors = $prct_errors%"); - $self->{output}->perfdata_add(label => 'hits', unit => '%', - value => $prct_hits, - min => 0); - $self->{output}->perfdata_add(label => 'partial_hits', unit => '%', - value => $prct_partial_hits, - min => 0); - $self->{output}->perfdata_add(label => 'misses', unit => '%', - value => $prct_misses, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_misses'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_misses'), - min => 0); - $self->{output}->perfdata_add(label => 'errors', unit => '%', - value => $prct_errors, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning_errors'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical_errors'), - min => 0); - - $self->{output}->display(); - $self->{output}->exit(); + $self->{global} = { client_http_requests => $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.1.0'}, + client_http_hits => $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.2.0'}, + client_http_partial_hits => $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.3.0'}, + client_http_misses => $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.4.0'}, + client_http_errors => $result->{'.1.3.6.1.4.1.3417.2.11.3.1.1.5.0'} }; } 1; @@ -163,21 +138,20 @@ Check http client requests (in percent by type: hit, partial, misses, errors) =over 8 -=item B<--warning-errors> +=item B<--filter-counters> -Threshold warning of client http errors in percent. +Only display some counters (regexp can be used). +Example: --filter-counters='errors' -=item B<--critical-errors> +=item B<--warning-*> -Threshold critical of client http errors in percent. +Threshold warning. +Can be: errors (%), hits (%), partial-hits (%), misses (%). -=item B<--warning-misses> +=item B<--critical-*> -Threshold warning of client http misses in percent. - -=item B<--critical-misses> - -Threshold critial of client http misses in percent. +Threshold critical. +Can be: errors (%), hits (%), partial-hits (%), misses (%). =back From c8271c4d0683f1047d801f2a578d7905cba10ecd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 8 Jul 2016 11:52:10 +0200 Subject: [PATCH 279/346] + fix oracle mode --- centreon-plugins/database/oracle/mode/rmanbackupage.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/database/oracle/mode/rmanbackupage.pm b/centreon-plugins/database/oracle/mode/rmanbackupage.pm index c01fc3634..5a04879d9 100644 --- a/centreon-plugins/database/oracle/mode/rmanbackupage.pm +++ b/centreon-plugins/database/oracle/mode/rmanbackupage.pm @@ -112,9 +112,6 @@ sub run { my $label = $_; $label =~ s/ /-/g; foreach my $row (@$result) { - - next if (defined($already_checked->{$$row[0]})); - if (defined($self->{option_results}->{incremental_level})) { # db incr with incremental level 0 = DB FULL if (/db full/ && $$row[0] =~ /db incr/i && defined($$row[2]) && $$row[2] == 0) { # it's a full. we get @@ -123,11 +120,14 @@ sub run { next if (/db incr/ && $$row[0] =~ /db incr/i && defined($$row[2]) && $$row[2] == 0); # it's a full. we skip. next if ($$row[0] !~ /$_/i); } - - $already_checked->{$$row[0]} = 1; + } else { next if ($$row[0] !~ /$_/i); } + + next if (defined($already_checked->{$$row[0]})); + + $already_checked->{$$row[0]} = 1; $count_backups++; $executed = 1; From bbb8785916d99653ed2c054b69faceecdae20eb1 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 11:47:54 +0200 Subject: [PATCH 280/346] + add plugin.pm Ref https://github.com/centreon/centreon-plugins/issues/20 --- centreon-plugins/network/sonus/sbc/plugin.pm | 59 ++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 centreon-plugins/network/sonus/sbc/plugin.pm diff --git a/centreon-plugins/network/sonus/sbc/plugin.pm b/centreon-plugins/network/sonus/sbc/plugin.pm new file mode 100644 index 000000000..92020bf61 --- /dev/null +++ b/centreon-plugins/network/sonus/sbc/plugin.pm @@ -0,0 +1,59 @@ +# +# Copyright 2016 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::sonus::sbc::1000::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; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'call-statistics' => 'network::sonus::sbc::1000::snmp::mode::callstats', + 'channels' => 'network::sonus::sbc::1000::snmp::mode::channels', + 'cpu' => 'snmp_standard::mode::cpu', + 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', + 'dsp-stats' => 'network::sonus::sbc::snmp::mode::dspstats', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'load' => 'snmp_standard::mode::loadaverage', + 'memory' => 'snmp_standard::mode::memory', + 'storage' => 'snmp_standard::mode::storage', + 'swap' => 'snmp_standard::mode::swap', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Sonus Session Border Controllers equipment in SNMP. + +=cut From d885d01bf4d813a3bdbba14af32c2e59efd28c32 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 11:49:03 +0200 Subject: [PATCH 281/346] + fix indent and paths --- centreon-plugins/network/sonus/sbc/plugin.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/network/sonus/sbc/plugin.pm b/centreon-plugins/network/sonus/sbc/plugin.pm index 92020bf61..f058bcfb7 100644 --- a/centreon-plugins/network/sonus/sbc/plugin.pm +++ b/centreon-plugins/network/sonus/sbc/plugin.pm @@ -32,15 +32,15 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'call-statistics' => 'network::sonus::sbc::1000::snmp::mode::callstats', - 'channels' => 'network::sonus::sbc::1000::snmp::mode::channels', + 'call-statistics' => 'network::sonus::sbc::snmp::mode::callstats', + 'channels' => 'network::sonus::sbc::snmp::mode::channels', 'cpu' => 'snmp_standard::mode::cpu', 'cpu-detailed' => 'snmp_standard::mode::cpudetailed', - 'dsp-stats' => 'network::sonus::sbc::snmp::mode::dspstats', + 'dsp-stats' => 'network::sonus::sbc::snmp::mode::dspstats', 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'load' => 'snmp_standard::mode::loadaverage', - 'memory' => 'snmp_standard::mode::memory', + 'memory' => 'snmp_standard::mode::memory', 'storage' => 'snmp_standard::mode::storage', 'swap' => 'snmp_standard::mode::swap', ); From 4388e747fa16d7997f64733b6dbf9509ca48b784 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 11:58:06 +0200 Subject: [PATCH 282/346] + add call statistics mode https://github.com/centreon/centreon-plugins/issues/20 --- .../network/sonus/sbc/snmp/callstats.pm | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 centreon-plugins/network/sonus/sbc/snmp/callstats.pm diff --git a/centreon-plugins/network/sonus/sbc/snmp/callstats.pm b/centreon-plugins/network/sonus/sbc/snmp/callstats.pm new file mode 100644 index 000000000..92c55d54c --- /dev/null +++ b/centreon-plugins/network/sonus/sbc/snmp/callstats.pm @@ -0,0 +1,173 @@ +# +# Copyright 2016 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::sonus::sbc::snmp::mode::callstats; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'port', type => 1, cb_prefix_output => 'prefix_port_output', message_multiple => 'All calls stats on ports are OK' }, + ]; + + $self->{maps_counters}->{port} = [ + { label => 'current-calls', set => { + key_values => [ { name => 'current' }, { name => 'display' } ], + output_template => 'Current calls : %s', + perfdatas => [ + { label => 'current', value => 'current_absolute', template => '%d', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'total-per-sec', set => { + key_values => [ { name => 'total', diff => 1 }, { name => 'display' } ], + per_second => 1, + output_template => 'total calls: %.2f/s', + perfdatas => [ + { label => 'total', value => 'total_per_second', template => '%.2f', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'connected-per-sec', set => { + key_values => [ { name => 'connected', diff => 1 }, { name => 'display' } ], + per_second => 1, + output_template => 'connected calls: %.2f/s', + perfdatas => [ + { label => 'connected', value => 'connected_per_second', template => '%.2f', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'refused-per-sec', set => { + key_values => [ { name => 'refused', diff => 1 }, { name => 'display' } ], + per_second => 1, + output_template => 'refused calls: %.2f/s', + perfdatas => [ + { label => 'refused', value => 'refused_per_second', template => '%.2f', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'errored-per-sec', set => { + key_values => [ { name => 'errored', diff => 1 }, { name => 'display' } ], + per_second => 1, + output_template => 'errored calls: %.2f/s', + perfdatas => [ + { label => 'errored', value => 'errored_per_second', template => '%.2f', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'blocked-per-sec', set => { + key_values => [ { name => 'blocked', diff => 1 }, { name => 'display' } ], + per_second => 1, + output_template => 'blocked calls: %.2f/s', + perfdatas => [ + { label => 'blocked', value => 'blocked_per_second', template => '%.2f', + min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_dsp_output { + my ($self, %options) = @_; + + return "Port => '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + return $self; +} + +my $mapping = { + uxPTCurrentCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.5' }, + uxPTTotalCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.6' }, + uxPTConnectedCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.7' }, + uxPTRefusedCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.8' }, + uxPTErroredCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.9' }, + uxPTBlockedCalls => { oid => '.1.3.6.1.4.1.177.15.1.5.1.2.1.18' }, +}; + +my $oid_uxPortTable = '.1.3.6.1.4.1.177.15.1.5.1.2.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{cache_name} = "sonus_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + $self->{results} = $options{snmp}->get_table(oid => $oid_uxPortTable, + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}}) { + next if $oid !~ /^$mapping->{uxPTCurrentCalls}->{oid}\.(.*)$/; + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + $self->{port}->{$instance} = { current => $result->{uxPTCurrentCalls}, + total => $result->{uxPTTotalCalls}, + connected => $result->{uxPTConnectedCalls}, + refused => $result->{uxPTRefusedCalls}, + errored => $result->{uxPTErroredCalls}, + blocked => $result->{uxPTBlockedCalls}, + display => $instance }; + } +} + +1; + +__END__ + +=head1 MODE + +Check Call statistics + +=over 8 + +=item B<--warning-*> + +Warning on counters. Can be ('current-calls', 'total-per-sec', 'connected-per-sec', 'refused-per-sec', 'errored-per-sec', 'blocked-per-sec') + +=item B<--critical-*> + +Critical on counters. Can be ('current-calls', 'total-per-sec', 'connected-per-sec', 'refused-per-sec', 'errored-per-sec', 'blocked-per-sec') + +=back + +=cut From 6e9f646c9671256c8ef33d4ee1ee2901393189a1 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 12:56:24 +0200 Subject: [PATCH 283/346] + add channels monitoring mode https://github.com/centreon/centreon-plugins/issues/20 --- .../network/sonus/sbc/snmp/channels.pm | 406 ++++++++++++++++++ 1 file changed, 406 insertions(+) create mode 100644 centreon-plugins/network/sonus/sbc/snmp/channels.pm diff --git a/centreon-plugins/network/sonus/sbc/snmp/channels.pm b/centreon-plugins/network/sonus/sbc/snmp/channels.pm new file mode 100644 index 000000000..5c98a74ab --- /dev/null +++ b/centreon-plugins/network/sonus/sbc/snmp/channels.pm @@ -0,0 +1,406 @@ +# +# Copyright 2016 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::sonus::sbc::snmp::mode::channels; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg; + + if ($self->{result_values}->{admstatus} eq 'disabled') { + $msg = ' is disabled (admin)'; + } else { + $msg = 'Oper Status : ' . $self->{result_values}->{opstatus}; + } + + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{opstatus} = $options{new_datas}->{$self->{instance} . '_opstatus'}; + $self->{result_values}->{admstatus} = $options{new_datas}->{$self->{instance} . '_admstatus'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'channels', type => 1, cb_prefix_output => 'prefix_channels_output', message_multiple => 'All channels are ok' } + ]; + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total channels : %s', + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-outofservice', set => { + key_values => [ { name => 'outofservice' } ], + output_template => 'OutOfService : %s', + perfdatas => [ + { label => 'total_outofservice', value => 'outofservice_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-idle', set => { + key_values => [ { name => 'idle' } ], + output_template => 'Idle : %s', + perfdatas => [ + { label => 'total_idle', value => 'idle_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-pending', set => { + key_values => [ { name => 'pending' } ], + output_template => 'Pending : %s', + perfdatas => [ + { label => 'total_pending', value => 'pending_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-waitingforroute', set => { + key_values => [ { name => 'waitingforroute' } ], + output_template => 'WaitingForRoute : %s', + perfdatas => [ + { label => 'total_waitingforroute', value => 'waitingforroute_absolute_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-actionlist', set => { + key_values => [ { name => 'actionlist' } ], + output_template => 'ActionList : %s', + perfdatas => [ + { label => 'total_actionlist', value => 'actionlist_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-waitingfordigits', set => { + key_values => [ { name => 'waitingfordigits' } ], + output_template => 'WaitingForDigits : %s', + perfdatas => [ + { label => 'total_waitingfordigits', value => 'waitingfordigits_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-remotesetup', set => { + key_values => [ { name => 'remotesetup' } ], + output_template => 'RemoteSetup : %s', + perfdatas => [ + { label => 'total_remotesetup', value => 'remotesetup_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-peersetup', set => { + key_values => [ { name => 'peersetup' } ], + output_template => 'PeerSetup : %s', + perfdatas => [ + { label => 'total_peersetup', value => 'peersetup_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-alerting', set => { + key_values => [ { name => 'alerting' } ], + output_template => 'Alerting : %s', + perfdatas => [ + { label => 'total_alerting', value => 'alerting_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-inbandinfo', set => { + key_values => [ { name => 'inbandinfo' } ], + output_template => 'InBandInfo : %s', + perfdatas => [ + { label => 'total_inbandinfo', value => 'inbandinfo_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-connected', set => { + key_values => [ { name => 'connected' } ], + output_template => 'Connected : %s', + perfdatas => [ + { label => 'total_connected', value => 'connected_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-tonegeneration', set => { + key_values => [ { name => 'tonegeneration' } ], + output_template => 'ToneGeneration : %s', + perfdatas => [ + { label => 'total_tonegeneration', value => 'tonegeneration_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-releasing', set => { + key_values => [ { name => 'releasing' } ], + output_template => 'Releasing : %s', + perfdatas => [ + { label => 'total_releasing', value => 'releasing_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-aborting', set => { + key_values => [ { name => 'aborting' } ], + output_template => 'Aborting : %s', + perfdatas => [ + { label => 'total_aborting', value => 'aborting_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-resetting', set => { + key_values => [ { name => 'resetting' } ], + output_template => 'Resetting : %s', + perfdatas => [ + { label => 'total_resetting', value => 'resetting_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-up', set => { + key_values => [ { name => 'up' } ], + output_template => 'Up : %s', + perfdatas => [ + { label => 'total_up', value => 'up_absolute', template => '%s', + min => 0 }, + ], + } + }, + { label => 'total-down', set => { + key_values => [ { name => 'down' } ], + output_template => 'Down : %s', + perfdatas => [ + { label => 'total_down', value => 'down_absolute', template => '%s', + min => 0 }, + ], + } + }, + ]; + + $self->{maps_counters}->{channels} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'opstatus' }, { name => 'admstatus' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + { label => 'seconds', set => { + key_values => [ { name => 'seconds' }, { name => 'display' } ], + output_template => 'lifetime : %s seconds', + perfdatas => [ + { label => 'seconds', value => 'seconds_absolute', template => '%s', + min => 0, unit => 's', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{admstatus} eq "enable" and %{opstatus} !~ /up|idle|connected/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_channels_output { + my ($self, %options) = @_; + + return "Channels '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_admin_status = ( + 0 => 'down', + 1 => 'up', +); +my %map_operation_status = ( + 0 => 'outOfService', + 1 => 'idle', + 2 => 'pending', + 3 => 'waitingForRoute', + 4 => 'actionList', + 5 => 'waitingForDigits', + 6 => 'remoteSetUp', + 7 => 'peerSetUp', + 8 => 'alerting', + 9 => 'inBandInfo', + 10 => 'connected', + 11 => 'toneGeneration', + 12 => 'releasing', + 13 => 'aborting', + 14 => 'resetting', + 15 => 'up', + 16 => 'down', +); + +my $mapping = { + uxChAdminState => { oid => '.1.3.6.1.4.1.177.15.1.5.6.1.5', map => \%map_admin_status }, + uxChOperState => { oid => '.1.3.6.1.4.1.177.15.1.5.6.1.6', map => \%map_operation_status }, + uxChInUseSeconds => { oid => '.1.3.6.1.4.1.177.15.1.5.6.1.7' }, +}; + +my $oid_uxChannelStatusEntry = '.1.3.6.1.4.1.177.15.1.5.6.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{channels} = {}; + $self->{global} = { total => 0, outofservice => 0, idle => 0, + pending => 0, waitingforroute => 0, actionlist => 0, + waitingfordigits => 0, remotesetup => 0, peersetup => 0, + alerting => 0, inbandinfo => 0, connected => 0, tonegeneration => 0, + releasing => 0, aborting => 0, resetting => 0, up => 0, down => 0 }; + + $self->{results} = $options{snmp}->get_table(oid => $oid_uxChannelStatusEntry, + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}}) { + next if($oid !~ /^$mapping->{uxChOperState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + $self->{global}->{total}++; + my $oper_state = lc($result->{uxChOperState}); + + $self->{global}->{$oper_state}++; + $self->{channels}->{$instance} = {display => $instance, + opstatus => $result->{uxChOperState}, + admstatus => $result->{uxChAdminState}, + seconds => $result->{uxChInUseSeconds}}; + } + +} + +1; + +__END__ + +=head1 MODE + +Check Channels on Sonus + +=over 8 + +=item B<--filter-counters> + +Only display some counters (Can be 'channels' or 'global'). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{admstatus}, %{opstatus}, %{display} + +=item B<--critical-status> + +Set critical threshold for status. +Can used special variables like: %{admstatus}, %{opstatus}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'total', 'total-outofservice', 'total-disassociating', 'total-idle', 'total-pending', 'total-waitingforroute', 'total-actionlist', 'total-waitingfordigits', 'total-remotesetup', 'total-peersetup', 'total-alerting', 'total-inbandinfo', 'total-connected', 'total-tonegeneration', 'total-releasing', 'total-aborting', 'total-resetting', 'total-up', 'total-down', 'seconds' + +=item B<--critical-*> + +Threshold critical. +Can be: 'total', 'total', 'total-outofservice', 'total-disassociating', 'total-idle', 'total-pending', 'total-waitingforroute', 'total-actionlist', 'total-waitingfordigits', 'total-remotesetup', 'total-peersetup', 'total-alerting', 'total-inbandinfo', 'total-connected', 'total-tonegeneration', 'total-releasing', 'total-aborting', 'total-resetting', 'total-up', 'total-down', 'seconds' + +=back + +=cut From 63c6d62ee025ece65d1608c4d03c45ef618b25c3 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 12:58:39 +0200 Subject: [PATCH 284/346] + add digital signal processing mode https://github.com/centreon/centreon-plugins/issues/20 --- .../network/sonus/sbc/snmp/dspstats.pm | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 centreon-plugins/network/sonus/sbc/snmp/dspstats.pm diff --git a/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm b/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm new file mode 100644 index 000000000..9bb8ba83e --- /dev/null +++ b/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm @@ -0,0 +1,209 @@ +# +# Copyright 2016 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::sonus::sbc::1000::snmp::mode::dspstats; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_state_output { + my ($self, %options) = @_; + + my $msg = sprintf("state is '%s'", $self->{result_values}->{state}); + return $msg; +} + +sub custom_state_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'dsp', type => 1, cb_prefix_output => 'prefix_dsp_output', message_multiple => 'All DSP stats and states are OK' }, + ]; + $self->{maps_counters}->{dsp} = [ + { label => 'state', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => \&custom_state_calc, + closure_custom_output => \&custom_state_output, + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => \&custom_threshold_output, + } + }, + { label => 'cpu', set => { + key_values => [ { name => 'cpu' }, { name => 'display' } ], + output_template => 'CPU Usage: %s', + perfdatas => [ + { label => 'cpu', value => 'cpu_absolute', template => '%d', + min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'channels', set => { + key_values => [ { name => 'channels' }, { name => 'display' } ], + output_template => 'Active Channels: %s', + perfdatas => [ + { label => 'channels', value => 'channels_absolute', template => '%d', + min => 0, unit => 'channels', label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_dsp_output { + my ($self, %options) = @_; + + return "DSP '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} eq "down"' }, + }); + return $self; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $self->change_macros(); + $instance_mode = $self; +} + +my %map_status = ( + 0 => 'down', + 1 => 'up', +); + +my $mapping = { + uxDSPIsPresent => { oid => '.1.3.6.1.4.1.177.15.1.6.1.3' }, + uxDSPCPUUsage => { oid => '.1.3.6.1.4.1.177.15.1.6.1.4' }, + uxDSPChannelsInUse => { oid => '.1.3.6.1.4.1.177.15.1.6.1.5' }, + uxDSPServiceStatus => { oid => '.1.3.6.1.4.1.177.15.1.6.1.6', map => \%map_status }, +}; + +my $oid_uxDSPResourceTable = '.1.3.6.1.4.1.177.15.1.6.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + + $self->{results} = $options{snmp}->get_table(oid => $oid_uxDSPResourceTable, + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}}) { + next if($oid !~ /^$mapping->{uxDSPServiceStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + next if ($result->{uxDSPIsPresent} eq '0'); + + $self->{dsp}->{$instance} = { state => $result->{uxDSPServiceStatus}, + cpu => $result->{uxDSPCPUUsage}, + channels => $result->{uxDSPChannelsInUse}, + display => $instance }; + } +} + +1; + +__END__ + +=head1 MODE + +Check Digital Signal Processing statistics + +=over 8 + +=item B<--warning-*> + +Warning on counters. Can be ('cpu', 'channels') + +=item B<--critical-*> + +Warning on counters. Can be ('cpu', 'channels') + +=item B<--warning-status> + +Set warning threshold for status. Use "%{state}" as a special variable. +Useful to be notified when tunnel is up "%{state} eq 'up'" + +=item B<--critical-status> + +Set critical threshold for status. Use "%{state}" as a special variable. +Useful to be notified when tunnel is up "%{state} eq 'up'" + +=back + +=cut From 8e22447a37847bbaf33ddd5363d2795520f9e197 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 13:04:01 +0200 Subject: [PATCH 285/346] + fix path to module --- centreon-plugins/network/sonus/sbc/snmp/dspstats.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm b/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm index 9bb8ba83e..e59f37440 100644 --- a/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm +++ b/centreon-plugins/network/sonus/sbc/snmp/dspstats.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::sonus::sbc::1000::snmp::mode::dspstats; +package network::sonus::sbc::snmp::mode::dspstats; use base qw(centreon::plugins::templates::counter); From 3db44cf886326ca7be86008b198b2a8255203f18 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 13 Jul 2016 13:05:44 +0200 Subject: [PATCH 286/346] + fix path to module --- centreon-plugins/network/sonus/sbc/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/sonus/sbc/plugin.pm b/centreon-plugins/network/sonus/sbc/plugin.pm index f058bcfb7..c0cc3d9cf 100644 --- a/centreon-plugins/network/sonus/sbc/plugin.pm +++ b/centreon-plugins/network/sonus/sbc/plugin.pm @@ -18,7 +18,7 @@ # limitations under the License. # -package network::sonus::sbc::1000::snmp::plugin; +package network::sonus::sbc::snmp::plugin; use strict; use warnings; From 2ae04e14483ae948c190ab7b8266bfcd0eb480da Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 15:00:06 +0200 Subject: [PATCH 287/346] + add aerohive plugin https://github.com/centreon/centreon-plugins/issues/445 --- .../network/aerohive/snmp/plugin.pm | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 centreon-plugins/network/aerohive/snmp/plugin.pm diff --git a/centreon-plugins/network/aerohive/snmp/plugin.pm b/centreon-plugins/network/aerohive/snmp/plugin.pm new file mode 100644 index 000000000..02a736b20 --- /dev/null +++ b/centreon-plugins/network/aerohive/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::aerohive::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}} = ( + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'connected-users' => 'network::aerohive::snmp::mode::connectedusers', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check aerohive equipment in SNMP + +=cut From 793eb710fa0d7ed78563519bc996fbf8b1d9a702 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 15:01:29 +0200 Subject: [PATCH 288/346] + add connectedusers mode Fix https://github.com/centreon/centreon-plugins/issues/445 --- .../aerohive/snmp/mode/connectedusers.pm | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm diff --git a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm new file mode 100644 index 000000000..e7fc608b9 --- /dev/null +++ b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm @@ -0,0 +1,144 @@ +# +# Copyright 2016 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::aerohive::snmp::mode::connectedusers; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'ssid', type => 1, cb_prefix_output => 'prefix_ssid_output', message_multiple => 'All users by SSID are ok' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'total', set => { + key_values => [ { name => 'total' } ], + output_template => 'Total Users : %s', + perfdatas => [ + { label => 'total', value => 'total_absolute', template => '%s', + unit => 'users', min => 0 }, + ], + } + }, + ]; + $self->{maps_counters}->{ssid} = [ + { label => 'ssid', set => { + key_values => [ { name => 'total' }, { name => 'display' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ssid', value => 'total_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_ssid_output { + my ($self, %options) = @_; + + return "SSID '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-ssid:s" => { name => 'filter_ssid' }, + }); + + return $self; +} + +my $oid_ahXIfEntry = '.1.3.6.1.4.1.26928.1.1.1.2.1.1.1'; +my $oid_ahSSIDNAME = '.1.3.6.1.4.1.26928.1.1.1.2.1.1.1.2'; +my $oid_ahClientSSID = '.1.3.6.1.4.1.26928.1.1.1.2.1.2.1.10'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{global} = { total => 0 }; + $self->{ssid} = {}; + + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_ahXIfEntry }, + { oid => $oid_ahClientSSID }, + ], + nothing_quit => 1); + + foreach my $oid (keys %{$self->{results}->{ $oid_ahXIfEntry }}) { + next if $oid !~ /^$oid_ahSSIDNAME\.(.*)$/; + my $ssid = $self->{results}->{ $oid_ahXIfEntry }->{$oid}; + if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && + $ssid !~ /$self->{option_results}->{filter_ssid}/) { + $self->{output}->output_add(long_msg => "skipping ssid " . $ssid . " : no matching filter.", debug => 1); + next; + } + $self->{ssid}->{$ssid} = { display => $ssid, total => 0 } if (!defined($self->{ssid}->{$ssid})); + } + + foreach my $oid (keys %{$self->{results}->{ $oid_ahClientSSID }}) { + $self->{global}->{total}++; + my $ssid = $self->{results}->{ $oid_ahClientSSID }->{$oid}; + $self->{ssid}->{$ssid}->{total}++; + } + +} + +1; + +__END__ + +=head1 MODE + +Check number of connected users (total and by SSID). + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='ssid$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'total', 'ssid' + +=item B<--critical-*> + +Threshold critical. +Can be: 'total', 'ssid' + +=item B<--filter-ssid> + +Filter by SSID (can be a regexp). + +=back + +=cut From 30ecfc7c04534bb58eb84e240fb5c59647629b07 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 15:48:50 +0200 Subject: [PATCH 289/346] + minor optimizations ++ enhance error management when filter by SSID ++ reduce snmp query scope --- .../network/aerohive/snmp/mode/connectedusers.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm index e7fc608b9..75ce6686e 100644 --- a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm +++ b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm @@ -76,7 +76,6 @@ sub new { return $self; } -my $oid_ahXIfEntry = '.1.3.6.1.4.1.26928.1.1.1.2.1.1.1'; my $oid_ahSSIDNAME = '.1.3.6.1.4.1.26928.1.1.1.2.1.1.1.2'; my $oid_ahClientSSID = '.1.3.6.1.4.1.26928.1.1.1.2.1.2.1.10'; @@ -86,13 +85,12 @@ sub manage_selection { $self->{global} = { total => 0 }; $self->{ssid} = {}; - $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_ahXIfEntry }, + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_ahSSIDNAME }, { oid => $oid_ahClientSSID }, ], nothing_quit => 1); foreach my $oid (keys %{$self->{results}->{ $oid_ahXIfEntry }}) { - next if $oid !~ /^$oid_ahSSIDNAME\.(.*)$/; my $ssid = $self->{results}->{ $oid_ahXIfEntry }->{$oid}; if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && $ssid !~ /$self->{option_results}->{filter_ssid}/) { @@ -105,7 +103,7 @@ sub manage_selection { foreach my $oid (keys %{$self->{results}->{ $oid_ahClientSSID }}) { $self->{global}->{total}++; my $ssid = $self->{results}->{ $oid_ahClientSSID }->{$oid}; - $self->{ssid}->{$ssid}->{total}++; + $self->{ssid}->{$ssid}->{total}++ if defined($self->{ssid}->{$ssid}); } } From 4650297c98fdc178d9ce726adf6621969f7f5031 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 16:03:14 +0200 Subject: [PATCH 290/346] + syntax guidelines --- centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm index 75ce6686e..d2f7ff181 100644 --- a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm +++ b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm @@ -103,7 +103,7 @@ sub manage_selection { foreach my $oid (keys %{$self->{results}->{ $oid_ahClientSSID }}) { $self->{global}->{total}++; my $ssid = $self->{results}->{ $oid_ahClientSSID }->{$oid}; - $self->{ssid}->{$ssid}->{total}++ if defined($self->{ssid}->{$ssid}); + $self->{ssid}->{$ssid}->{total}++ if (defined($self->{ssid}->{$ssid})); } } From d87b1b4037a08075acf2990be4724296040ff433 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 16:06:45 +0200 Subject: [PATCH 291/346] + fix error on ssid in foreach --- centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm index d2f7ff181..e4839dd42 100644 --- a/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm +++ b/centreon-plugins/network/aerohive/snmp/mode/connectedusers.pm @@ -90,8 +90,8 @@ sub manage_selection { ], nothing_quit => 1); - foreach my $oid (keys %{$self->{results}->{ $oid_ahXIfEntry }}) { - my $ssid = $self->{results}->{ $oid_ahXIfEntry }->{$oid}; + foreach my $oid (keys %{$self->{results}->{ $oid_ahSSIDNAME }}) { + my $ssid = $self->{results}->{ $oid_ahSSIDNAME }->{$oid}; if (defined($self->{option_results}->{filter_ssid}) && $self->{option_results}->{filter_ssid} ne '' && $ssid !~ /$self->{option_results}->{filter_ssid}/) { $self->{output}->output_add(long_msg => "skipping ssid " . $ssid . " : no matching filter.", debug => 1); From 51b7f4310bfc49002e5617d715a0c1c3d29fe2d1 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 16:33:00 +0200 Subject: [PATCH 292/346] + add cpu mode for digi rtr https://github.com/centreon/centreon-plugins/issues/447 --- .../network/digi/standard/mode/cpu.pm | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 centreon-plugins/network/digi/standard/mode/cpu.pm diff --git a/centreon-plugins/network/digi/standard/mode/cpu.pm b/centreon-plugins/network/digi/standard/mode/cpu.pm new file mode 100644 index 000000000..777483ee7 --- /dev/null +++ b/centreon-plugins/network/digi/standard/mode/cpu.pm @@ -0,0 +1,103 @@ +# +# Copyright 2016 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::digi::standard::snmp::mode::cpu; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_cpuUtil = '.1.3.6.1.4.1.16378.10000.3.1.0'; + + $self->{results} = $self->{snmp}->get_leef(oids => [ $oid_cpuUtil ], + nothing_quit => 1); + + my $cpu = $self->{results}->{$oid_cpuUtil}; + + my $exit = $self->{perfdata}->threshold_check(value => $cpu, + threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("CPU Usage is %.2f%%", $cpu)); + $self->{output}->perfdata_add(label => "cpu", unit => '%', + value => $cpu, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0, max => 100); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check cpu usage (sarian-monitor.mib). + +=over 8 + +=item B<--warning> + +Threshold warning in percent. + +=item B<--critical> + +Threshold critical in percent. + +=back + +=cut From 6e934d263c78cc533cace0b1b3c46e0ec554807c Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 16:33:55 +0200 Subject: [PATCH 293/346] + add memory mode for digi rtr https://github.com/centreon/centreon-plugins/issues/447 --- .../network/digi/standard/mode/memory.pm | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 centreon-plugins/network/digi/standard/mode/memory.pm diff --git a/centreon-plugins/network/digi/standard/mode/memory.pm b/centreon-plugins/network/digi/standard/mode/memory.pm new file mode 100644 index 000000000..b72e8b78a --- /dev/null +++ b/centreon-plugins/network/digi/standard/mode/memory.pm @@ -0,0 +1,111 @@ +# +# Copyright 2016 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::digi::standard::snmp::mode::memory; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_totalMemory = '.1.3.6.1.4.1.16378.10000.3.17.0'; # in Kbytes + my $oid_freeMemory = '.1.3.6.1.4.1.16378.10000.3.18.0'; # in Kbytes + + my $result = $self->{snmp}->get_leef(oids => [$oid_totalMemory, $oid_freeMemory], + nothing_quit => 1); + my $free = $result->{$oid_freeMemory} * 1024; + my $total_size = $result->{$oid_totalMemory} * 1024; + my $used = $total_size - $free; + + my $prct_used = $used * 100 / $total_size; + my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + + my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size); + my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $used); + + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Ram used %s (%.2f%%), Total: %s", + $used_value . " " . $used_unit, $prct_used, + $total_value . " " . $total_unit)); + + $self->{output}->perfdata_add(label => "used", unit => 'B', + value => $used, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $total_size, cast_int => 1), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $total_size, cast_int => 1), + min => 0, max => $total_size); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check memory usage (sarian-monitor.mib). + +=over 8 + +=item B<--warning> + +Threshold warning in percent. + +=item B<--critical> + +Threshold critical in percent. + +=back + +=cut From a41f25d0f57512d4f2bc05a00f75ec1fbb00eb93 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Wed, 20 Jul 2016 16:34:31 +0200 Subject: [PATCH 294/346] + add temperature mode for digi rtr https://github.com/centreon/centreon-plugins/issues/447 --- .../network/digi/standard/mode/temperature.pm | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 centreon-plugins/network/digi/standard/mode/temperature.pm diff --git a/centreon-plugins/network/digi/standard/mode/temperature.pm b/centreon-plugins/network/digi/standard/mode/temperature.pm new file mode 100644 index 000000000..b31c8e293 --- /dev/null +++ b/centreon-plugins/network/digi/standard/mode/temperature.pm @@ -0,0 +1,124 @@ +# +# Copyright 2016 Centreon (http://www.centreon.com/) +# +# Centreon is a full-fledged industry-strength solution that meets +# the needs in IT infrastructure and temperatureplication 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.temperatureache.org/licenses/LICENSE-2.0 +# +# Unless required by temperatureplicable 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::digi::standard::snmp::mode::temperature; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'temperature', type => 0, skipped_code => { -10 => 1 } }, + ]; + $self->{maps_counters}->{temperature} = [ + { label => 'device', set => { + key_values => [ { name => 'device' } ], + output_template => 'Temp Device : %d °C', + perfdatas => [ + { label => 'tempDevice', value => 'device_absolute', template => '%d', + unit => 'C' }, + ], + } + }, + { label => 'processor', set => { + key_values => [ { name => 'processor' } ], + output_template => 'Temp Processor : %d °C', + perfdatas => [ + { label => 'tempProcessor', value => 'processor_absolute', template => '%d', + unit => 'C' }, + ], + } + }, + { label => 'modem', set => { + key_values => [ { name => 'modem' } ], + output_template => 'Temp Modem : %d °C', + perfdatas => [ + { label => 'tempModem', value => 'modem_absolute', template => '%d', + unit => 'C' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +my $oid_temperature = '.1.3.6.1.4.1.16378.10000.3.11.0'; +my $oid_processorTemperature = '.1.3.6.1.4.1.16378.10000.3.12.0'; +my $oid_modemTemperature = '.1.3.6.1.4.1.16378.10000.3.13.0'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + + $self->{temperature} = {}; + $self->{results} = $self->{snmp}->get_leef(oids => [ $oid_temperature, $oid_processorTemperature, $oid_modemTemperature ], + nothing_quit => 1); + + $self->{temperature} = { device => $self->{results}->{$oid_temperature} > -20 ? $self->{results}->{$oid_temperature} : undef, + processor => $self->{results}->{$oid_processorTemperature}, + modem => $self->{results}->{$oid_modemTemperature} }; + +} + +1; + +__END__ + +=head1 MODE + +Check Digi equipment temperature (sarian-monitor.mib) + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='processor|modem' + +=item B<--warning-*> + +Threshold warning. +Can be: 'device', 'modem', 'processor' (C). + +=item B<--critical-*> + +Threshold critical. +Can be: 'device', 'modem', 'processor' (C). + +=back + +=cut From b917c237ec42ac4136eb826356a1f5027f909a7d Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 21 Jul 2016 11:13:35 +0200 Subject: [PATCH 295/346] + add gprs mode for digi rtr - check status, signal strength, attachement, registration and network technology --- .../network/digi/standard/mode/gprs.pm | 272 ++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 centreon-plugins/network/digi/standard/mode/gprs.pm diff --git a/centreon-plugins/network/digi/standard/mode/gprs.pm b/centreon-plugins/network/digi/standard/mode/gprs.pm new file mode 100644 index 000000000..7add1e7da --- /dev/null +++ b/centreon-plugins/network/digi/standard/mode/gprs.pm @@ -0,0 +1,272 @@ +# +# Copyright 2016 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::digi::standard::snmp::mode::gprs; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + my $msg; + + $msg = 'Attachement : ' . $self->{result_values}->{attachement}; + $msg .= ', Registration : ' . $self->{result_values}->{registered}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{registered} = $options{new_datas}->{$self->{instance} . '_registered'}; + $self->{result_values}->{attachement} = $options{new_datas}->{$self->{instance} . '_attachement'}; + return 0; +} + +sub custom_tech_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_technology}) && $instance_mode->{option_results}->{critical_technology} ne '' && + eval "$instance_mode->{option_results}->{critical_technology}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_technology}) && $instance_mode->{option_results}->{warning_technology} ne '' && + eval "$instance_mode->{option_results}->{warning_technology}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_tech_output { + my ($self, %options) = @_; + my $msg; + + $msg = 'Technology : ' . $self->{result_values}->{technology}; + return $msg; +} + +sub custom_tech_calc { + my ($self, %options) = @_; + + $self->{result_values}->{technology} = $options{new_datas}->{$self->{instance} . '_technology'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'gprs', type => 0 }, + ]; + $self->{maps_counters}->{gprs} = [ + { label => 'signal', set => { + key_values => [ { name => 'signal' } ], + output_template => 'Signal : %d dBm', + perfdatas => [ + { label => 'signal_strenght', value => 'signal_absolute', template => '%s', + unit => 'dBm' }, + ], + } + }, + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'registered' }, { name => 'attachement' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold_output'), + } + }, + { label => 'technology', threshold => 0, set => { + key_values => [ { name => 'technology' } ], + closure_custom_calc => $self->can('custom_tech_calc'), + closure_custom_output => $self->can('custom_tech_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_tech_threshold_output'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{attachement} eq "notAttached" or %{registered} !~ /registeredHostNetwork|registeredRoaming/' }, + "warning-technology:s" => { name => 'warning_technology', default => '' }, + "critical-technology:s" => { name => 'critical_technology', default => '%{technology} !~ /2G|3G|4G/' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'warning_technology', 'critical_technology' )) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_gprs_registration = ( + 0 => 'notRegisteredNotSearching', + 1 => 'registeredHostNetwork', + 2 => 'notRegisteredSearching', + 3 => 'registrationDenied', + 4 => 'unknown', + 5 => 'registeredRoaming', + 6 => 'unrecognised', +); + +my %map_gprs_attachement = ( + 0 => 'notAtached', + 1 => 'attached', +); + +my %map_gprs_technology = ( + 1 => 'unknown', + 2 => 'GPRS(2G)', + 3 => 'EDGE(2G)', + 4 => 'UMTS(3G)', + 5 => 'HSDPA(3G)', + 6 => 'HSUPA(3G)', + 7 => 'DC-HSPA+(3G)', + 8 => 'LTE(4G)', +); + +my $oid_gprsSignalStrength = '.1.3.6.1.4.1.16378.10000.2.1.0'; +my $oid_gprsRegistered = '.1.3.6.1.4.1.16378.10000.2.2.0'; +my $oid_gprsAttached = '.1.3.6.1.4.1.16378.10000.2.3.0'; +my $oid_gprsNetworkTechnology = '.1.3.6.1.4.1.16378.10000.2.7.0'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{gprs} = {}; + $self->{results} = $options{snmp}->get_leef(oids => [ $oid_gprsSignalStrength, $oid_gprsRegistered, + $oid_gprsAttached, $oid_gprsNetworkTechnology ], + nothing_quit => 1); + + $self->{gprs} = { signal => $self->{results}->{$oid_gprsSignalStrength}, + registered => $map_gprs_registration{$self->{results}->{$oid_gprsRegistered}}, + attachement => $map_gprs_attachement{$self->{results}->{$oid_gprsAttached}}, + technology => $map_gprs_technology{$self->{results}->{$oid_gprsNetworkTechnology}}, + }; + +} + +1; + +__END__ + +=head1 MODE + +Check AP status. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='signal|technology' + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{registered}, %{attachement} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{attachement} eq "attached" and %{registered} !~ /registeredHostNetwork|registeredRoaming/' +Can used special variables like: %{registered}, %{attachement} + +=item B<--warning-technology> + +Set warning threshold for technology. +Use special variables %{technology}. + +=item B<--critical-technology> + +Set critical threshold for technology (Default: '%{technology} !~ /2G|3G|4G/' +Use special variables %{technology}. + +=item B<--warning-signal> + +Threshold warning for signal strength. + +=item B<--critical-signal> + +Threshold critical for signal strength. + +=back + +=cut From af088cea838e23ea8e7cf5743744ad42089bdeae Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 21 Jul 2016 11:15:20 +0200 Subject: [PATCH 296/346] + add plugin for digi equipments https://github.com/centreon/centreon-plugins/issues/447 --- .../network/digi/standard/plugin.pm | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 centreon-plugins/network/digi/standard/plugin.pm diff --git a/centreon-plugins/network/digi/standard/plugin.pm b/centreon-plugins/network/digi/standard/plugin.pm new file mode 100644 index 000000000..732425486 --- /dev/null +++ b/centreon-plugins/network/digi/standard/plugin.pm @@ -0,0 +1,53 @@ +# +# Copyright 2016 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::digi::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}} = ( + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'cpu' => 'network::digi::standard::snmp::mode::cpu', + 'memory' => 'network::digi::standard::snmp::mode::memory', + 'temperature' => 'network::digi::standard::snmp::mode::temperature', + 'gprs' => 'network::digi::standard::snmp::mode::gprs', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check DIGI equipement supporting standard sarian-monitor.mib + +=cut From 027c8b16e157ea9302532e1d2c9607e0603cfb29 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Thu, 21 Jul 2016 11:16:58 +0200 Subject: [PATCH 297/346] Update linux local traffic mode (ref #443) --- centreon-plugins/os/linux/local/mode/traffic.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/os/linux/local/mode/traffic.pm b/centreon-plugins/os/linux/local/mode/traffic.pm index 908b6c5df..753fd9d32 100644 --- a/centreon-plugins/os/linux/local/mode/traffic.pm +++ b/centreon-plugins/os/linux/local/mode/traffic.pm @@ -113,6 +113,7 @@ sub manage_selection { command_options => $self->{option_results}->{command_options}); while ($stdout =~ /^(\S+)(.*?)(\n\n|\n$)/msg) { my ($interface_name, $values) = ($1, $2); + $interface_name =~ s/:$//; my $states = ''; $states .= 'R' if ($values =~ /RUNNING/ms); $states .= 'U' if ($values =~ /UP/ms); @@ -128,8 +129,9 @@ sub manage_selection { next if (defined($self->{option_results}->{name}) && !defined($self->{option_results}->{use_regexp}) && !defined($self->{option_results}->{use_regexpi}) && $interface_name ne $self->{option_results}->{name}); - $values =~ /RX bytes:(\S+).*?TX bytes:(\S+)/msi; - $self->{result}->{$interface_name} = {state => $states, in => $1, out => $2}; + if ($values =~ /RX bytes:(\S+).*?TX bytes:(\S+)/msi || $values =~ /RX packets\s+\d+\s+bytes\s+(\S+).*?TX packets\s+\d+\s+bytes\s+(\S+)/msi) { + $self->{result}->{$interface_name} = {state => $states, in => $1, out => $2}; + } } if (scalar(keys %{$self->{result}}) <= 0) { @@ -373,4 +375,4 @@ Don't display loopback interfaces. =back -=cut \ No newline at end of file +=cut From 1043249c17711e2a23acc1fda608cf911b66d9b7 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 21 Jul 2016 12:34:31 +0200 Subject: [PATCH 298/346] + add missing snmp directory --- centreon-plugins/network/digi/standard/{ => snmp}/mode/cpu.pm | 0 centreon-plugins/network/digi/standard/{ => snmp}/mode/gprs.pm | 0 centreon-plugins/network/digi/standard/{ => snmp}/mode/memory.pm | 0 .../network/digi/standard/{ => snmp}/mode/temperature.pm | 0 centreon-plugins/network/digi/standard/{ => snmp}/plugin.pm | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename centreon-plugins/network/digi/standard/{ => snmp}/mode/cpu.pm (100%) rename centreon-plugins/network/digi/standard/{ => snmp}/mode/gprs.pm (100%) rename centreon-plugins/network/digi/standard/{ => snmp}/mode/memory.pm (100%) rename centreon-plugins/network/digi/standard/{ => snmp}/mode/temperature.pm (100%) rename centreon-plugins/network/digi/standard/{ => snmp}/plugin.pm (100%) diff --git a/centreon-plugins/network/digi/standard/mode/cpu.pm b/centreon-plugins/network/digi/standard/snmp/mode/cpu.pm similarity index 100% rename from centreon-plugins/network/digi/standard/mode/cpu.pm rename to centreon-plugins/network/digi/standard/snmp/mode/cpu.pm diff --git a/centreon-plugins/network/digi/standard/mode/gprs.pm b/centreon-plugins/network/digi/standard/snmp/mode/gprs.pm similarity index 100% rename from centreon-plugins/network/digi/standard/mode/gprs.pm rename to centreon-plugins/network/digi/standard/snmp/mode/gprs.pm diff --git a/centreon-plugins/network/digi/standard/mode/memory.pm b/centreon-plugins/network/digi/standard/snmp/mode/memory.pm similarity index 100% rename from centreon-plugins/network/digi/standard/mode/memory.pm rename to centreon-plugins/network/digi/standard/snmp/mode/memory.pm diff --git a/centreon-plugins/network/digi/standard/mode/temperature.pm b/centreon-plugins/network/digi/standard/snmp/mode/temperature.pm similarity index 100% rename from centreon-plugins/network/digi/standard/mode/temperature.pm rename to centreon-plugins/network/digi/standard/snmp/mode/temperature.pm diff --git a/centreon-plugins/network/digi/standard/plugin.pm b/centreon-plugins/network/digi/standard/snmp/plugin.pm similarity index 100% rename from centreon-plugins/network/digi/standard/plugin.pm rename to centreon-plugins/network/digi/standard/snmp/plugin.pm From 3cdad547b02975b7c3d4d6acb3438059926491ee Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 21 Jul 2016 20:31:29 +0200 Subject: [PATCH 299/346] + Ref #383 --- .../common/aruba/snmp/mode/apusers.pm | 309 ++++-------------- 1 file changed, 72 insertions(+), 237 deletions(-) diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm index b80f8309e..f9cac0524 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm @@ -20,15 +20,21 @@ package centreon::common::aruba::snmp::mode::apusers; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::values; -my $maps_counters = { - global => { - '000_total' => { set => { +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + { name => 'essid', type => 1, cb_prefix_output => 'prefix_essid_output', message_multiple => 'All users by ESSID are ok' }, + { name => 'ap', type => 1, cb_prefix_output => 'prefix_ap_output', message_multiple => 'All users by AP are ok' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'total', set => { key_values => [ { name => 'total' } ], output_template => 'Total Users : %s', perfdatas => [ @@ -37,7 +43,7 @@ my $maps_counters = { ], } }, - '001_total-none' => { set => { + { label => 'total-none', set => { key_values => [ { name => 'total_none' } ], output_template => 'Total Auth None : %s', perfdatas => [ @@ -46,7 +52,7 @@ my $maps_counters = { ], } }, - '002_total-other' => { set => { + { label => 'total-other', set => { key_values => [ { name => 'total_other' } ], output_template => 'Total Auth Other : %s', perfdatas => [ @@ -55,7 +61,7 @@ my $maps_counters = { ], } }, - '003_total-web' => { set => { + { label => 'total-web', set => { key_values => [ { name => 'total_web' } ], output_template => 'Total Auth Web : %s', perfdatas => [ @@ -64,7 +70,7 @@ my $maps_counters = { ], } }, - '004_total-dot1x' => { set => { + { label => 'total-dot1x', set => { key_values => [ { name => 'total_dot1x' } ], output_template => 'Total Auth Dot1x : %s', perfdatas => [ @@ -73,7 +79,7 @@ my $maps_counters = { ], } }, - '005_total-vpn' => { set => { + { label => 'total-vpn', set => { key_values => [ { name => 'total_vpn' } ], output_template => 'Total Auth Vpn : %s', perfdatas => [ @@ -82,7 +88,7 @@ my $maps_counters = { ], } }, - '006_total-mac' => { set => { + { label => 'total-mac', set => { key_values => [ { name => 'total_mac' } ], output_template => 'Total Auth Mac : %s', perfdatas => [ @@ -91,7 +97,7 @@ my $maps_counters = { ], } }, - '007_avg-connection-time' => { set => { + { label => 'avg-connection-time', set => { key_values => [ { name => 'avg_connection_time' } ], output_template => 'Users average connection time : %.3f seconds', perfdatas => [ @@ -100,30 +106,44 @@ my $maps_counters = { ], } }, - }, - total_ap => { - '000_total-ap' => { set => { - key_values => [ { name => 'users' }, { name => 'bssid' } ], - output_template => 'Users : %s', - perfdatas => [ - { label => 'total', value => 'users_absolute', template => '%s', - unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'bssid_absolute' }, - ], - } - }, - }, - total_essid => { - '000_total-essid' => { set => { + ]; + + $self->{maps_counters}->{essid} = [ + { label => 'total-essid', set => { key_values => [ { name => 'users' }, { name => 'essid' } ], - output_template => 'Users : %s', + output_template => 'users : %s', perfdatas => [ - { label => 'total', value => 'users_absolute', template => '%s', + { label => 'essid', value => 'users_absolute', template => '%s', unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'essid_absolute' }, ], } }, - } -}; + ]; + + $self->{maps_counters}->{ap} = [ + { label => 'total-ap', set => { + key_values => [ { name => 'users' }, { name => 'bssid' } ], + output_template => 'users : %s', + perfdatas => [ + { label => 'ap', value => 'users_absolute', template => '%s', + unit => 'users', min => 0, label_extra_instance => 1, instance_use => 'bssid_absolute' }, + ], + } + }, + ]; +} + +sub prefix_essid_output { + my ($self, %options) = @_; + + return "ESSID '" . $options{instance_value}->{essid} . "' "; +} + +sub prefix_ap_output { + my ($self, %options) = @_; + + return "AP '" . $options{instance_value}->{bssid} . "' "; +} sub new { my ($class, %options) = @_; @@ -134,206 +154,13 @@ sub new { $options{options}->add_options(arguments => { "filter-ip-address:s" => { name => 'filter_ip_address' }, - "filter-essid:s" => { name => 'filter_essid' }, + "filter_bssid:s" => { name => 'filter_bssid' }, + "filter-essid:s" => { name => 'filter_essid' }, }); - - foreach my $key (('global', 'total_ap', 'total_essid')) { - foreach (keys %{$maps_counters->{$key}}) { - my ($id, $name) = split /_/; - if (!defined($maps_counters->{$key}->{$_}->{threshold}) || $maps_counters->{$key}->{$_}->{threshold} != 0) { - $options{options}->add_options(arguments => { - 'warning-' . $name . ':s' => { name => 'warning-' . $name }, - 'critical-' . $name . ':s' => { name => 'critical-' . $name }, - }); - } - $maps_counters->{$key}->{$_}->{obj} = centreon::plugins::values->new(output => $self->{output}, - perfdata => $self->{perfdata}, - label => $name); - $maps_counters->{$key}->{$_}->{obj}->set(%{$maps_counters->{$key}->{$_}->{set}}); - } - } - + return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - foreach my $key (('global', 'total_ap', 'total_essid')) { - foreach (keys %{$maps_counters->{$key}}) { - $maps_counters->{$key}->{$_}->{obj}->init(option_results => $self->{option_results}); - } - } -} - -sub run_total { - my ($self, %options) = @_; - - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits; - foreach (sort keys %{$maps_counters->{global}}) { - my $obj = $maps_counters->{global}->{$_}->{obj}; - - $obj->set(instance => 'global'); - - my ($value_check) = $obj->execute(values => $self->{global}); - - if ($value_check != 0) { - $long_msg .= $long_msg_append . $obj->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $obj->threshold_check(); - push @exits, $exit2; - - my $output = $obj->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $obj->perfdata(); - } - - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "$short_msg" - ); - } else { - $self->{output}->output_add(short_msg => "$long_msg"); - } -} - -sub run_ap { - my ($self, %options) = @_; - - my $multiple = 1; - if (scalar(keys %{$self->{ap_selected}}) == 1) { - $multiple = 0; - } - - if ($multiple == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'All users by AP are ok'); - } - - foreach my $id (sort keys %{$self->{ap_selected}}) { - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits = (); - foreach (sort keys %{$maps_counters->{total_ap}}) { - my $obj = $maps_counters->{total_ap}->{$_}->{obj}; - $obj->set(instance => $id); - - my ($value_check) = $obj->execute(values => $self->{ap_selected}->{$id}); - - if ($value_check != 0) { - $long_msg .= $long_msg_append . $obj->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $obj->threshold_check(); - push @exits, $exit2; - - my $output = $obj->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $obj->perfdata(extra_instance => $multiple); - } - - $self->{output}->output_add(long_msg => "AP '$id' $long_msg"); - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "AP '$id' $short_msg" - ); - } - - if ($multiple == 0) { - $self->{output}->output_add(short_msg => "AP '$id' $long_msg"); - } - } -} - -sub run_essid { - my ($self, %options) = @_; - - my $multiple = 1; - if (scalar(keys %{$self->{essid_selected}}) == 1) { - $multiple = 0; - } - - if ($multiple == 1) { - $self->{output}->output_add(severity => 'OK', - short_msg => 'All users by ESSID are ok'); - } - - foreach my $id (sort keys %{$self->{essid_selected}}) { - my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', ''); - my @exits = (); - foreach (sort keys %{$maps_counters->{total_essid}}) { - my $obj = $maps_counters->{total_essid}->{$_}->{obj}; - $obj->set(instance => $id); - - my ($value_check) = $obj->execute(values => $self->{essid_selected}->{$id}); - - if ($value_check != 0) { - $long_msg .= $long_msg_append . $obj->output_error(); - $long_msg_append = ', '; - next; - } - my $exit2 = $obj->threshold_check(); - push @exits, $exit2; - - my $output = $obj->output(); - $long_msg .= $long_msg_append . $output; - $long_msg_append = ', '; - - if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { - $short_msg .= $short_msg_append . $output; - $short_msg_append = ', '; - } - - $obj->perfdata(extra_instance => $multiple); - } - - $self->{output}->output_add(long_msg => "ESSID '$id' $long_msg"); - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { - $self->{output}->output_add(severity => $exit, - short_msg => "ESSID '$id' $short_msg" - ); - } - - if ($multiple == 0) { - $self->{output}->output_add(short_msg => "ESSID '$id' $long_msg"); - } - } -} - -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - $self->manage_selection(); - $self->run_total(); - $self->run_ap(); - $self->run_essid(); - - $self->{output}->display(); - $self->{output}->exit(); -} - my %map_auth_method = ( 0 => 'none', 1 => 'web', 2 => 'mac', 3 => 'vpn', @@ -368,10 +195,10 @@ sub manage_selection { $self->{global} = { total => 0, total_none => 0, total_web => 0, total_mac => 0, total_vpn => 0, total_dot1x => 0, total_kerberos => 0, total_secureId => 0, total_pubcookie => 0, total_xSec => 0, xSecMachine => 0, 'total_via-vpn' => 0, total_other => 0 }; - $self->{ap_selected} = {}; - $self->{essid_selected} = {}; + $self->{ap} = {}; + $self->{essid} = {}; - $self->{results} = $self->{snmp}->get_multiple_table(oids => [ + $self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_wlsxSwitchRole }, { oid => $oid_wlsxUserEntry, start => $mapping->{nUserUpTime}->{oid}, end => $mapping->{nUserAuthenticationMethod}->{oid} }, { oid => $mapping2->{nUserApBSSID}->{oid} }, @@ -398,8 +225,8 @@ sub manage_selection { foreach my $oid (keys %{$self->{results}->{$oid_wlsxUserEntry}}) { next if ($oid !~ /^$mapping->{nUserAuthenticationMethod}->{oid}\.(.*)$/); my $instance = $1; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_wlsxUserEntry}, instance => $instance); - my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{nUserApBSSID}->{oid}}, instance => $instance); + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_wlsxUserEntry}, instance => $instance); + my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{nUserApBSSID}->{oid}}, instance => $instance); # security next if (!defined($result2->{nUserApBSSID})); @@ -408,12 +235,14 @@ sub manage_selection { $map_ap{$bssid}->{ip} !~ /$self->{option_results}->{filter_ip_address}/); next if (defined($self->{option_results}->{filter_essid}) && $self->{option_results}->{filter_essid} ne '' && $map_ap{$bssid}->{essid} !~ /$self->{option_results}->{filter_essid}/); + next if (defined($self->{option_results}->{filter_bssid}) && $self->{option_results}->{filter_bssid} ne '' && + $bssid !~ /$self->{option_results}->{filter_bssid}/); - $self->{ap_selected}->{$bssid} = { users => 0, bssid => $bssid } if (!defined($self->{ap_selected}->{$bssid})); - $self->{ap_selected}->{$bssid}->{users}++; + $self->{ap}->{$bssid} = { users => 0, bssid => $bssid } if (!defined($self->{ap}->{$bssid})); + $self->{ap}->{$bssid}->{users}++; - $self->{essid_selected}->{$map_ap{$bssid}->{essid}} = { users => 0, essid => $map_ap{$bssid}->{essid} } if (!defined($self->{essid_selected}->{$map_ap{$bssid}->{essid}})); - $self->{essid_selected}->{$map_ap{$bssid}->{essid}}->{users}++; + $self->{essid}->{$map_ap{$bssid}->{essid}} = { users => 0, essid => $map_ap{$bssid}->{essid} } if (!defined($self->{essid}->{$map_ap{$bssid}->{essid}})); + $self->{essid}->{$map_ap{$bssid}->{essid}}->{users}++; $self->{global}->{total}++; $self->{global}->{'total_' . $result->{nUserAuthenticationMethod}}++; @@ -439,13 +268,15 @@ Check total users connected. Threshold warning. Can be: 'total', 'total-none', 'total-other', 'total-web', -'total-dot1x', 'total-vpn', 'total-mac', 'avg-connection-time' (seconds). +'total-dot1x', 'total-vpn', 'total-mac', 'avg-connection-time' (seconds), +'total-ap', 'total-essid'. =item B<--critical-*> Threshold critical. Can be: 'total', 'total-none', 'total-other', 'total-web', -'total-dot1x', 'total-vpn', 'total-mac', 'avg-connection-time' (seconds). +'total-dot1x', 'total-vpn', 'total-mac', 'avg-connection-time' (seconds), +'total-ap', 'total-essid'. =item B<--filter-ip-address> @@ -455,6 +286,10 @@ Filter by ip address (regexp can be used). Filter by ESSID (regexp can be used). +=item B<--filter-bssid> + +Filter by BSSID (regexp can be used). + =back =cut From 58d93a13cdd5ee1b193afee1a908ea4c1b20cea4 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Fri, 22 Jul 2016 11:59:17 +0200 Subject: [PATCH 300/346] fix option --- centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm index f9cac0524..bb85880f9 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apusers.pm @@ -154,7 +154,7 @@ sub new { $options{options}->add_options(arguments => { "filter-ip-address:s" => { name => 'filter_ip_address' }, - "filter_bssid:s" => { name => 'filter_bssid' }, + "filter-bssid:s" => { name => 'filter_bssid' }, "filter-essid:s" => { name => 'filter_essid' }, }); From 6cfffee1606491e7515a42d560f19a54b56c17b3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 26 Jul 2016 14:23:59 +0200 Subject: [PATCH 301/346] + Fix #451 --- .../powershell/dell/compellent/volumeusage.pm | 20 +++++++++++++++---- .../dell/compellent/local/mode/volumeusage.pm | 16 ++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm b/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm index fc06d1a84..c8bd176e0 100644 --- a/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm +++ b/centreon-plugins/centreon/common/powershell/dell/compellent/volumeusage.pm @@ -53,11 +53,17 @@ Function display_volume_information { '; } - $ps .= ' + $ps .= ' foreach ($sc in $storageCenters) { $volumeList = Get-DellScVolume -ConnectionName $connName -StorageCenter $sc foreach ($vol in $volumeList) { - $volusage = Get-DellScVolumeStorageUsageAssociation -ConnectionName $connName -Instance $vol +'; + if (defined($options{filter_vol}) && $options{filter_vol} ne '') { + $ps .= 'if (-Not ($vol -match "' . $options{filter_vol} . '")) { continue } +'; + } + + $ps .= '$volusage = Get-DellScVolumeStorageUsageAssociation -ConnectionName $connName -Instance $vol $usage = Get-DellScVolumeStorageUsage -ConnectionName $connName -Instance $volusage write-host ("[sc={0}]" -f $sc.Name) -NoNewline @@ -69,8 +75,14 @@ Function display_volume_information { write-host ("[totalDiskSpace={0}]" -f $usage.TotalDiskSpace.GetByteSize()) -NoNewline write-host ("[replaySpace={0}]" -f $usage.replaySpace.GetByteSize()) } - - $diskList = Get-DellScDisk -ConnectionName $connName -StorageCenter $sc +'; + + if (defined($options{filter_vol}) && $options{filter_vol} ne '') { + $ps .= 'continue +'; + } + + $ps .= '$diskList = Get-DellScDisk -ConnectionName $connName -StorageCenter $sc foreach ($disk in $diskList) { $diskusage = Get-DellScDiskStorageUsageAssociation -ConnectionName $connName -Instance $disk $usage = Get-DellScDiskStorageUsage -ConnectionName $connName -Instance $diskusage diff --git a/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm index 8da5629ab..b7062968f 100644 --- a/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm +++ b/centreon-plugins/storage/dell/compellent/local/mode/volumeusage.pm @@ -31,7 +31,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'sc', type => 1, cb_prefix_output => 'prefix_sc_output', message_multiple => 'All storage centers are ok' }, + { name => 'sc', type => 1, cb_prefix_output => 'prefix_sc_output', message_multiple => 'All storage centers are ok', cb_init => 'sc_init' }, { name => 'volume', type => 1, cb_prefix_output => 'prefix_volume_output', message_multiple => 'All volumes are ok' } ]; $self->{maps_counters}->{sc} = [ @@ -89,6 +89,15 @@ sub prefix_volume_output { return "Volume '" . $options{instance_value}->{display} . "' "; } +sub sc_init { + my ($self, %options) = @_; + + if (defined($self->{option_results}->{ps_sc_volume}) && $self->{option_results}->{ps_sc_volume} ne '') { + return 1; + } + return 0; +} + my $instance_mode; sub custom_usage_perfdata { @@ -182,6 +191,7 @@ sub new { "no-ps" => { name => 'no_ps' }, "ps-exec-only" => { name => 'ps_exec_only' }, "ps-sc-filter:s" => { name => 'ps_sc_filter' }, + "ps-sc-volume:s" => { name => 'ps_sc_volume' }, "units:s" => { name => 'units', default => '%' }, "free" => { name => 'free' }, }); @@ -310,6 +320,10 @@ Print powershell output. Filter Storage Center (only wilcard '*' can be used. In Powershell). +=item B<--ps-sc-volume> + +Filter Volume Name to display. + =item B<--units> Units of thresholds (Default: '%') ('%', 'B'). From 28ecf259b8bf514c9b1a65076b4c94ef8d674070 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 10:22:02 +0200 Subject: [PATCH 302/346] + fix help --- centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm index 89a1bb718..e36ed7a9e 100644 --- a/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/hardware.pm @@ -145,7 +145,8 @@ Check components. =item B<--component> Which component to check (Default: '.*'). -Can be: 'array', 'drive'. +Can be: 'array', 'drive', 'enclosure', 'enclosurebattery', 'enclosurecanister', +'enclosurepsu', 'host', 'portfc', 'portsas', 'vdisk', 'node', 'quorum', 'mdisk', 'systemstats'. =item B<--filter> From 4c4f0ef65c2d9ff57228c4501a9e8f6970a2c4ac Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 13:56:38 +0200 Subject: [PATCH 303/346] + add voice cisco gateway --- .../network/cisco/vg/snmp/plugin.pm | 50 +++++ .../snmp_standard/mode/isdnusage.pm | 182 ++++++++++++++++++ 2 files changed, 232 insertions(+) create mode 100644 centreon-plugins/network/cisco/vg/snmp/plugin.pm create mode 100644 centreon-plugins/snmp_standard/mode/isdnusage.pm diff --git a/centreon-plugins/network/cisco/vg/snmp/plugin.pm b/centreon-plugins/network/cisco/vg/snmp/plugin.pm new file mode 100644 index 000000000..847817d10 --- /dev/null +++ b/centreon-plugins/network/cisco/vg/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::cisco::vg::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}} = ( + 'interfaces' => 'snmp_standard::mode::interfaces', + 'isdn-usage' => 'snmp_standard::mode::isdnusage', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Cisco Voice Gateway in SNMP. + +=cut diff --git a/centreon-plugins/snmp_standard/mode/isdnusage.pm b/centreon-plugins/snmp_standard/mode/isdnusage.pm new file mode 100644 index 000000000..c99b5d3fa --- /dev/null +++ b/centreon-plugins/snmp_standard/mode/isdnusage.pm @@ -0,0 +1,182 @@ +# +# Copyright 2016 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 snmp_standard::mode::isdnusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'bearer', type => 0 }, + { name => 'isdn', type => 1, cb_prefix_output => 'prefix_isdn_output', message_multiple => 'All isdn channels are ok' } + ]; + + $self->{maps_counters}->{isdn} = [ + { label => 'in-calls', set => { + key_values => [ { name => 'in', diff => 1 }, { name => 'display' } ], + output_template => 'Incoming calls : %s', + perfdatas => [ + { label => 'in_calls', value => 'in_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'out-calls', set => { + key_values => [ { name => 'out', diff => 1 }, { name => 'display' } ], + output_template => 'Outgoing calls : %s', + perfdatas => [ + { label => 'out_calls', value => 'out_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; + $self->{maps_counters}->{bearer} = [ + { label => 'current-calls', set => { + key_values => [ { name => 'active' }, { name => 'total' } ], + output_template => 'Current calls : %s', + perfdatas => [ + { label => 'current_calls', value => 'active_absolute', template => '%s', + min => 0, max => 'total_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + }); + + return $self; +} + +sub prefix_isdn_output { + my ($self, %options) = @_; + + return "ISDN channel '" . $options{instance_value}->{display} . "' "; +} + +my %map_bearer_state = ( + 1 => 'idle', + 2 => 'connecting', + 3 => 'connected', + 4 => 'active', +); +my $mapping = { + isdnSigStatsInCalls => { oid => '.1.3.6.1.2.1.10.20.1.3.3.1.1' }, + isdnSigStatsOutCalls => { oid => '.1.3.6.1.2.1.10.20.1.3.3.1.3' }, +}; + +my $oid_isdnBearerOperStatus = '.1.3.6.1.2.1.10.20.1.2.1.1.2'; +my $oid_isdnSignalingIfIndex = '.1.3.6.1.2.1.10.20.1.3.2.1.2'; +my $oid_isdnSignalingStatsEntry = '.1.3.6.1.2.1.10.20.1.3.3.1'; +my $oid_ifDescr = '.1.3.6.1.2.1.2.2.1.2'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{isdn} = {}; + $self->{bearer} = { active => 0, total => 0 }; + my $snmp_result = $options{snmp}->get_multiple_table(oids => [ + { oid => $oid_isdnBearerOperStatus }, + { oid => $oid_isdnSignalingIfIndex }, + { oid => $oid_isdnSignalingStatsEntry }, + ], + nothing_quit => 1); + + # Get interface name + foreach my $oid (keys %{$snmp_result->{$oid_isdnSignalingIfIndex}}) { + $options{snmp}->load(oids => [$oid_ifDescr], instances => [$snmp_result->{$oid_isdnSignalingIfIndex}->{$oid}]); + } + my $result_ifdesc = $options{snmp}->get_leef(nothing_quit => 1); + + foreach my $oid (keys %{$snmp_result->{$oid_isdnSignalingIfIndex}}) { + $oid =~ /^$oid_isdnSignalingIfIndex\.(.*)/; + my $instance = $1; + my $display = $result_ifdesc->{$oid_ifDescr . '.' . $snmp_result->{$oid_isdnSignalingIfIndex}->{$oid_isdnSignalingIfIndex . '.' . $instance}}; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $display !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $display . "': no matching filter name.", debug => 1); + next; + } + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result->{$oid_isdnSignalingStatsEntry}, instance => $instance); + $self->{isdn}->{$instance} = { in => $result->{isdnSigStatsInCalls}, out => $result->{isdnSigStatsOutCalls}, + display => $display }; + } + + foreach my $oid (keys %{$snmp_result->{$oid_isdnBearerOperStatus}}) { + my $status = defined($map_bearer_state{$snmp_result->{$oid_isdnBearerOperStatus}->{$oid}}) ? + $map_bearer_state{$snmp_result->{$oid_isdnBearerOperStatus}->{$oid}} : 'unknown'; + $self->{bearer}->{total}++; + $self->{bearer}->{active}++ if ($status =~ /active/); + } + + $self->{cache_name} = "isdn_usage_" . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); +} + +1; + +__END__ + +=head1 MODE + +Check ISDN usages (ISDN-MIB). + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^current-calls$' + +=item B<--filter-name> + +Filter by name (regexp can be used). + +=item B<--warning-*> + +Threshold warning. +Can be: 'in-calls', 'out-calls', 'current-calls'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'in-calls', 'out-calls', 'current-calls'. + +=back + +=cut From dd764be93dd70050b46143af46dfe323f7843079 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 14:09:24 +0200 Subject: [PATCH 304/346] + remove useless lines --- .../apps/activedirectory/local/plugin.pm | 1 - .../apps/activedirectory/wsman/plugin.pm | 1 - .../apps/apache/serverstatus/plugin.pm | 1 - centreon-plugins/apps/apcupsd/local/plugin.pm | 1 - centreon-plugins/apps/bluemind/plugin.pm | 1 - .../apps/centreon/local/plugin.pm | 1 - .../apps/centreon/map/jmx/mode/gates.pm | 1 - .../apps/centreon/map/jmx/mode/sessions.pm | 1 - .../apps/centreon/map/jmx/plugin.pm | 1 - centreon-plugins/apps/checkmyws/plugin.pm | 1 - centreon-plugins/apps/citrix/local/plugin.pm | 1 - centreon-plugins/apps/elasticsearch/plugin.pm | 1 - .../apps/exchange/2010/local/plugin.pm | 1 - centreon-plugins/apps/github/plugin.pm | 1 - centreon-plugins/apps/hddtemp/local/plugin.pm | 1 - .../apps/hddtemp/remote/plugin.pm | 1 - centreon-plugins/apps/iis/local/plugin.pm | 1 - centreon-plugins/apps/iis/wsman/plugin.pm | 1 - .../apps/java/peoplesoft/jmx/plugin.pm | 1 - .../apps/java/weblogic/jmx/plugin.pm | 1 - centreon-plugins/apps/jenkins/plugin.pm | 1 - centreon-plugins/apps/kayako/api/plugin.pm | 1 - centreon-plugins/apps/lmsensors/mode/fan.pm | 1 - centreon-plugins/apps/lmsensors/mode/misc.pm | 1 - .../apps/lmsensors/mode/temperature.pm | 1 - .../apps/lmsensors/mode/voltage.pm | 1 - centreon-plugins/apps/lmsensors/plugin.pm | 1 - .../apps/lotus/snmp/mode/mailstate.pm | 1 - .../apps/lotus/snmp/mode/mailtime.pm | 1 - .../lotus/snmp/mode/serveravailability.pm | 1 - .../lotus/snmp/mode/servertransactions.pm | 1 - .../apps/lotus/snmp/mode/usersessions.pm | 1 - centreon-plugins/apps/lotus/snmp/plugin.pm | 1 - centreon-plugins/apps/msmq/local/plugin.pm | 1 - .../apps/nginx/serverstatus/plugin.pm | 1 - .../apps/pacemaker/local/plugin.pm | 1 - .../apps/pfsense/snmp/mode/blockedpackets.pm | 1 - .../pfsense/snmp/mode/memorydroppedpackets.pm | 1 - .../apps/pfsense/snmp/mode/runtime.pm | 1 - centreon-plugins/apps/pfsense/snmp/plugin.pm | 1 - centreon-plugins/apps/php/apc/web/plugin.pm | 1 - centreon-plugins/apps/php/fpm/web/plugin.pm | 1 - .../apps/protocols/bgp/4/mode/bgppeerstate.pm | 1 - .../apps/protocols/bgp/4/plugin.pm | 1 - .../apps/protocols/dhcp/plugin.pm | 1 - centreon-plugins/apps/protocols/dns/plugin.pm | 1 - centreon-plugins/apps/protocols/ftp/plugin.pm | 1 - .../apps/protocols/http/plugin.pm | 1 - .../apps/protocols/imap/plugin.pm | 1 - .../apps/protocols/jmx/mode/numericvalue.pm | 1 - centreon-plugins/apps/protocols/jmx/plugin.pm | 1 - .../apps/protocols/ldap/plugin.pm | 1 - centreon-plugins/apps/protocols/ntp/plugin.pm | 1 - .../apps/protocols/radius/plugin.pm | 1 - .../apps/protocols/smtp/plugin.pm | 1 - centreon-plugins/apps/protocols/tcp/plugin.pm | 1 - centreon-plugins/apps/protocols/udp/plugin.pm | 1 - .../apps/protocols/x509/plugin.pm | 1 - centreon-plugins/apps/rrdcached/plugin.pm | 1 - centreon-plugins/apps/selenium/plugin.pm | 1 - centreon-plugins/apps/tomcat/jmx/plugin.pm | 1 - centreon-plugins/apps/tomcat/web/plugin.pm | 1 - centreon-plugins/apps/varnish/local/plugin.pm | 1 - .../apps/vmware/connector/plugin.pm | 1 - centreon-plugins/apps/vmware/wsman/plugin.pm | 1 - .../apps/voip/asterisk/remote/plugin.pm | 1 - .../voip/asterisk/snmp/mode/activecalls.pm | 1 - .../voip/asterisk/snmp/mode/externalcalls.pm | 1 - .../apps/voip/asterisk/snmp/plugin.pm | 1 - .../cisco/meetingplace/mode/audiolicenses.pm | 1 - .../cisco/meetingplace/mode/audioports.pm | 1 - .../cisco/meetingplace/mode/videolicenses.pm | 1 - .../cisco/meetingplace/mode/videoports.pm | 1 - .../apps/voip/cisco/meetingplace/plugin.pm | 1 - .../common/airespace/snmp/mode/cpu.pm | 1 - .../common/airespace/snmp/mode/memory.pm | 1 - .../common/aruba/snmp/mode/apconnections.pm | 1 - .../centreon/common/aruba/snmp/mode/cpu.pm | 1 - .../centreon/common/aruba/snmp/mode/memory.pm | 1 - .../common/aruba/snmp/mode/storage.pm | 1 - .../cisco/smallbusiness/snmp/mode/cpu.pm | 1 - .../common/cisco/standard/snmp/mode/cpu.pm | 1 - .../cisco/standard/snmp/mode/environment.pm | 1 - .../common/cisco/standard/snmp/mode/hsrp.pm | 1 - .../common/cisco/standard/snmp/mode/memory.pm | 1 - .../cisco/standard/snmp/mode/memoryflash.pm | 1 - .../common/cisco/standard/snmp/mode/stack.pm | 1 - .../powerconnect3000/mode/globalstatus.pm | 1 - .../centreon/common/fastpath/mode/cpu.pm | 1 - .../centreon/common/fastpath/mode/memory.pm | 1 - .../fortinet/fortigate/mode/clusterstatus.pm | 1 - .../common/fortinet/fortigate/mode/cpu.pm | 1 - .../common/fortinet/fortigate/mode/disk.pm | 1 - .../fortinet/fortigate/mode/hardware.pm | 1 - .../fortinet/fortigate/mode/ipsstats.pm | 1 - .../fortigate/mode/listvirtualdomains.pm | 2 - .../common/fortinet/fortigate/mode/memory.pm | 1 - .../fortinet/fortigate/mode/sessions.pm | 1 - .../common/fortinet/fortigate/mode/virus.pm | 1 - .../centreon/common/radlan/mode/cpu.pm | 1 - .../common/radlan/mode/environment.pm | 1 - centreon-plugins/centreon/plugins/output.pm | 1 - centreon-plugins/cloud/docker/plugin.pm | 1 - centreon-plugins/database/firebird/plugin.pm | 1 - .../database/informix/mode/listdatabases.pm | 1 - .../database/informix/mode/listdbspaces.pm | 1 - centreon-plugins/database/informix/plugin.pm | 1 - centreon-plugins/database/mssql/plugin.pm | 1 - centreon-plugins/database/mysql/plugin.pm | 1 - .../database/postgres/mode/listdatabases.pm | 1 - centreon-plugins/database/postgres/plugin.pm | 1 - centreon-plugins/example/mode/getvalue.pm | 1 - centreon-plugins/example/plugin_command.pm | 1 - centreon-plugins/example/plugin_custom.pm | 1 - centreon-plugins/example/plugin_snmp.pm | 1 - .../hardware/ats/apc/mode/entity.pm | 1 - .../hardware/ats/apc/mode/input.pm | 397 +++++++++--------- centreon-plugins/hardware/ats/apc/mode/psu.pm | 1 - .../hardware/ats/apc/mode/source.pm | 1 - centreon-plugins/hardware/ats/apc/plugin.pm | 1 - .../hardware/pdu/apc/snmp/plugin.pm | 1 - .../hardware/pdu/eaton/mode/group.pm | 1 - .../hardware/pdu/eaton/mode/outlet.pm | 1 - centreon-plugins/hardware/pdu/eaton/plugin.pm | 1 - .../hardware/pdu/raritan/snmp/plugin.pm | 1 - .../standard/rfc3805/mode/coverstatus.pm | 1 - .../standard/rfc3805/mode/markerimpression.pm | 1 - .../standard/rfc3805/mode/markersupply.pm | 1 - .../standard/rfc3805/mode/papertray.pm | 1 - .../printers/standard/rfc3805/plugin.pm | 1 - .../sensors/sensorip/snmp/mode/sensors.pm | 1 - .../hardware/sensors/sensorip/snmp/plugin.pm | 1 - .../sensors/sensormetrix/em01/web/plugin.pm | 1 - .../sensorgateway/snmp/mode/sensors.pm | 1 - .../serverscheck/sensorgateway/snmp/plugin.pm | 1 - .../sensors/temperhum/local/plugin.pm | 1 - .../server/cisco/ucs/mode/auditlogs.pm | 1 - .../hardware/server/cisco/ucs/mode/faults.pm | 1 - .../server/cisco/ucs/mode/serviceprofile.pm | 1 - .../hardware/server/cisco/ucs/plugin.pm | 1 - .../server/dell/cmc/snmp/mode/hardware.pm | 1 - .../hardware/server/dell/cmc/snmp/plugin.pm | 1 - .../dell/idrac/snmp/mode/globalstatus.pm | 1 - .../hardware/server/dell/idrac/snmp/plugin.pm | 1 - .../dell/openmanage/snmp/mode/hardware.pm | 1 - .../server/dell/openmanage/snmp/plugin.pm | 1 - .../hp/bladechassis/snmp/mode/hardware.pm | 1 - .../server/hp/bladechassis/snmp/plugin.pm | 1 - .../hp/proliant/snmp/mode/globalstatus.pm | 1 - .../server/hp/proliant/snmp/mode/hardware.pm | 1 - .../server/hp/proliant/snmp/plugin.pm | 1 - .../server/ibm/bladecenter/snmp/plugin.pm | 1 - .../hardware/server/ibm/hmc/ssh/plugin.pm | 1 - .../mgmt_cards/imm/snmp/mode/environment.pm | 1 - .../ibm/mgmt_cards/imm/snmp/mode/eventlog.pm | 1 - .../server/ibm/mgmt_cards/imm/snmp/plugin.pm | 1 - .../hardware/server/sun/mgmt_cards/plugin.pm | 1 - .../server/sun/mseries/mode/domains.pm | 1 - .../server/sun/mseries/mode/hardware.pm | 1 - .../hardware/server/sun/mseries/plugin.pm | 1 - .../hardware/server/sun/sfxxk/plugin.pm | 1 - .../hardware/ups/apc/snmp/plugin.pm | 1 - .../ups/mge/snmp/mode/batterystatus.pm | 1 - .../hardware/ups/mge/snmp/mode/environment.pm | 1 - .../hardware/ups/mge/snmp/mode/inputlines.pm | 1 - .../hardware/ups/mge/snmp/mode/outputlines.pm | 1 - .../ups/mge/snmp/mode/outputsource.pm | 1 - .../hardware/ups/mge/snmp/plugin.pm | 1 - .../ups/powerware/snmp/mode/alarms.pm | 1 - .../ups/powerware/snmp/mode/batterystatus.pm | 1 - .../ups/powerware/snmp/mode/environment.pm | 1 - .../ups/powerware/snmp/mode/inputlines.pm | 1 - .../ups/powerware/snmp/mode/outputlines.pm | 1 - .../ups/powerware/snmp/mode/outputsource.pm | 1 - .../hardware/ups/powerware/snmp/plugin.pm | 1 - .../ups/standard/rfc1628/snmp/mode/alarms.pm | 1 - .../rfc1628/snmp/mode/batterystatus.pm | 1 - .../standard/rfc1628/snmp/mode/outputlines.pm | 1 - .../rfc1628/snmp/mode/outputsource.pm | 1 - .../ups/standard/rfc1628/snmp/plugin.pm | 1 - .../network/alcatel/common/mode/cpu.pm | 1 - .../alcatel/common/mode/flashmemory.pm | 1 - .../network/alcatel/common/mode/hardware.pm | 1 - .../network/alcatel/common/mode/memory.pm | 1 - .../network/alcatel/omniswitch/6850/plugin.pm | 1 - centreon-plugins/network/arkoon/plugin.pm | 1 - .../network/aruba/standard/snmp/plugin.pm | 1 - .../network/atrica/snmp/plugin.pm | 1 - .../bluecoat/snmp/mode/clientconnections.pm | 1 - .../bluecoat/snmp/mode/clienttraffic.pm | 1 - .../network/bluecoat/snmp/mode/cpu.pm | 1 - .../network/bluecoat/snmp/mode/disk.pm | 1 - .../network/bluecoat/snmp/mode/memory.pm | 1 - .../bluecoat/snmp/mode/serverconnections.pm | 1 - .../network/bluecoat/snmp/plugin.pm | 1 - centreon-plugins/network/brocade/mode/cpu.pm | 1 - .../network/brocade/mode/hardware.pm | 1 - .../network/brocade/mode/memory.pm | 1 - centreon-plugins/network/brocade/plugin.pm | 1 - .../network/checkpoint/mode/connections.pm | 1 - .../network/checkpoint/mode/cpu.pm | 1 - .../network/checkpoint/mode/hastate.pm | 1 - .../network/checkpoint/mode/memory.pm | 1 - centreon-plugins/network/checkpoint/plugin.pm | 1 - .../network/cisco/WaaS/mode/sessions.pm | 1 - centreon-plugins/network/cisco/WaaS/plugin.pm | 1 - .../network/cisco/asa/mode/failover.pm | 1 - centreon-plugins/network/cisco/asa/plugin.pm | 1 - .../cisco/ironport/snmp/mode/memory.pm | 1 - .../network/cisco/ironport/snmp/plugin.pm | 1 - .../smallbusiness/standard/snmp/plugin.pm | 1 - .../network/cisco/standard/snmp/plugin.pm | 1 - .../network/cisco/wlc/snmp/plugin.pm | 1 - .../common/mode/certificatesexpire.pm | 1 - .../citrix/netscaler/common/mode/cpu.pm | 1 - .../citrix/netscaler/common/mode/hastate.pm | 1 - .../citrix/netscaler/common/mode/health.pm | 1 - .../netscaler/common/mode/listvservers.pm | 2 - .../citrix/netscaler/common/mode/memory.pm | 1 - .../citrix/netscaler/common/mode/storage.pm | 1 - .../netscaler/common/mode/vserverstatus.pm | 1 - .../citrix/netscaler/mpx8000/plugin.pm | 1 - centreon-plugins/network/dell/6200/plugin.pm | 1 - centreon-plugins/network/dell/n4000/plugin.pm | 1 - .../network/dell/sseries/snmp/plugin.pm | 1 - .../network/digi/portserverts/snmp/plugin.pm | 1 - .../network/digi/standard/snmp/mode/cpu.pm | 1 - .../network/digi/standard/snmp/mode/memory.pm | 1 - .../network/dlink/dgs3100/snmp/mode/cpu.pm | 1 - .../network/dlink/dgs3100/snmp/plugin.pm | 1 - .../network/dlink/standard/snmp/mode/cpu.pm | 1 - .../network/dlink/standard/snmp/plugin.pm | 1 - .../network/extreme/snmp/mode/stack.pm | 1 - .../network/extreme/snmp/plugin.pm | 1 - .../network/f5/bigip/mode/listnodes.pm | 2 - .../network/f5/bigip/mode/listpools.pm | 2 - .../f5/bigip/mode/listvirtualservers.pm | 2 - centreon-plugins/network/f5/bigip/plugin.pm | 1 - .../network/fortinet/fortigate/plugin.pm | 1 - centreon-plugins/network/fritzbox/plugin.pm | 1 - centreon-plugins/network/h3c/snmp/mode/cpu.pm | 1 - .../network/h3c/snmp/mode/memory.pm | 1 - centreon-plugins/network/h3c/snmp/plugin.pm | 1 - .../hirschmann/standard/snmp/mode/cpu.pm | 1 - .../hirschmann/standard/snmp/mode/memory.pm | 1 - .../standard/snmp/mode/processcount.pm | 1 - .../hirschmann/standard/snmp/plugin.pm | 1 - .../network/hp/procurve/mode/cpu.pm | 1 - .../network/hp/procurve/mode/memory.pm | 1 - .../network/hp/procurve/plugin.pm | 1 - .../network/juniper/common/ive/mode/cpu.pm | 1 - .../network/juniper/common/ive/mode/disk.pm | 1 - .../juniper/common/ive/mode/logfile.pm | 1 - .../juniper/common/junos/mode/cpsessions.pm | 1 - .../common/junos/mode/cpuforwarding.pm | 1 - .../juniper/common/junos/mode/cpurouting.pm | 1 - .../juniper/common/junos/mode/flowsessions.pm | 1 - .../common/junos/mode/memoryforwarding.pm | 1 - .../common/junos/mode/memoryrouting.pm | 1 - .../juniper/common/screenos/mode/cpu.pm | 1 - .../juniper/common/screenos/mode/memory.pm | 1 - centreon-plugins/network/juniper/ex/plugin.pm | 1 - .../network/juniper/ggsn/mode/apnstats.pm | 1 - .../network/juniper/ggsn/mode/globalstats.pm | 1 - .../network/juniper/ggsn/plugin.pm | 1 - .../juniper/mag/mode/bladetemperature.pm | 1 - .../network/juniper/mag/plugin.pm | 1 - .../network/juniper/mseries/plugin.pm | 1 - centreon-plugins/network/juniper/sa/plugin.pm | 1 - .../network/juniper/srx/plugin.pm | 1 - .../network/juniper/ssg/plugin.pm | 1 - .../network/juniper/trapeze/snmp/plugin.pm | 1 - .../network/netasq/snmp/mode/vpnstatus.pm | 1 - .../network/netasq/snmp/plugin.pm | 1 - .../network/oneaccess/snmp/mode/cpu.pm | 1 - .../network/oneaccess/snmp/mode/memory.pm | 1 - .../network/oneaccess/snmp/plugin.pm | 1 - .../paloalto/snmp/mode/clusterstatus.pm | 1 - .../network/paloalto/snmp/mode/panorama.pm | 1 - .../network/paloalto/snmp/mode/sessions.pm | 1 - .../network/paloalto/snmp/plugin.pm | 1 - .../network/radware/alteon/5224/plugin.pm | 1 - .../network/radware/alteon/common/mode/cpu.pm | 1 - .../radware/alteon/common/mode/hardware.pm | 1 - .../radware/alteon/common/mode/memory.pm | 1 - .../network/redback/snmp/mode/cpu.pm | 1 - .../network/redback/snmp/plugin.pm | 1 - .../steelhead/snmp/mode/bwoptimization.pm | 1 - .../steelhead/snmp/mode/bwpassthrough.pm | 1 - .../steelhead/snmp/mode/connections.pm | 1 - .../steelhead/snmp/mode/diskutilization.pm | 1 - .../riverbed/steelhead/snmp/mode/health.pm | 1 - .../steelhead/snmp/mode/loadaverage.pm | 1 - .../steelhead/snmp/mode/servicestatus.pm | 1 - .../steelhead/snmp/mode/serviceuptime.pm | 1 - .../steelhead/snmp/mode/temperature.pm | 1 - .../network/riverbed/steelhead/snmp/plugin.pm | 1 - .../network/ruggedcom/mode/errors.pm | 1 - .../network/ruggedcom/mode/hardware.pm | 1 - .../network/ruggedcom/mode/memory.pm | 1 - .../network/ruggedcom/mode/temperature.pm | 1 - centreon-plugins/network/ruggedcom/plugin.pm | 1 - .../network/securactive/mode/bca.pm | 1 - .../network/securactive/mode/bcn.pm | 1 - .../network/securactive/mode/listbca.pm | 2 - .../network/securactive/mode/listbcn.pm | 2 - .../network/securactive/plugin.pm | 1 - centreon-plugins/network/sonus/sbc/plugin.pm | 1 - .../stonesoft/snmp/mode/clusterload.pm | 1 - .../stonesoft/snmp/mode/clusterstate.pm | 1 - .../stonesoft/snmp/mode/connections.pm | 1 - .../network/stonesoft/snmp/mode/cpu.pm | 1 - .../stonesoft/snmp/mode/droppedpackets.pm | 1 - .../network/stonesoft/snmp/mode/memory.pm | 1 - .../stonesoft/snmp/mode/rejectedpackets.pm | 1 - .../network/stonesoft/snmp/mode/storage.pm | 1 - .../network/stonesoft/snmp/plugin.pm | 1 - .../network/ucopia/wlc/snmp/plugin.pm | 1 - centreon-plugins/os/aix/local/plugin.pm | 1 - centreon-plugins/os/aix/snmp/mode/swap.pm | 1 - centreon-plugins/os/aix/snmp/plugin.pm | 1 - .../os/freebsd/snmp/mode/memory.pm | 1 - centreon-plugins/os/freebsd/snmp/plugin.pm | 1 - .../os/linux/local/mode/connections.pm | 1 - centreon-plugins/os/linux/local/plugin.pm | 1 - centreon-plugins/os/linux/snmp/plugin.pm | 1 - centreon-plugins/os/solaris/local/plugin.pm | 1 - centreon-plugins/os/solaris/snmp/plugin.pm | 1 - centreon-plugins/os/windows/local/plugin.pm | 1 - .../os/windows/snmp/mode/memory.pm | 1 - .../os/windows/snmp/mode/service.pm | 1 - centreon-plugins/os/windows/snmp/mode/swap.pm | 1 - centreon-plugins/os/windows/snmp/plugin.pm | 1 - centreon-plugins/os/windows/wsman/plugin.pm | 1 - centreon-plugins/snmp_standard/mode/cpu.pm | 1 - .../snmp_standard/mode/cpudetailed.pm | 1 - .../snmp_standard/mode/diskusage.pm | 1 - .../snmp_standard/mode/dynamiccommand.pm | 1 - .../snmp_standard/mode/hardwaredevice.pm | 1 - .../mode/hardwarefibrealliance.pm | 1 - .../snmp_standard/mode/listdiskspath.pm | 2 - .../snmp_standard/mode/liststorages.pm | 2 - .../snmp_standard/mode/loadaverage.pm | 1 - centreon-plugins/snmp_standard/mode/memory.pm | 1 - centreon-plugins/snmp_standard/mode/ntp.pm | 1 - .../snmp_standard/mode/numericvalue.pm | 1 - .../snmp_standard/mode/printererror.pm | 1 - .../snmp_standard/mode/processcount.pm | 1 - .../snmp_standard/mode/spanningtree.pm | 1 - .../snmp_standard/mode/storage.pm | 1 - centreon-plugins/snmp_standard/mode/swap.pm | 1 - centreon-plugins/snmp_standard/mode/tcpcon.pm | 1 - centreon-plugins/snmp_standard/plugin.pm | 1 - .../storage/dell/MD3000/cli/plugin.pm | 1 - .../storage/dell/TL2000/mode/globalstatus.pm | 1 - .../storage/dell/TL2000/plugin.pm | 1 - .../dell/equallogic/snmp/mode/arraystats.pm | 1 - .../dell/equallogic/snmp/mode/diskusage.pm | 1 - .../dell/equallogic/snmp/mode/hardware.pm | 1 - .../dell/equallogic/snmp/mode/poolusage.pm | 1 - .../storage/dell/equallogic/snmp/plugin.pm | 1 - .../storage/dell/ml6000/snmp/plugin.pm | 1 - .../storage/emc/DataDomain/mode/filesystem.pm | 1 - .../storage/emc/DataDomain/plugin.pm | 1 - .../storage/emc/celerra/local/plugin.pm | 1 - .../storage/emc/clariion/plugin.pm | 1 - .../storage/emc/recoverypoint/ssh/plugin.pm | 1 - .../storage/emc/vplex/restapi/plugin.pm | 1 - .../storage/emc/xtremio/restapi/plugin.pm | 1 - .../storage/fujitsu/eternus/dx/ssh/plugin.pm | 1 - .../storage/hp/3par/7000/plugin.pm | 1 - .../storage/hp/lefthand/mode/hardware.pm | 1 - .../storage/hp/lefthand/plugin.pm | 1 - .../storage/hp/msa2000/snmp/plugin.pm | 1 - .../storage/hp/msl/snmp/mode/status.pm | 1 - .../storage/hp/msl/snmp/plugin.pm | 1 - .../storage/hp/p2000/xmlapi/plugin.pm | 1 - .../storage/ibm/DS3000/cli/plugin.pm | 1 - .../storage/ibm/DS4000/cli/plugin.pm | 1 - .../storage/ibm/DS5000/cli/plugin.pm | 1 - .../storage/ibm/TS3100/mode/globalstatus.pm | 1 - centreon-plugins/storage/ibm/TS3100/plugin.pm | 1 - .../storage/ibm/TS3200/mode/globalstatus.pm | 1 - centreon-plugins/storage/ibm/TS3200/plugin.pm | 1 - .../netapp/snmp/mode/aggregatestate.pm | 1 - .../storage/netapp/snmp/mode/cpstatistics.pm | 1 - .../storage/netapp/snmp/mode/cpuload.pm | 1 - .../storage/netapp/snmp/mode/diskfailed.pm | 1 - .../storage/netapp/snmp/mode/fan.pm | 1 - .../storage/netapp/snmp/mode/globalstatus.pm | 1 - .../storage/netapp/snmp/mode/listfilesys.pm | 2 - .../storage/netapp/snmp/mode/ndmpsessions.pm | 1 - .../storage/netapp/snmp/mode/nvram.pm | 1 - .../storage/netapp/snmp/mode/partnerstatus.pm | 1 - .../storage/netapp/snmp/mode/psu.pm | 1 - .../storage/netapp/snmp/mode/qtreeusage.pm | 1 - .../storage/netapp/snmp/mode/sharecalls.pm | 1 - .../storage/netapp/snmp/mode/snapmirrorlag.pm | 1 - .../storage/netapp/snmp/mode/snapshotage.pm | 1 - .../storage/netapp/snmp/mode/temperature.pm | 1 - .../storage/netapp/snmp/mode/volumeoptions.pm | 1 - .../storage/netapp/snmp/plugin.pm | 1 - .../storage/panzura/snmp/mode/cpucloud.pm | 1 - .../panzura/snmp/mode/diskusagelocal.pm | 1 - .../storage/panzura/snmp/mode/memory.pm | 1 - .../storage/panzura/snmp/mode/ratios.pm | 1 - .../storage/panzura/snmp/plugin.pm | 1 - .../storage/qnap/snmp/mode/hardware.pm | 1 - .../storage/qnap/snmp/mode/memory.pm | 1 - .../storage/qnap/snmp/mode/volumeusage.pm | 1 - centreon-plugins/storage/qnap/snmp/plugin.pm | 1 - .../storage/synology/snmp/mode/components.pm | 1 - .../storage/synology/snmp/mode/temperature.pm | 1 - .../storage/synology/snmp/mode/ups.pm | 1 - .../storage/synology/snmp/plugin.pm | 1 - .../storage/violin/3000/snmp/plugin.pm | 1 - 416 files changed, 198 insertions(+), 624 deletions(-) diff --git a/centreon-plugins/apps/activedirectory/local/plugin.pm b/centreon-plugins/apps/activedirectory/local/plugin.pm index 918439a2e..b78e18018 100644 --- a/centreon-plugins/apps/activedirectory/local/plugin.pm +++ b/centreon-plugins/apps/activedirectory/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/activedirectory/wsman/plugin.pm b/centreon-plugins/apps/activedirectory/wsman/plugin.pm index 3e1b90591..a04c98062 100644 --- a/centreon-plugins/apps/activedirectory/wsman/plugin.pm +++ b/centreon-plugins/apps/activedirectory/wsman/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/apache/serverstatus/plugin.pm b/centreon-plugins/apps/apache/serverstatus/plugin.pm index cbbf875fa..620407bf4 100644 --- a/centreon-plugins/apps/apache/serverstatus/plugin.pm +++ b/centreon-plugins/apps/apache/serverstatus/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/apcupsd/local/plugin.pm b/centreon-plugins/apps/apcupsd/local/plugin.pm index e8694fa6d..a653bd346 100644 --- a/centreon-plugins/apps/apcupsd/local/plugin.pm +++ b/centreon-plugins/apps/apcupsd/local/plugin.pm @@ -82,7 +82,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/bluemind/plugin.pm b/centreon-plugins/apps/bluemind/plugin.pm index 0947ed956..c9c0bee69 100644 --- a/centreon-plugins/apps/bluemind/plugin.pm +++ b/centreon-plugins/apps/bluemind/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/centreon/local/plugin.pm b/centreon-plugins/apps/centreon/local/plugin.pm index d6fb0eef2..e9b02e138 100644 --- a/centreon-plugins/apps/centreon/local/plugin.pm +++ b/centreon-plugins/apps/centreon/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm b/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm index 250bc2fe6..62bef8224 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/gates.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{connector} = $options{custom}; $self->{request} = [ diff --git a/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm b/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm index 6d8f9052c..f0ae02058 100644 --- a/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm +++ b/centreon-plugins/apps/centreon/map/jmx/mode/sessions.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{connector} = $options{custom}; $self->{request} = [ diff --git a/centreon-plugins/apps/centreon/map/jmx/plugin.pm b/centreon-plugins/apps/centreon/map/jmx/plugin.pm index f9bca3abd..6320d3f82 100644 --- a/centreon-plugins/apps/centreon/map/jmx/plugin.pm +++ b/centreon-plugins/apps/centreon/map/jmx/plugin.pm @@ -27,7 +27,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/checkmyws/plugin.pm b/centreon-plugins/apps/checkmyws/plugin.pm index 1de610a64..ba1b77a53 100644 --- a/centreon-plugins/apps/checkmyws/plugin.pm +++ b/centreon-plugins/apps/checkmyws/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/citrix/local/plugin.pm b/centreon-plugins/apps/citrix/local/plugin.pm index 3ac4781a1..bcb1ea708 100644 --- a/centreon-plugins/apps/citrix/local/plugin.pm +++ b/centreon-plugins/apps/citrix/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/elasticsearch/plugin.pm b/centreon-plugins/apps/elasticsearch/plugin.pm index 945302278..f071b4c2b 100644 --- a/centreon-plugins/apps/elasticsearch/plugin.pm +++ b/centreon-plugins/apps/elasticsearch/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/exchange/2010/local/plugin.pm b/centreon-plugins/apps/exchange/2010/local/plugin.pm index ca9c805e4..22a54fce9 100644 --- a/centreon-plugins/apps/exchange/2010/local/plugin.pm +++ b/centreon-plugins/apps/exchange/2010/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/github/plugin.pm b/centreon-plugins/apps/github/plugin.pm index 0e5f8b7b8..cddc714f6 100644 --- a/centreon-plugins/apps/github/plugin.pm +++ b/centreon-plugins/apps/github/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/hddtemp/local/plugin.pm b/centreon-plugins/apps/hddtemp/local/plugin.pm index 55bc83f8f..58778ed91 100644 --- a/centreon-plugins/apps/hddtemp/local/plugin.pm +++ b/centreon-plugins/apps/hddtemp/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/hddtemp/remote/plugin.pm b/centreon-plugins/apps/hddtemp/remote/plugin.pm index cc01c55e5..6b7dd8c9b 100644 --- a/centreon-plugins/apps/hddtemp/remote/plugin.pm +++ b/centreon-plugins/apps/hddtemp/remote/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; -# $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/iis/local/plugin.pm b/centreon-plugins/apps/iis/local/plugin.pm index f8ce8235d..048aacc4f 100644 --- a/centreon-plugins/apps/iis/local/plugin.pm +++ b/centreon-plugins/apps/iis/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/iis/wsman/plugin.pm b/centreon-plugins/apps/iis/wsman/plugin.pm index c0a9c51a8..f0c9117ce 100644 --- a/centreon-plugins/apps/iis/wsman/plugin.pm +++ b/centreon-plugins/apps/iis/wsman/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm b/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm index cbd6d348d..17a0a233d 100644 --- a/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm +++ b/centreon-plugins/apps/java/peoplesoft/jmx/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/java/weblogic/jmx/plugin.pm b/centreon-plugins/apps/java/weblogic/jmx/plugin.pm index 122b9d8fe..00219ca31 100644 --- a/centreon-plugins/apps/java/weblogic/jmx/plugin.pm +++ b/centreon-plugins/apps/java/weblogic/jmx/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/jenkins/plugin.pm b/centreon-plugins/apps/jenkins/plugin.pm index f7cc92343..dbe2a6fd2 100644 --- a/centreon-plugins/apps/jenkins/plugin.pm +++ b/centreon-plugins/apps/jenkins/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/kayako/api/plugin.pm b/centreon-plugins/apps/kayako/api/plugin.pm index a8c0abcde..65bb80983 100644 --- a/centreon-plugins/apps/kayako/api/plugin.pm +++ b/centreon-plugins/apps/kayako/api/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/lmsensors/mode/fan.pm b/centreon-plugins/apps/lmsensors/mode/fan.pm index c18df7c63..cb6e0a3c0 100644 --- a/centreon-plugins/apps/lmsensors/mode/fan.pm +++ b/centreon-plugins/apps/lmsensors/mode/fan.pm @@ -66,7 +66,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/lmsensors/mode/misc.pm b/centreon-plugins/apps/lmsensors/mode/misc.pm index 34d3c4c11..7e7a663aa 100644 --- a/centreon-plugins/apps/lmsensors/mode/misc.pm +++ b/centreon-plugins/apps/lmsensors/mode/misc.pm @@ -66,7 +66,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/lmsensors/mode/temperature.pm b/centreon-plugins/apps/lmsensors/mode/temperature.pm index 71d51b19d..9151cc5d9 100644 --- a/centreon-plugins/apps/lmsensors/mode/temperature.pm +++ b/centreon-plugins/apps/lmsensors/mode/temperature.pm @@ -66,7 +66,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/lmsensors/mode/voltage.pm b/centreon-plugins/apps/lmsensors/mode/voltage.pm index 3a5e5a6ac..712426a81 100644 --- a/centreon-plugins/apps/lmsensors/mode/voltage.pm +++ b/centreon-plugins/apps/lmsensors/mode/voltage.pm @@ -66,7 +66,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/lmsensors/plugin.pm b/centreon-plugins/apps/lmsensors/plugin.pm index 624752644..8ebc72276 100644 --- a/centreon-plugins/apps/lmsensors/plugin.pm +++ b/centreon-plugins/apps/lmsensors/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm b/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm index 0a7c23d3e..e25d56445 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/mailstate.pm @@ -67,7 +67,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_lnDeadMail = '.1.3.6.1.4.1.334.72.1.1.4.1.0'; diff --git a/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm b/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm index b6fe57131..b82900a8f 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/mailtime.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_lnAverageMailDeliverTime = '.1.3.6.1.4.1.334.72.1.1.4.9.0'; diff --git a/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm b/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm index 8434c54f1..9bd2f7d1c 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/serveravailability.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_lnServerAvailabilityIndex = '.1.3.6.1.4.1.334.72.1.1.6.3.19.0'; diff --git a/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm b/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm index 49392dc9f..3a49a9ffa 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/servertransactions.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_lnServerTransPerMin = '.1.3.6.1.4.1.334.72.1.1.6.3.2.0'; diff --git a/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm b/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm index cabc676d6..c60449e60 100644 --- a/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm +++ b/centreon-plugins/apps/lotus/snmp/mode/usersessions.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_lnServerUsers = '.1.3.6.1.4.1.334.72.1.1.6.3.6.0'; diff --git a/centreon-plugins/apps/lotus/snmp/plugin.pm b/centreon-plugins/apps/lotus/snmp/plugin.pm index 70a99d8ea..6def9b5d1 100644 --- a/centreon-plugins/apps/lotus/snmp/plugin.pm +++ b/centreon-plugins/apps/lotus/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/msmq/local/plugin.pm b/centreon-plugins/apps/msmq/local/plugin.pm index 28694c710..f09174bae 100644 --- a/centreon-plugins/apps/msmq/local/plugin.pm +++ b/centreon-plugins/apps/msmq/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/nginx/serverstatus/plugin.pm b/centreon-plugins/apps/nginx/serverstatus/plugin.pm index 74dbeda13..9f0112d81 100644 --- a/centreon-plugins/apps/nginx/serverstatus/plugin.pm +++ b/centreon-plugins/apps/nginx/serverstatus/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; -# $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/pacemaker/local/plugin.pm b/centreon-plugins/apps/pacemaker/local/plugin.pm index 8d5c56c76..f07c3de64 100644 --- a/centreon-plugins/apps/pacemaker/local/plugin.pm +++ b/centreon-plugins/apps/pacemaker/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm b/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm index d2621b55b..481697e4f 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/blockedpackets.pm @@ -80,7 +80,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm b/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm index 4e10746fa..109655f7b 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/memorydroppedpackets.pm @@ -60,7 +60,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm b/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm index 031ae09ba..d1cc9dc7b 100644 --- a/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm +++ b/centreon-plugins/apps/pfsense/snmp/mode/runtime.pm @@ -58,7 +58,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_pfsenseStatus = '.1.3.6.1.4.1.12325.1.200.1.1.1.0'; diff --git a/centreon-plugins/apps/pfsense/snmp/plugin.pm b/centreon-plugins/apps/pfsense/snmp/plugin.pm index 03a0dd757..5746f623b 100644 --- a/centreon-plugins/apps/pfsense/snmp/plugin.pm +++ b/centreon-plugins/apps/pfsense/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/php/apc/web/plugin.pm b/centreon-plugins/apps/php/apc/web/plugin.pm index c15bb19a3..1415378c4 100644 --- a/centreon-plugins/apps/php/apc/web/plugin.pm +++ b/centreon-plugins/apps/php/apc/web/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/php/fpm/web/plugin.pm b/centreon-plugins/apps/php/fpm/web/plugin.pm index 55b82dd99..fc412c18f 100644 --- a/centreon-plugins/apps/php/fpm/web/plugin.pm +++ b/centreon-plugins/apps/php/fpm/web/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm index ca3d4a6ae..0d10eab70 100644 --- a/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm +++ b/centreon-plugins/apps/protocols/bgp/4/mode/bgppeerstate.pm @@ -89,7 +89,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_bgpPeerTable = '.1.3.6.1.2.1.15.3'; diff --git a/centreon-plugins/apps/protocols/bgp/4/plugin.pm b/centreon-plugins/apps/protocols/bgp/4/plugin.pm index 36b24a42a..ff32f1405 100644 --- a/centreon-plugins/apps/protocols/bgp/4/plugin.pm +++ b/centreon-plugins/apps/protocols/bgp/4/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/dhcp/plugin.pm b/centreon-plugins/apps/protocols/dhcp/plugin.pm index eb4bc0ec4..e25a739f1 100644 --- a/centreon-plugins/apps/protocols/dhcp/plugin.pm +++ b/centreon-plugins/apps/protocols/dhcp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/dns/plugin.pm b/centreon-plugins/apps/protocols/dns/plugin.pm index 6b7dd0a40..f6449f70d 100644 --- a/centreon-plugins/apps/protocols/dns/plugin.pm +++ b/centreon-plugins/apps/protocols/dns/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/ftp/plugin.pm b/centreon-plugins/apps/protocols/ftp/plugin.pm index 11515bb1d..c8bfad271 100644 --- a/centreon-plugins/apps/protocols/ftp/plugin.pm +++ b/centreon-plugins/apps/protocols/ftp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/http/plugin.pm b/centreon-plugins/apps/protocols/http/plugin.pm index 9d6c1f8f0..48ded3c07 100644 --- a/centreon-plugins/apps/protocols/http/plugin.pm +++ b/centreon-plugins/apps/protocols/http/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; -# $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/imap/plugin.pm b/centreon-plugins/apps/protocols/imap/plugin.pm index d8180d099..d10251fad 100644 --- a/centreon-plugins/apps/protocols/imap/plugin.pm +++ b/centreon-plugins/apps/protocols/imap/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm index 00a64d7db..04f24b667 100644 --- a/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm +++ b/centreon-plugins/apps/protocols/jmx/mode/numericvalue.pm @@ -227,7 +227,6 @@ sub find_values { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{connector} = $options{custom}; my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 1); diff --git a/centreon-plugins/apps/protocols/jmx/plugin.pm b/centreon-plugins/apps/protocols/jmx/plugin.pm index 1925b8156..ab813fb9e 100644 --- a/centreon-plugins/apps/protocols/jmx/plugin.pm +++ b/centreon-plugins/apps/protocols/jmx/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/ldap/plugin.pm b/centreon-plugins/apps/protocols/ldap/plugin.pm index 7a2c457e3..7876e15a6 100644 --- a/centreon-plugins/apps/protocols/ldap/plugin.pm +++ b/centreon-plugins/apps/protocols/ldap/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/ntp/plugin.pm b/centreon-plugins/apps/protocols/ntp/plugin.pm index 5ae6e11a5..464104da8 100644 --- a/centreon-plugins/apps/protocols/ntp/plugin.pm +++ b/centreon-plugins/apps/protocols/ntp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/radius/plugin.pm b/centreon-plugins/apps/protocols/radius/plugin.pm index 99d1d9801..bf9a391db 100644 --- a/centreon-plugins/apps/protocols/radius/plugin.pm +++ b/centreon-plugins/apps/protocols/radius/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/smtp/plugin.pm b/centreon-plugins/apps/protocols/smtp/plugin.pm index bb1758635..c0160c212 100644 --- a/centreon-plugins/apps/protocols/smtp/plugin.pm +++ b/centreon-plugins/apps/protocols/smtp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/tcp/plugin.pm b/centreon-plugins/apps/protocols/tcp/plugin.pm index 1a3939b73..b430ee5f3 100644 --- a/centreon-plugins/apps/protocols/tcp/plugin.pm +++ b/centreon-plugins/apps/protocols/tcp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/udp/plugin.pm b/centreon-plugins/apps/protocols/udp/plugin.pm index 54e1a91a4..e7f6d4c52 100644 --- a/centreon-plugins/apps/protocols/udp/plugin.pm +++ b/centreon-plugins/apps/protocols/udp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/protocols/x509/plugin.pm b/centreon-plugins/apps/protocols/x509/plugin.pm index b972e0898..8cea1e568 100644 --- a/centreon-plugins/apps/protocols/x509/plugin.pm +++ b/centreon-plugins/apps/protocols/x509/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/rrdcached/plugin.pm b/centreon-plugins/apps/rrdcached/plugin.pm index d589ce29f..30e6fa135 100644 --- a/centreon-plugins/apps/rrdcached/plugin.pm +++ b/centreon-plugins/apps/rrdcached/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/selenium/plugin.pm b/centreon-plugins/apps/selenium/plugin.pm index f0d299f1d..c35e4b434 100644 --- a/centreon-plugins/apps/selenium/plugin.pm +++ b/centreon-plugins/apps/selenium/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/tomcat/jmx/plugin.pm b/centreon-plugins/apps/tomcat/jmx/plugin.pm index 7f85c5da1..945a2668b 100644 --- a/centreon-plugins/apps/tomcat/jmx/plugin.pm +++ b/centreon-plugins/apps/tomcat/jmx/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/tomcat/web/plugin.pm b/centreon-plugins/apps/tomcat/web/plugin.pm index 4c711e729..dff816934 100644 --- a/centreon-plugins/apps/tomcat/web/plugin.pm +++ b/centreon-plugins/apps/tomcat/web/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/varnish/local/plugin.pm b/centreon-plugins/apps/varnish/local/plugin.pm index ac30a5e17..a5fb9b8b1 100644 --- a/centreon-plugins/apps/varnish/local/plugin.pm +++ b/centreon-plugins/apps/varnish/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; -# $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/vmware/connector/plugin.pm b/centreon-plugins/apps/vmware/connector/plugin.pm index 2791ffa03..0d487db73 100644 --- a/centreon-plugins/apps/vmware/connector/plugin.pm +++ b/centreon-plugins/apps/vmware/connector/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/vmware/wsman/plugin.pm b/centreon-plugins/apps/vmware/wsman/plugin.pm index 7207d6af8..6e99d865d 100644 --- a/centreon-plugins/apps/vmware/wsman/plugin.pm +++ b/centreon-plugins/apps/vmware/wsman/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/voip/asterisk/remote/plugin.pm b/centreon-plugins/apps/voip/asterisk/remote/plugin.pm index e7294c2b8..eb0cc05fc 100644 --- a/centreon-plugins/apps/voip/asterisk/remote/plugin.pm +++ b/centreon-plugins/apps/voip/asterisk/remote/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm b/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm index 0109fcd48..bb0f76135 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/mode/activecalls.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my ($result, $value); diff --git a/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm b/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm index 056987d10..c26fabdc7 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/mode/externalcalls.pm @@ -82,7 +82,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my ($result, $value); diff --git a/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm b/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm index 86aa0a944..93e7e5e5f 100644 --- a/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm +++ b/centreon-plugins/apps/voip/asterisk/snmp/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm index f643671de..d9ca5ddd7 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audiolicenses.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Nombre de ports audio utilise diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm index 32d858469..10bdeff45 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/audioports.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Nombre de ports audio utilise diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm index b3361a63e..892ee52cf 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videolicenses.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Nombre de ports audio utilise diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm index 022c947b6..222248e93 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/mode/videoports.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Nombre de ports video utilise diff --git a/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm b/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm index 6bbf9f658..e27739863 100644 --- a/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm +++ b/centreon-plugins/apps/voip/cisco/meetingplace/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm index ded1c4e09..9d8771648 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_agentCurrentCPUUtilization = '.1.3.6.1.4.1.14179.1.1.3.1.0'; diff --git a/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm b/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm index fc494246d..1c954eff0 100644 --- a/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/airespace/snmp/mode/memory.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_agentTotalMemory = '.1.3.6.1.4.1.14179.1.1.5.2.0'; # in Kbytes diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm index fc41e32cd..d6be2cbc4 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/apconnections.pm @@ -164,7 +164,6 @@ sub check_total { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm index 401db23ff..5cacc48ea 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_wlsxSysExtProcessorEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.13.1'; diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm index 18b577f6e..4db707a45 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_wlsxSysExtMemoryEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.15.1'; diff --git a/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm b/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm index 109574fbf..c18f7ed26 100644 --- a/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm +++ b/centreon-plugins/centreon/common/aruba/snmp/mode/storage.pm @@ -63,7 +63,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_wlsxSysExtStorageEntry = '.1.3.6.1.4.1.14823.2.2.1.2.1.14.1'; diff --git a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm index 842d7e81d..1c38d8562 100644 --- a/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/cisco/smallbusiness/snmp/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rlCpuUtilDuringLastSecond = '.1.3.6.1.4.1.9.6.1.101.1.7.0'; diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm index 2d39da097..ff6a9fd39 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/cpu.pm @@ -160,7 +160,6 @@ sub check_table_cpu { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Cisco IOS Software releases later to 12.0(3)T and prior to 12.2(3.5) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm index 21908824b..0d57fc375 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/environment.pm @@ -191,7 +191,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_entPhysicalDescr = '.1.3.6.1.2.1.47.1.1.1.1.2'; diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm index df8119165..aeeaf0357 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/hsrp.pm @@ -67,7 +67,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $vridout = ''; diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm index 03e72cfbd..91c149e14 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memory.pm @@ -141,7 +141,6 @@ sub check_percent_memory { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_ciscoMemoryPoolEntry = '.1.3.6.1.4.1.9.9.48.1.1.1'; diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm index 612e81fbc..e3ea795a8 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/memoryflash.pm @@ -122,7 +122,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm index 360bc549b..e971e36e0 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/stack.pm @@ -65,7 +65,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cswRingRedundant = '.1.3.6.1.4.1.9.9.500.1.1.3'; diff --git a/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm b/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm index b5ddb43b5..c2199f00a 100644 --- a/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm +++ b/centreon-plugins/centreon/common/dell/powerconnect3000/mode/globalstatus.pm @@ -51,7 +51,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_productStatusGlobalStatus = '.1.3.6.1.4.1.674.10895.3000.1.2.110.1'; diff --git a/centreon-plugins/centreon/common/fastpath/mode/cpu.pm b/centreon-plugins/centreon/common/fastpath/mode/cpu.pm index bb22bba21..588fb1f15 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/cpu.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_agentSwitchCpuProcessTotalUtilization1 = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0'; diff --git a/centreon-plugins/centreon/common/fastpath/mode/memory.pm b/centreon-plugins/centreon/common/fastpath/mode/memory.pm index b550e274d..6d0ea1fcd 100644 --- a/centreon-plugins/centreon/common/fastpath/mode/memory.pm +++ b/centreon-plugins/centreon/common/fastpath/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_agentSwitchCpuProcessMemFree = '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.1.0'; # in KB diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm index f8549a0bd..ab665e677 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/clusterstatus.pm @@ -67,7 +67,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{result} = $self->{snmp}->get_multiple_table(oids => [ diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm index 5eed9649f..b39d18dc0 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/cpu.pm @@ -102,7 +102,6 @@ sub cpu_ha { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $table_oids = [ { oid => $oid_fgProcessorUsage }, { oid => $oid_fgSysCpuUsage } ]; diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm index 4f8f902db..6a06e2986 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/disk.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_fgSysDiskUsage = '.1.3.6.1.4.1.12356.101.4.1.6.0'; # in MB diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm index a3b80a363..697009092 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/hardware.pm @@ -51,7 +51,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_sysDescr = '.1.3.6.1.2.1.1.1.0'; diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm index e0d90f0ce..1f88f7c3c 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/ipsstats.pm @@ -154,7 +154,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm index 9ecb34e83..992bc0161 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/listvirtualdomains.pm @@ -77,7 +77,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -101,7 +100,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm index 6435bce0d..45c1dd18d 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/memory.pm @@ -100,7 +100,6 @@ sub memory_ha { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_fgSystemInfo = '.1.3.6.1.4.1.12356.101.4.1'; diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm index fb2ce5dae..65a2bc4e9 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/sessions.pm @@ -94,7 +94,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_fgSysSesCount = '.1.3.6.1.4.1.12356.101.4.1.8.0'; diff --git a/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm b/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm index 9ff41dda1..127663f97 100644 --- a/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm +++ b/centreon-plugins/centreon/common/fortinet/fortigate/mode/virus.pm @@ -105,7 +105,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/centreon/common/radlan/mode/cpu.pm b/centreon-plugins/centreon/common/radlan/mode/cpu.pm index 05d7b20e5..a142ec6a4 100644 --- a/centreon-plugins/centreon/common/radlan/mode/cpu.pm +++ b/centreon-plugins/centreon/common/radlan/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rlCpuUtilEnable = '.1.3.6.1.4.1.89.1.6.0'; diff --git a/centreon-plugins/centreon/common/radlan/mode/environment.pm b/centreon-plugins/centreon/common/radlan/mode/environment.pm index 27c567ce0..54625eaeb 100644 --- a/centreon-plugins/centreon/common/radlan/mode/environment.pm +++ b/centreon-plugins/centreon/common/radlan/mode/environment.pm @@ -110,7 +110,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # There is a bug with get_leef and snmpv1. diff --git a/centreon-plugins/centreon/plugins/output.pm b/centreon-plugins/centreon/plugins/output.pm index 1243cb1ff..59a76a87a 100644 --- a/centreon-plugins/centreon/plugins/output.pm +++ b/centreon-plugins/centreon/plugins/output.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = {}; bless $self, $class; - # $options->{options} = options object if (!defined($options{options})) { print "Class Output: Need to specify 'options' argument to load.\n"; exit 3; diff --git a/centreon-plugins/cloud/docker/plugin.pm b/centreon-plugins/cloud/docker/plugin.pm index c30bd8bc7..ebb0824a4 100644 --- a/centreon-plugins/cloud/docker/plugin.pm +++ b/centreon-plugins/cloud/docker/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.2'; %{$self->{modes}} = ( diff --git a/centreon-plugins/database/firebird/plugin.pm b/centreon-plugins/database/firebird/plugin.pm index 213943690..623c88362 100644 --- a/centreon-plugins/database/firebird/plugin.pm +++ b/centreon-plugins/database/firebird/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/database/informix/mode/listdatabases.pm b/centreon-plugins/database/informix/mode/listdatabases.pm index 6ffe03d42..c2fc8710d 100644 --- a/centreon-plugins/database/informix/mode/listdatabases.pm +++ b/centreon-plugins/database/informix/mode/listdatabases.pm @@ -88,7 +88,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{sql} = $options{sql}; $self->manage_selection(); diff --git a/centreon-plugins/database/informix/mode/listdbspaces.pm b/centreon-plugins/database/informix/mode/listdbspaces.pm index d20ecb216..696050482 100644 --- a/centreon-plugins/database/informix/mode/listdbspaces.pm +++ b/centreon-plugins/database/informix/mode/listdbspaces.pm @@ -88,7 +88,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{sql} = $options{sql}; $self->manage_selection(); diff --git a/centreon-plugins/database/informix/plugin.pm b/centreon-plugins/database/informix/plugin.pm index a78c1f03b..6d7400e59 100644 --- a/centreon-plugins/database/informix/plugin.pm +++ b/centreon-plugins/database/informix/plugin.pm @@ -30,7 +30,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/database/mssql/plugin.pm b/centreon-plugins/database/mssql/plugin.pm index f36250f06..b6716d359 100644 --- a/centreon-plugins/database/mssql/plugin.pm +++ b/centreon-plugins/database/mssql/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/database/mysql/plugin.pm b/centreon-plugins/database/mysql/plugin.pm index 916f9f133..642a59745 100644 --- a/centreon-plugins/database/mysql/plugin.pm +++ b/centreon-plugins/database/mysql/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/database/postgres/mode/listdatabases.pm b/centreon-plugins/database/postgres/mode/listdatabases.pm index 48d908aeb..90055fb7a 100644 --- a/centreon-plugins/database/postgres/mode/listdatabases.pm +++ b/centreon-plugins/database/postgres/mode/listdatabases.pm @@ -87,7 +87,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{sql} = $options{sql}; $self->manage_selection(); diff --git a/centreon-plugins/database/postgres/plugin.pm b/centreon-plugins/database/postgres/plugin.pm index c72fa27d5..e7cd4e852 100644 --- a/centreon-plugins/database/postgres/plugin.pm +++ b/centreon-plugins/database/postgres/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/example/mode/getvalue.pm b/centreon-plugins/example/mode/getvalue.pm index 8757fdb35..5f0781007 100644 --- a/centreon-plugins/example/mode/getvalue.pm +++ b/centreon-plugins/example/mode/getvalue.pm @@ -62,7 +62,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); diff --git a/centreon-plugins/example/plugin_command.pm b/centreon-plugins/example/plugin_command.pm index 75470b367..ac305263b 100644 --- a/centreon-plugins/example/plugin_command.pm +++ b/centreon-plugins/example/plugin_command.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/example/plugin_custom.pm b/centreon-plugins/example/plugin_custom.pm index 47d862cb0..8bc5bc4ba 100644 --- a/centreon-plugins/example/plugin_custom.pm +++ b/centreon-plugins/example/plugin_custom.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/example/plugin_snmp.pm b/centreon-plugins/example/plugin_snmp.pm index dee41721c..d7636039e 100644 --- a/centreon-plugins/example/plugin_snmp.pm +++ b/centreon-plugins/example/plugin_snmp.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/ats/apc/mode/entity.pm b/centreon-plugins/hardware/ats/apc/mode/entity.pm index 298e71f55..d483d7d01 100644 --- a/centreon-plugins/hardware/ats/apc/mode/entity.pm +++ b/centreon-plugins/hardware/ats/apc/mode/entity.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_atsStatusSwitchStatus = '.1.3.6.1.4.1.318.1.1.8.5.1.10.0'; diff --git a/centreon-plugins/hardware/ats/apc/mode/input.pm b/centreon-plugins/hardware/ats/apc/mode/input.pm index 72cafe03e..1db77790d 100644 --- a/centreon-plugins/hardware/ats/apc/mode/input.pm +++ b/centreon-plugins/hardware/ats/apc/mode/input.pm @@ -1,199 +1,198 @@ -# -# Copyright 2016 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 hardware::ats::apc::mode::input; - -use base qw(centreon::plugins::mode); - -use strict; -use warnings; - -my %oids = ( - '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.3' => { counter => 'voltage', no_present => 0 }, # in mVolt outletVoltage - '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.6' => { counter => 'current', no_present => 0 }, # in mA outletCurrent - '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.9' => { counter => 'power', no_present => 0 }, # in Watt outletWatts -); - -my $oid_inputs = '.1.3.6.1.4.1.318.1.1.8.5.3.3.1'; - -my $maps_counters = { - voltage => { thresholds => { - warning_voltage => { label => 'warning-voltage', exit_value => 'warning' }, - critical_voltage => { label => 'critical-voltage', exit_value => 'critical' }, - }, - output_msg => 'Voltage : %d V', - factor => 1, unit => 'V', - }, - current => { thresholds => { - warning_current => { label => 'warning-current', exit_value => 'warning' }, - critical_current => { label => 'critical-current', exit_value => 'critical' }, - }, - output_msg => 'Current : %d A', - factor => 1, unit => 'A', - }, - power => { thresholds => { - warning_power => { label => 'warning-power', exit_value => 'warning' }, - critical_power => { label => 'critical-power', exit_value => 'critical' }, - }, - output_msg => 'Power : %d W', - factor => 1, unit => 'W', - }, -}; - -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - }); - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - $options{options}->add_options(arguments => { - $maps_counters->{$_}->{thresholds}->{$name}->{label} . ':s' => { name => $name }, - }); - } - } - - $self->{counters_value} = {}; - $self->{instances_done} = {}; - return $self; -} - -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); - - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - if (($self->{perfdata}->threshold_validate(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, value => $self->{option_results}->{$name})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong " . $maps_counters->{$_}->{thresholds}->{$name}->{label} . " threshold '" . $self->{option_results}->{$name} . "'."); - $self->{output}->option_exit(); - } - } - } -} - -sub build_values { - my ($self, %options) = @_; - my $counters_value = {}; - my $instance = undef; - - foreach my $oid (keys %oids) { - #if ($options{current} =~ /^$oid_inputs\.(.*)/) { - if ($options{current} =~ /^$oid\.(.*)/) { - $instance = $1; - #$instance =~ s/1\.1\.3\.//g; - last; - } - } - - # Skip already done - if (!defined($instance) || defined($self->{instances_done}->{$instance})) { - return 0; - } - - $self->{instances_done}->{$instance} = 1; - $self->{counters_value}->{$instance} = {}; - foreach my $oid (keys %oids) { - my $full_oid = $oid . '.' . $instance; - $self->{counters_value}->{$instance}->{$oids{$oid}->{counter}} = defined($options{result}->{$oid . '.' . $instance}) ? $options{result}->{$oid . '.' . $instance} : 0; - } -} - -sub run { - my ($self, %options) = @_; - # $options{snmp} = snmp object - $self->{snmp} = $options{snmp}; - - my $result = $self->{snmp}->get_table(oid => $oid_inputs, nothing_quit => 1); - foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) { - $self->build_values(current => $key, result => $result); - } - - my $num = scalar(keys %{$self->{instances_done}}); - foreach my $instance (keys %{$self->{instances_done}}) { - my $instance_input = $instance; - $instance_input =~ s/(\d+)\.\d+\.\d+/#$1/g; - - my @exits; - foreach (keys %{$maps_counters}) { - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) { - push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]); - } - } - } - - my $exit = $self->{output}->get_most_critical(status => [ @exits ]); - my $extra_label = ''; - $extra_label = '_' . $instance_input if ($num > 1); - - my $str_input = "Input '$instance_input' "; - my $str_append = ''; - foreach (keys %{$maps_counters}) { - next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} <= 0); - - $str_input .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}); - $str_append = ', '; - my ($warning, $critical); - foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { - $warning = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'warning'); - $critical = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'critical'); - } - - $self->{output}->perfdata_add(label => $_ . $extra_label, unit => $maps_counters->{$_}->{unit}, - value => sprintf("%.2f", $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}), - warning => $warning, - critical => $critical); - } - $self->{output}->output_add(severity => $exit, - short_msg => $str_input); - } - - $self->{output}->display(); - $self->{output}->exit(); -} - -1; - -__END__ - -=head1 MODE - -Check Outlet metrics (voltage, current and power). - -=over 8 - -=item B<--warning-*> - -Threshold warning. -Can be: 'voltage', 'current', 'power'. - -=item B<--critical-*> - -Threshold critical. -Can be: 'voltage', 'current', 'power'. - -=back - -=cut +# +# Copyright 2016 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 hardware::ats::apc::mode::input; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %oids = ( + '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.3' => { counter => 'voltage', no_present => 0 }, # in mVolt outletVoltage + '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.6' => { counter => 'current', no_present => 0 }, # in mA outletCurrent + '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.9' => { counter => 'power', no_present => 0 }, # in Watt outletWatts +); + +my $oid_inputs = '.1.3.6.1.4.1.318.1.1.8.5.3.3.1'; + +my $maps_counters = { + voltage => { thresholds => { + warning_voltage => { label => 'warning-voltage', exit_value => 'warning' }, + critical_voltage => { label => 'critical-voltage', exit_value => 'critical' }, + }, + output_msg => 'Voltage : %d V', + factor => 1, unit => 'V', + }, + current => { thresholds => { + warning_current => { label => 'warning-current', exit_value => 'warning' }, + critical_current => { label => 'critical-current', exit_value => 'critical' }, + }, + output_msg => 'Current : %d A', + factor => 1, unit => 'A', + }, + power => { thresholds => { + warning_power => { label => 'warning-power', exit_value => 'warning' }, + critical_power => { label => 'critical-power', exit_value => 'critical' }, + }, + output_msg => 'Power : %d W', + factor => 1, unit => 'W', + }, +}; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + foreach (keys %{$maps_counters}) { + foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { + $options{options}->add_options(arguments => { + $maps_counters->{$_}->{thresholds}->{$name}->{label} . ':s' => { name => $name }, + }); + } + } + + $self->{counters_value} = {}; + $self->{instances_done} = {}; + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + foreach (keys %{$maps_counters}) { + foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { + if (($self->{perfdata}->threshold_validate(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, value => $self->{option_results}->{$name})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong " . $maps_counters->{$_}->{thresholds}->{$name}->{label} . " threshold '" . $self->{option_results}->{$name} . "'."); + $self->{output}->option_exit(); + } + } + } +} + +sub build_values { + my ($self, %options) = @_; + my $counters_value = {}; + my $instance = undef; + + foreach my $oid (keys %oids) { + #if ($options{current} =~ /^$oid_inputs\.(.*)/) { + if ($options{current} =~ /^$oid\.(.*)/) { + $instance = $1; + #$instance =~ s/1\.1\.3\.//g; + last; + } + } + + # Skip already done + if (!defined($instance) || defined($self->{instances_done}->{$instance})) { + return 0; + } + + $self->{instances_done}->{$instance} = 1; + $self->{counters_value}->{$instance} = {}; + foreach my $oid (keys %oids) { + my $full_oid = $oid . '.' . $instance; + $self->{counters_value}->{$instance}->{$oids{$oid}->{counter}} = defined($options{result}->{$oid . '.' . $instance}) ? $options{result}->{$oid . '.' . $instance} : 0; + } +} + +sub run { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + my $result = $self->{snmp}->get_table(oid => $oid_inputs, nothing_quit => 1); + foreach my $key ($self->{snmp}->oid_lex_sort(keys %$result)) { + $self->build_values(current => $key, result => $result); + } + + my $num = scalar(keys %{$self->{instances_done}}); + foreach my $instance (keys %{$self->{instances_done}}) { + my $instance_input = $instance; + $instance_input =~ s/(\d+)\.\d+\.\d+/#$1/g; + + my @exits; + foreach (keys %{$maps_counters}) { + foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { + if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) { + push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]); + } + } + } + + my $exit = $self->{output}->get_most_critical(status => [ @exits ]); + my $extra_label = ''; + $extra_label = '_' . $instance_input if ($num > 1); + + my $str_input = "Input '$instance_input' "; + my $str_append = ''; + foreach (keys %{$maps_counters}) { + next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} <= 0); + + $str_input .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}); + $str_append = ', '; + my ($warning, $critical); + foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) { + $warning = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'warning'); + $critical = $self->{perfdata}->get_perfdata_for_output(label => $maps_counters->{$_}->{thresholds}->{$name}->{label}) if ($maps_counters->{$_}->{thresholds}->{$name}->{exit_value} eq 'critical'); + } + + $self->{output}->perfdata_add(label => $_ . $extra_label, unit => $maps_counters->{$_}->{unit}, + value => sprintf("%.2f", $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}), + warning => $warning, + critical => $critical); + } + $self->{output}->output_add(severity => $exit, + short_msg => $str_input); + } + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check Outlet metrics (voltage, current and power). + +=over 8 + +=item B<--warning-*> + +Threshold warning. +Can be: 'voltage', 'current', 'power'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'voltage', 'current', 'power'. + +=back + +=cut diff --git a/centreon-plugins/hardware/ats/apc/mode/psu.pm b/centreon-plugins/hardware/ats/apc/mode/psu.pm index c6bf55936..e6806803f 100644 --- a/centreon-plugins/hardware/ats/apc/mode/psu.pm +++ b/centreon-plugins/hardware/ats/apc/mode/psu.pm @@ -51,7 +51,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_atsStatus5VPowerSupply = '.1.3.6.1.4.1.318.1.1.8.5.1.5.0'; diff --git a/centreon-plugins/hardware/ats/apc/mode/source.pm b/centreon-plugins/hardware/ats/apc/mode/source.pm index 63048f31b..a621e8132 100644 --- a/centreon-plugins/hardware/ats/apc/mode/source.pm +++ b/centreon-plugins/hardware/ats/apc/mode/source.pm @@ -71,7 +71,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_atsStatusSelectedSource = '.1.3.6.1.4.1.318.1.1.8.5.1.2.0'; diff --git a/centreon-plugins/hardware/ats/apc/plugin.pm b/centreon-plugins/hardware/ats/apc/plugin.pm index 515a3ff64..4666c964b 100644 --- a/centreon-plugins/hardware/ats/apc/plugin.pm +++ b/centreon-plugins/hardware/ats/apc/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm b/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm index f211d46ec..c35141274 100644 --- a/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm +++ b/centreon-plugins/hardware/pdu/apc/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/pdu/eaton/mode/group.pm b/centreon-plugins/hardware/pdu/eaton/mode/group.pm index fce3e5528..0f0585cb6 100644 --- a/centreon-plugins/hardware/pdu/eaton/mode/group.pm +++ b/centreon-plugins/hardware/pdu/eaton/mode/group.pm @@ -120,7 +120,6 @@ sub build_values { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_table(oid => $oid_groups, nothing_quit => 1); diff --git a/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm b/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm index e1272927f..db037e05d 100644 --- a/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm +++ b/centreon-plugins/hardware/pdu/eaton/mode/outlet.pm @@ -122,7 +122,6 @@ sub build_values { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; #my $oid_outletName = '.1.3.6.1.4.1.534.6.6.7.6.1.1.3'; diff --git a/centreon-plugins/hardware/pdu/eaton/plugin.pm b/centreon-plugins/hardware/pdu/eaton/plugin.pm index e8aeee083..992270903 100644 --- a/centreon-plugins/hardware/pdu/eaton/plugin.pm +++ b/centreon-plugins/hardware/pdu/eaton/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm index 1539faf23..a81bb6aca 100644 --- a/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm +++ b/centreon-plugins/hardware/pdu/raritan/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm index 09e41ba0a..a74b78778 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/coverstatus.pm @@ -54,7 +54,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{output}->output_add(severity => 'OK', diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm index b7dfc75f0..9ed7b58ad 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markerimpression.pm @@ -63,7 +63,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm index 289e7101d..94662b888 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm @@ -69,7 +69,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_prtMarkerSuppliesColorantIndex = '.1.3.6.1.2.1.43.11.1.1.3'; diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm index d53d4580b..63cb45730 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/papertray.pm @@ -62,7 +62,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_prtInputCurrentLevel = '.1.3.6.1.2.1.43.8.2.1.10'; diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm b/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm index 2d7316b4b..56db8e2c8 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm index 01da26f5f..a5a4a8f0a 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/mode/sensors.pm @@ -122,7 +122,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $snmp_request = []; diff --git a/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm b/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm index 56d2338ec..f3c8c3d59 100644 --- a/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm +++ b/centreon-plugins/hardware/sensors/sensorip/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm index f3ac631a0..a10d5973f 100644 --- a/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm +++ b/centreon-plugins/hardware/sensors/sensormetrix/em01/web/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; -# $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm index 8090d056d..db98f25d6 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm @@ -109,7 +109,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $snmp_request = []; diff --git a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm index 79c559701..85d9a8ae8 100644 --- a/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm +++ b/centreon-plugins/hardware/sensors/serverscheck/sensorgateway/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm b/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm index 9c23af6d0..720308fdb 100644 --- a/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm +++ b/centreon-plugins/hardware/sensors/temperhum/local/plugin.pm @@ -27,7 +27,6 @@ use base qw(centreon::plugins::script_simple); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( 'environment' => 'hardware::sensors::temperhum::local::mode::environment', diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm index 0bb5553aa..e313f366a 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/auditlogs.pm @@ -100,7 +100,6 @@ sub get_timestamp { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm index 19e445fd9..1d0ca611e 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/faults.pm @@ -105,7 +105,6 @@ sub get_timestamp { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm b/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm index 3621b286f..3774d1075 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/mode/serviceprofile.pm @@ -62,7 +62,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cucsLsBindingDn = '.1.3.6.1.4.1.9.9.719.1.26.2.1.2'; diff --git a/centreon-plugins/hardware/server/cisco/ucs/plugin.pm b/centreon-plugins/hardware/server/cisco/ucs/plugin.pm index b9e1c8dc0..c13247b49 100644 --- a/centreon-plugins/hardware/server/cisco/ucs/plugin.pm +++ b/centreon-plugins/hardware/server/cisco/ucs/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm index 5a7569509..a5df1bf37 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/mode/hardware.pm @@ -128,7 +128,6 @@ sub display_system_information { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $snmp_request = [ { oid => $oid_drsProductShortName }, { oid => $oid_drsChassisServiceTag }, { oid => $oid_drsFirmwareVersion } ]; diff --git a/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm index d4a27e773..38b6dfc03 100644 --- a/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/cmc/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index 8f533d660..0accf84a8 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -54,7 +54,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_drsGlobalSystemStatus = '.1.3.6.1.4.1.674.10892.2.2.1.0'; diff --git a/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm index 187f1b98d..7e9b52983 100644 --- a/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/idrac/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm index 764db5c06..28e1dcd2f 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/mode/hardware.pm @@ -228,7 +228,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # In '10892-MIB' diff --git a/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm b/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm index 69431071e..cc228cf32 100644 --- a/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/dell/openmanage/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm index 49fde1f80..b6508df7b 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/mode/hardware.pm @@ -139,7 +139,6 @@ sub global { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; if ($self->{option_results}->{component} eq 'all') { diff --git a/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm b/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm index 54404f6e3..76a5e92bb 100644 --- a/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/hp/bladechassis/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm index cd75aaf34..7e7b0ca91 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/globalstatus.pm @@ -98,7 +98,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cpqHeMibCondition = '.1.3.6.1.4.1.232.6.1.3.0'; diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm index ffae6eaf4..b0eb8a6f2 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/hardware.pm @@ -315,7 +315,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->get_system_information(); diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm index ce1264c83..73441b46d 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm index b8a858d16..86748556e 100644 --- a/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/bladecenter/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm b/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm index cbb38f588..5e097bb3a 100644 --- a/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/hmc/ssh/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm index dfa5c2f1c..4d7d93ab0 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm @@ -61,7 +61,6 @@ sub global { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; if ($self->{option_results}->{component} eq 'all') { diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm index c4eca0396..e4a8d8521 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm index f8c9be29d..945df32d6 100644 --- a/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm +++ b/centreon-plugins/hardware/server/ibm/mgmt_cards/imm/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm b/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm index 290df3408..1e75cb330 100644 --- a/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm +++ b/centreon-plugins/hardware/server/sun/mgmt_cards/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm b/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm index 7e387adaa..afc3b87f0 100644 --- a/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm +++ b/centreon-plugins/hardware/server/sun/mseries/mode/domains.pm @@ -54,7 +54,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_scfDomainErrorStatus = '.1.3.6.1.4.1.211.1.15.3.1.1.5.2.1.15'; diff --git a/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm b/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm index cf8dfb388..4b747f801 100644 --- a/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm +++ b/centreon-plugins/hardware/server/sun/mseries/mode/hardware.pm @@ -156,7 +156,6 @@ sub check_exclude { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_scfComponentErrorStatus = '.1.3.6.1.4.1.211.1.15.3.1.1.12.2.1.14'; diff --git a/centreon-plugins/hardware/server/sun/mseries/plugin.pm b/centreon-plugins/hardware/server/sun/mseries/plugin.pm index ba0baa911..919d870b0 100644 --- a/centreon-plugins/hardware/server/sun/mseries/plugin.pm +++ b/centreon-plugins/hardware/server/sun/mseries/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm b/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm index 6529033bb..9d34441ea 100644 --- a/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm +++ b/centreon-plugins/hardware/server/sun/sfxxk/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/ups/apc/snmp/plugin.pm b/centreon-plugins/hardware/ups/apc/snmp/plugin.pm index a1a69652b..5ecaf6988 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/plugin.pm @@ -26,7 +26,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm index 105b7ae32..f223c8f5e 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/batterystatus.pm @@ -69,7 +69,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_upsmgBattery = '.1.3.6.1.4.1.705.1.5'; diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm index 50c3da145..4c157a606 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/environment.pm @@ -118,7 +118,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm index dcf6cd0f1..15d6a39c2 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/inputlines.pm @@ -161,7 +161,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm index 6c7d41269..ae2f0a6ae 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/outputlines.pm @@ -193,7 +193,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm index 245829593..34cccd84e 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/mode/outputsource.pm @@ -62,7 +62,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_table(oid => $oid_upsmgOutput, start => $oid_upsmgOutputOnBatteryEntry, nothing_quit => 1); diff --git a/centreon-plugins/hardware/ups/mge/snmp/plugin.pm b/centreon-plugins/hardware/ups/mge/snmp/plugin.pm index faea24cb3..5c685a232 100644 --- a/centreon-plugins/hardware/ups/mge/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/mge/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm index d3d5afca6..109611366 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/alarms.pm @@ -99,7 +99,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm index d8261c8ef..002d01185 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/batterystatus.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_xupsBattery = '.1.3.6.1.4.1.534.1.2'; diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm index 30331b1dc..80c0c4714 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/environment.pm @@ -121,7 +121,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm index fbb1b99f1..8fffa3153 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/inputlines.pm @@ -181,7 +181,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm index 72820204a..fddc1270a 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputlines.pm @@ -195,7 +195,6 @@ sub manage_counters { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm index cebbd2fb0..72d16040c 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/mode/outputsource.pm @@ -84,7 +84,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_leef(oids => [$oid_xupsOutputSource], nothing_quit => 1); diff --git a/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm b/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm index 89027ba99..c17114159 100644 --- a/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/powerware/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm index b0cebe98e..b90721176 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/alarms.pm @@ -45,7 +45,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_upsAlarmsPresent = '.1.3.6.1.2.1.33.1.6.1.0'; diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm index 5ee5dc174..6cf0446e2 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm @@ -63,7 +63,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_upsBattery = '.1.3.6.1.2.1.33.1.2'; diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm index a9e4c5ea8..dba10370c 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputlines.pm @@ -165,7 +165,6 @@ sub stdev { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_upsOutputEntry = '.1.3.6.1.2.1.33.1.4.4.1'; diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm index 41669e631..800f171e2 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_upsOutputSource = '.1.3.6.1.2.1.33.1.4.1.0'; diff --git a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm index 113fca649..d7c5a53d1 100644 --- a/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm +++ b/centreon-plugins/hardware/ups/standard/rfc1628/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/alcatel/common/mode/cpu.pm b/centreon-plugins/network/alcatel/common/mode/cpu.pm index 2a55d0d45..11863cf23 100644 --- a/centreon-plugins/network/alcatel/common/mode/cpu.pm +++ b/centreon-plugins/network/alcatel/common/mode/cpu.pm @@ -95,7 +95,6 @@ sub check_cpu { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_healthDeviceCpu1MinAvg = '.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.14'; # it's '.0' but it's for walk multiple diff --git a/centreon-plugins/network/alcatel/common/mode/flashmemory.pm b/centreon-plugins/network/alcatel/common/mode/flashmemory.pm index 4b880533c..da23ce927 100644 --- a/centreon-plugins/network/alcatel/common/mode/flashmemory.pm +++ b/centreon-plugins/network/alcatel/common/mode/flashmemory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_chasSupervisionFlashMemEntry = '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.9.1'; diff --git a/centreon-plugins/network/alcatel/common/mode/hardware.pm b/centreon-plugins/network/alcatel/common/mode/hardware.pm index bc39c6f88..7d5cfe461 100644 --- a/centreon-plugins/network/alcatel/common/mode/hardware.pm +++ b/centreon-plugins/network/alcatel/common/mode/hardware.pm @@ -137,7 +137,6 @@ sub component { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => [ diff --git a/centreon-plugins/network/alcatel/common/mode/memory.pm b/centreon-plugins/network/alcatel/common/mode/memory.pm index 9a931b45a..7b9c90966 100644 --- a/centreon-plugins/network/alcatel/common/mode/memory.pm +++ b/centreon-plugins/network/alcatel/common/mode/memory.pm @@ -95,7 +95,6 @@ sub check_memory { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_healthDeviceMemory1MinAvg = '.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.10'; # it's '.0' but it's for walk multiple diff --git a/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm b/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm index c8189f4ac..1779f1ad3 100644 --- a/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm +++ b/centreon-plugins/network/alcatel/omniswitch/6850/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/arkoon/plugin.pm b/centreon-plugins/network/arkoon/plugin.pm index 88ca4f939..975992c18 100644 --- a/centreon-plugins/network/arkoon/plugin.pm +++ b/centreon-plugins/network/arkoon/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/aruba/standard/snmp/plugin.pm b/centreon-plugins/network/aruba/standard/snmp/plugin.pm index 02972f050..a52067a3f 100644 --- a/centreon-plugins/network/aruba/standard/snmp/plugin.pm +++ b/centreon-plugins/network/aruba/standard/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/atrica/snmp/plugin.pm b/centreon-plugins/network/atrica/snmp/plugin.pm index 45104bdd0..da1181895 100644 --- a/centreon-plugins/network/atrica/snmp/plugin.pm +++ b/centreon-plugins/network/atrica/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm b/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm index 8c25063c0..7ad28f9c4 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clientconnections.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_leef(oids => ['.1.3.6.1.4.1.3417.2.11.3.1.3.1.0', diff --git a/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm b/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm index 46eb4bf47..abc9d3f77 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/clienttraffic.pm @@ -70,7 +70,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm b/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm index 89564cb74..6252f2d40 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/cpu.pm @@ -60,7 +60,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/bluecoat/snmp/mode/disk.pm b/centreon-plugins/network/bluecoat/snmp/mode/disk.pm index 8c7fc67eb..f0d8aa4ef 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/disk.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/disk.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $disk_num = 1; diff --git a/centreon-plugins/network/bluecoat/snmp/mode/memory.pm b/centreon-plugins/network/bluecoat/snmp/mode/memory.pm index d4724b2b1..735e8cedb 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/memory.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/memory.pm @@ -57,7 +57,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; if ($self->{snmp}->is_snmpv1()) { diff --git a/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm b/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm index 266b7b03b..f481729d7 100644 --- a/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm +++ b/centreon-plugins/network/bluecoat/snmp/mode/serverconnections.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_leef(oids => ['.1.3.6.1.4.1.3417.2.11.3.1.3.4.0', diff --git a/centreon-plugins/network/bluecoat/snmp/plugin.pm b/centreon-plugins/network/bluecoat/snmp/plugin.pm index c397621b2..df6376531 100644 --- a/centreon-plugins/network/bluecoat/snmp/plugin.pm +++ b/centreon-plugins/network/bluecoat/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/brocade/mode/cpu.pm b/centreon-plugins/network/brocade/mode/cpu.pm index fa013426d..36dce2469 100644 --- a/centreon-plugins/network/brocade/mode/cpu.pm +++ b/centreon-plugins/network/brocade/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_swFwFabricWatchLicense = '.1.3.6.1.4.1.1588.2.1.1.1.10.1.0'; diff --git a/centreon-plugins/network/brocade/mode/hardware.pm b/centreon-plugins/network/brocade/mode/hardware.pm index f80fe20ea..c16bf7225 100644 --- a/centreon-plugins/network/brocade/mode/hardware.pm +++ b/centreon-plugins/network/brocade/mode/hardware.pm @@ -66,7 +66,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_swFirmwareVersion = '.1.3.6.1.4.1.1588.2.1.1.1.1.6.0'; diff --git a/centreon-plugins/network/brocade/mode/memory.pm b/centreon-plugins/network/brocade/mode/memory.pm index e420d9fa0..85dace029 100644 --- a/centreon-plugins/network/brocade/mode/memory.pm +++ b/centreon-plugins/network/brocade/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_swFwFabricWatchLicense = '.1.3.6.1.4.1.1588.2.1.1.1.10.1.0'; diff --git a/centreon-plugins/network/brocade/plugin.pm b/centreon-plugins/network/brocade/plugin.pm index 5e345875f..b51bc0930 100644 --- a/centreon-plugins/network/brocade/plugin.pm +++ b/centreon-plugins/network/brocade/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/checkpoint/mode/connections.pm b/centreon-plugins/network/checkpoint/mode/connections.pm index dd283bb73..d51b20adc 100644 --- a/centreon-plugins/network/checkpoint/mode/connections.pm +++ b/centreon-plugins/network/checkpoint/mode/connections.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_fwNumCom = '.1.3.6.1.4.1.2620.1.1.25.3.0'; diff --git a/centreon-plugins/network/checkpoint/mode/cpu.pm b/centreon-plugins/network/checkpoint/mode/cpu.pm index 8416e15a3..9e545cd9f 100644 --- a/centreon-plugins/network/checkpoint/mode/cpu.pm +++ b/centreon-plugins/network/checkpoint/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_procUsrTime = '.1.3.6.1.4.1.2620.1.6.7.2.1.0'; diff --git a/centreon-plugins/network/checkpoint/mode/hastate.pm b/centreon-plugins/network/checkpoint/mode/hastate.pm index b5bdec42a..61fa3f2cd 100644 --- a/centreon-plugins/network/checkpoint/mode/hastate.pm +++ b/centreon-plugins/network/checkpoint/mode/hastate.pm @@ -47,7 +47,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_haInstalled = '.1.3.6.1.4.1.2620.1.5.2.0'; diff --git a/centreon-plugins/network/checkpoint/mode/memory.pm b/centreon-plugins/network/checkpoint/mode/memory.pm index 817e34b4b..bd82b0baa 100644 --- a/centreon-plugins/network/checkpoint/mode/memory.pm +++ b/centreon-plugins/network/checkpoint/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_memTotalReal64 = '.1.3.6.1.4.1.2620.1.6.7.4.3.0'; diff --git a/centreon-plugins/network/checkpoint/plugin.pm b/centreon-plugins/network/checkpoint/plugin.pm index 5360d0014..2bd1c1635 100644 --- a/centreon-plugins/network/checkpoint/plugin.pm +++ b/centreon-plugins/network/checkpoint/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/WaaS/mode/sessions.pm b/centreon-plugins/network/cisco/WaaS/mode/sessions.pm index 6e0c04a14..a09191205 100644 --- a/centreon-plugins/network/cisco/WaaS/mode/sessions.pm +++ b/centreon-plugins/network/cisco/WaaS/mode/sessions.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # Nombre de licences diff --git a/centreon-plugins/network/cisco/WaaS/plugin.pm b/centreon-plugins/network/cisco/WaaS/plugin.pm index 6181be111..7d883d2cd 100644 --- a/centreon-plugins/network/cisco/WaaS/plugin.pm +++ b/centreon-plugins/network/cisco/WaaS/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/asa/mode/failover.pm b/centreon-plugins/network/cisco/asa/mode/failover.pm index b9dd36012..48df71ae8 100644 --- a/centreon-plugins/network/cisco/asa/mode/failover.pm +++ b/centreon-plugins/network/cisco/asa/mode/failover.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $active_units = 0; diff --git a/centreon-plugins/network/cisco/asa/plugin.pm b/centreon-plugins/network/cisco/asa/plugin.pm index 09eaa3ba9..cabf77f22 100644 --- a/centreon-plugins/network/cisco/asa/plugin.pm +++ b/centreon-plugins/network/cisco/asa/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm b/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm index b838fb1d7..096e08fbf 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_perCentMemoryUtilization = '.1.3.6.1.4.1.15497.1.1.1.1.0'; diff --git a/centreon-plugins/network/cisco/ironport/snmp/plugin.pm b/centreon-plugins/network/cisco/ironport/snmp/plugin.pm index 3b5e4eda2..1f653bb1e 100644 --- a/centreon-plugins/network/cisco/ironport/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/ironport/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm b/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm index c2258ee1a..9288d0ba9 100644 --- a/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/smallbusiness/standard/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/standard/snmp/plugin.pm b/centreon-plugins/network/cisco/standard/snmp/plugin.pm index 45d1a067c..558abceaa 100644 --- a/centreon-plugins/network/cisco/standard/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/standard/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/cisco/wlc/snmp/plugin.pm b/centreon-plugins/network/cisco/wlc/snmp/plugin.pm index 13a7b43c6..aead226c1 100644 --- a/centreon-plugins/network/cisco/wlc/snmp/plugin.pm +++ b/centreon-plugins/network/cisco/wlc/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm b/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm index 30592ef0e..ffb1b1cdb 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/certificatesexpire.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_sslCertKeyName = '.1.3.6.1.4.1.5951.4.1.1.56.1.1.1'; diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm b/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm index 3921cbe88..f6673a0a7 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nsCPUEntry = '.1.3.6.1.4.1.5951.4.1.1.41.6'; diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm index b3fac2b74..0b657397c 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/hastate.pm @@ -99,7 +99,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{result} = $self->{snmp}->get_leef(oids => [$oid_haPeerState, $oid_haCurState], nothing_quit => 1); diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm index 5123dcc74..6d51e54ee 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/health.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/health.pm @@ -93,7 +93,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{result} = $self->{snmp}->get_table(oid => $oid_nsSysHealthEntry); diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm b/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm index 7790aa8ff..c4564542e 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/listvservers.pm @@ -94,7 +94,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -119,7 +118,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm b/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm index 5fe11ae7f..687acb285 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_resMemUsage = '.1.3.6.1.4.1.5951.4.1.1.41.2.0'; diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm b/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm index d2d174fec..fd43d4a2a 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/storage.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nsSysHealthDiskEntry = '.1.3.6.1.4.1.5951.4.1.1.41.8.1'; diff --git a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm index ba459818e..aabc2f759 100644 --- a/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm +++ b/centreon-plugins/network/citrix/netscaler/common/mode/vserverstatus.pm @@ -182,7 +182,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm b/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm index e305ce568..fd2402bc5 100644 --- a/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm +++ b/centreon-plugins/network/citrix/netscaler/mpx8000/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/dell/6200/plugin.pm b/centreon-plugins/network/dell/6200/plugin.pm index 5dafd1f26..24c68880f 100644 --- a/centreon-plugins/network/dell/6200/plugin.pm +++ b/centreon-plugins/network/dell/6200/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/dell/n4000/plugin.pm b/centreon-plugins/network/dell/n4000/plugin.pm index de182deeb..a79ba5326 100644 --- a/centreon-plugins/network/dell/n4000/plugin.pm +++ b/centreon-plugins/network/dell/n4000/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/dell/sseries/snmp/plugin.pm b/centreon-plugins/network/dell/sseries/snmp/plugin.pm index 5af2bd23c..7cd9b8104 100644 --- a/centreon-plugins/network/dell/sseries/snmp/plugin.pm +++ b/centreon-plugins/network/dell/sseries/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/digi/portserverts/snmp/plugin.pm b/centreon-plugins/network/digi/portserverts/snmp/plugin.pm index c5a856304..bcf838eed 100644 --- a/centreon-plugins/network/digi/portserverts/snmp/plugin.pm +++ b/centreon-plugins/network/digi/portserverts/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/digi/standard/snmp/mode/cpu.pm b/centreon-plugins/network/digi/standard/snmp/mode/cpu.pm index 777483ee7..e7dca8d64 100644 --- a/centreon-plugins/network/digi/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/network/digi/standard/snmp/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cpuUtil = '.1.3.6.1.4.1.16378.10000.3.1.0'; diff --git a/centreon-plugins/network/digi/standard/snmp/mode/memory.pm b/centreon-plugins/network/digi/standard/snmp/mode/memory.pm index b72e8b78a..4c316a735 100644 --- a/centreon-plugins/network/digi/standard/snmp/mode/memory.pm +++ b/centreon-plugins/network/digi/standard/snmp/mode/memory.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_totalMemory = '.1.3.6.1.4.1.16378.10000.3.17.0'; # in Kbytes diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm b/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm index e5062d63f..1bd126621 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rlCpuUtilEnable = '.1.3.6.1.4.1.171.10.94.89.89.1.6.0'; diff --git a/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm b/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm index d63e9acf2..c4cfc74f1 100644 --- a/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm +++ b/centreon-plugins/network/dlink/dgs3100/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm b/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm index 2da549008..be8b762a8 100644 --- a/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/network/dlink/standard/snmp/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_agentCPUutilizationIn5sec = '.1.3.6.1.4.1.171.12.1.1.6.1.0'; diff --git a/centreon-plugins/network/dlink/standard/snmp/plugin.pm b/centreon-plugins/network/dlink/standard/snmp/plugin.pm index 8b9bb85c0..b7007441f 100644 --- a/centreon-plugins/network/dlink/standard/snmp/plugin.pm +++ b/centreon-plugins/network/dlink/standard/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/extreme/snmp/mode/stack.pm b/centreon-plugins/network/extreme/snmp/mode/stack.pm index b9a211688..7600a0b50 100644 --- a/centreon-plugins/network/extreme/snmp/mode/stack.pm +++ b/centreon-plugins/network/extreme/snmp/mode/stack.pm @@ -98,7 +98,6 @@ my $mapping4 = { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $results = $self->{snmp}->get_multiple_table(oids => [ diff --git a/centreon-plugins/network/extreme/snmp/plugin.pm b/centreon-plugins/network/extreme/snmp/plugin.pm index 498dfd1c6..098124dc6 100644 --- a/centreon-plugins/network/extreme/snmp/plugin.pm +++ b/centreon-plugins/network/extreme/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/f5/bigip/mode/listnodes.pm b/centreon-plugins/network/f5/bigip/mode/listnodes.pm index e8644fb17..df4dbb99b 100644 --- a/centreon-plugins/network/f5/bigip/mode/listnodes.pm +++ b/centreon-plugins/network/f5/bigip/mode/listnodes.pm @@ -80,7 +80,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -106,7 +105,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); diff --git a/centreon-plugins/network/f5/bigip/mode/listpools.pm b/centreon-plugins/network/f5/bigip/mode/listpools.pm index f21064bee..17916b0f6 100644 --- a/centreon-plugins/network/f5/bigip/mode/listpools.pm +++ b/centreon-plugins/network/f5/bigip/mode/listpools.pm @@ -78,7 +78,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -102,7 +101,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); diff --git a/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm b/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm index d6b69c5ba..9a28037de 100644 --- a/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm +++ b/centreon-plugins/network/f5/bigip/mode/listvirtualservers.pm @@ -78,7 +78,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -102,7 +101,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); diff --git a/centreon-plugins/network/f5/bigip/plugin.pm b/centreon-plugins/network/f5/bigip/plugin.pm index fd4a370e5..4d322b8e1 100644 --- a/centreon-plugins/network/f5/bigip/plugin.pm +++ b/centreon-plugins/network/f5/bigip/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/fortinet/fortigate/plugin.pm b/centreon-plugins/network/fortinet/fortigate/plugin.pm index 61918f05b..1c41a6d17 100644 --- a/centreon-plugins/network/fortinet/fortigate/plugin.pm +++ b/centreon-plugins/network/fortinet/fortigate/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/fritzbox/plugin.pm b/centreon-plugins/network/fritzbox/plugin.pm index eaf2762de..4418b7c3a 100644 --- a/centreon-plugins/network/fritzbox/plugin.pm +++ b/centreon-plugins/network/fritzbox/plugin.pm @@ -69,7 +69,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/h3c/snmp/mode/cpu.pm b/centreon-plugins/network/h3c/snmp/mode/cpu.pm index ff5a2ee23..5a5038f08 100644 --- a/centreon-plugins/network/h3c/snmp/mode/cpu.pm +++ b/centreon-plugins/network/h3c/snmp/mode/cpu.pm @@ -94,7 +94,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/h3c/snmp/mode/memory.pm b/centreon-plugins/network/h3c/snmp/mode/memory.pm index 7279b6596..2003f3269 100644 --- a/centreon-plugins/network/h3c/snmp/mode/memory.pm +++ b/centreon-plugins/network/h3c/snmp/mode/memory.pm @@ -151,7 +151,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/h3c/snmp/plugin.pm b/centreon-plugins/network/h3c/snmp/plugin.pm index b50f55d4c..87b22ae32 100644 --- a/centreon-plugins/network/h3c/snmp/plugin.pm +++ b/centreon-plugins/network/h3c/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm index 09fdc0e49..40433e169 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/cpu.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hmCpuUtilization = '.1.3.6.1.4.1.248.14.2.15.2.1.0'; # in % diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm index a34f50d08..6a15e5f27 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/memory.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hmMemoryFree = '.1.3.6.1.4.1.248.14.2.15.3.2.0'; # in KBytes diff --git a/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm b/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm index 1523e1192..87f996fff 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/mode/processcount.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hmCpuRunningProcesses = '.1.3.6.1.4.1.248.14.2.15.2.3.0'; diff --git a/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm b/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm index 73dc2148a..83fe5e7d0 100644 --- a/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm +++ b/centreon-plugins/network/hirschmann/standard/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/hp/procurve/mode/cpu.pm b/centreon-plugins/network/hp/procurve/mode/cpu.pm index 9edc6ac86..2336a830f 100644 --- a/centreon-plugins/network/hp/procurve/mode/cpu.pm +++ b/centreon-plugins/network/hp/procurve/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hpSwitchCpuStat = '.1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0'; diff --git a/centreon-plugins/network/hp/procurve/mode/memory.pm b/centreon-plugins/network/hp/procurve/mode/memory.pm index 9f1866cf0..a78d23fe3 100644 --- a/centreon-plugins/network/hp/procurve/mode/memory.pm +++ b/centreon-plugins/network/hp/procurve/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hpGlobalMemEntry = '.1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1'; diff --git a/centreon-plugins/network/hp/procurve/plugin.pm b/centreon-plugins/network/hp/procurve/plugin.pm index 6fadf6ce6..d79ca65d3 100644 --- a/centreon-plugins/network/hp/procurve/plugin.pm +++ b/centreon-plugins/network/hp/procurve/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/common/ive/mode/cpu.pm b/centreon-plugins/network/juniper/common/ive/mode/cpu.pm index 1bb94eec5..54a178d03 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/cpu.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_iveCpuUtil = '.1.3.6.1.4.1.12532.10.0'; diff --git a/centreon-plugins/network/juniper/common/ive/mode/disk.pm b/centreon-plugins/network/juniper/common/ive/mode/disk.pm index d0d06d28e..3f95bcfee 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/disk.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/disk.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_diskFullPercent = '.1.3.6.1.4.1.12532.25.0'; diff --git a/centreon-plugins/network/juniper/common/ive/mode/logfile.pm b/centreon-plugins/network/juniper/common/ive/mode/logfile.pm index 602adad7f..d8fdfcb4f 100644 --- a/centreon-plugins/network/juniper/common/ive/mode/logfile.pm +++ b/centreon-plugins/network/juniper/common/ive/mode/logfile.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_logFullPercent = '.1.3.6.1.4.1.12532.1.0'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm b/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm index e7e575090..7b4817ad2 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpsessions.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxJsSPUMonitoringSPUIndex = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.3'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm b/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm index 2d5b621fd..eec24a5ec 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpuforwarding.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxJsSPUMonitoringSPUIndex = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.3'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm b/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm index 1d3c2dd89..478fb4639 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/cpurouting.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxOperatingDescr = '.1.3.6.1.4.1.2636.3.1.13.1.5'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm b/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm index e292e6d72..4b8c0a53a 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/flowsessions.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxJsSPUMonitoringSPUIndex = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.3'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm b/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm index df096bdcc..ca4eefdab 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/memoryforwarding.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxJsSPUMonitoringSPUIndex = '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.3'; diff --git a/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm b/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm index de2274407..ab3108295 100644 --- a/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm +++ b/centreon-plugins/network/juniper/common/junos/mode/memoryrouting.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_jnxOperatingDescr = '.1.3.6.1.4.1.2636.3.1.13.1.5'; diff --git a/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm b/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm index 06c5f3053..25739df6e 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nsResCpuLast1Min = '.1.3.6.1.4.1.3224.16.1.2.0'; diff --git a/centreon-plugins/network/juniper/common/screenos/mode/memory.pm b/centreon-plugins/network/juniper/common/screenos/mode/memory.pm index 2413cfc3a..63bdd7dab 100644 --- a/centreon-plugins/network/juniper/common/screenos/mode/memory.pm +++ b/centreon-plugins/network/juniper/common/screenos/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nsResMemAllocate= '.1.3.6.1.4.1.3224.16.2.1.0'; diff --git a/centreon-plugins/network/juniper/ex/plugin.pm b/centreon-plugins/network/juniper/ex/plugin.pm index 717b68cea..a030f80ce 100644 --- a/centreon-plugins/network/juniper/ex/plugin.pm +++ b/centreon-plugins/network/juniper/ex/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm b/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm index d6db069a2..1b0b828a7 100644 --- a/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm +++ b/centreon-plugins/network/juniper/ggsn/mode/apnstats.pm @@ -254,7 +254,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm b/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm index 5c5e93f6a..02ed2e78b 100644 --- a/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm +++ b/centreon-plugins/network/juniper/ggsn/mode/globalstats.pm @@ -250,7 +250,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/juniper/ggsn/plugin.pm b/centreon-plugins/network/juniper/ggsn/plugin.pm index fdca6fb75..4ba145741 100644 --- a/centreon-plugins/network/juniper/ggsn/plugin.pm +++ b/centreon-plugins/network/juniper/ggsn/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm b/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm index b4f017fb0..cc4c7486d 100644 --- a/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm +++ b/centreon-plugins/network/juniper/mag/mode/bladetemperature.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_iveTemperature = '.1.3.6.1.4.1.12532.42.0'; diff --git a/centreon-plugins/network/juniper/mag/plugin.pm b/centreon-plugins/network/juniper/mag/plugin.pm index a1b5e0083..551a8470c 100644 --- a/centreon-plugins/network/juniper/mag/plugin.pm +++ b/centreon-plugins/network/juniper/mag/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/mseries/plugin.pm b/centreon-plugins/network/juniper/mseries/plugin.pm index 28411f177..5ea2f60d1 100644 --- a/centreon-plugins/network/juniper/mseries/plugin.pm +++ b/centreon-plugins/network/juniper/mseries/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/sa/plugin.pm b/centreon-plugins/network/juniper/sa/plugin.pm index 0d51783ae..61cd57493 100644 --- a/centreon-plugins/network/juniper/sa/plugin.pm +++ b/centreon-plugins/network/juniper/sa/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/srx/plugin.pm b/centreon-plugins/network/juniper/srx/plugin.pm index 81c3970c5..fb1e6e866 100644 --- a/centreon-plugins/network/juniper/srx/plugin.pm +++ b/centreon-plugins/network/juniper/srx/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/ssg/plugin.pm b/centreon-plugins/network/juniper/ssg/plugin.pm index e25d6b7cf..78bfe3d54 100644 --- a/centreon-plugins/network/juniper/ssg/plugin.pm +++ b/centreon-plugins/network/juniper/ssg/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm b/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm index 46ec7ada3..9461c65b2 100644 --- a/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm +++ b/centreon-plugins/network/juniper/trapeze/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm b/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm index 99d98dd33..11b982699 100644 --- a/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm +++ b/centreon-plugins/network/netasq/snmp/mode/vpnstatus.pm @@ -142,7 +142,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/netasq/snmp/plugin.pm b/centreon-plugins/network/netasq/snmp/plugin.pm index 8152bc355..fc0f06178 100644 --- a/centreon-plugins/network/netasq/snmp/plugin.pm +++ b/centreon-plugins/network/netasq/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm b/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm index eeb3191a4..4b7b2aaa5 100644 --- a/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm +++ b/centreon-plugins/network/oneaccess/snmp/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_oacSysCpuUsed = '.1.3.6.1.4.1.13191.10.3.3.1.2.1.0'; diff --git a/centreon-plugins/network/oneaccess/snmp/mode/memory.pm b/centreon-plugins/network/oneaccess/snmp/mode/memory.pm index 52acb6369..905b2a511 100644 --- a/centreon-plugins/network/oneaccess/snmp/mode/memory.pm +++ b/centreon-plugins/network/oneaccess/snmp/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_oacSysMemoryTotal = '.1.3.6.1.4.1.13191.10.3.3.1.1.3.0'; diff --git a/centreon-plugins/network/oneaccess/snmp/plugin.pm b/centreon-plugins/network/oneaccess/snmp/plugin.pm index 76a4ad438..ff696c28e 100644 --- a/centreon-plugins/network/oneaccess/snmp/plugin.pm +++ b/centreon-plugins/network/oneaccess/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm index f28e1c60b..9a98ca90f 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/clusterstatus.pm @@ -99,7 +99,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{result} = $self->{snmp}->get_leef(oids => [ $oid_panSysHAState, $oid_panSysHAPeerState, $oid_panSysHAMode ], diff --git a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm index 989576489..25d9d879d 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/panorama.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/panorama.pm @@ -106,7 +106,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_panMgmtPanoramaConnected = '.1.3.6.1.4.1.25461.2.1.2.4.1.0'; diff --git a/centreon-plugins/network/paloalto/snmp/mode/sessions.pm b/centreon-plugins/network/paloalto/snmp/mode/sessions.pm index db7c4e23e..8895209f3 100644 --- a/centreon-plugins/network/paloalto/snmp/mode/sessions.pm +++ b/centreon-plugins/network/paloalto/snmp/mode/sessions.pm @@ -137,7 +137,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/paloalto/snmp/plugin.pm b/centreon-plugins/network/paloalto/snmp/plugin.pm index 86a8ba02a..0958ea926 100644 --- a/centreon-plugins/network/paloalto/snmp/plugin.pm +++ b/centreon-plugins/network/paloalto/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.5'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/radware/alteon/5224/plugin.pm b/centreon-plugins/network/radware/alteon/5224/plugin.pm index 7b49ccf85..fca2dcb49 100644 --- a/centreon-plugins/network/radware/alteon/5224/plugin.pm +++ b/centreon-plugins/network/radware/alteon/5224/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/radware/alteon/common/mode/cpu.pm b/centreon-plugins/network/radware/alteon/common/mode/cpu.pm index 8e7a565cb..03ea40c6a 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/cpu.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/cpu.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_mpCpuStatsUtil1Second = '.1.3.6.1.4.1.1872.2.5.1.2.2.1.0'; diff --git a/centreon-plugins/network/radware/alteon/common/mode/hardware.pm b/centreon-plugins/network/radware/alteon/common/mode/hardware.pm index 3312cb132..90af5a195 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/hardware.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/hardware.pm @@ -71,7 +71,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{components_fans} = 0; diff --git a/centreon-plugins/network/radware/alteon/common/mode/memory.pm b/centreon-plugins/network/radware/alteon/common/mode/memory.pm index 08cf5f135..b72539938 100644 --- a/centreon-plugins/network/radware/alteon/common/mode/memory.pm +++ b/centreon-plugins/network/radware/alteon/common/mode/memory.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_mpMemStatsTotal = '.1.3.6.1.4.1.1872.2.5.1.2.8.1.0'; diff --git a/centreon-plugins/network/redback/snmp/mode/cpu.pm b/centreon-plugins/network/redback/snmp/mode/cpu.pm index c80a19015..44d54398a 100644 --- a/centreon-plugins/network/redback/snmp/mode/cpu.pm +++ b/centreon-plugins/network/redback/snmp/mode/cpu.pm @@ -89,7 +89,6 @@ sub check_table_cpu { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rbnCpuMeterFiveSecondAvg = '.1.3.6.1.4.1.2352.2.6.1.1.0'; diff --git a/centreon-plugins/network/redback/snmp/plugin.pm b/centreon-plugins/network/redback/snmp/plugin.pm index 897850d1a..992cf3cd8 100644 --- a/centreon-plugins/network/redback/snmp/plugin.pm +++ b/centreon-plugins/network/redback/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm index 32ccea1b8..6cf0446c9 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwoptimization.pm @@ -46,7 +46,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm index 5277c5360..ae377d703 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/bwpassthrough.pm @@ -71,7 +71,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm index 4486dd2e0..58c4cbac4 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/connections.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_optimizedConnections = '.1.3.6.1.4.1.17163.1.1.5.2.1.0'; diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm index 17b669090..85cfb0aa3 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/diskutilization.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_dsAveDiskUtilization = '.1.3.6.1.4.1.17163.1.1.5.4.4.0'; # in % diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm index 8a918c074..362029168 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/health.pm @@ -49,7 +49,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_systemHealth = '.1.3.6.1.4.1.17163.1.1.2.7.0'; diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm index 042fe88fc..ecaeadc3c 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/loadaverage.pm @@ -75,7 +75,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cpuLoad1 = '.1.3.6.1.4.1.17163.1.1.5.1.1.0'; diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm index 6bf5e80c0..06b5a318d 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/servicestatus.pm @@ -54,7 +54,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_optServiceStatus = '.1.3.6.1.4.1.17163.1.1.2.8.0'; diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm index e4ee22d8d..d73a24fa7 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/serviceuptime.pm @@ -58,7 +58,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_serviceUptime = '.1.3.6.1.4.1.17163.1.1.2.4.0'; diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm b/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm index d1c457449..e85c9f8dc 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/mode/temperature.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_systemTemperature = '.1.3.6.1.4.1.17163.1.1.2.9.0'; # in Celsius diff --git a/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm b/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm index c128c63cc..a97a9e48c 100644 --- a/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm +++ b/centreon-plugins/network/riverbed/steelhead/snmp/plugin.pm @@ -29,7 +29,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object # Plugin version $self->{version} = '0.1'; diff --git a/centreon-plugins/network/ruggedcom/mode/errors.pm b/centreon-plugins/network/ruggedcom/mode/errors.pm index fb7ab3b56..8bb31d480 100644 --- a/centreon-plugins/network/ruggedcom/mode/errors.pm +++ b/centreon-plugins/network/ruggedcom/mode/errors.pm @@ -85,7 +85,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_table(oid => $oid_rcDeviceError, start => $oid_rcDeviceErrWatchdogReset); diff --git a/centreon-plugins/network/ruggedcom/mode/hardware.pm b/centreon-plugins/network/ruggedcom/mode/hardware.pm index b7267ad9f..39bc82518 100644 --- a/centreon-plugins/network/ruggedcom/mode/hardware.pm +++ b/centreon-plugins/network/ruggedcom/mode/hardware.pm @@ -115,7 +115,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # There is a bug with get_leef and snmpv1. diff --git a/centreon-plugins/network/ruggedcom/mode/memory.pm b/centreon-plugins/network/ruggedcom/mode/memory.pm index 4c9498fc5..981549525 100644 --- a/centreon-plugins/network/ruggedcom/mode/memory.pm +++ b/centreon-plugins/network/ruggedcom/mode/memory.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rcDeviceStsAvailableRam = '.1.3.6.1.4.1.15004.4.2.2.2.0'; # in bytes diff --git a/centreon-plugins/network/ruggedcom/mode/temperature.pm b/centreon-plugins/network/ruggedcom/mode/temperature.pm index d526bfc62..b87f822ec 100644 --- a/centreon-plugins/network/ruggedcom/mode/temperature.pm +++ b/centreon-plugins/network/ruggedcom/mode/temperature.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_rcDeviceStsTemperature = '.1.3.6.1.4.1.15004.4.2.2.3.0'; # in Celsius diff --git a/centreon-plugins/network/ruggedcom/plugin.pm b/centreon-plugins/network/ruggedcom/plugin.pm index 9ec45e9d8..86d953df6 100644 --- a/centreon-plugins/network/ruggedcom/plugin.pm +++ b/centreon-plugins/network/ruggedcom/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/securactive/mode/bca.pm b/centreon-plugins/network/securactive/mode/bca.pm index 895c0e386..b9e75eaae 100644 --- a/centreon-plugins/network/securactive/mode/bca.pm +++ b/centreon-plugins/network/securactive/mode/bca.pm @@ -108,7 +108,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/securactive/mode/bcn.pm b/centreon-plugins/network/securactive/mode/bcn.pm index 2f48b46cb..2ae1179a4 100644 --- a/centreon-plugins/network/securactive/mode/bcn.pm +++ b/centreon-plugins/network/securactive/mode/bcn.pm @@ -100,7 +100,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/securactive/mode/listbca.pm b/centreon-plugins/network/securactive/mode/listbca.pm index 4d2bc7d0b..ac9c1c724 100644 --- a/centreon-plugins/network/securactive/mode/listbca.pm +++ b/centreon-plugins/network/securactive/mode/listbca.pm @@ -78,7 +78,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -102,7 +101,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/securactive/mode/listbcn.pm b/centreon-plugins/network/securactive/mode/listbcn.pm index 61a374929..ab9bc50d6 100644 --- a/centreon-plugins/network/securactive/mode/listbcn.pm +++ b/centreon-plugins/network/securactive/mode/listbcn.pm @@ -85,7 +85,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -121,7 +120,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/securactive/plugin.pm b/centreon-plugins/network/securactive/plugin.pm index cb74dce6a..5fc5ff8f5 100644 --- a/centreon-plugins/network/securactive/plugin.pm +++ b/centreon-plugins/network/securactive/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/sonus/sbc/plugin.pm b/centreon-plugins/network/sonus/sbc/plugin.pm index c0cc3d9cf..1eff70cc3 100644 --- a/centreon-plugins/network/sonus/sbc/plugin.pm +++ b/centreon-plugins/network/sonus/sbc/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm b/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm index d02028aa9..ece6d59e8 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/clusterload.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nodeCPULoad = '.1.3.6.1.4.1.1369.6.1.1.4.0'; diff --git a/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm b/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm index 4c59829e2..2a3e1c737 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/clusterstate.pm @@ -59,7 +59,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nodeMemberId = '.1.3.6.1.4.1.1369.6.1.1.2.0'; diff --git a/centreon-plugins/network/stonesoft/snmp/mode/connections.pm b/centreon-plugins/network/stonesoft/snmp/mode/connections.pm index 38eb0df01..a9ddad144 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/connections.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/connections.pm @@ -97,7 +97,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm b/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm index 52d6b50cd..f54223e41 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cputable = '.1.3.6.1.4.1.1369.5.2.1.11.1.1.3'; diff --git a/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm b/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm index 618b169f4..2097cc432 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/droppedpackets.pm @@ -61,7 +61,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/stonesoft/snmp/mode/memory.pm b/centreon-plugins/network/stonesoft/snmp/mode/memory.pm index d4ed35afc..383868e45 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/memory.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/memory.pm @@ -78,7 +78,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_fwMemBytesTotal = '.1.3.6.1.4.1.1369.5.2.1.11.2.4.0'; diff --git a/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm b/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm index b6fa26e9c..b3e40a24c 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/rejectedpackets.pm @@ -61,7 +61,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/network/stonesoft/snmp/mode/storage.pm b/centreon-plugins/network/stonesoft/snmp/mode/storage.pm index 0c25bec82..7c69f6ecb 100644 --- a/centreon-plugins/network/stonesoft/snmp/mode/storage.pm +++ b/centreon-plugins/network/stonesoft/snmp/mode/storage.pm @@ -67,7 +67,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/network/stonesoft/snmp/plugin.pm b/centreon-plugins/network/stonesoft/snmp/plugin.pm index ffc2821c0..f59ecd0e7 100644 --- a/centreon-plugins/network/stonesoft/snmp/plugin.pm +++ b/centreon-plugins/network/stonesoft/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm b/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm index daab7ca41..ad4cb5a38 100644 --- a/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm +++ b/centreon-plugins/network/ucopia/wlc/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/aix/local/plugin.pm b/centreon-plugins/os/aix/local/plugin.pm index adf8ddf5a..696b7963f 100644 --- a/centreon-plugins/os/aix/local/plugin.pm +++ b/centreon-plugins/os/aix/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/aix/snmp/mode/swap.pm b/centreon-plugins/os/aix/snmp/mode/swap.pm index 62fafdc63..df11c1eaf 100644 --- a/centreon-plugins/os/aix/snmp/mode/swap.pm +++ b/centreon-plugins/os/aix/snmp/mode/swap.pm @@ -57,7 +57,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # sysDescr values: diff --git a/centreon-plugins/os/aix/snmp/plugin.pm b/centreon-plugins/os/aix/snmp/plugin.pm index c420672ab..fd4095883 100644 --- a/centreon-plugins/os/aix/snmp/plugin.pm +++ b/centreon-plugins/os/aix/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/freebsd/snmp/mode/memory.pm b/centreon-plugins/os/freebsd/snmp/mode/memory.pm index 698e5f7be..06c503ad0 100644 --- a/centreon-plugins/os/freebsd/snmp/mode/memory.pm +++ b/centreon-plugins/os/freebsd/snmp/mode/memory.pm @@ -77,7 +77,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; # with bsnmpd-ucd 0.4.1 diff --git a/centreon-plugins/os/freebsd/snmp/plugin.pm b/centreon-plugins/os/freebsd/snmp/plugin.pm index 136c4a9ec..bc5fe1e80 100644 --- a/centreon-plugins/os/freebsd/snmp/plugin.pm +++ b/centreon-plugins/os/freebsd/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/linux/local/mode/connections.pm b/centreon-plugins/os/linux/local/mode/connections.pm index ae28a3783..0722fe9f1 100644 --- a/centreon-plugins/os/linux/local/mode/connections.pm +++ b/centreon-plugins/os/linux/local/mode/connections.pm @@ -312,7 +312,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->build_connections(); diff --git a/centreon-plugins/os/linux/local/plugin.pm b/centreon-plugins/os/linux/local/plugin.pm index e1d9b849d..879ea0e84 100644 --- a/centreon-plugins/os/linux/local/plugin.pm +++ b/centreon-plugins/os/linux/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/linux/snmp/plugin.pm b/centreon-plugins/os/linux/snmp/plugin.pm index dc4e05b39..701775fdb 100644 --- a/centreon-plugins/os/linux/snmp/plugin.pm +++ b/centreon-plugins/os/linux/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/solaris/local/plugin.pm b/centreon-plugins/os/solaris/local/plugin.pm index 3535e3f15..f0c12238d 100644 --- a/centreon-plugins/os/solaris/local/plugin.pm +++ b/centreon-plugins/os/solaris/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/solaris/snmp/plugin.pm b/centreon-plugins/os/solaris/snmp/plugin.pm index b9d4bc45b..1be0f2586 100644 --- a/centreon-plugins/os/solaris/snmp/plugin.pm +++ b/centreon-plugins/os/solaris/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/windows/local/plugin.pm b/centreon-plugins/os/windows/local/plugin.pm index 452e7b994..58736a3e7 100644 --- a/centreon-plugins/os/windows/local/plugin.pm +++ b/centreon-plugins/os/windows/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/windows/snmp/mode/memory.pm b/centreon-plugins/os/windows/snmp/mode/memory.pm index 815e570d9..5f6fad4a5 100644 --- a/centreon-plugins/os/windows/snmp/mode/memory.pm +++ b/centreon-plugins/os/windows/snmp/mode/memory.pm @@ -58,7 +58,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hrStorageDescr = '.1.3.6.1.2.1.25.2.3.1.3'; diff --git a/centreon-plugins/os/windows/snmp/mode/service.pm b/centreon-plugins/os/windows/snmp/mode/service.pm index 610908371..fbe477231 100644 --- a/centreon-plugins/os/windows/snmp/mode/service.pm +++ b/centreon-plugins/os/windows/snmp/mode/service.pm @@ -77,7 +77,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_svSvcEntry = '.1.3.6.1.4.1.77.1.2.3.1'; diff --git a/centreon-plugins/os/windows/snmp/mode/swap.pm b/centreon-plugins/os/windows/snmp/mode/swap.pm index 8cb773c77..7b2ddb74f 100644 --- a/centreon-plugins/os/windows/snmp/mode/swap.pm +++ b/centreon-plugins/os/windows/snmp/mode/swap.pm @@ -58,7 +58,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_hrStorageDescr = '.1.3.6.1.2.1.25.2.3.1.3'; diff --git a/centreon-plugins/os/windows/snmp/plugin.pm b/centreon-plugins/os/windows/snmp/plugin.pm index 0275918cd..dbed7c263 100644 --- a/centreon-plugins/os/windows/snmp/plugin.pm +++ b/centreon-plugins/os/windows/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/os/windows/wsman/plugin.pm b/centreon-plugins/os/windows/wsman/plugin.pm index 92a2324c4..d7cd1827d 100644 --- a/centreon-plugins/os/windows/wsman/plugin.pm +++ b/centreon-plugins/os/windows/wsman/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/snmp_standard/mode/cpu.pm b/centreon-plugins/snmp_standard/mode/cpu.pm index f07047098..3ac2e0d04 100644 --- a/centreon-plugins/snmp_standard/mode/cpu.pm +++ b/centreon-plugins/snmp_standard/mode/cpu.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cputable = '.1.3.6.1.2.1.25.3.3.1.2'; diff --git a/centreon-plugins/snmp_standard/mode/cpudetailed.pm b/centreon-plugins/snmp_standard/mode/cpudetailed.pm index 7ef1eeda7..39c3cdcb0 100644 --- a/centreon-plugins/snmp_standard/mode/cpudetailed.pm +++ b/centreon-plugins/snmp_standard/mode/cpudetailed.pm @@ -78,7 +78,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/snmp_standard/mode/diskusage.pm b/centreon-plugins/snmp_standard/mode/diskusage.pm index 943a9ca62..c4aec55c8 100644 --- a/centreon-plugins/snmp_standard/mode/diskusage.pm +++ b/centreon-plugins/snmp_standard/mode/diskusage.pm @@ -82,7 +82,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{snmp_port} = $self->{snmp}->get_port(); $self->{hostname} = $self->{snmp}->get_hostname(); diff --git a/centreon-plugins/snmp_standard/mode/dynamiccommand.pm b/centreon-plugins/snmp_standard/mode/dynamiccommand.pm index da5297202..cb5ffd34b 100644 --- a/centreon-plugins/snmp_standard/mode/dynamiccommand.pm +++ b/centreon-plugins/snmp_standard/mode/dynamiccommand.pm @@ -124,7 +124,6 @@ sub update_command { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); diff --git a/centreon-plugins/snmp_standard/mode/hardwaredevice.pm b/centreon-plugins/snmp_standard/mode/hardwaredevice.pm index 8b38cb61e..9ff8d4fa9 100644 --- a/centreon-plugins/snmp_standard/mode/hardwaredevice.pm +++ b/centreon-plugins/snmp_standard/mode/hardwaredevice.pm @@ -54,7 +54,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{output}->output_add(severity => 'OK', diff --git a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm index fdfbfb7e1..305cada4d 100644 --- a/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm +++ b/centreon-plugins/snmp_standard/mode/hardwarefibrealliance.pm @@ -172,7 +172,6 @@ sub component { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => [ diff --git a/centreon-plugins/snmp_standard/mode/listdiskspath.pm b/centreon-plugins/snmp_standard/mode/listdiskspath.pm index 80182fc02..464b2a708 100644 --- a/centreon-plugins/snmp_standard/mode/listdiskspath.pm +++ b/centreon-plugins/snmp_standard/mode/listdiskspath.pm @@ -58,7 +58,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -170,7 +169,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); diff --git a/centreon-plugins/snmp_standard/mode/liststorages.pm b/centreon-plugins/snmp_standard/mode/liststorages.pm index 62f3f5b0e..281ff3a33 100644 --- a/centreon-plugins/snmp_standard/mode/liststorages.pm +++ b/centreon-plugins/snmp_standard/mode/liststorages.pm @@ -114,7 +114,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -252,7 +251,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); diff --git a/centreon-plugins/snmp_standard/mode/loadaverage.pm b/centreon-plugins/snmp_standard/mode/loadaverage.pm index d4cc8a0ae..5c04a2d0f 100644 --- a/centreon-plugins/snmp_standard/mode/loadaverage.pm +++ b/centreon-plugins/snmp_standard/mode/loadaverage.pm @@ -76,7 +76,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_CountCpu = '.1.3.6.1.2.1.25.3.3.1.2'; diff --git a/centreon-plugins/snmp_standard/mode/memory.pm b/centreon-plugins/snmp_standard/mode/memory.pm index ea88d86ce..b4638ff17 100644 --- a/centreon-plugins/snmp_standard/mode/memory.pm +++ b/centreon-plugins/snmp_standard/mode/memory.pm @@ -77,7 +77,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_memTotalReal = '.1.3.6.1.4.1.2021.4.5.0'; diff --git a/centreon-plugins/snmp_standard/mode/ntp.pm b/centreon-plugins/snmp_standard/mode/ntp.pm index 441592568..9a7c606a4 100644 --- a/centreon-plugins/snmp_standard/mode/ntp.pm +++ b/centreon-plugins/snmp_standard/mode/ntp.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my ($ref_time, $distant_time); diff --git a/centreon-plugins/snmp_standard/mode/numericvalue.pm b/centreon-plugins/snmp_standard/mode/numericvalue.pm index d7f37984c..dc9264571 100644 --- a/centreon-plugins/snmp_standard/mode/numericvalue.pm +++ b/centreon-plugins/snmp_standard/mode/numericvalue.pm @@ -87,7 +87,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/snmp_standard/mode/printererror.pm b/centreon-plugins/snmp_standard/mode/printererror.pm index 7432ac6c5..6b427f75c 100644 --- a/centreon-plugins/snmp_standard/mode/printererror.pm +++ b/centreon-plugins/snmp_standard/mode/printererror.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{output}->output_add(severity => 'OK', diff --git a/centreon-plugins/snmp_standard/mode/processcount.pm b/centreon-plugins/snmp_standard/mode/processcount.pm index 774a7ac0b..f531cc265 100644 --- a/centreon-plugins/snmp_standard/mode/processcount.pm +++ b/centreon-plugins/snmp_standard/mode/processcount.pm @@ -154,7 +154,6 @@ sub check_top { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid2check_filter = 'status'; diff --git a/centreon-plugins/snmp_standard/mode/spanningtree.pm b/centreon-plugins/snmp_standard/mode/spanningtree.pm index abb5b2652..1d603577a 100644 --- a/centreon-plugins/snmp_standard/mode/spanningtree.pm +++ b/centreon-plugins/snmp_standard/mode/spanningtree.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_dot1dStpPortEnable = '.1.3.6.1.2.1.17.2.15.1.4'; diff --git a/centreon-plugins/snmp_standard/mode/storage.pm b/centreon-plugins/snmp_standard/mode/storage.pm index b469b442e..3d5a6a0b5 100644 --- a/centreon-plugins/snmp_standard/mode/storage.pm +++ b/centreon-plugins/snmp_standard/mode/storage.pm @@ -135,7 +135,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/snmp_standard/mode/swap.pm b/centreon-plugins/snmp_standard/mode/swap.pm index 2935dc161..b022541c8 100644 --- a/centreon-plugins/snmp_standard/mode/swap.pm +++ b/centreon-plugins/snmp_standard/mode/swap.pm @@ -64,7 +64,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_memTotalSwap = '.1.3.6.1.4.1.2021.4.3.0'; # KB diff --git a/centreon-plugins/snmp_standard/mode/tcpcon.pm b/centreon-plugins/snmp_standard/mode/tcpcon.pm index 5b38eff1b..55e8e87a0 100644 --- a/centreon-plugins/snmp_standard/mode/tcpcon.pm +++ b/centreon-plugins/snmp_standard/mode/tcpcon.pm @@ -299,7 +299,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->build_connections(); diff --git a/centreon-plugins/snmp_standard/plugin.pm b/centreon-plugins/snmp_standard/plugin.pm index 0a9e92569..d0bf3ea14 100644 --- a/centreon-plugins/snmp_standard/plugin.pm +++ b/centreon-plugins/snmp_standard/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/dell/MD3000/cli/plugin.pm b/centreon-plugins/storage/dell/MD3000/cli/plugin.pm index c50f5318a..8018d43b2 100644 --- a/centreon-plugins/storage/dell/MD3000/cli/plugin.pm +++ b/centreon-plugins/storage/dell/MD3000/cli/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm index 5c055f623..499da55ca 100644 --- a/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm +++ b/centreon-plugins/storage/dell/TL2000/mode/globalstatus.pm @@ -86,7 +86,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_TL2000StatusGlobalStatus = '.1.3.6.1.4.1.674.10893.2.102.2.1.0'; diff --git a/centreon-plugins/storage/dell/TL2000/plugin.pm b/centreon-plugins/storage/dell/TL2000/plugin.pm index 1549d1290..e44d292bb 100644 --- a/centreon-plugins/storage/dell/TL2000/plugin.pm +++ b/centreon-plugins/storage/dell/TL2000/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm index 329b5fa25..e331abb00 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/arraystats.pm @@ -198,7 +198,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm index 27206f5ae..36e4e33c8 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/diskusage.pm @@ -142,7 +142,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm index 25ae74f97..30cc22e06 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/hardware.pm @@ -165,7 +165,6 @@ sub get_member_name { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $snmp_request = [ { oid => $oid_eqlMemberName } ]; diff --git a/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm b/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm index 1d1d3f278..aa870964c 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/mode/poolusage.pm @@ -122,7 +122,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm b/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm index 54764b8e1..7ea205d59 100644 --- a/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm +++ b/centreon-plugins/storage/dell/equallogic/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm index 0803e660e..6dd742036 100644 --- a/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm +++ b/centreon-plugins/storage/dell/ml6000/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm index 44d427aa8..10f207e40 100644 --- a/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm +++ b/centreon-plugins/storage/emc/DataDomain/mode/filesystem.pm @@ -180,7 +180,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); foreach (sort keys %{$self->{fs}}) { diff --git a/centreon-plugins/storage/emc/DataDomain/plugin.pm b/centreon-plugins/storage/emc/DataDomain/plugin.pm index 0c185ecaa..bf7e91f9a 100644 --- a/centreon-plugins/storage/emc/DataDomain/plugin.pm +++ b/centreon-plugins/storage/emc/DataDomain/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/celerra/local/plugin.pm b/centreon-plugins/storage/emc/celerra/local/plugin.pm index 2cf5bbe73..882c1a4d2 100644 --- a/centreon-plugins/storage/emc/celerra/local/plugin.pm +++ b/centreon-plugins/storage/emc/celerra/local/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/clariion/plugin.pm b/centreon-plugins/storage/emc/clariion/plugin.pm index 061146d5d..29b24abb1 100644 --- a/centreon-plugins/storage/emc/clariion/plugin.pm +++ b/centreon-plugins/storage/emc/clariion/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm b/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm index 8ebeb8501..9d7d93854 100644 --- a/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm +++ b/centreon-plugins/storage/emc/recoverypoint/ssh/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm index ea589aab6..54a9da54e 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm b/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm index e3a829b1f..fd35ce71f 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm index 45eeaaab1..f23159562 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/hp/3par/7000/plugin.pm b/centreon-plugins/storage/hp/3par/7000/plugin.pm index 57f877647..c11a33aff 100644 --- a/centreon-plugins/storage/hp/3par/7000/plugin.pm +++ b/centreon-plugins/storage/hp/3par/7000/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/hp/lefthand/mode/hardware.pm b/centreon-plugins/storage/hp/lefthand/mode/hardware.pm index 437ede8d3..691d4e219 100644 --- a/centreon-plugins/storage/hp/lefthand/mode/hardware.pm +++ b/centreon-plugins/storage/hp/lefthand/mode/hardware.pm @@ -93,7 +93,6 @@ sub component { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->get_global_information(); diff --git a/centreon-plugins/storage/hp/lefthand/plugin.pm b/centreon-plugins/storage/hp/lefthand/plugin.pm index 6281dfe1e..1c19dc751 100644 --- a/centreon-plugins/storage/hp/lefthand/plugin.pm +++ b/centreon-plugins/storage/hp/lefthand/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm b/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm index 1df84e6dd..3df6de7b0 100644 --- a/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm +++ b/centreon-plugins/storage/hp/msa2000/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm index d1a15ca6b..586fee416 100644 --- a/centreon-plugins/storage/hp/msl/snmp/mode/status.pm +++ b/centreon-plugins/storage/hp/msl/snmp/mode/status.pm @@ -84,7 +84,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $result = $self->{snmp}->get_leef(oids => [$oid_hpHttpMgDeviceHealth], diff --git a/centreon-plugins/storage/hp/msl/snmp/plugin.pm b/centreon-plugins/storage/hp/msl/snmp/plugin.pm index 38cb5c45c..9f54755cd 100644 --- a/centreon-plugins/storage/hp/msl/snmp/plugin.pm +++ b/centreon-plugins/storage/hp/msl/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm b/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm index df83a3c0c..371fb14ed 100644 --- a/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm +++ b/centreon-plugins/storage/hp/p2000/xmlapi/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm index 8d956d994..55ae39f9f 100644 --- a/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS3000/cli/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm index 106e3fe21..40de84be7 100644 --- a/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS4000/cli/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm b/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm index c446e47a4..72b3e8d64 100644 --- a/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm +++ b/centreon-plugins/storage/ibm/DS5000/cli/plugin.pm @@ -29,7 +29,6 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm index 12eba93ad..a4601826a 100644 --- a/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3100/mode/globalstatus.pm @@ -86,7 +86,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_ibm3100StatusGlobalStatus = '.1.3.6.1.4.1.2.6.210.2.1.0'; diff --git a/centreon-plugins/storage/ibm/TS3100/plugin.pm b/centreon-plugins/storage/ibm/TS3100/plugin.pm index ac764f694..f9970a392 100644 --- a/centreon-plugins/storage/ibm/TS3100/plugin.pm +++ b/centreon-plugins/storage/ibm/TS3100/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm index 1f4a13020..a9fec788e 100644 --- a/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm +++ b/centreon-plugins/storage/ibm/TS3200/mode/globalstatus.pm @@ -86,7 +86,6 @@ sub get_severity { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_ibm3200StatusGlobalStatus = '.1.3.6.1.4.1.2.6.211.2.1.0'; diff --git a/centreon-plugins/storage/ibm/TS3200/plugin.pm b/centreon-plugins/storage/ibm/TS3200/plugin.pm index 5827e7e5d..583b91e15 100644 --- a/centreon-plugins/storage/ibm/TS3200/plugin.pm +++ b/centreon-plugins/storage/ibm/TS3200/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm b/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm index b6a934a14..87960e0c7 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/aggregatestate.pm @@ -148,7 +148,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm b/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm index 36ff93368..c9b4bb8b7 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cpstatistics.pm @@ -180,7 +180,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm b/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm index c8dfe96ad..bddabaefc 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/cpuload.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cpuBusyTimePerCent = '.1.3.6.1.4.1.789.1.2.1.3.0'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm b/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm index cc2123ec3..bccb1e4dd 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/diskfailed.pm @@ -45,7 +45,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_diskFailedCount = '.1.3.6.1.4.1.789.1.6.4.7.0'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/fan.pm b/centreon-plugins/storage/netapp/snmp/mode/fan.pm index cd32ff61c..deea0a679 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/fan.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/fan.pm @@ -45,7 +45,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_envFailedFanCount = '.1.3.6.1.4.1.789.1.2.4.2'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm b/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm index 4c692ce40..bb369f53b 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/globalstatus.pm @@ -121,7 +121,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm b/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm index ce146af37..6fce3a9e7 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/listfilesys.pm @@ -108,7 +108,6 @@ sub get_additional_information { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); @@ -143,7 +142,6 @@ sub disco_format { sub disco_show { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm b/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm index f744f5fd6..5ca68caab 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/ndmpsessions.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_ndmpSessionOpened = '.1.3.6.1.4.1.789.1.10.2.0'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/nvram.pm b/centreon-plugins/storage/netapp/snmp/mode/nvram.pm index 56f8395a2..757daf3bb 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/nvram.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/nvram.pm @@ -94,7 +94,6 @@ my $mapping2 = { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_nodeName = '.1.3.6.1.4.1.789.1.25.2.1.1'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm b/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm index aa01dca13..9427f45c2 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/partnerstatus.pm @@ -99,7 +99,6 @@ my $mapping4 = { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cfPartnerName = '.1.3.6.1.4.1.789.1.2.3.6'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/psu.pm b/centreon-plugins/storage/netapp/snmp/mode/psu.pm index eeba442d4..b035e1f6c 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/psu.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/psu.pm @@ -45,7 +45,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_envFailedPowerSupplyCount = '.1.3.6.1.4.1.789.1.2.4.4'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm b/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm index 35f6a2f1b..d49e59076 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/qtreeusage.pm @@ -161,7 +161,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm b/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm index de4a71180..0e681e136 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/sharecalls.pm @@ -95,7 +95,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->{hostname} = $self->{snmp}->get_hostname(); $self->{snmp_port} = $self->{snmp}->get_port(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm b/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm index 12d4aa8fb..d29b11def 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/snapmirrorlag.pm @@ -97,7 +97,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm b/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm index e12772744..137fb7eae 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/snapshotage.pm @@ -95,7 +95,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/mode/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/temperature.pm index fcd95f6b4..1acc82132 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/temperature.pm @@ -50,7 +50,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_envOverTemperature = '.1.3.6.1.4.1.789.1.2.4.1'; diff --git a/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm b/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm index a32e873ef..d454992d2 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/volumeoptions.pm @@ -90,7 +90,6 @@ sub manage_selection { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/netapp/snmp/plugin.pm b/centreon-plugins/storage/netapp/snmp/plugin.pm index c1703ea81..e4a6eae99 100644 --- a/centreon-plugins/storage/netapp/snmp/plugin.pm +++ b/centreon-plugins/storage/netapp/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm b/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm index dbe1c3ecb..f5439250d 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/cpucloud.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_cpuLoad = '.1.3.6.1.4.1.32853.1.3.1.1.1.0'; diff --git a/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm b/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm index 991e332e0..74c6bba44 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/diskusagelocal.pm @@ -56,7 +56,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; if ($self->{snmp}->is_snmpv1()) { diff --git a/centreon-plugins/storage/panzura/snmp/mode/memory.pm b/centreon-plugins/storage/panzura/snmp/mode/memory.pm index 8a2743ca8..87f15ce1d 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/memory.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/memory.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; if ($self->{snmp}->is_snmpv1()) { diff --git a/centreon-plugins/storage/panzura/snmp/mode/ratios.pm b/centreon-plugins/storage/panzura/snmp/mode/ratios.pm index 972212c27..8449aca69 100644 --- a/centreon-plugins/storage/panzura/snmp/mode/ratios.pm +++ b/centreon-plugins/storage/panzura/snmp/mode/ratios.pm @@ -95,7 +95,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/panzura/snmp/plugin.pm b/centreon-plugins/storage/panzura/snmp/plugin.pm index 787bbecad..f365ebc96 100644 --- a/centreon-plugins/storage/panzura/snmp/plugin.pm +++ b/centreon-plugins/storage/panzura/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm index 9aa58aed3..2e68bbf4f 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/hardware.pm @@ -117,7 +117,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $snmp_request = []; diff --git a/centreon-plugins/storage/qnap/snmp/mode/memory.pm b/centreon-plugins/storage/qnap/snmp/mode/memory.pm index 0d64ad67d..dd2755885 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/memory.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/memory.pm @@ -76,7 +76,6 @@ sub convert_bytes { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_SystemTotalMem = '.1.3.6.1.4.1.24681.1.2.2.0'; diff --git a/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm b/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm index 7aaa895a7..d1412bfd2 100644 --- a/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm +++ b/centreon-plugins/storage/qnap/snmp/mode/volumeusage.pm @@ -146,7 +146,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(); diff --git a/centreon-plugins/storage/qnap/snmp/plugin.pm b/centreon-plugins/storage/qnap/snmp/plugin.pm index 5d8fab070..9726110ab 100644 --- a/centreon-plugins/storage/qnap/snmp/plugin.pm +++ b/centreon-plugins/storage/qnap/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '0.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/synology/snmp/mode/components.pm b/centreon-plugins/storage/synology/snmp/mode/components.pm index 8c4d2e6c8..0d3e6ddd1 100644 --- a/centreon-plugins/storage/synology/snmp/mode/components.pm +++ b/centreon-plugins/storage/synology/snmp/mode/components.pm @@ -159,7 +159,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; diff --git a/centreon-plugins/storage/synology/snmp/mode/temperature.pm b/centreon-plugins/storage/synology/snmp/mode/temperature.pm index c50e15679..3eed30c09 100644 --- a/centreon-plugins/storage/synology/snmp/mode/temperature.pm +++ b/centreon-plugins/storage/synology/snmp/mode/temperature.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_synoSystemtemperature = '.1.3.6.1.4.1.6574.1.2.0'; # in Celsius diff --git a/centreon-plugins/storage/synology/snmp/mode/ups.pm b/centreon-plugins/storage/synology/snmp/mode/ups.pm index 6972339dc..7dbb0b21b 100644 --- a/centreon-plugins/storage/synology/snmp/mode/ups.pm +++ b/centreon-plugins/storage/synology/snmp/mode/ups.pm @@ -55,7 +55,6 @@ sub check_options { sub run { my ($self, %options) = @_; - # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; my $oid_synoUPSupsBatteryRuntimeValue = '.1.3.6.1.4.1.6574.4.3.6.1.0'; # in Seconds diff --git a/centreon-plugins/storage/synology/snmp/plugin.pm b/centreon-plugins/storage/synology/snmp/plugin.pm index c8a9aea1d..0353fd243 100644 --- a/centreon-plugins/storage/synology/snmp/plugin.pm +++ b/centreon-plugins/storage/synology/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.1'; %{$self->{modes}} = ( diff --git a/centreon-plugins/storage/violin/3000/snmp/plugin.pm b/centreon-plugins/storage/violin/3000/snmp/plugin.pm index 656cd7a59..810fe61e6 100644 --- a/centreon-plugins/storage/violin/3000/snmp/plugin.pm +++ b/centreon-plugins/storage/violin/3000/snmp/plugin.pm @@ -28,7 +28,6 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - # $options->{options} = options object $self->{version} = '1.0'; %{$self->{modes}} = ( From bd25d9f34b441f304b522fb12216c30fbd77791a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 14:12:40 +0200 Subject: [PATCH 305/346] + Fix indent --- centreon-plugins/hardware/ats/apc/mode/input.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/ats/apc/mode/input.pm b/centreon-plugins/hardware/ats/apc/mode/input.pm index 1db77790d..45b6d9f64 100644 --- a/centreon-plugins/hardware/ats/apc/mode/input.pm +++ b/centreon-plugins/hardware/ats/apc/mode/input.pm @@ -102,7 +102,7 @@ sub build_values { #if ($options{current} =~ /^$oid_inputs\.(.*)/) { if ($options{current} =~ /^$oid\.(.*)/) { $instance = $1; - #$instance =~ s/1\.1\.3\.//g; + #$instance =~ s/1\.1\.3\.//g; last; } } @@ -115,7 +115,7 @@ sub build_values { $self->{instances_done}->{$instance} = 1; $self->{counters_value}->{$instance} = {}; foreach my $oid (keys %oids) { - my $full_oid = $oid . '.' . $instance; + my $full_oid = $oid . '.' . $instance; $self->{counters_value}->{$instance}->{$oids{$oid}->{counter}} = defined($options{result}->{$oid . '.' . $instance}) ? $options{result}->{$oid . '.' . $instance} : 0; } } From b48c94f29f8974daf89a922e5446ac842aaa5f3b Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 15:23:35 +0200 Subject: [PATCH 306/346] + add telnet plugin --- .../apps/protocols/telnet/mode/scenario.pm | 180 ++++++++++++++++++ .../apps/protocols/telnet/plugin.pm | 47 +++++ 2 files changed, 227 insertions(+) create mode 100644 centreon-plugins/apps/protocols/telnet/mode/scenario.pm create mode 100644 centreon-plugins/apps/protocols/telnet/plugin.pm diff --git a/centreon-plugins/apps/protocols/telnet/mode/scenario.pm b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm new file mode 100644 index 000000000..b3cd7f201 --- /dev/null +++ b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm @@ -0,0 +1,180 @@ +# +# Copyright 2016 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 apps::protocols::telnet::mode::scenario; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use Time::HiRes qw(gettimeofday tv_interval); +use JSON; +use Net::Telnet; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "scenario:s" => { name => 'scenario' }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + # Example of a scenario file: + # [ + # {"cmd": "open", "options": { "Host": "10.0.0.1", "Port": "23", "Timeout": "30" } }, + # {"cmd": "login", "options": { "Name": "admin", "Password": "pass", "Timeout": "5" } }, + # {"cmd": "waitfor", "options": { "Match": "/string/", "Timeout": "5" } }, + # {"cmd": "put", "options": { "String": "/mystring/", "Timeout": "5" } }, + # {"cmd": "close" } + #] + if (!defined($self->{option_results}->{scenario})) { + $self->{output}->add_option_msg(short_msg => "Please specify a scenario file."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +sub read_scenario { + my ($self, %options) = @_; + + my $content_scenario = do { + local $/ = undef; + if (!open my $fh, "<", $self->{option_results}->{scenario}) { + $self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{scenario} : $!"); + $self->{output}->option_exit(); + } + <$fh>; + }; + + eval { + $self->{json_scenario} = decode_json($content_scenario); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot decode json scenario"); + $self->{output}->option_exit(); + } +} + +sub execute_scenario { + my ($self, %options) = @_; + + my $session = new Net::Telnet(); + $session->errmode('return'); + + my $timing0 = [gettimeofday]; + my ($step_ok, $exit1) = (0, 'OK'); + my $step_total = scalar(@{$self->{json_scenario}}); + foreach my $cmd (@{$self->{json_scenario}}) { + next if (!defined($cmd->{cmd})); + if ($cmd->{cmd} !~ /^(open|login|waitfor|put|close)$/i) { + $self->{output}->add_option_msg(short_msg => "command '$cmd->{cmd}' is not managed"); + $self->{output}->option_exit(); + } + + my $cmd_name = lc($cmd->{cmd}); + my $method = $session->can($cmd_name); + if ($method) { + my $ret = $method->($session, defined($cmd->{options}) ? %{$cmd->{options}} : undef); + if (!defined($ret)) { + $self->{output}->output_add(long_msg => sprintf("errmsg: %s", $session->errmsg())); + $exit1 = 'CRITICAL'; + last; + } + } + + $step_ok++; + } + + my $timeelapsed = tv_interval($timing0, [gettimeofday]); + my $exit2 = $self->{perfdata}->threshold_check(value => $timeelapsed, + threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("%d/%d steps (%.3fs)", $step_ok, $step_total, $timeelapsed)); + + $self->{output}->perfdata_add(label => "time", unit => 's', + value => sprintf('%.3f', $timeelapsed), + min => 0, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical')); + $self->{output}->perfdata_add(label => "steps", + value => $step_ok, + min => 0, + max => $step_total); +} + +sub run { + my ($self, %options) = @_; + + $self->read_scenario(); + $self->execute_scenario(); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check telnet scenario execution + +=over 8 + +=item B<--scenario> + +Scenario used + +=item B<--timeout> + +Set global execution timeout (Default: 50) + +=item B<--warning> + +Threshold warning in seconds (Scenario execution time) + +=item B<--critical> + +Threshold critical in seconds (Scenario execution time) + +=back + +=cut diff --git a/centreon-plugins/apps/protocols/telnet/plugin.pm b/centreon-plugins/apps/protocols/telnet/plugin.pm new file mode 100644 index 000000000..6409fb2d4 --- /dev/null +++ b/centreon-plugins/apps/protocols/telnet/plugin.pm @@ -0,0 +1,47 @@ +# +# Copyright 2016 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 apps::protocols::telnet::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_simple); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '0.1'; + %{$self->{modes}} = ( + 'scenario' => 'apps::protocols::telnet::mode::scenario', + ); + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check telnet server. + +=cut From 745df38cd624e87a5a0df6c645f42d55efb2a617 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 15:49:30 +0200 Subject: [PATCH 307/346] + Add option for scenario telnet --- .../apps/protocols/telnet/mode/scenario.pm | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/protocols/telnet/mode/scenario.pm b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm index b3cd7f201..09e34a43a 100644 --- a/centreon-plugins/apps/protocols/telnet/mode/scenario.pm +++ b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm @@ -39,6 +39,8 @@ sub new { "scenario:s" => { name => 'scenario' }, "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, + "hostname:s" => { name => 'hostname' }, + "port:s" => { name => 'port', default => 23 }, }); return $self; @@ -94,10 +96,18 @@ sub read_scenario { sub execute_scenario { my ($self, %options) = @_; + my $timing0 = [gettimeofday]; my $session = new Net::Telnet(); $session->errmode('return'); - my $timing0 = [gettimeofday]; + if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { + if (!$session->open(Host => $self->{option_results}->{hostname}, Port => $self->{option_results}->{port}, Timeout => 30)) { + $self->{output}->output_add(severity => 'critical', + short_msg => sprintf("cannot open session: %s", $session->errmsg())); + return ; + } + } + my ($step_ok, $exit1) = (0, 'OK'); my $step_total = scalar(@{$self->{json_scenario}}); foreach my $cmd (@{$self->{json_scenario}}) { @@ -161,12 +171,22 @@ Check telnet scenario execution =item B<--scenario> -Scenario used +Scenario used (Required) =item B<--timeout> Set global execution timeout (Default: 50) +=item B<--hostname> + +Set telnet hostname. +Could be used if you want to use the same scenario for X hosts. + +=item B<--port> + +Set telnet port. +Could be used if you want to use the same scenario for X hosts. + =item B<--warning> Threshold warning in seconds (Scenario execution time) From 5b6f781700950a2802cd16e807ba75c998d4ac6d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 16:10:39 +0200 Subject: [PATCH 308/346] + enhance telnet options --- .../apps/protocols/telnet/mode/scenario.pm | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/centreon-plugins/apps/protocols/telnet/mode/scenario.pm b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm index 09e34a43a..257ae9339 100644 --- a/centreon-plugins/apps/protocols/telnet/mode/scenario.pm +++ b/centreon-plugins/apps/protocols/telnet/mode/scenario.pm @@ -75,14 +75,19 @@ sub check_options { sub read_scenario { my ($self, %options) = @_; - my $content_scenario = do { - local $/ = undef; - if (!open my $fh, "<", $self->{option_results}->{scenario}) { - $self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{scenario} : $!"); - $self->{output}->option_exit(); - } - <$fh>; - }; + my $content_scenario; + if (-f $self->{option_results}->{scenario}) { + $content_scenario = do { + local $/ = undef; + if (!open my $fh, "<", $self->{option_results}->{scenario}) { + $self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{scenario} : $!"); + $self->{output}->option_exit(); + } + <$fh>; + }; + } else { + $content_scenario = $self->{option_results}->{scenario}; + } eval { $self->{json_scenario} = decode_json($content_scenario); @@ -171,7 +176,8 @@ Check telnet scenario execution =item B<--scenario> -Scenario used (Required) +Scenario used (Required). +Can be a file or json content. =item B<--timeout> From 028664a478bf6eba44a06a953018a91687228ad7 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 22:16:52 +0200 Subject: [PATCH 309/346] + enhance clariion mode --- .../common/emc/navisphere/mode/cache.pm | 1 - .../common/emc/navisphere/mode/disk.pm | 2 +- .../centreon/common/emc/navisphere/mode/sp.pm | 183 +++--------------- .../navisphere/mode/spcomponents/battery.pm | 21 +- .../emc/navisphere/mode/spcomponents/cable.pm | 21 +- .../emc/navisphere/mode/spcomponents/cpu.pm | 20 +- .../emc/navisphere/mode/spcomponents/fan.pm | 20 +- .../navisphere/mode/spcomponents/iomodule.pm | 20 +- .../emc/navisphere/mode/spcomponents/lcc.pm | 20 +- .../navisphere/mode/spcomponents/memory.pm | 20 +- .../emc/navisphere/mode/spcomponents/psu.pm | 20 +- .../emc/navisphere/mode/spcomponents/sp.pm | 20 +- 12 files changed, 97 insertions(+), 271 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm index d926609c3..e1c39a72b 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/cache.pm @@ -47,7 +47,6 @@ my %states = ( ], ); - sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index 676b9f4bd..a5bf080e5 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -147,7 +147,7 @@ sub set_counters { output_template => 'Utils : %.2f %%', output_use => 'utils', perfdatas => [ { label => 'utils', value => 'utils', template => '%.2f', - min => 0, max => 100, unit => '%%', label_extra_instance => 1, instance_use => 'display' }, + min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'display' }, ], } }, diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm index 778d4aaff..06eef859d 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm @@ -18,173 +18,38 @@ # limitations under the License. # -package centreon::common::emc::navisphere::mode::sp; - -use base qw(centreon::plugins::mode); +package centreon::common::emc::navisphere::mode::spcomponents::sp; use strict; use warnings; -use centreon::common::emc::navisphere::mode::spcomponents::fan; -use centreon::common::emc::navisphere::mode::spcomponents::lcc; -use centreon::common::emc::navisphere::mode::spcomponents::psu; -use centreon::common::emc::navisphere::mode::spcomponents::battery; -use centreon::common::emc::navisphere::mode::spcomponents::memory; -use centreon::common::emc::navisphere::mode::spcomponents::cpu; -use centreon::common::emc::navisphere::mode::spcomponents::iomodule; -use centreon::common::emc::navisphere::mode::spcomponents::cable; -use centreon::common::emc::navisphere::mode::spcomponents::sp; -sub new { - my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); - bless $self, $class; - - $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "getcrus-options:s" => { name => 'getcrus_options', default => '-all' }, - "exclude:s" => { name => 'exclude' }, - "component:s" => { name => 'component', default => 'all' }, - "no-component:s" => { name => 'no_component' }, - }); +sub load { }; - $self->{components} = {}; - $self->{no_components} = undef; - - return $self; -} +sub check { + my ($self) = @_; -sub check_options { - my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->{output}->output_add(long_msg => "Checking sp"); + $self->{components}->{sp} = {name => 'sp', total => 0, skip => 0}; + return if ($self->check_filter(section => 'sp')); - if (defined($self->{option_results}->{no_component})) { - if ($self->{option_results}->{no_component} ne '') { - $self->{no_components} = $self->{option_results}->{no_component}; - } else { - $self->{no_components} = 'critical'; + # SP A State: Present + while ($self->{response} =~ /^SP\s+(\S+)\s+State:\s+(.*)$/mgi) { + my $instance = $1; + my $state = $2; + + next if ($self->check_filter(section => 'sp', instance => $instance)); + $self->{components}->{sp}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("sp '%s' state is %s.", + $instance, $state) + ); + my $exit = $self->get_severity(section => 'sp', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("sp '%s' state is %s", + $instance, $state)); } } } -sub component { - my ($self, %options) = @_; - - if ($self->{option_results}->{component} eq 'all') { - centreon::common::emc::navisphere::mode::spcomponents::fan::check($self); - centreon::common::emc::navisphere::mode::spcomponents::lcc::check($self); - centreon::common::emc::navisphere::mode::spcomponents::psu::check($self); - centreon::common::emc::navisphere::mode::spcomponents::battery::check($self); - centreon::common::emc::navisphere::mode::spcomponents::cable::check($self); - centreon::common::emc::navisphere::mode::spcomponents::iomodule::check($self); - centreon::common::emc::navisphere::mode::spcomponents::memory::check($self); - centreon::common::emc::navisphere::mode::spcomponents::cpu::check($self); - centreon::common::emc::navisphere::mode::spcomponents::sp::check($self); - } elsif ($self->{option_results}->{component} eq 'sp') { - centreon::common::emc::navisphere::mode::spcomponents::sp::check($self); - } elsif ($self->{option_results}->{component} eq 'fan') { - centreon::common::emc::navisphere::mode::spcomponents::fan::check($self); - } elsif ($self->{option_results}->{component} eq 'lcc') { - centreon::common::emc::navisphere::mode::spcomponents::lcc::check($self); - } elsif ($self->{option_results}->{component} eq 'psu') { - centreon::common::emc::navisphere::mode::spcomponents::psu::check($self); - } elsif ($self->{option_results}->{component} eq 'battery') { - centreon::common::emc::navisphere::mode::spcomponents::psu::check($self); - } elsif ($self->{option_results}->{component} eq 'memory') { - centreon::common::emc::navisphere::mode::spcomponents::memory::check($self); - } elsif ($self->{option_results}->{component} eq 'cpu') { - centreon::common::emc::navisphere::mode::spcomponents::cpu::check($self); - } elsif ($self->{option_results}->{component} eq 'io') { - centreon::common::emc::navisphere::mode::spcomponents::iomodule::check($self); - } elsif ($self->{option_results}->{component} eq 'cable') { - centreon::common::emc::navisphere::mode::spcomponents::cable::check($self); - } else { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - my $total_components = 0; - my $display_by_component = ''; - my $display_by_component_append = ''; - foreach my $comp (sort(keys %{$self->{components}})) { - # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); - $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $self->{components}->{$comp}->{skip} . ' ' . $self->{components}->{$comp}->{name}; - $display_by_component_append = ', '; - } - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %s components [%s] are ok.", - $total_components, - $display_by_component) - ); - - if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); - } -} - -sub run { - my ($self, %options) = @_; - my $clariion = $options{custom}; - - $self->{response} = $clariion->execute_command(cmd => 'getcrus ' . $self->{option_results}->{getcrus_options}); - chomp $self->{response}; - - $self->component(); - - $self->{output}->display(); - $self->{output}->exit(); -} - -sub check_exclude { - my ($self, %options) = @_; - - if (defined($options{instance})) { - if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)${options{section}}[^,]*#\Q$options{instance}\E#/) { - $self->{components}->{$options{section}}->{skip}++; - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section $options{instance} instance.")); - return 1; - } - } elsif (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} =~ /(^|\s|,)$options{section}(\s|,|$)/) { - $self->{output}->output_add(long_msg => sprintf("Skipping $options{section} section.")); - return 1; - } - return 0; -} - -1; - -__END__ - -=head1 MODE - -Check status of storage processor. - -=over 8 - -=item B<--getcrus-options> - -Set option for 'getcrus' command (Default: '-all'). -'-all' option is for some new flare version. - -=item B<--component> - -Which component to check (Default: 'all'). -Can be: 'cpu', 'psu', 'pc', 'fan', 'network', 'temperature', 'storage', 'battery'. - -=item B<--exclude> - -Exclude some parts (comma seperated list) (Example: --exclude=fan,lcc) -Can also exclude specific instance: --exclude=fan#1.2#,lcc - -=item B<--no-component> - -Return an error if no compenents are checked. -If total (with skipped) is 0. (Default: 'critical' returns). - -=back - -=cut \ No newline at end of file +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm index aade7195f..5bb257dd4 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/battery.pm @@ -23,17 +23,14 @@ package centreon::common::emc::navisphere::mode::spcomponents::battery; use strict; use warnings; -my @conditions = ( - ['^(Not Ready|Testing|Unknown)$' => 'WARNING'], - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking batteries"); $self->{components}->{battery} = {name => 'battery', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'battery')); + return if ($self->check_filter(section => 'battery')); # SPS means = Standby Power Supply @@ -44,19 +41,17 @@ sub check { $instance = "$1.$2.$3.$4"; } - next if ($self->check_exclude(section => 'battery', instance => $instance)); + next if ($self->check_filter(section => 'battery', instance => $instance)); $self->{components}->{battery}->{total}++; $self->{output}->output_add(long_msg => sprintf("Battery '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("Battery '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'battery', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Battery '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm index e67ffebac..73a475465 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cable.pm @@ -23,17 +23,14 @@ package centreon::common::emc::navisphere::mode::spcomponents::cable; use strict; use warnings; -my @conditions = ( - ['^(.*Unknown.*)$' => 'WARNING'], - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking cables"); $self->{components}->{cable} = {name => 'cables', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'cable')); + return if ($self->check_filter(section => 'cable')); # Enclosure SPE SPS A Cabling State: Valid while ($self->{response} =~ /^(?:Bus\s+(\d+)\s+){0,1}Enclosure\s+(\S+)\s+(Power|SPS)\s+(\S+)\s+Cabling\s+State:\s+(.*)$/mgi) { @@ -42,19 +39,17 @@ sub check { $instance = "$1.$2.$3.$4"; } - next if ($self->check_exclude(section => 'cable', instance => $instance)); + next if ($self->check_filter(section => 'cable', instance => $instance)); $self->{components}->{cable}->{total}++; $self->{output}->output_add(long_msg => sprintf("cable '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("cable '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'cable', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("cable '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm index 52083daf2..4874e3b7f 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/cpu.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::cpu; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking cpu"); $self->{components}->{cpu} = {name => 'cpus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'cpu')); + return if ($self->check_filter(section => 'cpu')); # Enclosure SPE CPU Module A State: Present while ($self->{response} =~ /^Enclosure\s+(\S+)\s+CPU\s+Module\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = "$1.$2"; my $state = $3; - next if ($self->check_exclude(section => 'cpu', instance => $instance)); + next if ($self->check_filter(section => 'cpu', instance => $instance)); $self->{components}->{cpu}->{total}++; $self->{output}->output_add(long_msg => sprintf("cpu '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("cpu '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'cpu', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("cpu '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm index 5070bdcee..ea2598480 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/fan.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::fan; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking fans"); $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'fan')); + return if ($self->check_filter(section => 'fan')); # Bus 0 Enclosure 0 Fan A State: Present while ($self->{response} =~ /^Bus\s+(\d+)\s+Enclosure\s+(\d+)\s+Fan\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = "$1.$2.$3"; my $state = $4; - next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("fan '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("fan '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'fan', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("fan '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm index 2590978bb..4a68e5e96 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/iomodule.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::iomodule; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid|Empty)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking I/O modules"); $self->{components}->{io} = {name => 'IO module', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'io')); + return if ($self->check_filter(section => 'io')); # Enclosure SPE SP A I/O Module 0 State: Present while ($self->{response} =~ /^Enclosure\s+(\S+)\s+SP\s+(\S+)\s+I\/O\s+Module\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = "$1.$2.$3"; my $state = $4; - next if ($self->check_exclude(section => 'io', instance => $instance)); + next if ($self->check_filter(section => 'io', instance => $instance)); $self->{components}->{io}->{total}++; $self->{output}->output_add(long_msg => sprintf("I/O module '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("I/O module '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'io', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("I/O module '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm index 1d114955c..71cc1b105 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/lcc.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::lcc; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking link control card"); $self->{components}->{lcc} = {name => 'lccs', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'lcc')); + return if ($self->check_filter(section => 'lcc')); # Bus 1 Enclosure 6 LCC A State: Present while ($self->{response} =~ /^Bus\s+(\d+)\s+Enclosure\s+(\d+)\s+LCC\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = "$1.$2.$3"; my $state = $4; - next if ($self->check_exclude(section => 'lcc', instance => $instance)); + next if ($self->check_filter(section => 'lcc', instance => $instance)); $self->{components}->{lcc}->{total}++; $self->{output}->output_add(long_msg => sprintf("lcc '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("lcc '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'lcc', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("lcc '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm index 03af85d65..002bb0956 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/memory.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::memory; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking dimm"); $self->{components}->{dimm} = {name => 'dimm', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'dimm')); + return if ($self->check_filter(section => 'dimm')); # Enclosure SPE DIMM Module A State: Present while ($self->{response} =~ /^Enclosure\s+(\S+)\s+DIMM\s+Module\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = "$1.$2"; my $state = $3; - next if ($self->check_exclude(section => 'dimm', instance => $instance)); + next if ($self->check_filter(section => 'dimm', instance => $instance)); $self->{components}->{dimm}->{total}++; $self->{output}->output_add(long_msg => sprintf("Dimm '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("Dimm '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'dimm', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("dimm '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm index 86d13d2d4..b25687d83 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/psu.pm @@ -23,16 +23,14 @@ package centreon::common::emc::navisphere::mode::spcomponents::psu; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking power supplies"); $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'psu')); + return if ($self->check_filter(section => 'psu')); # Enclosure SPE Power A0 State: Present # Bus 0 Enclosure 0 Power A State: Present @@ -42,19 +40,17 @@ sub check { $instance = "$1.$2.$3.$4"; } - next if ($self->check_exclude(section => 'psu', instance => $instance)); + next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; $self->{output}->output_add(long_msg => sprintf("Power Supply '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("Power Supply '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'psu', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power Supply '%s' state is %s", + $instance, $state)); } } } diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm index 70a0d4f75..06eef859d 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/spcomponents/sp.pm @@ -23,35 +23,31 @@ package centreon::common::emc::navisphere::mode::spcomponents::sp; use strict; use warnings; -my @conditions = ( - ['^(?!(Present|Valid)$)' => 'CRITICAL'], -); +sub load { }; sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking sp"); $self->{components}->{sp} = {name => 'sp', total => 0, skip => 0}; - return if ($self->check_exclude(section => 'sp')); + return if ($self->check_filter(section => 'sp')); # SP A State: Present while ($self->{response} =~ /^SP\s+(\S+)\s+State:\s+(.*)$/mgi) { my $instance = $1; my $state = $2; - next if ($self->check_exclude(section => 'sp', instance => $instance)); + next if ($self->check_filter(section => 'sp', instance => $instance)); $self->{components}->{sp}->{total}++; $self->{output}->output_add(long_msg => sprintf("sp '%s' state is %s.", $instance, $state) ); - foreach (@conditions) { - if ($state =~ /$$_[0]/i) { - $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("sp '%s' state is %s", - $instance, $state)); - last; - } + my $exit = $self->get_severity(section => 'sp', value => $state); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("sp '%s' state is %s", + $instance, $state)); } } } From ccddf9c4d85ed42038695deac2d49bb1351eb5b2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 1 Aug 2016 22:17:42 +0200 Subject: [PATCH 310/346] + fix mode command --- centreon-plugins/os/solaris/local/mode/fmadm.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/os/solaris/local/mode/fmadm.pm b/centreon-plugins/os/solaris/local/mode/fmadm.pm index 020fe90e4..643a6a503 100644 --- a/centreon-plugins/os/solaris/local/mode/fmadm.pm +++ b/centreon-plugins/os/solaris/local/mode/fmadm.pm @@ -41,9 +41,9 @@ sub new { "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, "timeout:s" => { name => 'timeout', default => 30 }, "sudo" => { name => 'sudo' }, - "command:s" => { name => 'command', default => 'luxadm' }, + "command:s" => { name => 'command', default => 'fmadm' }, "command-path:s" => { name => 'command_path', default => '/usr/sbin' }, - "command-options:s" => { name => 'command_options', default => '-e port 2>&1' }, + "command-options:s" => { name => 'command_options', default => 'faulty -r 2>&1' }, "warning:s" => { name => 'warning', }, "critical:s" => { name => 'critical', }, }); From 30c8d99a887acb0bb325457011483a538596c8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duret?= Date: Tue, 2 Aug 2016 10:31:23 +0200 Subject: [PATCH 311/346] Possibility to skip Non/Applicable sensor value --- .../storage/netapp/snmp/mode/components/temperature.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm index a2829f392..b30ac3b54 100644 --- a/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm +++ b/centreon-plugins/storage/netapp/snmp/mode/components/temperature.pm @@ -78,6 +78,8 @@ sub check { foreach my $num (split /,/, $result->{enclTempSensorsPresent}) { $num = centreon::plugins::misc::trim($num); next if ($num !~ /[0-9]/ || !defined($current_temp[$num - 1])); + + next if ($self->check_filter(section => 'temperature', instance => $shelf_addr . '.' . $num)); $warn_under_thr[$num - 1] =~ /(-*[0-9]+)C/; my $wu_thr = $1; @@ -90,7 +92,6 @@ sub check { $current_temp[$num - 1] =~ /(-*[0-9]+)C/; my $current_value = $1; - next if ($self->check_filter(section => 'temperature', instance => $shelf_addr . '.' . $num)); $self->{components}->{temperature}->{total}++; my $status = 'ok'; @@ -134,4 +135,4 @@ sub check { } } -1; \ No newline at end of file +1; From 17bef655e902c113b6b24c688896ecae969a773c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jean-fran=C3=A7ois=20Rameau?= Date: Tue, 2 Aug 2016 18:10:46 +0200 Subject: [PATCH 312/346] Round remaining time to minutes --- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index 8b7db9daf..5f46b54c2 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -204,7 +204,7 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0'); my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0'); - $result2->{upsAdvBatteryRunTimeRemaining} = $result2->{upsAdvBatteryRunTimeRemaining} / 100 / 60 if (defined($result2->{upsAdvBatteryRunTimeRemaining})); + $result2->{upsAdvBatteryRunTimeRemaining} = sprintf "%.0f", $result2->{upsAdvBatteryRunTimeRemaining} / 100 / 60 if (defined($result2->{upsAdvBatteryRunTimeRemaining})); foreach my $name (keys %{$mapping}) { $self->{global}->{$name} = $result->{$name}; From 66d6d4bb71a900b3f20ec14bc0543b820dd26d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jean-fran=C3=A7ois=20Rameau?= Date: Tue, 2 Aug 2016 18:31:46 +0200 Subject: [PATCH 313/346] Desambiguate sprintf --- centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm index 5f46b54c2..021ccf08f 100644 --- a/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/centreon-plugins/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -204,7 +204,7 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_upsBasicBattery}, instance => '0'); my $result2 = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_upsAdvBattery}, instance => '0'); - $result2->{upsAdvBatteryRunTimeRemaining} = sprintf "%.0f", $result2->{upsAdvBatteryRunTimeRemaining} / 100 / 60 if (defined($result2->{upsAdvBatteryRunTimeRemaining})); + $result2->{upsAdvBatteryRunTimeRemaining} = sprintf("%.0f", $result2->{upsAdvBatteryRunTimeRemaining} / 100 / 60) if (defined($result2->{upsAdvBatteryRunTimeRemaining})); foreach my $name (keys %{$mapping}) { $self->{global}->{$name} = $result->{$name}; From 578d174fd8d5da1b321fe2ef99930824c479ec18 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Aug 2016 10:53:54 +0200 Subject: [PATCH 314/346] + add clever pdu plugin --- .../hardware/pdu/clever/snmp/mode/psusage.pm | 112 ++++++++++++++++++ .../hardware/pdu/clever/snmp/plugin.pm | 48 ++++++++ 2 files changed, 160 insertions(+) create mode 100644 centreon-plugins/hardware/pdu/clever/snmp/mode/psusage.pm create mode 100644 centreon-plugins/hardware/pdu/clever/snmp/plugin.pm diff --git a/centreon-plugins/hardware/pdu/clever/snmp/mode/psusage.pm b/centreon-plugins/hardware/pdu/clever/snmp/mode/psusage.pm new file mode 100644 index 000000000..0302bc2b0 --- /dev/null +++ b/centreon-plugins/hardware/pdu/clever/snmp/mode/psusage.pm @@ -0,0 +1,112 @@ +# +# Copyright 2016 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 hardware::pdu::clever::snmp::mode::psusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0 }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'power', set => { + key_values => [ { name => 'power' } ], + output_template => 'Input power : %s W', + perfdatas => [ + { label => 'power', value => 'power_absolute', template => '%s', + unit => 'W', min => 0 }, + ], + } + }, + { label => 'current', set => { + key_values => [ { name => 'current' } ], + output_template => 'Current : %s A', + perfdatas => [ + { label => 'current', value => 'current_absolute', template => '%s', + unit => 'A', min => 0 }, + ], + } + }, + { label => 'voltage', set => { + key_values => [ { name => 'voltage' } ], + output_template => 'Voltage : %s V', + perfdatas => [ + { label => 'voltage', value => 'voltage_absolute', template => '%s', + unit => 'V', min => 0 }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +my $oid_current = '.1.3.6.1.4.1.30966.1.2.1.6.0'; +my $oid_voltage = '.1.3.6.1.4.1.30966.1.2.1.9.0'; + +sub manage_selection { + my ($self, %options) = @_; + + my $result = $options{snmp}->get_leef(oids => [ $oid_current, $oid_voltage ], + nothing_quit => 1); + $self->{global} = { current => $result->{$oid_current}, voltage => $result->{$oid_voltage}, + power => $result->{$oid_current} * $result->{$oid_voltage} }; +} + +1; + +__END__ + +=head1 MODE + +Check power source usage. + +=over 8 + +=item B<--warning-*> + +Threshold warning. +Can be: 'current', 'power', 'voltage'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'current', 'power', 'voltage'. + +=back + +=cut diff --git a/centreon-plugins/hardware/pdu/clever/snmp/plugin.pm b/centreon-plugins/hardware/pdu/clever/snmp/plugin.pm new file mode 100644 index 000000000..853c2afc6 --- /dev/null +++ b/centreon-plugins/hardware/pdu/clever/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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 hardware::pdu::clever::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} = '0.1'; + %{$self->{modes}} = ( + 'ps-usage' => 'hardware::pdu::clever::snmp::mode::psusage', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check China Clever PDU in SNMP. + +=cut From ce242c5f4513ec24f00d6c224dbbf7263ee44c2f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Aug 2016 15:22:58 +0200 Subject: [PATCH 315/346] + add state for memory esx --- .../apps/vmware/connector/mode/memoryhost.pm | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm b/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm index 9c6919010..09964fecd 100644 --- a/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm +++ b/centreon-plugins/apps/vmware/connector/mode/memoryhost.pm @@ -38,8 +38,10 @@ sub new { "scope-datacenter:s" => { name => 'scope_datacenter' }, "scope-cluster:s" => { name => 'scope_cluster' }, "disconnect-status:s" => { name => 'disconnect_status', default => 'unknown' }, - "warning:s" => { name => 'warning', }, - "critical:s" => { name => 'critical', }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + "warning-state:s" => { name => 'warning_state' }, + "critical-state:s" => { name => 'critical_state' }, }); return $self; } @@ -48,13 +50,13 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); - } - if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); + foreach my $label (('warning', 'critical', 'warning_state', 'critical_state')) { + if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) { + my ($label_opt) = $label; + $label_opt =~ tr/_/-/; + $self->{output}->add_option_msg(short_msg => "Wrong " . $label_opt . " threshold '" . $self->{option_results}->{$label} . "'."); + $self->{output}->option_exit(); + } } if ($self->{output}->is_litteral_status(status => $self->{option_results}->{disconnect_status}) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong disconnect-status status option '" . $self->{option_results}->{disconnect_status} . "'."); @@ -110,6 +112,14 @@ Threshold warning in percent. Threshold critical in percent. +=item B<--warning-state> + +Threshold warning. For state != 'high': --warning-state=0 + +=item B<--critical-state> + +Threshold critical. For state != 'high': --warning-state=0 + =back =cut From b0c9aa9580a734312332a46250d2dc379a6e0b55 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Aug 2016 15:49:35 +0200 Subject: [PATCH 316/346] + Fix #457 --- centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm b/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm index c33c663fd..6caa7a169 100644 --- a/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm +++ b/centreon-plugins/apps/apache/serverstatus/mode/slotstates.pm @@ -360,14 +360,14 @@ Threshold for HTTP timeout Threshold unit (Default: '%'. Can be: '%' or 'absolute') -=item B<--warning> +=item B<--warning-*> Warning threshold. Can be: 'busy', 'free', 'waiting', 'starting', 'reading', 'sending', 'keepalive', 'dns-lookup', 'closing', 'logging', 'gracefuly-finished', 'idle-cleanup-worker'. -=item B<--critical> +=item B<--critical-*> Critical threshold. Can be: 'busy', 'free', 'waiting', 'starting', 'reading', From 7a0e70ce1214150e1d728d64584dec884cef726e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 3 Aug 2016 16:00:39 +0200 Subject: [PATCH 317/346] + prepare new version --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index 1bd77cc03..a5f0bb9bb 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160627; +my $global_version = 20160803; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index d4d08dcae..fbd05c73c 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,13 @@ +2016-08-03 Quentin Garnier + * Plugin added: to check IBM Storwize (#438) + * Plugin added: to check Sonus SBC + * Plugin added: to check Aerohive + * Plugin added: to check Digi routers + * Plugin added: to check telnet sessions + * Plugin added: to check china clever PDU + * Plugin added: to check Cisco Voice Gateway + * Some minor fix and enhancement + 2016-06-27 Quentin Garnier * Update FAQ: build a standalone perl script * Plugin added: to check Lenovo S Series (#412) From f5c0fd1fbf222448ac3358671333143d57e1b2c2 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 4 Aug 2016 11:33:08 +0200 Subject: [PATCH 318/346] + add device-vm mode for vmware connector --- .../apps/vmware/connector/mode/devicevm.pm | 149 ++++++++++++++++++ .../apps/vmware/connector/plugin.pm | 3 +- 2 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 centreon-plugins/apps/vmware/connector/mode/devicevm.pm diff --git a/centreon-plugins/apps/vmware/connector/mode/devicevm.pm b/centreon-plugins/apps/vmware/connector/mode/devicevm.pm new file mode 100644 index 000000000..4a9d2270c --- /dev/null +++ b/centreon-plugins/apps/vmware/connector/mode/devicevm.pm @@ -0,0 +1,149 @@ +# +# Copyright 2016 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 apps::vmware::connector::mode::devicevm; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "vm-hostname:s" => { name => 'vm_hostname' }, + "filter" => { name => 'filter' }, + "scope-datacenter:s" => { name => 'scope_datacenter' }, + "scope-cluster:s" => { name => 'scope_cluster' }, + "scope-host:s" => { name => 'scope_host' }, + "filter-description:s" => { name => 'filter_description' }, + "disconnect-status:s" => { name => 'disconnect_status', default => 'unknown' }, + "nopoweredon-status:s" => { name => 'nopoweredon_status', default => 'unknown' }, + "display-description" => { name => 'display_description' }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, + "device:s" => { name => 'device' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + foreach my $label (('warning', 'critical')) { + if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) { + my ($label_opt) = $label; + $label_opt =~ tr/_/-/; + $self->{output}->add_option_msg(short_msg => "Wrong " . $label_opt . " threshold '" . $self->{option_results}->{$label} . "'."); + $self->{output}->option_exit(); + } + } + + if (!defined($self->{option_results}->{device}) || $self->{option_results}->{device} eq '') { + $self->{output}->add_option_msg(short_msg => "Please set device option."); + $self->{output}->option_exit(); + } + if ($self->{output}->is_litteral_status(status => $self->{option_results}->{disconnect_status}) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong disconnect-status option '" . $self->{option_results}->{disconnect_status} . "'."); + $self->{output}->option_exit(); + } + if ($self->{output}->is_litteral_status(status => $self->{option_results}->{nopoweredon_status}) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong nopoweredon-status option '" . $self->{option_results}->{nopoweredon_status} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + $self->{connector} = $options{custom}; + + $self->{connector}->add_params(params => $self->{option_results}, + command => 'devicevm'); + $self->{connector}->run(); +} + +1; + +__END__ + +=head1 MODE + +Check virtual machine device connected. + +=over 8 + +=item B<--vm-hostname> + +VM hostname to check. +If not set, we check all VMs. + +=item B<--filter> + +VM hostname is a regexp. + +=item B<--filter-description> + +Filter also virtual machines description (can be a regexp). + +=item B<--scope-datacenter> + +Search in following datacenter(s) (can be a regexp). + +=item B<--scope-cluster> + +Search in following cluster(s) (can be a regexp). + +=item B<--scope-host> + +Search in following host(s) (can be a regexp). + +=item B<--disconnect-status> + +Status if VM disconnected (default: 'unknown'). + +=item B<--nopoweredon-status> + +Status if VM is not poweredOn (default: 'unknown'). + +=item B<--display-description> + +Display virtual machine description. + +=item B<--warning> + +Threshold warning in bytes per seconds. + +=item B<--critical> + +Threshold critical in bytes per seconds. + +=item B<--device> + +Device to check (Required) (Example: --device='VirtualCdrom'). + +=back + +=cut diff --git a/centreon-plugins/apps/vmware/connector/plugin.pm b/centreon-plugins/apps/vmware/connector/plugin.pm index 0d487db73..9eeb4c665 100644 --- a/centreon-plugins/apps/vmware/connector/plugin.pm +++ b/centreon-plugins/apps/vmware/connector/plugin.pm @@ -42,7 +42,8 @@ sub new { 'datastore-iops' => 'apps::vmware::connector::mode::datastoreiops', 'datastore-snapshot' => 'apps::vmware::connector::mode::datastoresnapshot', 'datastore-usage' => 'apps::vmware::connector::mode::datastoreusage', - 'datastore-vm' => 'apps::vmware::connector::mode::datastorevm', + 'datastore-vm' => 'apps::vmware::connector::mode::datastorevm', + 'device-vm' => 'apps::vmware::connector::mode::devicevm', 'getmap' => 'apps::vmware::connector::mode::getmap', 'health-host' => 'apps::vmware::connector::mode::healthhost', 'limit-vm' => 'apps::vmware::connector::mode::limitvm', From 673ffac4db1eb1668b880e7f4fd93eaf5c0199f8 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 5 Aug 2016 14:08:45 +0200 Subject: [PATCH 319/346] + add some guidelines --- centreon-plugins/docs/en/developer/guide.rst | 99 +++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/docs/en/developer/guide.rst b/centreon-plugins/docs/en/developer/guide.rst index edffa0f57..bc741a169 100644 --- a/centreon-plugins/docs/en/developer/guide.rst +++ b/centreon-plugins/docs/en/developer/guide.rst @@ -10,7 +10,8 @@ But to avoid reinventing the wheel, you should first take a look at the “examp There are 3 chapters: * :ref:`Quick Start `: Howto create file structure. -* :ref:`Libraries Reference `: API description. +* :ref:`Libraries Reference `: API description. +* :ref:`Code Style Guidelines `: Follow it. * :ref:`Model Classes Usage `: description of classes you should use for your plugin. The lastest version is available on following git repository: http://git.centreon.com/centreon-plugins.git @@ -1446,7 +1447,6 @@ This is an example of how to use **fetchrow_hashref** method: Output displays Postgres databases. - ***************** Complete examples ***************** @@ -1776,6 +1776,101 @@ Output may display: OK: Dropped packets due to memory limitations : 0.00 /s | dropped_packets_Per_Sec=0.00;0;;1;2 + +.. _code_style_guidelines: + +********************* +Code Style Guidelines +********************* + +------------ +Introduction +------------ + +Perl code from Pull-request must conform to the following style guidelines. If you find any code which doesn't conform, please fix it. + +----------- +Indentation +----------- + +Space should be used to indent all code blocks. Tabs should never be used to indent code blocks. Mixing tabs and spaces results in misaligned code blocks for other developers who prefer different indentation settings. +Please use 4 for indentation space width. + +.. code-block:: perl + + if ($1 > 1) { + ....return 1; + } else { + if ($i == -1) { + ....return 0; + } + return -1 + } + +-------- +Comments +-------- + +There should always be at least 1 space between the # character and the beginning of the comment. This makes it a little easier to read multi-line comments: + +.. code-block:: perl + + # Good comment + #Wrong comment + +--------------------------- +Subroutine & Variable Names +--------------------------- + +Whenever possible, use underscore to seperator words and don't use uppercase characters: + +.. code-block:: perl + + sub get_logs {} + my $start_time; + +Keys of hash table should be used alphanumeric and underscore characters only (and no quote!): + +.. code-block:: perl + + $dogs->{meapolitan_mastiff} = 10; + +--------------------------- +Curly Brackets, Parenthesis +--------------------------- + +There should be a space between every control/loop keyword and the opening parenthesis: + +.. code-block:: perl + + if ($i == 1) { + ... + } + while ($i == 2) { + ... + } + +------------------ +If/Else Statements +------------------ + +'else', 'elsif' should be on the same line after the previous closing curly brace: + +.. code-block:: perl + + if ($i == 1) { + ... + } else { + ... + } + +You can use single line if conditional: + +.. code-block:: perl + + next if ($i == 1); + + .. _model_classes_usage: ******************* From b004b1ee4023f4fef1c022e9c07d044a2039d6e4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 11 Aug 2016 15:02:58 +0200 Subject: [PATCH 320/346] + Fix #462 --- .../hardware/pdu/emerson/snmp/mode/globalstatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm b/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm index c9a747a3d..1eeb20634 100644 --- a/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm +++ b/centreon-plugins/hardware/pdu/emerson/snmp/mode/globalstatus.pm @@ -154,9 +154,9 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); my $name = defined($result->{lgpPduEntryUsrLabel}) && $result->{lgpPduEntryUsrLabel} ne '' ? $result->{lgpPduEntryUsrLabel} : $instance; - my $status = 'unknow'; + my $status = 'unknown'; foreach (keys %bitmap_status) { - if (($result->{lgpPduEntrySysStatus} & $_)) { + if ((int($result->{lgpPduEntrySysStatus}) & $_)) { $status = $bitmap_status{$_}; last; } From d323be5067acc0271a105228dfcf878f79ed4087 Mon Sep 17 00:00:00 2001 From: Erkan Date: Thu, 18 Aug 2016 10:10:58 +0200 Subject: [PATCH 321/346] fix typo --- .../network/alcatel/common/mode/components/powersupply.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm b/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm index 22902766c..75a6591ba 100644 --- a/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm +++ b/centreon-plugins/network/alcatel/common/mode/components/powersupply.pm @@ -95,7 +95,7 @@ sub check { foreach (@oper_conditions) { if ($phys_oper_status{$oper_status} =~ /$$_[0]/i) { $self->{output}->output_add(severity => $$_[1], - short_msg => sprintf("power supply '%s/%s/%s' oeprationnal status is %s", + short_msg => sprintf("power supply '%s/%s/%s' operationnal status is %s", $name, $descr, $instance, $phys_oper_status{$oper_status})); last; } @@ -103,4 +103,4 @@ sub check { } } -1; \ No newline at end of file +1; From 88601586abeb5061a636f7dfbd42605524f5c9df Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 19 Aug 2016 11:02:03 +0200 Subject: [PATCH 322/346] + Fix matching for extra oids --- centreon-plugins/snmp_standard/mode/listinterfaces.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/snmp_standard/mode/listinterfaces.pm b/centreon-plugins/snmp_standard/mode/listinterfaces.pm index 66985c012..f067adba8 100644 --- a/centreon-plugins/snmp_standard/mode/listinterfaces.pm +++ b/centreon-plugins/snmp_standard/mode/listinterfaces.pm @@ -126,7 +126,7 @@ sub check_options { foreach (@{$self->{option_results}->{add_extra_oid}}) { next if ($_ eq ''); my ($name, $oid, $matching) = split /,/; - $matching = '%{instance}' if (!defined($matching)); + $matching = '%{instance}$' if (!defined($matching)); if (!defined($oid) || $oid !~ /^(\.\d+){1,}$/ || $name eq '') { $self->{output}->add_option_msg(short_msg => "Wrong syntax for add-extra-oid '" . $_ . "' option."); $self->{output}->option_exit(); From bde6c000470b80c427bd9e8ff08659fae7d055ac Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 24 Aug 2016 12:06:32 +0200 Subject: [PATCH 323/346] + add quantum scalar plugin in snmp --- .../tape/snmp/mode/components/component.pm | 78 ++++++++++++ .../adic/tape/snmp/mode/components/fan.pm | 117 ++++++++++++++++++ .../adic/tape/snmp/mode/components/global.pm | 30 +++-- .../snmp/mode/components/physicaldrive.pm | 60 +++++---- .../tape/snmp/mode/components/temperature.pm | 117 ++++++++++++++++++ .../common/adic/tape/snmp/mode/hardware.pm | 41 +++++- .../storage/quantum/scalar/snmp/plugin.pm | 48 +++++++ 7 files changed, 458 insertions(+), 33 deletions(-) create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/component.pm create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/fan.pm create mode 100644 centreon-plugins/centreon/common/adic/tape/snmp/mode/components/temperature.pm create mode 100644 centreon-plugins/storage/quantum/scalar/snmp/plugin.pm diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/component.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/component.pm new file mode 100644 index 000000000..50a3bc195 --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/component.pm @@ -0,0 +1,78 @@ +# +# Copyright 2016 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 centreon::common::adic::tape::snmp::mode::components::component; + +use strict; +use warnings; +use centreon::plugins::misc; + +my %map_status = ( + 1 => 'unknown', + 2 => 'unused', + 3 => 'ok', + 4 => 'warning', + 5 => 'failed', +); + +# In MIB 'ADIC-INTELLIGENT-STORAGE-MIB' +my $mapping = { + componentDisplayName => { oid => '.1.3.6.1.4.1.3764.1.1.30.10.1.3' }, + componentStatus => { oid => '.1.3.6.1.4.1.3764.1.1.30.10.1.8', map => \%map_status }, +}; +my $oid_componentEntry = '.1.3.6.1.4.1.3764.1.1.30.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_componentEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking components"); + $self->{components}->{component} = {name => 'components', total => 0, skip => 0}; + return if ($self->check_filter(section => 'component')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_componentEntry}})) { + next if ($oid !~ /^$mapping->{componentStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_componentEntry}, instance => $instance); + + next if ($self->check_filter(section => 'component', instance => $result->{componentDisplayName})); + $self->{components}->{component}->{total}++; + + $result->{componentDisplayName} =~ s/\s+/ /g; + $result->{componentDisplayName} = centreon::plugins::misc::trim($result->{componentDisplayName}); + $self->{output}->output_add(long_msg => sprintf("component '%s' status is %s [instance: %s].", + $result->{componentDisplayName}, $result->{componentStatus}, + $result->{componentDisplayName} + )); + my $exit = $self->get_severity(section => 'component', value => $result->{componentStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Component '%s' status is %s", + $result->{componentDisplayName}, $result->{componentStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/fan.pm new file mode 100644 index 000000000..2b0d91828 --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/fan.pm @@ -0,0 +1,117 @@ +# +# Copyright 2016 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 centreon::common::adic::tape::snmp::mode::components::fan; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'nominal', + 2 => 'warningLow', 3 => 'warningHigh', + 4 => 'alarmLow', 5 => 'alarmHigh', + 6 => 'notInstalled', 7 => 'noData', +); + +my $mapping = { + coolingFanName => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.2' }, + coolingFanStatus => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.3', map => \%map_status }, + coolingFanRPM => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.4' }, + coolingFanWarningHi => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.8' }, + coolingFanNominalHi => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.6' }, + coolingFanNominalLo => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.5' }, + coolingFanWarningLo => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.7' }, + coolingFanLocation => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.40.1.9' }, +}; +my $oid_coolingFanEntry = '.1.3.6.1.4.1.3764.1.1.200.200.40.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_coolingFanEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fans"); + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_coolingFanEntry}})) { + next if ($oid !~ /^$mapping->{coolingFanStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_coolingFanEntry}, instance => $instance); + + $result->{coolingFanName} =~ s/\s+/ /g; + $result->{coolingFanName} = centreon::plugins::misc::trim($result->{coolingFanName}); + $result->{coolingFanLocation} =~ s/,/_/g; + my $id = $result->{coolingFanName} . '_' . $result->{coolingFanLocation}; + + next if ($self->check_filter(section => 'fan', instance => $id)); + $self->{components}->{fan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance = %s] [value = %s]", + $id, $result->{coolingFanStatus}, $id, + $result->{coolingFanRPM})); + + my $exit = $self->get_severity(label => 'sensor', section => 'fan', value => $result->{coolingFanStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("fan '%s' status is '%s'", $id, $result->{coolingFanStatus})); + next; + } + + if (defined($result->{coolingFanRPM}) && $result->{coolingFanRPM} =~ /[0-9]/) { + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{coolingFanRPM}); + if ($checked == 0) { + $result->{coolingFanNominalLo} = (defined($result->{coolingFanNominalLo}) && $result->{coolingFanNominalLo} =~ /[0-9]/) ? + $result->{coolingFanNominalLo} : ''; + $result->{coolingFanWarningLo} = (defined($result->{coolingFanWarningLo}) && $result->{coolingFanWarningLo} =~ /[0-9]/) ? + $result->{coolingFanWarningLo} : ''; + $result->{coolingFanNominalHi} = (defined($result->{coolingFanNominalHi}) && $result->{coolingFanNominalHi} =~ /[0-9]/) ? + $result->{coolingFanNominalHi} : ''; + $result->{coolingFanWarningHi} = (defined($result->{coolingFanWarningHi}) && $result->{coolingFanWarningHi} =~ /[0-9]/) ? + $result->{coolingFanWarningHi} : ''; + my $warn_th = $result->{coolingFanNominalLo} . ':' . $result->{coolingFanNominalHi}; + my $crit_th = $result->{coolingFanWarningLo} . ':' . $result->{coolingFanWarningHi}; + $self->{perfdata}->threshold_validate(label => 'warning-fan-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-fan-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{coolingFanRPM}, threshold => [ { label => 'critical-fan-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-fan-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-fan-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-fan-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' is %s rpm", $id, $result->{coolingFanRPM})); + } + $self->{output}->perfdata_add(label => 'fan_' . $id, unit => 'rpm', + value => $result->{coolingFanRPM}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm index cbc31f51c..29914680d 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/global.pm @@ -32,16 +32,29 @@ my %map_status = ( 6 => 'unknown', 7 => 'invalid', ); +my %map_agent_status = ( + 1 => 'other', + 2 => 'unknown', + 3 => 'ok', + 4 => 'non-critical', + 5 => 'critical', + 6 => 'non-recoverable', +); # In MIB 'ADIC-TAPE-LIBRARY-MIB' my $mapping = { - libraryGlobalStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.1.8', map => \%map_status }, + GlobalStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.1.8', map => \%map_status }, # libraryGlobalStatus +}; +# In MIB 'ADIC-INTELLIGENT-STORAGE-MIB' +my $mapping2 = { + GlobalStatus => { oid => '.1.3.6.1.4.1.3764.1.1.20.1', map => \%map_agent_status }, # agentGlobalStatus }; sub load { my ($self) = @_; - push @{$self->{request}}, { oid => $mapping->{libraryGlobalStatus}->{oid} }; + push @{$self->{request}}, { oid => $mapping->{GlobalStatus}->{oid} }, + { oid => $mapping2->{GlobalStatus}->{oid} }; } sub check { @@ -52,8 +65,11 @@ sub check { return if ($self->check_filter(section => 'global')); my $instance = '0'; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{libraryGlobalStatus}->{oid}}, instance => $instance); - if (!defined($result->{libraryGlobalStatus})) { + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{GlobalStatus}->{oid}}, instance => $instance); + if (!defined($result->{GlobalStatus})) { + $result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{GlobalStatus}->{oid}}, instance => $instance); + } + if (!defined($result->{GlobalStatus})) { $self->{output}->output_add(long_msg => "skipping global status: no value."); return ; } @@ -62,13 +78,13 @@ sub check { $self->{components}->{global}->{total}++; $self->{output}->output_add(long_msg => sprintf("library global status is %s [instance: %s].", - $result->{libraryGlobalStatus}, $instance + $result->{GlobalStatus}, $instance )); - my $exit = $self->get_severity(section => 'global', label => 'default', value => $result->{libraryGlobalStatus}); + my $exit = $self->get_severity(section => 'global', label => 'default', value => $result->{GlobalStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Library global status is %s", - $result->{libraryGlobalStatus})); + $result->{GlobalStatus})); } } diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm index f839dd943..650f04205 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/physicaldrive.pm @@ -34,18 +34,30 @@ my %map_status = ( 7 => 'invalid', ); -# In MIB 'ADIC-TAPE-LIBRARY-MIB' my $mapping = { - phDriveSerialNumber => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.2' }, - phDriveModel => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.3' }, - phDriveRasStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.11', map => \%map_status }, + # 'ADIC-TAPE-LIBRARY-MIB' + adic_tape => { + phDriveSerialNumber => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.2' }, + phDriveModel => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.3' }, + phDriveRasStatus => { oid => '.1.3.6.1.4.1.3764.1.10.10.11.3.1.11', map => \%map_status }, + }, + # 'ADIC-MANAGEMENT-MIB' + adic_management => { + phDriveSerialNumber => { oid => '.1.3.6.1.4.1.3764.1.1.200.20.80.110.1.8' }, + phDriveModel => { oid => '.1.3.6.1.4.1.3764.1.1.200.20.80.110.1.7' }, # phDriveProduct + phDriveRasStatus => { oid => '.1.3.6.1.4.1.3764.1.1.200.20.80.110.1.31', map => \%map_status }, + } }; -my $oid_physicalDriveEntry = '.1.3.6.1.4.1.3764.1.10.10.11.3.1'; + +my %oid_table = ( + adic_tape => '.1.3.6.1.4.1.3764.1.10.10.11.3.1', # physicalDriveEntry + adic_management => '.1.3.6.1.4.1.3764.1.1.200.20.80.110.1', # phDriveEntry +); sub load { my ($self) = @_; - push @{$self->{request}}, { oid => $oid_physicalDriveEntry }; + push @{$self->{request}}, { oid => $oid_table{adic_tape} }, { oid => $oid_table{adic_management} }; } sub check { @@ -54,25 +66,29 @@ sub check { $self->{output}->output_add(long_msg => "Checking physical drives"); $self->{components}->{physicaldrive} = {name => 'physical drives', total => 0, skip => 0}; return if ($self->check_filter(section => 'physicaldrive')); + + foreach my $label (keys %{$mapping}) { + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_table{$label}}})) { + next if ($oid !~ /^$mapping->{$label}->{phDriveRasStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$label}, results => $self->{results}->{$oid_table{$label}}, instance => $instance); - foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_physicalDriveEntry}})) { - next if ($oid !~ /^$mapping->{phDriveRasStatus}->{oid}\.(.*)$/); - my $instance = $1; - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_physicalDriveEntry}, instance => $instance); + $result->{phDriveSerialNumber} = centreon::plugins::misc::trim($result->{phDriveSerialNumber}); - next if ($self->check_filter(section => 'physicaldrive', instance => $instance)); - $self->{components}->{physicaldrive}->{total}++; + next if ($self->check_filter(section => 'physicaldrive', instance => $result->{phDriveSerialNumber})); + $self->{components}->{physicaldrive}->{total}++; - $self->{output}->output_add(long_msg => sprintf("physical drive '%s' status is %s [instance: %s, model: %s, serial: %s].", - $instance, $result->{phDriveRasStatus}, - $instance, centreon::plugins::misc::trim($result->{phDriveModel}), - centreon::plugins::misc::trim($result->{phDriveSerialNumber}) - )); - my $exit = $self->get_severity(section => 'physicaldrive', label => 'default', value => $result->{phDriveRasStatus}); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Physical drive '%s' status is %s", - $instance, $result->{phDriveRasStatus})); + $self->{output}->output_add(long_msg => sprintf("physical drive '%s' status is %s [instance: %s, model: %s, serial: %s].", + $result->{phDriveSerialNumber}, $result->{phDriveRasStatus}, + $result->{phDriveSerialNumber}, centreon::plugins::misc::trim($result->{phDriveModel}), + centreon::plugins::misc::trim($result->{phDriveSerialNumber}) + )); + my $exit = $self->get_severity(section => 'physicaldrive', label => 'default', value => $result->{phDriveRasStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Physical drive '%s' status is %s", + $result->{phDriveSerialNumber}, $result->{phDriveRasStatus})); + } } } } diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/temperature.pm new file mode 100644 index 000000000..49821f26a --- /dev/null +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/components/temperature.pm @@ -0,0 +1,117 @@ +# +# Copyright 2016 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 centreon::common::adic::tape::snmp::mode::components::temperature; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'nominal', + 2 => 'warningLow', 3 => 'warningHigh', + 4 => 'alarmLow', 5 => 'alarmHigh', + 6 => 'notInstalled', 7 => 'noData', +); + +my $mapping = { + temperatureSensorName => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.2' }, + temperatureSensorStatus => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.3', map => \%map_status }, + temperatureSensorDegreesCelsius => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.4' }, + temperatureSensorWarningHi => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.8' }, + temperatureSensorNominalHi => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.6' }, + temperatureSensorNominalLo => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.5' }, + temperatureSensorWarningLo => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.7' }, + temperatureSensorLocation => { oid => '.1.3.6.1.4.1.3764.1.1.200.200.30.1.9' }, +}; +my $oid_temperatureSensorEntry = '.1.3.6.1.4.1.3764.1.1.200.200.30.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_temperatureSensorEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_temperatureSensorEntry}})) { + next if ($oid !~ /^$mapping->{temperatureSensorStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureSensorEntry}, instance => $instance); + + $result->{temperatureSensorName} =~ s/\s+/ /g; + $result->{temperatureSensorName} = centreon::plugins::misc::trim($result->{temperatureSensorName}); + $result->{temperatureSensorLocation} =~ s/,/_/g; + my $id = $result->{temperatureSensorName} . '_' . $result->{temperatureSensorLocation}; + + next if ($self->check_filter(section => 'temperature', instance => $id)); + $self->{components}->{temperature}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s' [instance = %s] [value = %s]", + $id, $result->{temperatureSensorStatus}, $id, + $result->{temperatureSensorDegreesCelsius})); + + my $exit = $self->get_severity(label => 'sensor', section => 'temperature', value => $result->{temperatureSensorStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' status is '%s'", $id, $result->{temperatureSensorStatus})); + next; + } + + if (defined($result->{temperatureSensorDegreesCelsius}) && $result->{temperatureSensorDegreesCelsius} =~ /[0-9]/) { + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{temperatureSensorDegreesCelsius}); + if ($checked == 0) { + $result->{temperatureSensorNominalLo} = (defined($result->{temperatureSensorNominalLo}) && $result->{temperatureSensorNominalLo} =~ /[0-9]/) ? + $result->{temperatureSensorNominalLo} : ''; + $result->{temperatureSensorWarningLo} = (defined($result->{temperatureSensorWarningLo}) && $result->{temperatureSensorWarningLo} =~ /[0-9]/) ? + $result->{temperatureSensorWarningLo} : ''; + $result->{temperatureSensorNominalHi} = (defined($result->{temperatureSensorNominalHi}) && $result->{temperatureSensorNominalHi} =~ /[0-9]/) ? + $result->{temperatureSensorNominalHi} : ''; + $result->{temperatureSensorWarningHi} = (defined($result->{temperatureSensorWarningHi}) && $result->{temperatureSensorWarningHi} =~ /[0-9]/) ? + $result->{temperatureSensorWarningHi} : ''; + my $warn_th = $result->{temperatureSensorNominalLo} . ':' . $result->{temperatureSensorNominalHi}; + my $crit_th = $result->{temperatureSensorWarningLo} . ':' . $result->{temperatureSensorWarningHi}; + $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{temperatureSensorDegreesCelsius}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' is %s degree centigrade", $id, $result->{temperatureSensorDegreesCelsius})); + } + $self->{output}->perfdata_add(label => 'temp_' . $id, unit => 'C', + value => $result->{temperatureSensorDegreesCelsius}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm index 9a1ae3f0d..76683d9fd 100644 --- a/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm +++ b/centreon-plugins/centreon/common/adic/tape/snmp/mode/hardware.pm @@ -28,7 +28,8 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(global|physicaldrive|subsystem)$'; + $self->{regexp_threshold_overload_check_section_option} = '^(global|physicaldrive|subsystem|component|temperature)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -41,11 +42,33 @@ sub set_system { ['informational', 'OK'], ['unknown', 'UNKNOWN'], ['invalid', 'CRITICAL'], + + ['other', 'OK'], + ['ok', 'OK'], + ['non-critical', 'WARNING'], + ['critical', 'CRITICAL'], + ['non-recoverable', 'CRITICAL'], + ], + component => [ + ['unknown', 'UNKNOWN'], + ['unused', 'OK'], + ['ok', 'OK'], + ['warning', 'WARNING'], + ['failed', 'CRITICAL'], + ], + sensor => [ + ['nominal', 'OK'], + ['warningLow', 'WARNING'], + ['warningHigh', 'CRITICAL'], + ['alarmLow', 'CRITICAL'], + ['alarmHigh', 'CRITICAL'], + ['notInstalled', 'OK'], + ['noData', 'OK'], ], }; $self->{components_path} = 'centreon::common::adic::tape::snmp::mode::components'; - $self->{components_module} = ['global', 'physicaldrive', 'subsystem']; + $self->{components_module} = ['global', 'physicaldrive', 'subsystem', 'component', 'temperature', 'fan']; } sub snmp_execute { @@ -57,7 +80,7 @@ sub snmp_execute { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; $self->{version} = '1.0'; @@ -81,7 +104,7 @@ Check Hardware. =item B<--component> Which component to check (Default: '.*'). -Can be: 'global', 'physicaldrive', 'subsystem'. +Can be: 'global', 'physicaldrive', 'subsystem', 'component', 'temperature', 'fan'. =item B<--filter> @@ -99,6 +122,16 @@ Set to overload default threshold values (syntax: section,[instance,]status,rege It used before default thresholds (order stays). Example: --threshold-overload='physicaldrive,OK,invalid' +=item B<--warning> + +Set warning threshold (syntax: type,regexp,threshold) +Example: --warning='temperature,.*,30' + +=item B<--critical> + +Set critical threshold (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,40' + =back =cut \ No newline at end of file diff --git a/centreon-plugins/storage/quantum/scalar/snmp/plugin.pm b/centreon-plugins/storage/quantum/scalar/snmp/plugin.pm new file mode 100644 index 000000000..ae3b83bc2 --- /dev/null +++ b/centreon-plugins/storage/quantum/scalar/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::quantum::scalar::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}} = ( + 'hardware' => 'centreon::common::adic::tape::snmp::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Quantum Scalar (i6000, i500, ...) in SNMP. + +=cut From 6a051d559d29349d970ec2aba505348da05a4143 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 24 Aug 2016 15:35:10 +0200 Subject: [PATCH 324/346] + add plugin to monitor hnas in snmp --- .../common/bluearc/snmp/mode/clusterstatus.pm | 201 ++++++++++++ .../bluearc/snmp/mode/components/fan.pm | 87 +++++ .../bluearc/snmp/mode/components/psu.pm | 72 +++++ .../bluearc/snmp/mode/components/sysdrive.pm | 73 +++++ .../snmp/mode/components/temperature.pm | 86 +++++ .../common/bluearc/snmp/mode/hardware.pm | 137 ++++++++ .../common/bluearc/snmp/mode/volumeusage.pm | 300 ++++++++++++++++++ .../storage/hitachi/hnas/snmp/plugin.pm | 52 +++ 8 files changed, 1008 insertions(+) create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/clusterstatus.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/components/fan.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/components/psu.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/components/sysdrive.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/components/temperature.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/hardware.pm create mode 100644 centreon-plugins/centreon/common/bluearc/snmp/mode/volumeusage.pm create mode 100644 centreon-plugins/storage/hitachi/hnas/snmp/plugin.pm diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/clusterstatus.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/clusterstatus.pm new file mode 100644 index 000000000..edb7156fa --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/clusterstatus.pm @@ -0,0 +1,201 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::clusterstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'node', type => 1, cb_prefix_output => 'prefix_node_output', message_multiple => 'All nodes are ok' } + ]; + + $self->{maps_counters}->{node} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'state' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_threshold_output'), + } + }, + ]; +} + +my $instance_mode; + +sub custom_threshold_output { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } elsif (defined($instance_mode->{option_results}->{unknown_status}) && $instance_mode->{option_results}->{unknown_status} ne '' && + eval "$instance_mode->{option_results}->{unknown_status}") { + $status = 'unknown'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'state : ' . $self->{result_values}->{state}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub prefix_node_output { + my ($self, %options) = @_; + + return "Node '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "unknown-status:s" => { name => 'unknown_status', default => '%{state} =~ /unknown/' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{state} =~ /offline/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status', 'unknown_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_vnode_status = ( + 1 => 'unknown', + 2 => 'onLine', + 3 => 'offLine', +); + +my $mapping = { + clusterVNodeName => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.5.11.1.2' }, + clusterVNodeStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.5.11.1.4', map => \%map_vnode_status }, +}; +my $oid_clusterVNodeEntry = '.1.3.6.1.4.1.11096.6.1.1.1.2.5.11.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{node} = {}; + $self->{results} = $options{snmp}->get_table(oid => $oid_clusterVNodeEntry, + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{clusterVNodeStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{clusterVNodeName} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{clusterVNodeName} . "': no matching filter.", debug => 1); + next; + } + + $self->{node}->{$instance} = { display => $result->{clusterVNodeName}, + state => $result->{clusterVNodeStatus}}; + } + + if (scalar(keys %{$self->{node}}) <= 0) { + $self->{output}->output_add(severity => 'OK', + short_msg => 'No node(s) finded'); + } +} + +1; + +__END__ + +=head1 MODE + +Check node status. + +=over 8 + +=item B<--filter-name> + +Filter node name (can be a regexp). + +=item B<--unknown-status> + +Set warning threshold for status (Default: '%{state} =~ /unknown/'). +Can used special variables like: %{state}, %{display} + +=item B<--warning-status> + +Set warning threshold for status (Default: -). +Can used special variables like: %{state}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{state} =~ /offline/i'). +Can used special variables like: %{state}, %{display} + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/components/fan.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/fan.pm new file mode 100644 index 000000000..e8456ca8d --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/fan.pm @@ -0,0 +1,87 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::components::fan; + +use strict; +use warnings; + +my %map_speed_status = ( + 1 => 'ok', + 2 => 'warning', + 3 => 'severe', + 4 => 'unknown', +); + +my $mapping = { + fanSpeedStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.1.11.1.4', map => \%map_speed_status }, + fanSpeed => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.1.11.1.5' }, +}; +my $oid_fanEntry = '.1.3.6.1.4.1.11096.6.1.1.1.2.1.11.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_fanEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fans"); + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_fanEntry}})) { + next if ($oid !~ /^$mapping->{fanSpeedStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fan', instance => $instance)); + $self->{components}->{fan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance = %s] [value = %s]", + $instance, $result->{fanSpeedStatus}, $instance, + $result->{fanSpeedStatus})); + + my $exit = $self->get_severity(section => 'fan.speed', value => $result->{fanSpeedStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' status is '%s'", $instance, $result->{fanSpeedStatus})); + next; + } + + if (defined($result->{fanSpeedStatus}) && $result->{fanSpeedStatus} =~ /[0-9]/) { + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{temperatureSensorCReading}); + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Fan '%s' is %s rpm", $instance, $result->{fanSpeedStatus})); + } + $self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm', + value => $result->{fanSpeedStatus}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/components/psu.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/psu.pm new file mode 100644 index 000000000..303f9eb60 --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/psu.pm @@ -0,0 +1,72 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::components::psu; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'ok', + 2 => 'failed', + 3 => 'notFitted', + 4 => 'unknown', +); + +my $mapping = { + psuStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.1.13.1.3', map => \%map_status }, +}; +my $oid_psuEntry = '.1.3.6.1.4.1.11096.6.1.1.1.2.1.13.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_psuEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power supplies"); + $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'psu')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_psuEntry}})) { + next if ($oid !~ /^$mapping->{psuStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_psuEntry}, instance => $instance); + + next if ($self->check_filter(section => 'psu', instance => $instance)); + $self->{components}->{psu}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance: %s].", + $instance, $result->{psuStatus}, + $instance + )); + my $exit = $self->get_severity(section => 'psu', value => $result->{psuStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power supply '%s' status is '%s'", + $instance, $result->{psuStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/components/sysdrive.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/sysdrive.pm new file mode 100644 index 000000000..03097928b --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/sysdrive.pm @@ -0,0 +1,73 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::components::sysdrive; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'online', 2 => 'corrupt', 3 => 'failed', + 4 => 'notPresent', 5 => 'disconnected', + 6 => 'offline', 7 => 'initializing', + 8 => 'formatting', 9 => 'unknown', +); + +my $mapping = { + sysDriveWWN => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.4.2.1.2' }, + sysDriveStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.4.2.1.4', map => \%map_status }, +}; +my $oid_sysDriveEntry = '.1.3.6.1.4.1.11096.6.1.1.1.3.4.2.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_sysDriveEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking system drives"); + $self->{components}->{sysdrive} = {name => 'sysdrives', total => 0, skip => 0}; + return if ($self->check_filter(section => 'sysdrive')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_sysDriveEntry}})) { + next if ($oid !~ /^$mapping->{sysDriveStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_sysDriveEntry}, instance => $instance); + + next if ($self->check_filter(section => 'sysdrive', instance => $result->{sysDriveWWN})); + $self->{components}->{sysdrive}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("system drive '%s' status is '%s' [instance: %s].", + $result->{sysDriveWWN}, $result->{sysDriveStatus}, + $result->{sysDriveWWN} + )); + my $exit = $self->get_severity(section => 'sysdrive', value => $result->{sysDriveStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("System drive '%s' status is '%s'", + $result->{sysDriveWWN}, $result->{sysDriveStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/components/temperature.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/temperature.pm new file mode 100644 index 000000000..024410fb4 --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/components/temperature.pm @@ -0,0 +1,86 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::components::temperature; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'ok', 2 => 'tempWarning', 3 => 'tempSevere', + 4 => 'tempSensorFailed', 5 => 'tempSensorWarning', + 6 => 'unknown', +); + +my $mapping = { + temperatureSensorStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.1.9.1.3', map => \%map_status }, + temperatureSensorCReading => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.2.1.9.1.4' }, +}; +my $oid_temperatureSensorEntry = '.1.3.6.1.4.1.11096.6.1.1.1.2.1.9.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_temperatureSensorEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_temperatureSensorEntry}})) { + next if ($oid !~ /^$mapping->{temperatureSensorStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_temperatureSensorEntry}, instance => $instance); + + next if ($self->check_filter(section => 'temperature', instance => $instance)); + $self->{components}->{temperature}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("temperature '%s' status is '%s' [instance = %s] [value = %s]", + $instance, $result->{temperatureSensorStatus}, $instance, + $result->{temperatureSensorCReading})); + + my $exit = $self->get_severity(section => 'temperature', value => $result->{temperatureSensorStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' status is '%s'", $instance, $result->{temperatureSensorStatus})); + next; + } + + if (defined($result->{temperatureSensorCReading}) && $result->{temperatureSensorCReading} =~ /[0-9]/) { + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{temperatureSensorCReading}); + + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Temperature '%s' is %s degree centigrade", $instance, $result->{temperatureSensorCReading})); + } + $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', + value => $result->{temperatureSensorCReading}, + warning => $warn, + critical => $crit, + ); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/hardware.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/hardware.pm new file mode 100644 index 000000000..28930bc26 --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/hardware.pm @@ -0,0 +1,137 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu|sysdrive)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + psu => [ + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ['notFitted', 'WARNING'], + ['unknown', 'UNKNOWN'], + ], + 'fan.speed' => [ + ['ok', 'OK'], + ['warning', 'WARNING'], + ['severe', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ], + temperature => [ + ['ok', 'OK'], + ['tempWarning', 'WARNING'], + ['tempSevere', 'CRITICAL'], + ['tempSensorFailed', 'CRITICAL'], + ['tempSensorWarning', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ], + sysdrive => [ + ['online', 'OK'], + ['corrupt', 'WARNING'], + ['failed', 'CRITICAL'], + ['notPresent', 'OK'], + ['disconnected', 'WARNING'], + ['offline', 'OK'], + ['initializing', 'OK'], + ['formatting', 'OK'], + ['unknown', 'UNKNOWN'], + ], + }; + + $self->{components_path} = 'centreon::common::bluearc::snmp::mode::components'; + $self->{components_module} = ['temperature', 'fan', 'psu', 'sysdrive']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check Hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'temperature', 'fan', 'psu', 'sysdrive'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=sysdrive) +Can also exclude specific instance: --filter=sysdrive,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='sysdrive,OK,formatting' + +=item B<--warning> + +Set warning threshold (syntax: type,regexp,threshold) +Example: --warning='temperature,.*,30' + +=item B<--critical> + +Set critical threshold (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,40' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/centreon/common/bluearc/snmp/mode/volumeusage.pm b/centreon-plugins/centreon/common/bluearc/snmp/mode/volumeusage.pm new file mode 100644 index 000000000..171e4302f --- /dev/null +++ b/centreon-plugins/centreon/common/bluearc/snmp/mode/volumeusage.pm @@ -0,0 +1,300 @@ +# +# Copyright 2016 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 centreon::common::bluearc::snmp::mode::volumeusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'volume', type => 1, cb_prefix_output => 'prefix_volume_output', message_multiple => 'All volumes are ok' } + ]; + + $self->{maps_counters}->{volume} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /needsChecking/i' }, + "critical-status:s" => { name => 'critical_status', default => '' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_volume_output { + my ($self, %options) = @_; + + return "Volume '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %map_volume_status = ( + 1 => 'unformatted', + 2 => 'mounted', + 3 => 'formatted', + 4 => 'needsChecking', +); + +my $mapping = { + volumeLabel => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.5.2.1.3' }, + volumeStatus => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.5.2.1.4', map => \%map_volume_status }, + volumeCapacity => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.5.2.1.5' }, + volumeFreeCapacity => { oid => '.1.3.6.1.4.1.11096.6.1.1.1.3.5.2.1.6' }, +}; +my $oid_volumeEntry = '.1.3.6.1.4.1.11096.6.1.1.1.3.5.2.1'; + +sub manage_selection { + my ($self, %options) = @_; + + if ($options{snmp}->is_snmpv1()) { + $self->{output}->add_option_msg(short_msg => "Need to use SNMP v2c or v3."); + $self->{output}->option_exit(); + } + + $self->{volume} = {}; + $self->{results} = $options{snmp}->get_table(oid => $oid_volumeEntry, + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{volumeStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{volumeLabel} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{volumeLabel} . "': no matching filter.", debug => 1); + next; + } + + $self->{volume}->{$instance} = { display => $result->{volumeLabel}, + status => $result->{volumeStatus}, + total => $result->{volumeCapacity}, + used => $result->{volumeCapacity} - $result->{volumeFreeCapacity} }; + } + + + if (scalar(keys %{$self->{volume}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No volume found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check volume usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter volume name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{status} =~ /needsChecking/i'). +Can used special variables like: %{status}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: -). +Can used special variables like: %{status}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage'. + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=back + +=cut diff --git a/centreon-plugins/storage/hitachi/hnas/snmp/plugin.pm b/centreon-plugins/storage/hitachi/hnas/snmp/plugin.pm new file mode 100644 index 000000000..31b5ef62e --- /dev/null +++ b/centreon-plugins/storage/hitachi/hnas/snmp/plugin.pm @@ -0,0 +1,52 @@ +# +# Copyright 2016 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::hitachi::hnas::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}} = ( + 'cluster-status' => 'centreon::common::bluearc::snmp::mode::clusterstatus', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'hardware' => 'centreon::common::bluearc::snmp::mode::hardware', + 'volume-usage' => 'centreon::common::bluearc::snmp::mode::volumeusage', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Hitachi HNAS in SNMP. + +=cut From d83640604db4d89c4c4bc55ab89cc89dfa7b0b80 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 26 Aug 2016 17:02:42 +0200 Subject: [PATCH 325/346] + Fix #231 --- .../snmp/mode/components/component.pm | 101 +++++++++++++++++ .../standard/snmp/mode/components/dkc.pm | 82 ++++++++++++++ .../standard/snmp/mode/components/dku.pm | 78 +++++++++++++ .../hitachi/standard/snmp/mode/hardware.pm | 106 ++++++++++++++++++ .../storage/hitachi/standard/snmp/plugin.pm | 48 ++++++++ 5 files changed, 415 insertions(+) create mode 100644 centreon-plugins/storage/hitachi/standard/snmp/mode/components/component.pm create mode 100644 centreon-plugins/storage/hitachi/standard/snmp/mode/components/dkc.pm create mode 100644 centreon-plugins/storage/hitachi/standard/snmp/mode/components/dku.pm create mode 100644 centreon-plugins/storage/hitachi/standard/snmp/mode/hardware.pm create mode 100644 centreon-plugins/storage/hitachi/standard/snmp/plugin.pm diff --git a/centreon-plugins/storage/hitachi/standard/snmp/mode/components/component.pm b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/component.pm new file mode 100644 index 000000000..a361de8f0 --- /dev/null +++ b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/component.pm @@ -0,0 +1,101 @@ +# +# Copyright 2016 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::hitachi::standard::snmp::mode::components::component; + +use strict; +use warnings; + +my %map_status = ( + 0 => 'ok', + 1 => 'abnormal', +); +my %mapping_type = ( + 0 => 'drive', + 1 => 'spare drive', + 2 => 'data drive', + 3 => 'ENC', + 5 => 'notUsed', + 6 => 'warning', + 7 => 'Other controller', + 8 => 'UPS', + 9 => 'loop', + 10 => 'path', + 11 => 'NAS Server', + 12 => 'NAS Path', + 13 => 'NAS UPS', + 14 => 'notUsed', + 15 => 'notUsed', + 16 => 'battery', + 17 => 'power supply', + 18 => 'AC', + 19 => 'BK', + 20 => 'fan', + 21 => 'notUsed', + 22 => 'notUsed', + 23 => 'notUsed', + 24 => 'cache memory', + 25 => 'SATA spare disk', + 26 => 'SATA data drive', + 27 => 'SENC status', + 28 => 'HostConnector', + 29 => 'notUsed', + 30 => 'notUsed', + 31 => 'notUsed', + ); + +my $oid_dfRegressionStatus = '.1.3.6.1.4.1.116.5.11.1.2.2.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_dfRegressionStatus }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking components"); + $self->{components}->{component} = {name => 'components', total => 0, skip => 0}; + return if ($self->check_filter(section => 'component')); + + return if (!defined($self->{results}->{$oid_dfRegressionStatus}->{$oid_dfRegressionStatus . '.0'})); + + foreach my $bit_num (sort keys %mapping_type) { + my $bit_indicate = int($self->{results}->{$oid_dfRegressionStatus}->{$oid_dfRegressionStatus . '.0'}) & (1 << int($bit_num)); + $bit_indicate = 1 if ($bit_indicate > 0); + my $status = $map_status{$bit_indicate}; + next if ($self->check_filter(section => 'component', instance => $mapping_type{$bit_num})); + $self->{components}->{component}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("component '%s' status is '%s' [instance: %s].", + $mapping_type{$bit_num}, $status, + $mapping_type{$bit_num} + )); + my $exit = $self->get_severity(section => 'component', instance => $mapping_type{$bit_num}, value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Component '%s' status is '%s'", + $mapping_type{$bit_num}, $status)); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dkc.pm b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dkc.pm new file mode 100644 index 000000000..5abcea76a --- /dev/null +++ b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dkc.pm @@ -0,0 +1,82 @@ +# +# Copyright 2016 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::hitachi::standard::snmp::mode::components::dkc; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'noError', + 2 => 'acute', + 3 => 'serious', + 4 => 'moderate', + 5 => 'service', +); + +my $mapping = { + dkcHWProcessor => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.2', map => \%map_status, type => 'processor' }, + dkcHWCSW => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.3', map => \%map_status, type => 'bus' }, + dkcHWCache => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.4', map => \%map_status, type => 'cache' }, + dkcHWSM => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.5', map => \%map_status, type => 'memory' }, + dkcHWPS => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.6', map => \%map_status, type => 'psu' }, + dkcHWBattery => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.7', map => \%map_status, type => 'battery' }, + dkcHWFan => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.8', map => \%map_status, type => 'fan' }, + dkcHWEnvironment => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.6.1.9', map => \%map_status, type => 'environment' }, +}; +my $oid_raidExMibDKCHWEntry = '.1.3.6.1.4.1.116.5.11.4.1.1.6.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_raidExMibDKCHWEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controller chassis"); + $self->{components}->{dkc} = {name => 'dkc', total => 0, skip => 0}; + return if ($self->check_filter(section => 'dkc')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_raidExMibDKCHWEntry}})) { + next if ($oid !~ /^$mapping->{dkcHWProcessor}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_raidExMibDKCHWEntry}, instance => $instance); + + $self->{components}->{dkc}->{total}++; + + foreach (keys %{$mapping}) { + next if ($self->check_filter(section => 'dkc', instance => $1 . '.' . $mapping->{$_}->{type})); + $self->{output}->output_add(long_msg => sprintf("dkc '%s' %s status is '%s' [instance: %s].", + $instance, $mapping->{$_}->{type}, $result->{$_}, + $instance . '.' . $mapping->{$_}->{type} + )); + my $exit = $self->get_severity(label => 'dk', section => 'dkc', instance => $1 . '.' . $mapping->{$_}->{type}, value => $result->{$_}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("DKC '%s' %s status is '%s'", + $instance, $mapping->{$_}->{type}, $result->{$_})); + } + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dku.pm b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dku.pm new file mode 100644 index 000000000..dc17316b3 --- /dev/null +++ b/centreon-plugins/storage/hitachi/standard/snmp/mode/components/dku.pm @@ -0,0 +1,78 @@ +# +# Copyright 2016 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::hitachi::standard::snmp::mode::components::dku; + +use strict; +use warnings; + +my %map_status = ( + 1 => 'noError', + 2 => 'acute', + 3 => 'serious', + 4 => 'moderate', + 5 => 'service', +); + +my $mapping = { + dkuHWPS => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.7.1.2', map => \%map_status, type => 'psu' }, + dkuHWFan => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.7.1.3', map => \%map_status, type => 'fan' }, + dkuHWEnvironment => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.7.1.4', map => \%map_status, type => 'environment' }, + dkuHWDrive => { oid => '.1.3.6.1.4.1.116.5.11.4.1.1.7.1.5', map => \%map_status, type => 'drive' }, +}; +my $oid_raidExMibDKUHWEntry = '.1.3.6.1.4.1.116.5.11.4.1.1.7.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_raidExMibDKUHWEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking drive chassis"); + $self->{components}->{dku} = {name => 'dku', total => 0, skip => 0}; + return if ($self->check_filter(section => 'dku')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_raidExMibDKUHWEntry}})) { + next if ($oid !~ /^$mapping->{dkuHWEnvironment}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_raidExMibDKUHWEntry}, instance => $instance); + + $self->{components}->{dku}->{total}++; + + foreach (keys %{$mapping}) { + next if ($self->check_filter(section => 'dku', instance => $1 . '.' . $mapping->{$_}->{type})); + $self->{output}->output_add(long_msg => sprintf("dku '%s' %s status is '%s' [instance: %s].", + $instance, $mapping->{$_}->{type}, $result->{$_}, + $instance . '.' . $mapping->{$_}->{type} + )); + my $exit = $self->get_severity(label => 'dk', section => 'dku', instance => $1 . '.' . $mapping->{$_}->{type}, value => $result->{$_}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("DKU '%s' %s status is '%s'", + $instance, $mapping->{$_}->{type}, $result->{$_})); + } + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/hitachi/standard/snmp/mode/hardware.pm b/centreon-plugins/storage/hitachi/standard/snmp/mode/hardware.pm new file mode 100644 index 000000000..c7e25a89d --- /dev/null +++ b/centreon-plugins/storage/hitachi/standard/snmp/mode/hardware.pm @@ -0,0 +1,106 @@ +# +# Copyright 2016 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::hitachi::standard::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(component|dkc|dku)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + component => [ + ['ok', 'OK'], + ['abnormal', 'CRITICAL'], + ], + dk => [ + ['noError', 'OK'], + ['acute', 'CRITICAL'], + ['serious', 'CRITICAL'], + ['moderate', 'UNKNOWN'], + ['service', 'OK'], + ], + }; + + $self->{components_path} = 'storage::hitachi::standard::snmp::mode::components'; + $self->{components_module} = ['component', 'dkc', 'dku']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check Hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'component', 'dkc', 'dku'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=dkc) +Can also exclude specific instance: --filter=dkc,1.fan + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='component,NAS Server,OK,abnormal' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/hitachi/standard/snmp/plugin.pm b/centreon-plugins/storage/hitachi/standard/snmp/plugin.pm new file mode 100644 index 000000000..da2fa06da --- /dev/null +++ b/centreon-plugins/storage/hitachi/standard/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::hitachi::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}} = ( + 'hardware' => 'storage::hitachi::standard::snmp::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Hitachi Storage (9990, df600,...) in SNMP. + +=cut From aa52322efe284abed53fff2f7d07c88433d03a75 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 29 Aug 2016 11:04:24 +0200 Subject: [PATCH 326/346] + fix clariion sp mode --- .../centreon/common/emc/navisphere/mode/sp.pm | 134 ++++++++++++++---- 1 file changed, 106 insertions(+), 28 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm index 06eef859d..b8e9b7f00 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/sp.pm @@ -18,38 +18,116 @@ # limitations under the License. # -package centreon::common::emc::navisphere::mode::spcomponents::sp; +package centreon::common::emc::navisphere::mode::sp; + +use base qw(centreon::plugins::templates::hardware); use strict; use warnings; -sub load { }; - -sub check { - my ($self) = @_; - - $self->{output}->output_add(long_msg => "Checking sp"); - $self->{components}->{sp} = {name => 'sp', total => 0, skip => 0}; - return if ($self->check_filter(section => 'sp')); +sub set_system { + my ($self, %options) = @_; - # SP A State: Present - while ($self->{response} =~ /^SP\s+(\S+)\s+State:\s+(.*)$/mgi) { - my $instance = $1; - my $state = $2; - - next if ($self->check_filter(section => 'sp', instance => $instance)); - $self->{components}->{sp}->{total}++; - - $self->{output}->output_add(long_msg => sprintf("sp '%s' state is %s.", - $instance, $state) - ); - my $exit = $self->get_severity(section => 'sp', value => $state); - if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("sp '%s' state is %s", - $instance, $state)); - } - } + $self->{regexp_threshold_overload_check_section_option} = '^(fan|lcc|psu|battery|memory|cpu|iomodule|cable)$'; + + $self->{cb_hook2} = 'navisphere_execute'; + + $self->{thresholds} = { + battery => [ + ['^(Not Ready|Testing|Unknown)$', 'WARNING'], + ['^(?!(Present|Valid)$)', 'CRITICAL'], + ['.*', 'OK'], + ], + psu => [ + ['^(?!(Present|Valid)$)', 'CRITICAL'], + ['.*', 'OK'], + ], + sp => [ + ['^(?!(Present|Valid)$)', 'CRITICAL'], + ['.*', 'OK'], + ], + cable => [ + ['^(.*Unknown.*)$' => 'WARNING'], + ['^(?!(Present|Valid)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + cpu => [ + ['^(?!(Present|Valid)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + fan => [ + ['^(?!(Present|Valid)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + io => [ + ['^(?!(Present|Valid|Empty)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + lcc => [ + ['^(?!(Present|Valid)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + dimm => [ + ['^(?!(Present|Valid)$)' => 'CRITICAL'], + ['.*', 'OK'], + ], + }; + + $self->{components_path} = 'centreon::common::emc::navisphere::mode::spcomponents'; + $self->{components_module} = ['fan', 'lcc', 'psu', 'battery', 'memory', 'cpu', 'iomodule', 'cable']; } -1; \ No newline at end of file +sub navisphere_execute { + my ($self, %options) = @_; + + $self->{response} = $options{custom}->execute_command(cmd => 'getcrus ' . $self->{option_results}->{getcrus_options}); + chomp $self->{response}; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "getcrus-options:s" => { name => 'getcrus_options', default => '-all' }, + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check status of storage processor. + +=over 8 + +=item B<--getcrus-options> + +Set option for 'getcrus' command (Default: '-all'). +'-all' option is for some new flare version. + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'fan', 'lcc', 'psu', 'battery', 'memory', 'cpu', 'iomodule', 'cable'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=lcc --filter=fan) +Can also exclude specific instance: --filter=fan,1.2 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=back + +=cut \ No newline at end of file From 473436eb8f211e226b90f37e769daaf9c4a770e1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 29 Aug 2016 14:25:04 +0200 Subject: [PATCH 327/346] + add hp storeonce ssh plugin --- .../storage/hp/storeonce/ssh/custom/custom.pm | 170 ++++++++++++++++++ .../storeonce/ssh/mode/components/hardware.pm | 97 ++++++++++ .../ssh/mode/components/serviceset.pm | 85 +++++++++ .../storage/hp/storeonce/ssh/mode/hardware.pm | 126 +++++++++++++ .../storage/hp/storeonce/ssh/plugin.pm | 49 +++++ 5 files changed, 527 insertions(+) create mode 100644 centreon-plugins/storage/hp/storeonce/ssh/custom/custom.pm create mode 100644 centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm create mode 100644 centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm create mode 100644 centreon-plugins/storage/hp/storeonce/ssh/mode/hardware.pm create mode 100644 centreon-plugins/storage/hp/storeonce/ssh/plugin.pm diff --git a/centreon-plugins/storage/hp/storeonce/ssh/custom/custom.pm b/centreon-plugins/storage/hp/storeonce/ssh/custom/custom.pm new file mode 100644 index 000000000..8e1f2118a --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/ssh/custom/custom.pm @@ -0,0 +1,170 @@ +# +# Copyright 2016 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::hp::storeonce::ssh::custom::custom; + +use strict; +use warnings; +use centreon::plugins::misc; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + if (!defined($options{output})) { + print "Class Custom: Need to specify 'output' argument.\n"; + exit 3; + } + if (!defined($options{options})) { + $options{output}->add_option_msg(short_msg => "Class Custom: Need to specify 'options' argument."); + $options{output}->option_exit(); + } + + if (!defined($options{noptions})) { + $options{options}->add_options(arguments => + { + "hostname:s" => { name => 'hostname' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 45 }, + "command:s" => { name => 'command' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options' }, + }); + } + $options{options}->add_help(package => __PACKAGE__, sections => 'SSH OPTIONS', once => 1); + + $self->{output} = $options{output}; + $self->{mode} = $options{mode}; + + return $self; +} + +sub set_options { + my ($self, %options) = @_; + + $self->{option_results} = $options{option_results}; +} + +sub set_defaults { + my ($self, %options) = @_; + + foreach (keys %{$options{default}}) { + if ($_ eq $self->{mode}) { + for (my $i = 0; $i < scalar(@{$options{default}->{$_}}); $i++) { + foreach my $opt (keys %{$options{default}->{$_}[$i]}) { + if (!defined($self->{option_results}->{$opt}[$i])) { + $self->{option_results}->{$opt}[$i] = $options{default}->{$_}[$i]->{$opt}; + } + } + } + } + } +} + +sub check_options { + my ($self, %options) = @_; + + $self->{option_results}->{remote} = 1; + if (defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '') { + $self->{option_results}->{remote} = 0; + } elsif (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') { + $self->{output}->add_option_msg(short_msg => "Need to set hostname option."); + $self->{output}->option_exit(); + } + + return 0; +} + +############## +# Specific methods +############## +sub execute_command { + my ($self, %options) = @_; + + $self->{ssh_commands} = ''; + foreach (@{$options{commands}}) { + $self->{ssh_commands} .= "$_\n"; + } + return centreon::plugins::misc::execute(output => $self->{output}, + options => $self->{option_results}, + ssh_pipe => 1, + command => defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '' ? $self->{option_results}->{command} : $self->{ssh_commands} . "exit\n", + command_path => $self->{option_results}->{command_path}, + command_options => defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne '' ? $self->{option_results}->{command_options} : undef); +} + +1; + +__END__ + +=head1 NAME + +ssh + +=head1 SYNOPSIS + +my ssh + +=head1 SSH OPTIONS + +=over 8 + +=item B<--hostname> + +Hostname to query. + +=item B<--ssh-option> + +Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). + +=item B<--ssh-path> + +Specify ssh command path (default: none) + +=item B<--ssh-command> + +Specify ssh command (default: 'ssh'). Useful to use 'plink'. + +=item B<--timeout> + +Timeout in seconds for the command (Default: 45). + +=item B<--command> + +Command to get information. Used it you have output in a file. + +=item B<--command-path> + +Command path. + +=item B<--command-options> + +Command options. + +=back + +=head1 DESCRIPTION + +B. + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm new file mode 100644 index 000000000..4c86dd885 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm @@ -0,0 +1,97 @@ +# +# Copyright 2016 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::hp::storeonce::ssh::mode::components::hardware; + +use strict; +use warnings; +use centreon::plugins::misc; + +sub load { + my ($self) = @_; + + #Name + #------------------------------------------------------------------ + #hp80239e8624-1 + # Dev-id = 31343337-3338-5A43-3235-323430375631 + # Status = OK + # message = - + # type = server + # model = ProLiant DL380p Gen8 + # serialNumber = CZ252407V1 + # firmwareVersion = P70 07/01/2015 + # location = - + # warrantySerialNumber = CZ35283EK4 + # warrantyPartNumber = BB896A + # SKU = 734183-B21 + # + #hp80239e8624-2 + # Dev-id = 31343337-3338-5A43-3235-323431303648 + # Status = OK + # message = - + # type = server + # model = ProLiant DL380p Gen8 + # serialNumber = CZ2524106H + # firmwareVersion = P70 07/01/2015 + # location = - + # warrantySerialNumber = CZ35283EK4 + # warrantyPartNumber = BB896A + # SKU = 734183-B21 + + push @{$self->{commands}}, "hardware show status details"; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking hardwares"); + $self->{components}->{hardware} = {name => 'hardwares', total => 0, skip => 0}; + return if ($self->check_filter(section => 'hardware')); + + return if ($self->{result} !~ />\s*hardware show status details(.*?)\n>/msi); + my $content = $1; + + while ($content =~ /^(\S+[^\n]*?)\n\s+(.*?)\n\s*?\n/msgi) { + my ($name, $details) = (centreon::plugins::misc::trim($1), $2); + + $details =~ /type.*?=\s*(.*?)\n/msi; + my $type = centreon::plugins::misc::trim($1); + $details =~ /Status.*?=\s*(.*?)\n/msi; + my $status = centreon::plugins::misc::trim($1); + $details =~ /Dev-id.*?=\s*(.*?)\n/msi; + my $dev_id = centreon::plugins::misc::trim($1); + + next if ($self->check_filter(section => 'hardware', instance => $type . '.' . $dev_id)); + $self->{components}->{hardware}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("%s '%s' status is '%s' [instance: %s, name: %s].", + $type, $dev_id, $status, + $type . '.' . $dev_id, $name + )); + my $exit = $self->get_severity(section => 'hardware', instance => $type . '.' . $dev_id, value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("%s '%s' status is '%s'", + $type, $dev_id, $status)); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm new file mode 100644 index 000000000..a6d44aac1 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm @@ -0,0 +1,85 @@ +# +# Copyright 2016 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::hp::storeonce::ssh::mode::components::serviceset; + +use strict; +use warnings; + +sub load { + my ($self) = @_; + + #Service Set 1 Status + #------------- ------- + #Overall : Running + #StoreOnce Subsystem : Running + #Virtual Tape : Running + #NAS : Running + #StoreOnce Catalyst : Running + #Replication : Running + #Housekeeping : Running + # + #Service Set 2 Status + #------------- ------- + #Overall : Running + #StoreOnce Subsystem : Running + #Virtual Tape : Running + #NAS : Running + #StoreOnce Catalyst : Running + #Replication : Running + #Housekeeping : Running + + push @{$self->{commands}}, "serviceset show status"; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking service sets"); + $self->{components}->{serviceset} = {name => 'service sets', total => 0, skip => 0}; + return if ($self->check_filter(section => 'serviceset')); + + return if ($self->{result} !~ />\s*serviceset show status(.*?)\n>/msi); + my $content = $1; + + while ($content =~ /^Service Set (\d+).*?\n(.*?)\n\s*?\n/msgi) { + my ($num, $details) = ($1, $2); + + while ($details =~ /^([^\n]+?):\s*(.*?)\n/msgi) { + my ($instance, $status) = (centreon::plugins::misc::trim($1), centreon::plugins::misc::trim($2)); + + next if ($self->check_filter(section => 'serviceset', instance => $num . '.' . $instance)); + $self->{components}->{serviceset}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("service set '%s' %s status is '%s' [instance: %s].", + $num, $instance, $status, + $num . '.' . $instance + )); + my $exit = $self->get_severity(section => 'serviceset', instance => $num . '.' . $instance, value => $status); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("service set '%s' %s status is '%s'", + $num, $instance, $status)); + } + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/hp/storeonce/ssh/mode/hardware.pm b/centreon-plugins/storage/hp/storeonce/ssh/mode/hardware.pm new file mode 100644 index 000000000..428207e54 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/ssh/mode/hardware.pm @@ -0,0 +1,126 @@ +# +# Copyright 2016 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::hp::storeonce::ssh::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = + '^(hardware|serviceset)$'; + + $self->{cb_hook2} = 'ssh_execute'; + + $self->{thresholds} = { + hardware => [ + ['ok', 'OK'], + ['failed', 'CRITICAL'], + ['degraded', 'WARNING'], + ['missing', 'OK'], + ], + serviceset => [ + ['running', 'OK'], + ['fault', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'storage::hp::storeonce::ssh::mode::components'; + $self->{components_module} = ['hardware', 'serviceset']; +} + +sub ssh_execute { + my ($self, %options) = @_; + + ($self->{result}, $self->{exit_code}) = $options{custom}->execute_command(commands => $self->{commands}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + $self->{commands} = []; + return $self; +} + +sub get_hasharray { + my ($self, %options) = @_; + + my $result = []; + return $result if ($options{content} eq ''); + my ($header, @lines) = split /\n/, $options{content}; + my @header_names = split /$options{delim}/, $header; + + for (my $i = 0; $i <= $#lines; $i++) { + my @content = split /$options{delim}/, $lines[$i]; + my $data = {}; + for (my $j = 0; $j <= $#header_names; $j++) { + $data->{$header_names[$j]} = $content[$j]; + } + push @$result, $data; + } + + return $result; +} + +1; + +__END__ + +=head1 MODE + +Check components (hardware and service set). + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'hardware', 'serviceset'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=hardware --filter=serviceset) +Can also exclude specific instance: --filter=hardware,storageCluster + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='hardware,networkSwitch,OK,degraded' + +=back + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/ssh/plugin.pm b/centreon-plugins/storage/hp/storeonce/ssh/plugin.pm new file mode 100644 index 000000000..cdd48867e --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/ssh/plugin.pm @@ -0,0 +1,49 @@ +# +# Copyright 2016 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::hp::storeonce::ssh::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}} = ( + 'components' => 'storage::hp::storeonce::ssh::mode::hardware', + ); + + $self->{custom_modes}{ssh} = 'storage::hp::storeonce::ssh::custom::custom'; + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check HP Storeonce in SSH. + +=cut From dd102898a30303939c0d601e5c26421c692ca939 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 1 Sep 2016 11:45:58 +0200 Subject: [PATCH 328/346] + add plugin for overland snmp --- centreon-plugins/centreon/plugins/snmp.pm | 4 +- .../neo/snmp/mode/components/drive.pm | 74 ++++++++++ .../neo/snmp/mode/components/library.pm | 71 ++++++++++ .../overland/neo/snmp/mode/eventlog.pm | 131 ++++++++++++++++++ .../overland/neo/snmp/mode/hardware.pm | 107 ++++++++++++++ .../storage/overland/neo/snmp/plugin.pm | 50 +++++++ 6 files changed, 436 insertions(+), 1 deletion(-) create mode 100644 centreon-plugins/storage/overland/neo/snmp/mode/components/drive.pm create mode 100644 centreon-plugins/storage/overland/neo/snmp/mode/components/library.pm create mode 100644 centreon-plugins/storage/overland/neo/snmp/mode/eventlog.pm create mode 100644 centreon-plugins/storage/overland/neo/snmp/mode/hardware.pm create mode 100644 centreon-plugins/storage/overland/neo/snmp/plugin.pm diff --git a/centreon-plugins/centreon/plugins/snmp.pm b/centreon-plugins/centreon/plugins/snmp.pm index 069d8b879..448a4cada 100644 --- a/centreon-plugins/centreon/plugins/snmp.pm +++ b/centreon-plugins/centreon/plugins/snmp.pm @@ -761,8 +761,10 @@ sub map_instance { my ($self, %options) = @_; my $results = {}; + my $instance = ''; + $instance = '.' . $options{instance} if (defined($options{instance})); foreach my $name (keys %{$options{mapping}}) { - my $entry = $options{mapping}->{$name}->{oid} . '.' . $options{instance}; + my $entry = $options{mapping}->{$name}->{oid} . $instance; if (defined($options{results}->{$entry})) { $results->{$name} = $options{results}->{$entry}; } elsif (defined($options{results}->{$options{mapping}->{$name}->{oid}}->{$entry})) { diff --git a/centreon-plugins/storage/overland/neo/snmp/mode/components/drive.pm b/centreon-plugins/storage/overland/neo/snmp/mode/components/drive.pm new file mode 100644 index 000000000..94cee4e1f --- /dev/null +++ b/centreon-plugins/storage/overland/neo/snmp/mode/components/drive.pm @@ -0,0 +1,74 @@ +# +# Copyright 2016 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::overland::neo::snmp::mode::components::drive; + +use strict; +use warnings; + +my %map_state = ( + 0 => 'initializedNoError', + 1 => 'initializedWithError', + 2 => 'notInitialized', + 3 => 'notInstalled', + 4 => 'notInserted', +); + +my $mapping = { + dstState => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.1.1.3', map => \%map_state }, + dstSerialNum => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.1.1.8' }, +}; +my $oid_driveStatusEntry = '.1.3.6.1.4.1.3351.1.3.2.3.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_driveStatusEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking drives"); + $self->{components}->{drive} = {name => 'drives', total => 0, skip => 0}; + return if ($self->check_filter(section => 'drive')); + + # there is no instance for the table. Weird. Need to manage the two cases. + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_driveStatusEntry}})) { + next if ($oid !~ /^$mapping->{dstState}->{oid}(?:\.(.*)|$)/); + my $instance = defined($1) ? $1 : undef; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_driveStatusEntry}, instance => $instance); + + # we set a 1 to do some filters + $instance = '1' if (!defined($instance)); + next if ($self->check_filter(section => 'drive', instance => $instance)); + + $self->{components}->{drive}->{total}++; + $self->{output}->output_add(long_msg => sprintf("drive '%s' status is '%s' [instance = %s]", + $instance, $result->{dstState}, $instance)); + my $exit = $self->get_severity(section => 'drive', instance => $instance, value => $result->{dstState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("drive '%s' status is '%s'", $instance, $result->{dstState})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/overland/neo/snmp/mode/components/library.pm b/centreon-plugins/storage/overland/neo/snmp/mode/components/library.pm new file mode 100644 index 000000000..d0a492f4f --- /dev/null +++ b/centreon-plugins/storage/overland/neo/snmp/mode/components/library.pm @@ -0,0 +1,71 @@ +# +# Copyright 2016 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::overland::neo::snmp::mode::components::library; + +use strict; +use warnings; + +my %map_state = ( + 0 => 'initializing', + 1 => 'online', + 2 => 'offline', +); + +my $mapping = { + lstLibraryState => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.2.1.6', map => \%map_state }, +}; +my $oid_libraryStatusEntry = '.1.3.6.1.4.1.3351.1.3.2.3.2.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_libraryStatusEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking libraries"); + $self->{components}->{library} = {name => 'libraries', total => 0, skip => 0}; + return if ($self->check_filter(section => 'library')); + + # there is no instance for the table. Weird. Need to manage the two cases. + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_libraryStatusEntry}})) { + next if ($oid !~ /^$mapping->{lstLibraryState}->{oid}(?:\.(.*)|$)/); + my $instance = defined($1) ? $1 : undef; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_libraryStatusEntry}, instance => $instance); + + # we set a 1 to do some filters + $instance = '1' if (!defined($instance)); + next if ($self->check_filter(section => 'library', instance => $instance)); + + $self->{components}->{library}->{total}++; + $self->{output}->output_add(long_msg => sprintf("library '%s' status is '%s' [instance = %s]", + $instance, $result->{lstLibraryState}, $instance)); + my $exit = $self->get_severity(section => 'library', instance => $instance, value => $result->{lstLibraryState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("library '%s' status is '%s'", $instance, $result->{lstLibraryState})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/overland/neo/snmp/mode/eventlog.pm b/centreon-plugins/storage/overland/neo/snmp/mode/eventlog.pm new file mode 100644 index 000000000..26d907e48 --- /dev/null +++ b/centreon-plugins/storage/overland/neo/snmp/mode/eventlog.pm @@ -0,0 +1,131 @@ +# +# Copyright 2016 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::overland::neo::snmp::mode::eventlog; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %severity_map = ( + 0 => 'informational', + 1 => 'mild', + 2 => 'hard', + 3 => 'severe', +); + +my $mapping = { + errCode => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.3.1.2' }, + errSeverity => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.3.1.3', map => \%severity_map }, + errMsg => { oid => '.1.3.6.1.4.1.3351.1.3.2.3.3.1.4' }, +}; +my $oid_errorEntry = '.1.3.6.1.4.1.3351.1.3.2.3.3.1'; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-severity:s" => { name => 'filter_severity', default => 'hard|severe' }, + "filter-message:s" => { name => 'filter_message' }, + "warning" => { name => 'warning' }, + }); + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub run { + my ($self, %options) = @_; + + my $exit = defined($self->{option_results}->{warning}) ? 'WARNING' : 'CRITICAL'; + my ($num_eventlog_checked, $num_errors) = (0, 0); + + $self->{output}->output_add(severity => 'OK', + short_msg => "No problems detected."); + + my $results = $options{snmp}->get_table(oid => $oid_errorEntry); + + foreach my $oid ($options{snmp}->oid_lex_sort(keys %$results)) { + next if ($oid !~ /^$mapping->{errSeverity}->{oid}(?:\.(.*)|$)/); + my $instance = defined($1) ? $1 : undef; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $results, instance => $instance); + + $num_eventlog_checked++; + + next if (defined($self->{option_results}->{filter_severity}) && $self->{option_results}->{filter_severity} ne '' && $result->{errSeverity} !~ /$self->{option_results}->{filter_severity}/); + next if (defined($self->{option_results}->{filter_message}) && $self->{option_results}->{filter_message} ne '' && $result->{errMsg} !~ /$self->{option_results}->{filter_message}/); + + $num_errors++; + $self->{output}->output_add(long_msg => sprintf("%s : %s [severity: %s]", + $result->{errCode}, + $result->{errMsg}, $result->{errSeverity} + ) + ); + + + } + + $self->{output}->output_add(long_msg => sprintf("Number of message checked: %s", $num_eventlog_checked)); + if ($num_errors != 0) { + # Message problem + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("%d problem detected (use verbose for more details)", $num_errors) + ); + } + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check eventlogs. + +=over 8 + +=item B<--warning> + +Use warning return instead 'critical'. + +=item B<--filter-severity> + +Filter on severity. (Default: hard|severe) +Can be: severe, hard, mild, informational. + +=item B<--filter-message> + +Filter on event message. (Default: none) + +=back + +=cut + \ No newline at end of file diff --git a/centreon-plugins/storage/overland/neo/snmp/mode/hardware.pm b/centreon-plugins/storage/overland/neo/snmp/mode/hardware.pm new file mode 100644 index 000000000..e5a8080a8 --- /dev/null +++ b/centreon-plugins/storage/overland/neo/snmp/mode/hardware.pm @@ -0,0 +1,107 @@ +# +# Copyright 2016 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::overland::neo::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(drive|library)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + drive => [ + ['initializedNoError', 'OK'], + ['initializedWithError', 'CRITICAL'], + ['notInitialized', 'WARNING'], + ['notInstalled', 'OK'], + ['notInserted', 'OK'], + ], + library => [ + ['initializing', 'OK'], + ['online', 'OK'], + ['offline', 'CRITICAL'], + ], + }; + + $self->{components_path} = 'storage::overland::neo::snmp::mode::components'; + $self->{components_module} = ['drive', 'library']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'drive', 'library', 'eventlog'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=drive) +Can also exclude specific instance: --filter=drive,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='drive,OK,notInitialized' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/overland/neo/snmp/plugin.pm b/centreon-plugins/storage/overland/neo/snmp/plugin.pm new file mode 100644 index 000000000..8ba4baadb --- /dev/null +++ b/centreon-plugins/storage/overland/neo/snmp/plugin.pm @@ -0,0 +1,50 @@ +# +# Copyright 2016 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::overland::neo::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}} = ( + 'hardware' => 'storage::overland::neo::snmp::mode::hardware', + 'eventlog' => 'storage::overland::neo::snmp::mode::eventlog', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Overland Neo Series in SNMP. +Need to use --snmp-force-getnext options. + +=cut From 72757979a26fea222002e9a00460b293dcf36ac5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 1 Sep 2016 16:26:48 +0200 Subject: [PATCH 329/346] + add plugin for hp-ux in snmp (Fix #13) --- centreon-plugins/os/hpux/snmp/mode/cpu.pm | 159 +++++++++++++ centreon-plugins/os/hpux/snmp/mode/load.pm | 139 ++++++++++++ centreon-plugins/os/hpux/snmp/mode/memory.pm | 175 ++++++++++++++ centreon-plugins/os/hpux/snmp/mode/process.pm | 199 ++++++++++++++++ centreon-plugins/os/hpux/snmp/mode/storage.pm | 214 ++++++++++++++++++ centreon-plugins/os/hpux/snmp/plugin.pm | 54 +++++ 6 files changed, 940 insertions(+) create mode 100644 centreon-plugins/os/hpux/snmp/mode/cpu.pm create mode 100644 centreon-plugins/os/hpux/snmp/mode/load.pm create mode 100644 centreon-plugins/os/hpux/snmp/mode/memory.pm create mode 100644 centreon-plugins/os/hpux/snmp/mode/process.pm create mode 100644 centreon-plugins/os/hpux/snmp/mode/storage.pm create mode 100644 centreon-plugins/os/hpux/snmp/plugin.pm diff --git a/centreon-plugins/os/hpux/snmp/mode/cpu.pm b/centreon-plugins/os/hpux/snmp/mode/cpu.pm new file mode 100644 index 000000000..426885d78 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/mode/cpu.pm @@ -0,0 +1,159 @@ +# +# Copyright 2016 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 os::hpux::snmp::mode::cpu; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::MD5 qw(md5_hex); + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, cb_prefix_output => 'prefix_output' }, + ]; + $self->{maps_counters}->{global} = [ + { label => 'user', set => { + key_values => [ { name => 'total', diff => 1 }, { name => 'user', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'user' }, + output_template => 'User %.2f %%', output_use => 'user_prct', + perfdatas => [ + { label => 'user', value => 'user_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'sys', set => { + key_values => [ { name => 'total', diff => 1 }, { name => 'sys', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'sys' }, + output_template => 'System %.2f %%', output_use => 'sys_prct', + perfdatas => [ + { label => 'sys', value => 'sys_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'nice', set => { + key_values => [ { name => 'total', diff => 1 }, { name => 'nice', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'nice' }, + output_template => 'Nice %.2f %%', output_use => 'nice_prct', + perfdatas => [ + { label => 'nice', value => 'nice_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + { label => 'idle', set => { + key_values => [ { name => 'total', diff => 1 }, { name => 'idle', diff => 1 } ], + closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'idle' }, + output_template => 'Idle %.2f %%', output_use => 'idle_prct', + perfdatas => [ + { label => 'idle', value => 'idle_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + ], + } + }, + ]; +} + +sub custom_data_calc { + my ($self, %options) = @_; + + my $label = $options{extra_options}->{label_ref}; + my $delta_value = $options{new_datas}->{$self->{instance} . '_' . $label} - $options{old_datas}->{$self->{instance} . '_' . $label}; + my $delta_total = $options{new_datas}->{$self->{instance} . '_total'} - $options{old_datas}->{$self->{instance} . '_total'}; + + $self->{result_values}->{$label . '_prct'} = 0; + if ($delta_total > 0) { + $self->{result_values}->{$label . '_prct'} = $delta_value * 100 / $delta_total; + } + return 0; +} + +sub prefix_output { + my ($self, %options) = @_; + + return "CPU Usage : "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-counters:s" => { name => 'filter_counters' }, + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cache_name} = "hpux_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + + my $oid_computerSystemUserCPU = '.1.3.6.1.4.1.11.2.3.1.1.13.0'; + my $oid_computerSystemSysCPU = '.1.3.6.1.4.1.11.2.3.1.1.14.0'; + my $oid_computerSystemIdleCPU = '.1.3.6.1.4.1.11.2.3.1.1.15.0'; + my $oid_computerSystemNiceCPU = '.1.3.6.1.4.1.11.2.3.1.1.16.0'; + + my $result = $options{snmp}->get_leef(oids => [$oid_computerSystemUserCPU, $oid_computerSystemSysCPU, + $oid_computerSystemIdleCPU, $oid_computerSystemNiceCPU], + nothing_quit => 1); + $self->{global} = { + total => $result->{$oid_computerSystemUserCPU} + $result->{$oid_computerSystemSysCPU} + $result->{$oid_computerSystemIdleCPU} + $result->{$oid_computerSystemNiceCPU}, + sys => $result->{$oid_computerSystemSysCPU}, + user => $result->{$oid_computerSystemUserCPU}, + idle => $result->{$oid_computerSystemIdleCPU}, + nice => $result->{$oid_computerSystemNiceCPU}, + }; +} + +1; + +__END__ + +=head1 MODE + +Check system CPUs. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example : --filter-counters='^idle$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'user', 'sys', 'idle', 'nice'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'user', 'sys', 'idle', 'nice'. + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/os/hpux/snmp/mode/load.pm b/centreon-plugins/os/hpux/snmp/mode/load.pm new file mode 100644 index 000000000..d5c6bde31 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/mode/load.pm @@ -0,0 +1,139 @@ +# +# Copyright 2016 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 os::hpux::snmp::mode::load; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning', default => '' }, + "critical:s" => { name => 'critical', default => '' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + ($self->{warn1}, $self->{warn5}, $self->{warn15}) = split /,/, $self->{option_results}->{warning}; + ($self->{crit1}, $self->{crit5}, $self->{crit15}) = split /,/, $self->{option_results}->{critical}; + + if (($self->{perfdata}->threshold_validate(label => 'warn1', value => $self->{warn1})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning (1min) threshold '" . $self->{warn1} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'warn5', value => $self->{warn5})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning (5min) threshold '" . $self->{warn5} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'warn15', value => $self->{warn15})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning (15min) threshold '" . $self->{warn15} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'crit1', value => $self->{crit1})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical (1min) threshold '" . $self->{crit1} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'crit5', value => $self->{crit5})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical (5min) threshold '" . $self->{crit5} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'crit15', value => $self->{crit15})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical (15min) threshold '" . $self->{crit15} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + my $oid_computerSystemAvgJobs1 = '.1.3.6.1.4.1.11.2.3.1.1.3.0'; + my $oid_computerSystemAvgJobs5 = '.1.3.6.1.4.1.11.2.3.1.1.4.0'; + my $oid_computerSystemAvgJobs15 = '.1.3.6.1.4.1.11.2.3.1.1.5.0'; + + my $result = $options{snmp}->get_leef(oids => [$oid_computerSystemAvgJobs1, $oid_computerSystemAvgJobs5, $oid_computerSystemAvgJobs15], nothing_quit => 1); + + my $cpu_load1 = $result->{$oid_computerSystemAvgJobs1} / 100; + my $cpu_load5 = $result->{$oid_computerSystemAvgJobs5} / 100; + my $cpu_load15 = $result->{$oid_computerSystemAvgJobs15} / 100; + + $self->{output}->perfdata_add(label => 'load1', + value => $cpu_load1, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1'), + min => 0); + $self->{output}->perfdata_add(label => 'load5', + value => $cpu_load5, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn5'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit5'), + min => 0); + $self->{output}->perfdata_add(label => 'load15', + value => $cpu_load15, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn15'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit15'), + min => 0); + + my $exit1 = $self->{perfdata}->threshold_check(value => $cpu_load1, + threshold => [ { label => 'crit1', exit_litteral => 'critical' }, { label => 'warn1', exit_litteral => 'warning' } ]); + my $exit2 = $self->{perfdata}->threshold_check(value => $cpu_load5, + threshold => [ { label => 'crit5', exit_litteral => 'critical' }, { label => 'warn5', exit_litteral => 'warning' } ]); + my $exit3 = $self->{perfdata}->threshold_check(value => $cpu_load15, + threshold => [ { label => 'crit15', exit_litteral => 'critical' }, { label => 'warn15', exit_litteral => 'warning' } ]); + my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2, $exit3 ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Load average: %s, %s, %s", $cpu_load1, $cpu_load5, $cpu_load15)); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check system load-average. + +=over 8 + +=item B<--warning> + +Threshold warning (1min,5min,15min). + +=item B<--critical> + +Threshold critical (1min,5min,15min). + +=back + +=cut diff --git a/centreon-plugins/os/hpux/snmp/mode/memory.pm b/centreon-plugins/os/hpux/snmp/mode/memory.pm new file mode 100644 index 000000000..528204a29 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/mode/memory.pm @@ -0,0 +1,175 @@ +# +# Copyright 2016 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 os::hpux::snmp::mode::memory; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + $self->{output}->perfdata_add(label => $self->{result_values}->{label} . '_used', unit => 'B', + value => $self->{result_values}->{used}, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my $exit = $self->{perfdata}->threshold_check(value => $self->{result_values}->{prct_used}, threshold => [ { label => 'critical-' . $self->{result_values}->{label} . '-usage', exit_litteral => 'critical' }, { label => 'warning-' . $self->{result_values}->{label} . '-usage', exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + + my $msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{label} = $options{extra_options}->{label_ref}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_used'} + $options{new_datas}->{$self->{instance} . '_free'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'}; + $self->{result_values}->{prct_free} = $self->{result_values}->{free} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'memory', type => 0, cb_prefix_output => 'prefix_memory_output' }, + { name => 'swap', type => 0, cb_prefix_output => 'prefix_swap_output' } + ]; + + $self->{maps_counters}->{memory} = [ + { label => 'physical-usage', set => { + key_values => [ { name => 'free' }, { name => 'used' } ], + closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_calc_extra_options => { label_ref => 'physical' }, + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; + $self->{maps_counters}->{swap} = [ + { label => 'swap-usage', set => { + key_values => [ { name => 'free' }, { name => 'used' } ], + closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_calc_extra_options => { label_ref => 'swap' }, + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +sub prefix_memory_output { + my ($self, %options) = @_; + + return "Physical memory "; +} + +sub prefix_swap_output { + my ($self, %options) = @_; + + return "Swap memory "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-counters:s" => { name => 'filter_counters' }, + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $oid_computerSystemFreeMemory = '.1.3.6.1.4.1.11.2.3.1.1.7.0'; # in KB + my $oid_computerSystemPhysMemory = '.1.3.6.1.4.1.11.2.3.1.1.8.0'; # in KB + my $oid_computerSystemSwapConfig = '.1.3.6.1.4.1.11.2.3.1.1.10.0'; # in KB + my $oid_computerSystemFreeSwap = '.1.3.6.1.4.1.11.2.3.1.1.12.0'; # in KB + + my $result = $options{snmp}->get_leef(oids => [$oid_computerSystemFreeMemory, $oid_computerSystemPhysMemory, + $oid_computerSystemSwapConfig, $oid_computerSystemFreeSwap], + nothing_quit => 1); + $self->{memory} = { + free => $result->{$oid_computerSystemFreeMemory} * 1024, + used => $result->{$oid_computerSystemPhysMemory} * 1024 - $result->{$oid_computerSystemFreeMemory} * 1024, + }; + $self->{swap} = { + free => $result->{$oid_computerSystemFreeSwap} * 1024, + used => $result->{$oid_computerSystemSwapConfig} * 1024 - $result->{$oid_computerSystemFreeSwap} * 1024, + }; +} + +1; + +__END__ + +=head1 MODE + +Check memory usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example : --filter-counters='^physical-usage$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'physical-usage' (%), 'swap-usage' (%). + +=item B<--critical-*> + +Threshold critical. +Can be: 'physical-usage' (%), 'swap-usage' (%). + +=back + +=cut diff --git a/centreon-plugins/os/hpux/snmp/mode/process.pm b/centreon-plugins/os/hpux/snmp/mode/process.pm new file mode 100644 index 000000000..5d0ed09f1 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/mode/process.pm @@ -0,0 +1,199 @@ +# +# Copyright 2016 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 os::hpux::snmp::mode::process; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %map_process_status = ( + 1 => 'sleep', + 2 => 'run', + 3 => 'stop', + 4 => 'zombie', + 5 => 'other', + 6 => 'idle', +); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "warning:s" => { name => 'warning', }, + "critical:s" => { name => 'critical', }, + "process-cmd:s" => { name => 'process_cmd', }, + "regexp-cmd" => { name => 'regexp_cmd', }, + "process-status:s" => { name => 'process_status', default => 'run' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); + } +} + +my $oids = { + status => '.1.3.6.1.4.1.11.2.3.1.4.2.1.19', # processStatus + cmd => '.1.3.6.1.4.1.11.2.3.1.4.2.1.22', # processCmd +}; + +sub run { + my ($self, %options) = @_; + $self->{snmp} = $options{snmp}; + + my $oid2check_filter = 'status'; + # To have a better order + foreach (('cmd', 'status')) { + if (defined($self->{option_results}->{'process_' . $_}) && $self->{option_results}->{'process_' . $_} ne '') { + $oid2check_filter = $_; + last; + } + } + # Build other + my $mores_filters = {}; + my $more_oids = []; + foreach (keys %$oids) { + if ($_ ne $oid2check_filter && defined($self->{option_results}->{'process_' . $_}) && $self->{option_results}->{'process_' . $_} ne '') { + push @{$more_oids}, $oids->{$_}; + $mores_filters->{$_} = 1; + } + } + + my $oids_multiple_table = [ { oid => $oids->{$oid2check_filter} } ]; + + $self->{results} = $self->{snmp}->get_multiple_table(oids => $oids_multiple_table); + my $result = $self->{results}->{$oids->{$oid2check_filter}}; + my $instances_keep = {}; + foreach my $key ($self->{snmp}->oid_lex_sort(keys %{$result})) { + my $option_val = $self->{option_results}->{'process_' . $oid2check_filter}; + + if ($oid2check_filter eq 'status') { + if ($map_process_status{$result->{$key}} =~ /$option_val/) { + $key =~ /\.([0-9]+)$/; + $instances_keep->{$1} = 1; + } + } elsif ((defined($self->{option_results}->{'regexp_' . $oid2check_filter}) && $result->{$key} =~ /$option_val/) + || (!defined($self->{option_results}->{'regexp_' . $oid2check_filter}) && $result->{$key} eq $option_val)) { + $key =~ /\.([0-9]+)$/; + $instances_keep->{$1} = 1; + } + } + + my $result2; + if (scalar(keys %$instances_keep) > 0) { + if (scalar(@$more_oids) > 0) { + $self->{snmp}->load(oids => $more_oids, instances => [ keys %$instances_keep ]); + $result2 = $self->{snmp}->get_leef(); + } + + foreach my $key (keys %$instances_keep) { + my $value = ($oid2check_filter eq 'status') ? $map_process_status{$result->{$oids->{$oid2check_filter} . '.' . $key}} : $result->{$oids->{$oid2check_filter} . '.' . $key}; + my $long_value = '[ ' . $oid2check_filter . ' => ' . $value . ' ]'; + my $deleted = 0; + foreach (keys %$mores_filters) { + my $opt_val = $self->{option_results}->{'process_' . $_}; + $value = ($_ eq 'status') ? $map_process_status{$result2->{$oids->{$_} . '.' . $key}} : $result2->{$oids->{$_} . '.' . $key}; + + if ($_ eq 'status') { + if ($value !~ /$opt_val/) { + delete $instances_keep->{$key}; + $deleted = 1; + last; + } + } elsif ((defined($self->{option_results}->{'regexp_' . $_}) && $value !~ /$opt_val/) + || (!defined($self->{option_results}->{'regexp_' . $_}) && $value ne $opt_val)) { + delete $instances_keep->{$key}; + $deleted = 1; + last; + } + + $long_value .= ' [ ' . $_ . ' => ' . $value . ' ]'; + } + + if ($deleted == 0) { + $self->{output}->output_add(long_msg => 'Process: ' . $long_value); + } + } + } + + my $num_processes_match = scalar(keys(%$instances_keep)); + my $exit = $self->{perfdata}->threshold_check(value => $num_processes_match, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => "Number of current processes running: $num_processes_match"); + $self->{output}->perfdata_add(label => 'nbproc', + value => $num_processes_match, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check system number of processes. + +=over 8 + +=item B<--warning> + +Threshold warning (process count). + +=item B<--critical> + +Threshold critical (process count). + +=item B<--process-cmd> + +Check process command. + +=item B<--regexp-cmd> + +Allows to use regexp to filter process command (with option --process-cmd). + +=item B<--process-status> + +Check process status (Default: 'run'). Can be a regexp. + +=back + +=cut diff --git a/centreon-plugins/os/hpux/snmp/mode/storage.pm b/centreon-plugins/os/hpux/snmp/mode/storage.pm new file mode 100644 index 000000000..fa5978771 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/mode/storage.pm @@ -0,0 +1,214 @@ +# +# Copyright 2016 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 os::hpux::snmp::mode::storage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'storage', type => 1, cb_prefix_output => 'prefix_storage_output', message_multiple => 'All storages are ok' } + ]; + + $self->{maps_counters}->{storage} = [ + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; +} + +sub prefix_storage_output { + my ($self, %options) = @_; + + return "Storage '" . $options{instance_value}->{display} . "' "; +} + +my $mapping = { + fileSystemName => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.3' }, + fileSystemBlock => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.4' }, + fileSystemBfree => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.5' }, + fileSystemBavail => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.6' }, + fileSystemBsize => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.7' }, + fileSystemDir => { oid => '.1.3.6.1.4.1.11.2.3.1.2.2.1.10' }, +}; +my $oid_fileSystemEntry = '.1.3.6.1.4.1.11.2.3.1.2.2.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{storage} = {}; + $self->{results} = $options{snmp}->get_table(oid => $oid_fileSystemEntry, + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{fileSystemDir}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{fileSystemDir} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{fileSystemDir} . "': no matching filter.", debug => 1); + next; + } + + $self->{storage}->{$instance} = { display => $result->{fileSystemDir}, + total => $result->{fileSystemBlock} * $result->{fileSystemBsize}, + used => $result->{fileSystemBlock} * $result->{fileSystemBsize} - $result->{fileSystemBavail} * $result->{fileSystemBsize} }; + } + + + if (scalar(keys %{$self->{storage}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No storage found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check storages. + +=over 8 + +=item B<--filter-name> + +Filter path name (can be a regexp). + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage'. + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=back + +=cut diff --git a/centreon-plugins/os/hpux/snmp/plugin.pm b/centreon-plugins/os/hpux/snmp/plugin.pm new file mode 100644 index 000000000..3bf1ae533 --- /dev/null +++ b/centreon-plugins/os/hpux/snmp/plugin.pm @@ -0,0 +1,54 @@ +# +# Copyright 2016 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 os::hpux::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} = '0.1'; + %{$self->{modes}} = ( + 'cpu' => 'os::hpux::snmp::mode::cpu', + 'load' => 'os::hpux::snmp::mode::load', + 'memory' => 'os::hpux::snmp::mode::memory', + 'process' => 'os::hpux::snmp::mode::process', + 'storage' => 'os::hpux::snmp::mode::storage', + 'tcpcon' => 'snmp_standard::mode::tcpcon', + 'uptime' => 'snmp_standard::mode::uptime', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check HP-UX operating systems in SNMP. + +=cut From cd0529625ff3916d13611e860867d1fe484d982e Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 2 Sep 2016 10:21:22 +0200 Subject: [PATCH 330/346] + prepare new version --- centreon-plugins/centreon/plugins/script.pm | 2 +- centreon-plugins/changelog | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/plugins/script.pm b/centreon-plugins/centreon/plugins/script.pm index a5f0bb9bb..91dec7855 100644 --- a/centreon-plugins/centreon/plugins/script.pm +++ b/centreon-plugins/centreon/plugins/script.pm @@ -30,7 +30,7 @@ use Pod::Find qw(pod_where); my %handlers = (DIE => {}); -my $global_version = 20160803; +my $global_version = 20160902; my $alternative_fatpacker = 0; sub new { diff --git a/centreon-plugins/changelog b/centreon-plugins/changelog index fbd05c73c..5ca6549db 100644 --- a/centreon-plugins/changelog +++ b/centreon-plugins/changelog @@ -1,3 +1,11 @@ +2016-09-02 Quentin Garnier + * Plugin added: to check HP-UX SNMP (#13) + * Plugin added: to check Hitachi HNAS + * Plugin added: to check Overland Neo Series + * Plugin added: to check Quantum Scalar + * Plugin added: to check HP Storeonce SSH + * Fix: [pdu emerson]{global-status} wrong status + 2016-08-03 Quentin Garnier * Plugin added: to check IBM Storwize (#438) * Plugin added: to check Sonus SBC From 0b4034a2eee41de3d7df6d793baa46387a62af86 Mon Sep 17 00:00:00 2001 From: Zehir Date: Fri, 2 Sep 2016 16:01:02 +0200 Subject: [PATCH 331/346] Update git url http://git.centreon.com/centreon-plugins.git do not exist --- centreon-plugins/docs/fr/developer/guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/docs/fr/developer/guide.rst b/centreon-plugins/docs/fr/developer/guide.rst index 294e1dbd1..7f54ffaa5 100644 --- a/centreon-plugins/docs/fr/developer/guide.rst +++ b/centreon-plugins/docs/fr/developer/guide.rst @@ -6,7 +6,7 @@ Ce document présente les bonnes pratiques pour le développement de "centreon-p Comme tous les plugins sont écrits en Perl, "There's more than one way to do it". Afib de ne pas réinventer la roue, vous devriez d'abord regarder le dossier “example”. Vous aurez alors un aperçu de la méthodologie pour construire votre propre plugin ainsi que ses modes associés. -La dernière version est disponible sur le dépôt git suivant: http://git.centreon.com/centreon-plugins.git +La dernière version est disponible sur le dépôt git suivant: https://github.com/centreon/centreon-plugins.git **************** Démarrage rapide From db3ea6cfcfa5f49b3ed86d5b8c0deaab2c3f51e5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 2 Sep 2016 16:13:19 +0200 Subject: [PATCH 332/346] + minor update doc --- centreon-plugins/README.md | 2 +- centreon-plugins/docs/en/developer/guide.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/README.md b/centreon-plugins/README.md index f9ca13ec2..f52fb7712 100644 --- a/centreon-plugins/README.md +++ b/centreon-plugins/README.md @@ -27,7 +27,7 @@ It seems that 'os::linux::snmp::plugin' is the good one. So i verify with the op Plugin Description: Check Linux operating systems in SNMP. -It's exactly what i need. Now i'll the option ``--list-mode`` to know what can i do with it: +It's exactly what i need. Now i'll add the option ``--list-mode`` to know what can i do with it: $ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --list-mode ... diff --git a/centreon-plugins/docs/en/developer/guide.rst b/centreon-plugins/docs/en/developer/guide.rst index bc741a169..41dc32334 100644 --- a/centreon-plugins/docs/en/developer/guide.rst +++ b/centreon-plugins/docs/en/developer/guide.rst @@ -14,7 +14,7 @@ There are 3 chapters: * :ref:`Code Style Guidelines `: Follow it. * :ref:`Model Classes Usage `: description of classes you should use for your plugin. -The lastest version is available on following git repository: http://git.centreon.com/centreon-plugins.git +The lastest version is available on following git repository: https://github.com/centreon/centreon-plugins.git .. _quick-start: From 43572301395f2c83922d6cc3e47b1bf006f26993 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 5 Sep 2016 14:44:20 +0200 Subject: [PATCH 333/346] + add storagetek SLxxx SNMP plugin --- .../storagetek/sl/snmp/mode/components/cap.pm | 66 ++++++++++ .../sl/snmp/mode/components/controller.pm | 67 ++++++++++ .../sl/snmp/mode/components/elevator.pm | 67 ++++++++++ .../storagetek/sl/snmp/mode/components/fan.pm | 67 ++++++++++ .../sl/snmp/mode/components/interface.pm | 69 +++++++++++ .../storagetek/sl/snmp/mode/components/psu.pm | 67 ++++++++++ .../sl/snmp/mode/components/resources.pm | 46 +++++++ .../sl/snmp/mode/components/robot.pm | 67 ++++++++++ .../sl/snmp/mode/components/temperature.pm | 84 +++++++++++++ .../sl/snmp/mode/components/turntable.pm | 67 ++++++++++ .../storagetek/sl/snmp/mode/hardware.pm | 117 ++++++++++++++++++ .../storage/storagetek/sl/snmp/plugin.pm | 48 +++++++ 12 files changed, 832 insertions(+) create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/cap.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/controller.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/elevator.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/fan.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/interface.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/psu.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/robot.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/temperature.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/components/turntable.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/mode/hardware.pm create mode 100644 centreon-plugins/storage/storagetek/sl/snmp/plugin.pm diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/cap.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/cap.pm new file mode 100644 index 000000000..19b1a5b6c --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/cap.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::cap; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slCapStatusEnum => { oid => '.1.3.6.1.4.1.1211.1.15.4.20.1.6', map => $map_status }, +}; +my $oid_slCapEntry = '.1.3.6.1.4.1.1211.1.15.4.20.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slCapEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking cartridge access ports"); + $self->{components}->{cap} = {name => 'cap', total => 0, skip => 0}; + return if ($self->check_filter(section => 'cap')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slCapEntry}})) { + next if ($oid !~ /^$mapping->{slCapStatusEnum}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slCapEntry}, instance => $instance); + + next if ($self->check_filter(section => 'cap', instance => $instance)); + $self->{components}->{cap}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("cap '%s' status is '%s' [instance: %s].", + $instance, $result->{slCapStatusEnum}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'cap', value => $result->{slCapStatusEnum}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("cap '%s' status is '%s'", + $instance, $result->{slCapStatusEnum})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/controller.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/controller.pm new file mode 100644 index 000000000..0ae0b6479 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/controller.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::controller; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slControllerSerialNum => { oid => '.1.3.6.1.4.1.1211.1.15.4.14.1.3' }, + slControllerStatus => { oid => '.1.3.6.1.4.1.1211.1.15.4.14.1.4', map => $map_status }, +}; +my $oid_slControllerEntry = '.1.3.6.1.4.1.1211.1.15.4.14.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slControllerEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking controllers"); + $self->{components}->{controller} = {name => 'controllers', total => 0, skip => 0}; + return if ($self->check_filter(section => 'controller')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slControllerEntry}})) { + next if ($oid !~ /^$mapping->{slControllerStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slControllerEntry}, instance => $instance); + + next if ($self->check_filter(section => 'controller', instance => $instance)); + $self->{components}->{controller}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("controller '%s' status is '%s' [instance: %s].", + $result->{slControllerSerialNum}, $result->{slControllerStatus}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'controller', value => $result->{slControllerStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Controller '%s' status is '%s'", + $result->{slControllerSerialNum}, $result->{slControllerStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/elevator.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/elevator.pm new file mode 100644 index 000000000..baca22d62 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/elevator.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::elevator; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slElevatorSerialNum => { oid => '.1.3.6.1.4.1.1211.1.15.4.12.1.5' }, + slElevatorStatusEnum => { oid => '.1.3.6.1.4.1.1211.1.15.4.12.1.8', map => $map_status }, +}; +my $oid_slElevatorEntry = '.1.3.6.1.4.1.1211.1.15.4.12.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slElevatorEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking elevators"); + $self->{components}->{elevator} = {name => 'elevators', total => 0, skip => 0}; + return if ($self->check_filter(section => 'elevator')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slElevatorEntry}})) { + next if ($oid !~ /^$mapping->{slElevatorStatusEnum}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slElevatorEntry}, instance => $instance); + + next if ($self->check_filter(section => 'elevator', instance => $instance)); + $self->{components}->{elevator}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("elevator '%s' status is '%s' [instance: %s].", + $result->{slElevatorSerialNum}, $result->{slElevatorStatusEnum}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'elevator', value => $result->{slElevatorStatusEnum}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Elevator '%s' status is '%s'", + $result->{slElevatorSerialNum}, $result->{slElevatorStatusEnum})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/fan.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/fan.pm new file mode 100644 index 000000000..8bbdc8fdf --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/fan.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::fan; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_operational); + +my $mapping = { + slHdwFanName => { oid => '.1.3.6.1.4.1.1211.1.15.4.6.1.2' }, + slHdwFanOperational => { oid => '.1.3.6.1.4.1.1211.1.15.4.6.1.3', map => $map_operational }, +}; +my $oid_slHdwFanEntry = '.1.3.6.1.4.1.1211.1.15.4.6.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slHdwFanEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fans"); + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slHdwFanEntry}})) { + next if ($oid !~ /^$mapping->{slHdwFanOperational}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slHdwFanEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fan', instance => $instance)); + $self->{components}->{fan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance: %s].", + $result->{slHdwFanName}, $result->{slHdwFanOperational}, + $instance + )); + my $exit = $self->get_severity(label => 'operational', section => 'fan', value => $result->{slHdwFanOperational}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' status is '%s'", + $result->{slHdwFanName}, $result->{slHdwFanOperational})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/interface.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/interface.pm new file mode 100644 index 000000000..1009c158b --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/interface.pm @@ -0,0 +1,69 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::interface; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slHostInterfaceAWWN => { oid => '.1.3.6.1.4.1.1211.1.15.4.2.1.3' }, + slHostInterfaceBWWN => { oid => '.1.3.6.1.4.1.1211.1.15.4.2.1.12' }, + slHostInterfaceStatusEnum => { oid => '.1.3.6.1.4.1.1211.1.15.4.2.1.26', map => $map_status }, +}; +my $oid_slHostInterfaceEntry = '.1.3.6.1.4.1.1211.1.15.4.2.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slHostInterfaceEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking interfaces"); + $self->{components}->{interface} = {name => 'interfaces', total => 0, skip => 0}; + return if ($self->check_filter(section => 'interface')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slHostInterfaceEntry}})) { + next if ($oid !~ /^$mapping->{slHostInterfaceStatusEnum}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slHostInterfaceEntry}, instance => $instance); + + next if ($self->check_filter(section => 'interface', instance => $instance)); + $self->{components}->{interface}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("interface '%s/%s' status is '%s' [instance: %s].", + $result->{slHostInterfaceAWWN}, $result->{slHostInterfaceBWWN}, $result->{slHostInterfaceStatusEnum}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'interface', value => $result->{slHostInterfaceStatusEnum}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Interface '%s/%s' status is '%s'", + $result->{slHostInterfaceAWWN}, $result->{slHostInterfaceBWWN}, + $result->{slHostInterfaceStatusEnum})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/psu.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/psu.pm new file mode 100644 index 000000000..3cf08b025 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/psu.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::psu; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_operational); + +my $mapping = { + slHdwSupplyName => { oid => '.1.3.6.1.4.1.1211.1.15.4.8.1.2' }, + slHdwSupplyOperational => { oid => '.1.3.6.1.4.1.1211.1.15.4.8.1.4', map => $map_operational }, +}; +my $oid_slHdwSupplyEntry = '.1.3.6.1.4.1.1211.1.15.4.8.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slHdwSupplyEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power supplies"); + $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'psu')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slHdwSupplyEntry}})) { + next if ($oid !~ /^$mapping->{slHdwSupplyOperational}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slHdwSupplyEntry}, instance => $instance); + + next if ($self->check_filter(section => 'psu', instance => $instance)); + $self->{components}->{psu}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance: %s].", + $result->{slHdwSupplyName}, $result->{slHdwSupplyOperational}, + $instance + )); + my $exit = $self->get_severity(label => 'operational', section => 'psu', value => $result->{slHdwSupplyOperational}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power supply '%s' status is '%s'", + $result->{slHdwSupplyName}, $result->{slHdwSupplyOperational})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/resources.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/resources.pm new file mode 100644 index 000000000..7f11ac901 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/resources.pm @@ -0,0 +1,46 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our $map_status; +our $map_operational; + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw($map_status $map_operational); + +$map_operational = { + 1 => 'failed', + 2 => 'normal', +}; + +$map_status = { + 0 => 'ok', + 1 => 'error', + 2 => 'warning', + 3 => 'info', + 4 => 'trace', +}; + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/robot.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/robot.pm new file mode 100644 index 000000000..fcb0d51f8 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/robot.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::robot; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slRobotSerialNum => { oid => '.1.3.6.1.4.1.1211.1.15.4.10.1.5' }, + slRobotStatusEnum => { oid => '.1.3.6.1.4.1.1211.1.15.4.10.1.8', map => $map_status }, +}; +my $oid_slRobotEntry = '.1.3.6.1.4.1.1211.1.15.4.10.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slRobotEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking robots"); + $self->{components}->{robot} = {name => 'robots', total => 0, skip => 0}; + return if ($self->check_filter(section => 'robot')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slRobotEntry}})) { + next if ($oid !~ /^$mapping->{slRobotStatusEnum}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slRobotEntry}, instance => $instance); + + next if ($self->check_filter(section => 'robot', instance => $instance)); + $self->{components}->{robot}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("robot '%s' status is '%s' [instance: %s].", + $result->{slRobotSerialNum}, $result->{slRobotStatusEnum}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'robot', value => $result->{slRobotStatusEnum}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Robot '%s' status is '%s'", + $result->{slRobotSerialNum}, $result->{slRobotStatusEnum})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/temperature.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/temperature.pm new file mode 100644 index 000000000..3d8481604 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/temperature.pm @@ -0,0 +1,84 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::temperature; + +use strict; +use warnings; + +my $mapping = { + slHdwTempSensorName => { oid => '.1.3.6.1.4.1.1211.1.15.4.4.1.2' }, + slHdwTempSensorCurrentTemp => { oid => '.1.3.6.1.4.1.1211.1.15.4.4.1.3' }, + slHdwTempSensorWarnThreshold => { oid => '.1.3.6.1.4.1.1211.1.15.4.4.1.5' }, + slHdwTempSensorFailThreshold => { oid => '.1.3.6.1.4.1.1211.1.15.4.4.1.6' }, +}; +my $oid_slHdwTempSensorEntry = '.1.3.6.1.4.1.1211.1.15.4.4.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slHdwTempSensorEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slHdwTempSensorEntry}})) { + next if ($oid !~ /^$mapping->{slHdwTempSensorCurrentTemp}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slHdwTempSensorEntry}, instance => $instance); + + next if ($self->check_filter(section => 'temperature', instance => $instance)); + $self->{components}->{temperature}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("temperature '%s' is %s degree centigrade [instance = %s]", + $result->{slHdwTempSensorName}, $result->{slHdwTempSensorCurrentTemp}, $instance, + )); + + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{slHdwTempSensorCurrentTemp}); + if ($checked == 0) { + my $warn_th = ':' . $result->{slHdwTempSensorWarnThreshold}; + my $crit_th = ':' . $result->{slHdwTempSensorFailThreshold}; + $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th); + $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); + + $exit = $self->{perfdata}->threshold_check(value => $result->{slHdwTempSensorCurrentTemp}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, + { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ]); + $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); + $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance); + } + + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{slHdwTempSensorName}, $result->{slHdwTempSensorCurrentTemp})); + } + $self->{output}->perfdata_add(label => 'temp_' . $result->{slHdwTempSensorName}, unit => 'C', + value => $result->{slHdwTempSensorCurrentTemp}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/components/turntable.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/turntable.pm new file mode 100644 index 000000000..083823ad5 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/components/turntable.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::components::turntable; + +use strict; +use warnings; +use storage::storagetek::sl::snmp::mode::components::resources qw($map_status); + +my $mapping = { + slTurntableSerialNum => { oid => '.1.3.6.1.4.1.1211.1.15.4.22.1.5' }, + slTurntableStatusEnum => { oid => '.1.3.6.1.4.1.1211.1.15.4.22.1.8', map => $map_status }, +}; +my $oid_slTurntableEntry = '.1.3.6.1.4.1.1211.1.15.4.22.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_slTurntableEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking turntables"); + $self->{components}->{turntable} = {name => 'turntables', total => 0, skip => 0}; + return if ($self->check_filter(section => 'turntable')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_slTurntableEntry}})) { + next if ($oid !~ /^$mapping->{slTurntableStatusEnum}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_slTurntableEntry}, instance => $instance); + + next if ($self->check_filter(section => 'turntable', instance => $instance)); + $self->{components}->{turntable}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("turntable '%s' status is '%s' [instance: %s].", + $result->{slTurntableSerialNum}, $result->{slTurntableStatusEnum}, + $instance + )); + my $exit = $self->get_severity(label => 'status', section => 'turntable', value => $result->{slTurntableStatusEnum}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Turntable '%s' status is '%s'", + $result->{slTurntableSerialNum}, $result->{slTurntableStatusEnum})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/mode/hardware.pm b/centreon-plugins/storage/storagetek/sl/snmp/mode/hardware.pm new file mode 100644 index 000000000..589d29755 --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/mode/hardware.pm @@ -0,0 +1,117 @@ +# +# Copyright 2016 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::storagetek::sl::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(interface|temperature|fan|psu|robot|elevator|controller|cap|turntable)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + status => [ + ['ok', 'OK'], + ['error', 'CRITICAL'], + ['warning', 'WARNING'], + ['info', 'OK'], + ['trace', 'OK'], + ], + operational => [ + ['normal', 'OK'], + ['failed', 'WARNING'], + ], + }; + + $self->{components_path} = 'storage::storagetek::sl::snmp::mode::components'; + $self->{components_module} = ['interface', 'temperature', 'fan', 'psu', 'robot', 'elevator', 'controller', 'cap', 'turntable']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'interface', 'temperature', 'fan', 'psu', 'robot', 'elevator', 'controller', 'cap', 'turntable'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=controller) +Can also exclude specific instance: --filter=cap,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='robot,CRITICAL,warning' + +=item B<--warning> + +Set warning threshold (syntax: type,regexp,threshold) +Example: --warning='temperature,.*,30' + +=item B<--critical> + +Set critical threshold (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,40' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/storage/storagetek/sl/snmp/plugin.pm b/centreon-plugins/storage/storagetek/sl/snmp/plugin.pm new file mode 100644 index 000000000..bd26593bb --- /dev/null +++ b/centreon-plugins/storage/storagetek/sl/snmp/plugin.pm @@ -0,0 +1,48 @@ +# +# Copyright 2016 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::storagetek::sl::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}} = ( + 'hardware' => 'storage::storagetek::sl::snmp::mode::hardware', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check StorageTek SL Series (SL150, SL500, ...) in SNMP. + +=cut From 264d4f5ae3c177a8e771e8efd459de96fb054575 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 6 Sep 2016 17:55:44 +0200 Subject: [PATCH 334/346] + Fix #486 --- centreon-plugins/network/h3c/snmp/mode/hardware.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon-plugins/network/h3c/snmp/mode/hardware.pm b/centreon-plugins/network/h3c/snmp/mode/hardware.pm index 8e1903c03..55000458d 100644 --- a/centreon-plugins/network/h3c/snmp/mode/hardware.pm +++ b/centreon-plugins/network/h3c/snmp/mode/hardware.pm @@ -170,7 +170,7 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); $self->{statefile_cache}->check_options(%options); } From 38384a22233f0d2158db14e67c855cb4790b300f Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 8 Sep 2016 15:10:12 +0200 Subject: [PATCH 335/346] + add plugin hp storeonce rest api (WIP) --- .../hp/storeonce/restapi/custom/api.pm | 196 ++++++++++++ .../storeonce/restapi/mode/servicesetusage.pm | 289 ++++++++++++++++++ .../storage/hp/storeonce/restapi/plugin.pm | 47 +++ 3 files changed, 532 insertions(+) create mode 100644 centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm create mode 100644 centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm create mode 100644 centreon-plugins/storage/hp/storeonce/restapi/plugin.pm diff --git a/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm b/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm new file mode 100644 index 000000000..ebdc6155f --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm @@ -0,0 +1,196 @@ +# +# Copyright 2016 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::hp::storeonce::restapi::custom::api; + +use strict; +use warnings; +use centreon::plugins::http; +use XML::Simple; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + if (!defined($options{output})) { + print "Class Custom: Need to specify 'output' argument.\n"; + exit 3; + } + if (!defined($options{options})) { + $options{output}->add_option_msg(short_msg => "Class Custom: Need to specify 'options' argument."); + $options{output}->option_exit(); + } + + if (!defined($options{noptions})) { + $options{options}->add_options(arguments => + { + "hostname:s@" => { name => 'hostname', }, + "username:s@" => { name => 'username', }, + "password:s@" => { name => 'password', }, + "proxyurl:s@" => { name => 'proxyurl', }, + "timeout:s@" => { name => 'timeout', }, + }); + } + $options{options}->add_help(package => __PACKAGE__, sections => 'REST API OPTIONS', once => 1); + + $self->{output} = $options{output}; + $self->{mode} = $options{mode}; + $self->{http} = centreon::plugins::http->new(output => $self->{output}); + + return $self; + +} + +# Method to manage multiples +sub set_options { + my ($self, %options) = @_; + # options{options_result} + + $self->{option_results} = $options{option_results}; +} + +# Method to manage multiples +sub set_defaults { + my ($self, %options) = @_; + # options{default} + + # Manage default value + foreach (keys %{$options{default}}) { + if ($_ eq $self->{mode}) { + for (my $i = 0; $i < scalar(@{$options{default}->{$_}}); $i++) { + foreach my $opt (keys %{$options{default}->{$_}[$i]}) { + if (!defined($self->{option_results}->{$opt}[$i])) { + $self->{option_results}->{$opt}[$i] = $options{default}->{$_}[$i]->{$opt}; + } + } + } + } + } +} + +sub check_options { + my ($self, %options) = @_; + # return 1 = ok still hostname + # return 0 = no hostname left + + $self->{hostname} = (defined($self->{option_results}->{hostname})) ? shift(@{$self->{option_results}->{hostname}}) : undef; + $self->{username} = (defined($self->{option_results}->{username})) ? shift(@{$self->{option_results}->{username}}) : ''; + $self->{password} = (defined($self->{option_results}->{password})) ? shift(@{$self->{option_results}->{password}}) : ''; + $self->{timeout} = (defined($self->{option_results}->{timeout})) ? shift(@{$self->{option_results}->{timeout}}) : 10; + $self->{proxyurl} = (defined($self->{option_results}->{proxyurl})) ? shift(@{$self->{option_results}->{proxyurl}}) : undef; + + if (!defined($self->{hostname})) { + $self->{output}->add_option_msg(short_msg => "Need to specify hostname option."); + $self->{output}->option_exit(); + } + + if (!defined($self->{hostname}) || + scalar(@{$self->{option_results}->{hostname}}) == 0) { + return 0; + } + return 1; +} + +sub build_options_for_httplib { + my ($self, %options) = @_; + + $self->{option_results}->{hostname} = $self->{hostname}; + $self->{option_results}->{timeout} = $self->{timeout}; + $self->{option_results}->{port} = 443; + $self->{option_results}->{proto} = 'https'; + $self->{option_results}->{proxyurl} = $self->{proxyurl}; + $self->{option_results}->{credentials} = 1; + $self->{option_results}->{username} = $self->{username}; + $self->{option_results}->{password} = $self->{password}; +} + +sub settings { + my ($self, %options) = @_; + + $self->build_options_for_httplib(); + $self->{http}->add_header(key => 'Accept', value => 'text/xml'); + $self->{http}->set_options(%{$self->{option_results}}); +} + +#my $xml = XMLin($biggest_reponse, ForceArray => 1); + +sub get { + my ($self, %options) = @_; + + $self->settings(); + + my $response = $self->{http}->request(url_path => '/storeonceservices' . $options{path}, + critical_status => '', warning_status => ''); + my $content; + eval { + $content = XMLin($response); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot decode xml response: $@"); + $self->{output}->option_exit(); + } + + return $content; +} + +1; + +__END__ + +=head1 NAME + +STOREONCE REST API + +=head1 SYNOPSIS + +Storeonce Rest API custom mode + +=head1 REST API OPTIONS + +=over 8 + +=item B<--hostname> + +Storeonce hostname. + +=item B<--username> + +Storeonce username. + +=item B<--password> + +Storeonce password. + +=item B<--proxyurl> + +Proxy URL if any + +=item B<--timeout> + +Set HTTP timeout + +=back + +=head1 DESCRIPTION + +B. + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm b/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm new file mode 100644 index 000000000..680c5729b --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm @@ -0,0 +1,289 @@ +# +# Copyright 2016 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::hp::storeonce::restapi::mode::servicesetusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{status}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'scs', type => 1, cb_prefix_output => 'prefix_scs_output', message_multiple => 'All service sets are ok' } + ]; + + $self->{maps_counters}->{scs} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'status' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + { label => 'dedup', set => { + key_values => [ { name => 'dedup' }, { name => 'display' } ], + output_template => 'Dedup Ratio : %.2f', + perfdatas => [ + { label => 'dedup_ratio', value => 'dedup_absolute', template => '%.2f', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /^(?!(running)$)/i' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_scs_output { + my ($self, %options) = @_; + + return "Service set '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +sub manage_selection { + my ($self, %options) = @_; + + $self->{scs} = {}; + my $result = $options{custom}->get(path => '/cluster/servicesets'); + if (defined($result->{servicesets}->{serviceset})) { + foreach my $entry (@{$result->{servicesets}->{serviceset}}) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $entry->{properties}->{alias} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $entry->{properties}->{alias} . "': no matching filter.", debug => 1); + next; + } + + $self->{scs}->{$entry->{properties}->{ssid}} = { + display => $entry->{properties}->{alias}, + status => $entry->{properties}->{status}, + total => $entry->{properties}->{capacityBytes}, + used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes}, + dedup => $entry->{properties}->{dedupeRatio} }; + } + } + + if (scalar(keys %{$self->{scs}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No service set found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check service set usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter service set name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: -). +Can used special variables like: %{status}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} =~ /^(?!(running)$)/'). +Can used special variables like: %{status}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage', 'dedup'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage', 'dedup'. + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=back + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm b/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm new file mode 100644 index 000000000..3cc9e4817 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm @@ -0,0 +1,47 @@ +# +# Copyright 2016 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::hp::storeonce::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}} = ( + 'serviceset-usage' => 'storage::hp::storeonce::restapi::mode::servicesetusage', + ); + + $self->{custom_modes}{api} = 'storage::hp::storeonce::restapi::custom::api'; + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Hp Storeonce through HTTP/REST API. From 8e7fb2b339ebf6ec9004440ab2010324ef8f6810 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 Sep 2016 11:52:23 +0200 Subject: [PATCH 336/346] + Enhance error message --- .../apps/protocols/udp/mode/connection.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/apps/protocols/udp/mode/connection.pm b/centreon-plugins/apps/protocols/udp/mode/connection.pm index 2c12f81da..47ce6af46 100644 --- a/centreon-plugins/apps/protocols/udp/mode/connection.pm +++ b/centreon-plugins/apps/protocols/udp/mode/connection.pm @@ -67,7 +67,11 @@ sub check_options { sub run { my ($self, %options) = @_; - my $icmp_sock = new IO::Socket::INET(Proto=>"icmp"); + my $icmp_sock = new IO::Socket::INET(Proto => "icmp"); + if (!defined($icmp_sock)) { + $self->{output}->add_option_msg(short_msg => "Cannot create socket: $!"); + $self->{output}->option_exit(); + } my $read_set = new IO::Select(); $read_set->add($icmp_sock); @@ -78,7 +82,8 @@ sub run { $sock->send("Hello"); close($sock); - (my $new_readable) = IO::Select->select($read_set, undef, undef, $self->{option_results}->{timeout}); + + my ($new_readable) = IO::Select->select($read_set, undef, undef, $self->{option_results}->{timeout}); my $icmp_arrived = 0; foreach $sock (@$new_readable) { if ($sock == $icmp_sock) { @@ -89,8 +94,8 @@ sub run { close($icmp_sock); if ($icmp_arrived == 1) { - $self->{output}->output_add(severity => 'CRITICAL', - short_msg => sprintf("Connection failed on port %s", $self->{option_results}->{port})); + $self->{output}->output_add(severity => 'CRITICAL', + short_msg => sprintf("Connection failed on port %s", $self->{option_results}->{port})); } else { $self->{output}->output_add(severity => 'OK', short_msg => sprintf("Connection success on port %s", $self->{option_results}->{port})); From d66a69d80eba396dc773f31160d754d47db5c110 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 Sep 2016 15:28:02 +0200 Subject: [PATCH 337/346] + Fix #490 --- .../hardware/printers/standard/rfc3805/mode/markersupply.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm index 94662b888..a8ce3512b 100644 --- a/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm +++ b/centreon-plugins/hardware/printers/standard/rfc3805/mode/markersupply.pm @@ -103,8 +103,8 @@ sub run { my $current_value = $result2->{$oid_prtMarkerSuppliesLevel . '.' . $instance}; my $max_value = $result2->{$oid_prtMarkerSuppliesMaxCapacity . '.' . $instance}; - if (!defined($unit_managed{$unit})) { - $self->{output}->output_add(long_msg => "Skipping marker supply '$descr': unit not managed."); + if (!defined($unit) || !defined($unit_managed{$unit})) { + $self->{output}->output_add(long_msg => "Skipping marker supply '$descr': no unit or not managed."); next; } if ($current_value == -1) { From 921b83c5d23bf1c4847865ca22eebcc4d1a749d4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 Sep 2016 15:44:03 +0200 Subject: [PATCH 338/346] + Fix command for root user --- .../storage/hp/storeonce/ssh/mode/components/hardware.pm | 2 +- .../storage/hp/storeonce/ssh/mode/components/serviceset.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm index 4c86dd885..904d1ee0b 100644 --- a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm +++ b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/hardware.pm @@ -65,7 +65,7 @@ sub check { $self->{components}->{hardware} = {name => 'hardwares', total => 0, skip => 0}; return if ($self->check_filter(section => 'hardware')); - return if ($self->{result} !~ />\s*hardware show status details(.*?)\n>/msi); + return if ($self->{result} !~ /[>#]\s*hardware show status details(.*?)\n[>#]/msi); my $content = $1; while ($content =~ /^(\S+[^\n]*?)\n\s+(.*?)\n\s*?\n/msgi) { diff --git a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm index a6d44aac1..d66455694 100644 --- a/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm +++ b/centreon-plugins/storage/hp/storeonce/ssh/mode/components/serviceset.pm @@ -56,7 +56,7 @@ sub check { $self->{components}->{serviceset} = {name => 'service sets', total => 0, skip => 0}; return if ($self->check_filter(section => 'serviceset')); - return if ($self->{result} !~ />\s*serviceset show status(.*?)\n>/msi); + return if ($self->{result} !~ /[>#]\s*serviceset show status(.*?)\n[>#]/msi); my $content = $1; while ($content =~ /^Service Set (\d+).*?\n(.*?)\n\s*?\n/msgi) { From 95a028fb30eafa7486f8c5043171f844cc2c4ca5 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 12 Sep 2016 16:39:17 +0200 Subject: [PATCH 339/346] + Ref #468 (WIP) --- .../standard/snmp/mode/components/card.pm | 67 ++++++++ .../standard/snmp/mode/components/entity.pm | 69 ++++++++ .../standard/snmp/mode/components/fan.pm | 78 +++++++++ .../standard/snmp/mode/components/psu.pm | 66 ++++++++ .../snmp/mode/components/resources.pm | 68 ++++++++ .../snmp/mode/components/temperature.pm | 70 ++++++++ .../network/nortel/standard/snmp/mode/cpu.pm | 155 ++++++++++++++++++ .../nortel/standard/snmp/mode/hardware.pm | 138 ++++++++++++++++ .../network/nortel/standard/snmp/plugin.pm | 52 ++++++ 9 files changed, 763 insertions(+) create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/card.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/entity.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/fan.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/psu.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/resources.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/components/temperature.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/cpu.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/hardware.pm create mode 100644 centreon-plugins/network/nortel/standard/snmp/plugin.pm diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/card.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/card.pm new file mode 100644 index 000000000..bb1169a40 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/card.pm @@ -0,0 +1,67 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::card; + +use strict; +use warnings; +use network::nortel::standard::snmp::mode::components::resources qw($map_card_status); + +my $mapping = { + rcCardSerialNumber => { oid => '.1.3.6.1.4.1.2272.1.4.9.1.1.3' }, + rcCardOperStatus => { oid => '.1.3.6.1.4.1.2272.1.4.9.1.1.6', map => $map_card_status }, +}; +my $oid_rcCardEntry = '.1.3.6.1.4.1.2272.1.4.9.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_rcCardEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking cards"); + $self->{components}->{card} = {name => 'cards', total => 0, skip => 0}; + return if ($self->check_filter(section => 'card')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rcCardEntry}})) { + next if ($oid !~ /^$mapping->{rcCardOperStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rcCardEntry}, instance => $instance); + + next if ($self->check_filter(section => 'card', instance => $instance)); + $self->{components}->{card}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("card '%s' status is '%s' [instance: %s].", + $result->{rcCardSerialNumber}, $result->{rcCardOperStatus}, + $instance + )); + my $exit = $self->get_severity(section => 'card', instance => $instance, value => $result->{rcCardOperStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Card '%s' status is '%s'", + $result->{rcCardSerialNumber}, $result->{rcCardOperStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/entity.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/entity.pm new file mode 100644 index 000000000..69096e850 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/entity.pm @@ -0,0 +1,69 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::entity; + +use strict; +use warnings; +use network::nortel::standard::snmp::mode::components::resources qw($map_comp_status); + +my $mapping = { + s5ChasComDescr => { oid => '.1.3.6.1.4.1.45.1.6.3.3.1.1.5' }, + s5ChasComOperState => { oid => '.1.3.6.1.4.1.45.1.6.3.3.1.1.10', map => $map_comp_status }, +}; +my $oid_s5ChasComEntry = '.1.3.6.1.4.1.45.1.6.3.3.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_s5ChasComEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking entities"); + $self->{components}->{entity} = {name => 'entities', total => 0, skip => 0}; + return if ($self->check_filter(section => 'entity')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_s5ChasComEntry}})) { + next if ($oid !~ /^$mapping->{s5ChasComOperState}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_s5ChasComEntry}, instance => $instance); + + next if ($self->check_filter(section => 'entity', instance => $instance)); + $self->{components}->{entity}->{total}++; + + my $name = defined($result->{s5ChasComDescr}) && $result->{s5ChasComDescr} ne '' ? + $result->{s5ChasComDescr} : $instance; + $self->{output}->output_add(long_msg => sprintf("entity '%s' status is '%s' [instance: %s].", + $name, $result->{s5ChasComOperState}, + $instance + )); + my $exit = $self->get_severity(section => 'entity', instance => $instance, value => $result->{s5ChasComOperState}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Entity '%s' status is '%s'", + $name, $result->{s5ChasComOperState})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/fan.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/fan.pm new file mode 100644 index 000000000..645bf4101 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/fan.pm @@ -0,0 +1,78 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::fan; + +use strict; +use warnings; +use network::nortel::standard::snmp::mode::components::resources qw($map_fan_status); + +my $mapping = { + rcChasFanOperStatus => { oid => '.1.3.6.1.4.1.2272.1.4.7.1.1.2', map => $map_fan_status }, + rcChasFanAmbientTemperature => { oid => '.1.3.6.1.4.1.2272.1.4.7.1.1.3' }, +}; +my $oid_rcChasFanEntry = '.1.3.6.1.4.1.2272.1.4.7.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_rcChasFanEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking fans"); + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; + return if ($self->check_filter(section => 'fan')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rcChasFanEntry}})) { + next if ($oid !~ /^$mapping->{rcChasFanOperStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rcChasFanEntry}, instance => $instance); + + next if ($self->check_filter(section => 'fan', instance => $instance)); + $self->{components}->{fan}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance: %s, value: %s].", + $instance, $result->{rcChasFanOperStatus}, + $instance, $result->{rcChasFanAmbientTemperature} + )); + my $exit = $self->get_severity(section => 'fan', instance => $instance, value => $result->{rcChasFanOperStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Fan '%s' status is '%s'", + $instance, $result->{rcChasFanOperStatus})); + } + + my ($exit2, $warn, $crit) = $self->get_severity_numeric(section => 'fan.temperature', instance => $instance, value => $result->{rcChasFanAmbientTemperature}); + if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit2, + short_msg => sprintf("Fan temperature '%s' is %s degree centigrade", $instance, $result->{rcChasFanAmbientTemperature})); + } + $self->{output}->perfdata_add(label => 'fan_temp_' . $instance, unit => 'C', + value => $result->{rcChasFanAmbientTemperature}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/psu.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/psu.pm new file mode 100644 index 000000000..e7b8ce7ce --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/psu.pm @@ -0,0 +1,66 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::psu; + +use strict; +use warnings; +use network::nortel::standard::snmp::mode::components::resources qw($map_psu_status); + +my $mapping = { + rcChasPowerSupplyOperStatus => { oid => '.1.3.6.1.4.1.2272.1.4.8.1.1.2', map => $map_psu_status }, +}; +my $oid_rcChasPowerSupplyEntry = '.1.3.6.1.4.1.2272.1.4.8.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_rcChasPowerSupplyEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking power supplies"); + $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; + return if ($self->check_filter(section => 'psu')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rcChasPowerSupplyEntry}})) { + next if ($oid !~ /^$mapping->{rcChasPowerSupplyOperStatus}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rcChasPowerSupplyEntry}, instance => $instance); + + next if ($self->check_filter(section => 'psu', instance => $instance)); + $self->{components}->{psu}->{total}++; + + $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance: %s].", + $instance, $result->{rcChasPowerSupplyOperStatus}, + $instance + )); + my $exit = $self->get_severity(section => 'psu', instance => $instance, value => $result->{rcChasPowerSupplyOperStatus}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Power supply '%s' status is '%s'", + $instance, $result->{rcChasPowerSupplyOperStatus})); + } + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/resources.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/resources.pm new file mode 100644 index 000000000..7b22e15e7 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/resources.pm @@ -0,0 +1,68 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::resources; + +use strict; +use warnings; +use Exporter; + +our ($map_comp_status, $map_fan_status, $map_psu_status, $map_card_status); + +our @ISA = qw(Exporter); +our @EXPORT_OK = qw($map_comp_status $map_fan_status $map_psu_status $map_card_status); + +$map_fan_status = { + 1 => 'unknown', + 2 => 'up', + 3 => 'down', +}; + +$map_psu_status = { + 1 => 'unknown', + 2 => 'empty', + 3 => 'up', + 4 => 'down', +}; + +$map_card_status = { + 1 => 'up', + 2 => 'down', + 3 => 'testing', + 4 => 'unknown', + 5 => 'dormant', +}; + +$map_comp_status = { + 1 => 'other', + 2 => 'notAvail', + 3 => 'removed', + 4 => 'disabled', + 5 => 'normal', + 6 => 'resetInProg', + 7 => 'testing', + 8 => 'warning', + 9 => 'nonFatalErr', + 10 => 'fatalErr', + 11 => 'notConfig', + 12 => 'obsoleted', +}; + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/components/temperature.pm b/centreon-plugins/network/nortel/standard/snmp/mode/components/temperature.pm new file mode 100644 index 000000000..9f9543183 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/components/temperature.pm @@ -0,0 +1,70 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::components::temperature; + +use strict; +use warnings; + +my $mapping = { + s5ChasTmpSnrTmpValue => { oid => '.1.3.6.1.4.1.45.1.6.3.7.1.1.5' }, +}; +my $oid_s5ChasTmpSnrEntry = '.1.3.6.1.4.1.45.1.6.3.7.1.1'; + +sub load { + my ($self) = @_; + + push @{$self->{request}}, { oid => $oid_s5ChasTmpSnrEntry }; +} + +sub check { + my ($self) = @_; + + $self->{output}->output_add(long_msg => "Checking temperatures"); + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; + return if ($self->check_filter(section => 'temperature')); + + foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_s5ChasTmpSnrEntry}})) { + next if ($oid !~ /^$mapping->{s5ChasTmpSnrTmpValue}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_s5ChasTmpSnrEntry}, instance => $instance); + + next if ($self->check_filter(section => 'temperature', instance => $instance)); + $self->{components}->{temperature}->{total}++; + + $result->{s5ChasTmpSnrTmpValue} = sprintf("%.2f", $result->{s5ChasTmpSnrTmpValue} / 2); + $self->{output}->output_add(long_msg => sprintf("temperature '%s' is %s degree centigrade [instance = %s]", + $instance, $result->{s5ChasTmpSnrTmpValue}, $instance, + )); + + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{s5ChasTmpSnrTmpValue}); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Temperature '%s' is %s degree centigrade", $result->{slHdwTempSensorName}, $result->{s5ChasTmpSnrTmpValue})); + } + $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => 'C', + value => $result->{s5ChasTmpSnrTmpValue}, + warning => $warn, + critical => $crit, + ); + } +} + +1; \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/cpu.pm b/centreon-plugins/network/nortel/standard/snmp/mode/cpu.pm new file mode 100644 index 000000000..b82b8d28b --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/cpu.pm @@ -0,0 +1,155 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::cpu; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'cpu', type => 1, cb_prefix_output => 'prefix_cpu_output', message_multiple => 'All CPU usages are ok', skipped_code => { -10 => 1 } } + ]; + + $self->{maps_counters}->{cpu} = [ + { label => 'total', set => { + key_values => [ { name => 'total' }, { name => 'num' } ], + output_template => 'Total CPU Usage : %.2f %%', + perfdatas => [ + { label => 'cpu_total', value => 'total_absolute', template => '%.2f', min => 0, max => 100, unit => '%', + label_extra_instance => 1, instance_use => 'num_absolute' }, + ], + } + }, + { label => '1m', set => { + key_values => [ { name => '1m' }, { name => 'num' } ], + output_template => '1 minute : %.2f %%', + perfdatas => [ + { label => 'cpu_1min', value => '1m_absolute', template => '%.2f', + min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'num_absolute' }, + ], + } + }, + { label => '10m', set => { + key_values => [ { name => '10m' }, { name => 'num' } ], + output_template => '10 minutes : %.2f %%', + perfdatas => [ + { label => 'cpu_10min', value => '10m_absolute', template => '%.2f', + min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'num_absolute' }, + ], + } + }, + { label => '1h', set => { + key_values => [ { name => '1h' }, { name => 'num' } ], + output_template => '1 hour : %.2f %%', + perfdatas => [ + { label => 'cpu_1h', value => '1h_absolute', template => '%.2f', + min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'num_absolute' }, + ], + } + }, + ]; +} + +sub prefix_cpu_output { + my ($self, %options) = @_; + + return "CPU '" . $options{instance_value}->{num} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +my $mapping = { + s5ChasUtilTotalCPUUsage => { oid => '.1.3.6.1.4.1.45.1.6.3.8.1.1.4' }, + s5ChasUtilCPUUsageLast1Minute => { oid => '.1.3.6.1.4.1.45.1.6.3.8.1.1.5' }, + s5ChasUtilCPUUsageLast10Minutes => { oid => '.1.3.6.1.4.1.45.1.6.3.8.1.1.6' }, + s5ChasUtilCPUUsageLast1Hour => { oid => '.1.3.6.1.4.1.45.1.6.3.8.1.1.7' }, +}; + +my $oid_rcSysCpuUtil = '.1.3.6.1.4.1.2272.1.1.20'; # without .0 +my $oid_s5ChasUtilEntry = '.1.3.6.1.4.1.45.1.6.3.8.1.1'; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{results} = $options{snmp}->get_multiple_table(oids => [ + { oid => $oid_rcSysCpuUtil }, + { oid => $oid_s5ChasUtilEntry }, + ], nothing_quit => 1); + + $self->{cpu} = {}; + foreach my $oid (keys %{$self->{results}->{$oid_s5ChasUtilEntry}}) { + next if ($oid !~ /^$mapping->{s5ChasUtilTotalCPUUsage}->{oid}\.(.*)$/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_s5ChasUtilEntry}, instance => $instance); + + $self->{cpu}->{$instance} = { num => $instance, total => $result->{s5ChasUtilTotalCPUUsage}, + '1m' => $result->{s5ChasUtilCPUUsageLast1Minute}, '10m' => $result->{s5ChasUtilCPUUsageLast10Minutes}, + '1h' => $result->{s5ChasUtilCPUUsageLast1Hour} }; + } + + if (scalar(keys %{$self->{results}->{$oid_rcSysCpuUtil}}) > 0) { + $self->{cpu}->{0} = { num => 0, total => $self->{results}->{$oid_rcSysCpuUtil}->{$oid_rcSysCpuUtil . '.0'} }; + } +} + +1; + +__END__ + +=head1 MODE + +Check CPU usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^(1m|10m)$' + +=item B<--warning-*> + +Threshold warning. +Can be: 'total', '1m', '5m', '10m', '1h'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'total', '1m', '5m', '10m', '1h'. + +=back + +=cut diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/hardware.pm b/centreon-plugins/network/nortel/standard/snmp/mode/hardware.pm new file mode 100644 index 000000000..f74465860 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/hardware.pm @@ -0,0 +1,138 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::hardware; + +use base qw(centreon::plugins::templates::hardware); + +use strict; +use warnings; + +sub set_system { + my ($self, %options) = @_; + + $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|card|entity)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan.temperature)$'; + + $self->{cb_hook2} = 'snmp_execute'; + + $self->{thresholds} = { + fan => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ], + psu => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ['empty', 'OK'], + ], + card => [ + ['up', 'OK'], + ['down', 'CRITICAL'], + ['unknown', 'UNKNOWN'], + ['testing', 'OK'], + ['dormant', 'OK'], + ], + entity => [ + ['other', 'UNKNOWN'], + ['notAvail', 'OK'], + ['removed', 'OK'], + ['disabled', 'OK'], + ['normal', 'OK'], + ['resetInProg', 'OK'], + ['testing', 'OK'], + ['warning', 'WARNING'], + ['nonFatalErr', 'WARNING'], + ['fatalErr', 'CRITICAL'], + ['notConfig', 'OK'], + ['obsoleted', 'WARNING'], + ], + }; + + $self->{components_path} = 'network::nortel::standard::snmp::mode::components'; + $self->{components_module} = ['fan', 'psu', 'card', 'entity']; +} + +sub snmp_execute { + my ($self, %options) = @_; + + $self->{snmp} = $options{snmp}; + $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check hardware. + +=over 8 + +=item B<--component> + +Which component to check (Default: '.*'). +Can be: 'fan', 'psu', 'card', 'entity'. + +=item B<--filter> + +Exclude some parts (comma seperated list) (Example: --filter=psu) +Can also exclude specific instance: --filter=psu,1 + +=item B<--no-component> + +Return an error if no compenents are checked. +If total (with skipped) is 0. (Default: 'critical' returns). + +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,[instance,]status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='entity,WARNING,disabled' + +=item B<--warning> + +Set warning threshold (syntax: type,regexp,threshold) +Example: --warning='temperature,.*,30' --warning=fan.temperature,.*,10 + +=item B<--critical> + +Set critical threshold (syntax: type,regexp,threshold) +Example: --critical='temperature,.*,40' + +=back + +=cut \ No newline at end of file diff --git a/centreon-plugins/network/nortel/standard/snmp/plugin.pm b/centreon-plugins/network/nortel/standard/snmp/plugin.pm new file mode 100644 index 000000000..225edd25e --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/plugin.pm @@ -0,0 +1,52 @@ +# +# Copyright 2016 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::nortel::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' => 'network::nortel::standard::snmp::mode::cpu', + 'hardware' => 'network::nortel::standard::snmp::mode::hardware', + 'interfaces' => 'snmp_standard::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Nortel switch/routers in SNMP. +Can be used for avaya equipments also. + +=cut From 9af27e0b1796e256217be494e9336e1321c69941 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 10:45:10 +0200 Subject: [PATCH 340/346] + fix hp-ux cpu threshold --- centreon-plugins/os/hpux/snmp/mode/cpu.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/os/hpux/snmp/mode/cpu.pm b/centreon-plugins/os/hpux/snmp/mode/cpu.pm index 426885d78..baba0bc0b 100644 --- a/centreon-plugins/os/hpux/snmp/mode/cpu.pm +++ b/centreon-plugins/os/hpux/snmp/mode/cpu.pm @@ -36,7 +36,7 @@ sub set_counters { { label => 'user', set => { key_values => [ { name => 'total', diff => 1 }, { name => 'user', diff => 1 } ], closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'user' }, - output_template => 'User %.2f %%', output_use => 'user_prct', + output_template => 'User %.2f %%', output_use => 'user_prct', threshold_use => 'user_prct', perfdatas => [ { label => 'user', value => 'user_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, ], @@ -45,7 +45,7 @@ sub set_counters { { label => 'sys', set => { key_values => [ { name => 'total', diff => 1 }, { name => 'sys', diff => 1 } ], closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'sys' }, - output_template => 'System %.2f %%', output_use => 'sys_prct', + output_template => 'System %.2f %%', output_use => 'sys_prct', threshold_use => 'sys_prct', perfdatas => [ { label => 'sys', value => 'sys_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, ], @@ -54,7 +54,7 @@ sub set_counters { { label => 'nice', set => { key_values => [ { name => 'total', diff => 1 }, { name => 'nice', diff => 1 } ], closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'nice' }, - output_template => 'Nice %.2f %%', output_use => 'nice_prct', + output_template => 'Nice %.2f %%', output_use => 'nice_prct', threshold_use => 'nice_prct', perfdatas => [ { label => 'nice', value => 'nice_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, ], @@ -63,7 +63,7 @@ sub set_counters { { label => 'idle', set => { key_values => [ { name => 'total', diff => 1 }, { name => 'idle', diff => 1 } ], closure_custom_calc => $self->can('custom_data_calc'), closure_custom_calc_extra_options => { label_ref => 'idle' }, - output_template => 'Idle %.2f %%', output_use => 'idle_prct', + output_template => 'Idle %.2f %%', output_use => 'idle_prct', threshold_use => 'idle_prct', perfdatas => [ { label => 'idle', value => 'idle_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, ], From 6b02bac75f010f3c64486b631e4d6d899a96e3cd Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 11:15:04 +0200 Subject: [PATCH 341/346] + Fix #468 --- .../nortel/standard/snmp/mode/memory.pm | 107 ++++++++++++++++++ .../network/nortel/standard/snmp/plugin.pm | 1 + 2 files changed, 108 insertions(+) create mode 100644 centreon-plugins/network/nortel/standard/snmp/mode/memory.pm diff --git a/centreon-plugins/network/nortel/standard/snmp/mode/memory.pm b/centreon-plugins/network/nortel/standard/snmp/mode/memory.pm new file mode 100644 index 000000000..eb0160521 --- /dev/null +++ b/centreon-plugins/network/nortel/standard/snmp/mode/memory.pm @@ -0,0 +1,107 @@ +# +# Copyright 2016 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::nortel::standard::snmp::mode::memory; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'memory', type => 1, cb_prefix_output => 'prefix_memory_output', message_multiple => 'All memory usages are ok' } + ]; + + $self->{maps_counters}->{memory} = [ + { label => 'usage', set => { + key_values => [ { name => 'used' }, { name => 'display' } ], + output_template => 'Used : %.2f %%', + perfdatas => [ + { label => 'used', value => 'used_absolute', template => '%.2f', min => 0, max => 100, unit => '%', + label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub prefix_memory_output { + my ($self, %options) = @_; + + return "Memory '" . $options{instance_value}->{display} . "' "; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +my $mapping = { + s5ChasUtilMemoryAvailable => { oid => '.1.3.6.1.4.1.45.1.6.3.8.1.1.9' }, +}; + +sub manage_selection { + my ($self, %options) = @_; + + $self->{memory} = {}; + $self->{results} = $options{snmp}->get_table(oid => $mapping->{s5ChasUtilMemoryAvailable}->{oid}, + nothing_quit => 1); + foreach my $oid (keys %{$self->{results}}) { + next if ($oid !~ /^$mapping->{s5ChasUtilMemoryAvailable}->{oid}\.(.*)/); + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); + + $self->{memory}->{$instance} = { display => $instance, + used => 100 - $result->{s5ChasUtilMemoryAvailable}}; + } +} + +1; + +__END__ + +=head1 MODE + +Check memory usages. + +=over 8 + +=item B<--warning-usage> + +Threshold warning (in percent). + +=item B<--critical-usage> + +Threshold critical (in percent). + +=back + +=cut diff --git a/centreon-plugins/network/nortel/standard/snmp/plugin.pm b/centreon-plugins/network/nortel/standard/snmp/plugin.pm index 225edd25e..5d64bc2e9 100644 --- a/centreon-plugins/network/nortel/standard/snmp/plugin.pm +++ b/centreon-plugins/network/nortel/standard/snmp/plugin.pm @@ -35,6 +35,7 @@ sub new { 'hardware' => 'network::nortel::standard::snmp::mode::hardware', 'interfaces' => 'snmp_standard::mode::interfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'memory' => 'network::nortel::standard::snmp::mode::memory', ); return $self; From a4b1beb4f0ec223bc99231a20e25c05a449c04fa Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 15:07:42 +0200 Subject: [PATCH 342/346] + Fix division by zero --- .../centreon/common/emc/navisphere/mode/disk.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm index a5bf080e5..3971afccc 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/disk.pm @@ -81,7 +81,11 @@ sub custom_utils_calc { my $diff_busy = $options{new_datas}->{$self->{instance} . '_busy_ticks'} - $options{old_datas}->{$self->{instance} . '_busy_ticks'}; my $diff_idle = $options{new_datas}->{$self->{instance} . '_idle_ticks'} - $options{old_datas}->{$self->{instance} . '_idle_ticks'}; - + + if (($diff_busy + $diff_idle) == 0) { + $self->{error_msg} = "wait new values"; + return -3; + } $self->{result_values}->{utils} = $diff_busy * 100 / ($diff_busy + $diff_idle); $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; return 0; From f3bd0f59957f975e13ea942b9befb9d25d3d7a18 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 15:24:04 +0200 Subject: [PATCH 343/346] + upde hp storeonce restapi --- .../hp/storeonce/restapi/custom/api.pm | 2 +- .../hp/storeonce/restapi/mode/clusterusage.pm | 297 ++++++++++++++++++ .../hp/storeonce/restapi/mode/fcsusage.pm | 235 ++++++++++++++ .../storeonce/restapi/mode/servicesetusage.pm | 34 +- .../storage/hp/storeonce/restapi/plugin.pm | 2 + 5 files changed, 557 insertions(+), 13 deletions(-) create mode 100644 centreon-plugins/storage/hp/storeonce/restapi/mode/clusterusage.pm create mode 100644 centreon-plugins/storage/hp/storeonce/restapi/mode/fcsusage.pm diff --git a/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm b/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm index ebdc6155f..ebec97e7f 100644 --- a/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm +++ b/centreon-plugins/storage/hp/storeonce/restapi/custom/api.pm @@ -141,7 +141,7 @@ sub get { critical_status => '', warning_status => ''); my $content; eval { - $content = XMLin($response); + $content = XMLin($response, ForceArray => $options{ForceArray}); }; if ($@) { $self->{output}->add_option_msg(short_msg => "Cannot decode xml response: $@"); diff --git a/centreon-plugins/storage/hp/storeonce/restapi/mode/clusterusage.pm b/centreon-plugins/storage/hp/storeonce/restapi/mode/clusterusage.pm new file mode 100644 index 000000000..6a5086a27 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/restapi/mode/clusterusage.pm @@ -0,0 +1,297 @@ +# +# Copyright 2016 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::hp::storeonce::restapi::mode::clusterusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{health}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{health} = $options{new_datas}->{$self->{instance} . '_health'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub custom_usage_perfdata { + my ($self, %options) = @_; + + my $label = 'used'; + my $value_perf = $self->{result_values}->{used}; + if (defined($instance_mode->{option_results}->{free})) { + $label = 'free'; + $value_perf = $self->{result_values}->{free}; + } + my $extra_label = ''; + $extra_label = '_' . $self->{result_values}->{display} if (!defined($options{extra_instance}) || $options{extra_instance} != 0); + my %total_options = (); + if ($instance_mode->{option_results}->{units} eq '%') { + $total_options{total} = $self->{result_values}->{total}; + $total_options{cast_int} = 1; + } + + $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'B', + value => $value_perf, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options), + min => 0, max => $self->{result_values}->{total}); +} + +sub custom_usage_threshold { + my ($self, %options) = @_; + + my ($exit, $threshold_value); + $threshold_value = $self->{result_values}->{used}; + $threshold_value = $self->{result_values}->{free} if (defined($instance_mode->{option_results}->{free})); + if ($instance_mode->{option_results}->{units} eq '%') { + $threshold_value = $self->{result_values}->{prct_used}; + $threshold_value = $self->{result_values}->{prct_free} if (defined($instance_mode->{option_results}->{free})); + } + $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]); + return $exit; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); + my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); + my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); + my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", + $total_size_value . " " . $total_size_unit, + $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, + $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); + return $msg; +} + +sub custom_usage_calc { + my ($self, %options) = @_; + + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; + $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; + $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; + $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; + $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; + + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'cluster', type => 1, cb_prefix_output => 'prefix_cluster_output', message_multiple => 'All clusters are ok' } + ]; + + $self->{maps_counters}->{cluster} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'health' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], + closure_custom_calc => $self->can('custom_usage_calc'), + closure_custom_output => $self->can('custom_usage_output'), + closure_custom_perfdata => $self->can('custom_usage_perfdata'), + closure_custom_threshold_check => $self->can('custom_usage_threshold'), + } + }, + { label => 'dedup', set => { + key_values => [ { name => 'dedup' }, { name => 'display' } ], + output_template => 'Dedup Ratio : %.2f', + perfdatas => [ + { label => 'dedup_ratio', value => 'dedup_absolute', template => '%.2f', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, + "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_cluster_output { + my ($self, %options) = @_; + + return "Cluster '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %mapping_health_level = ( + 0 => 'unknown', + 1 => 'ok', + 2 => 'information', + 3 => 'warning', + 4 => 'critical', +); + +sub manage_selection { + my ($self, %options) = @_; + + $self->{cluster} = {}; + my $result = $options{custom}->get(path => '/cluster', ForceArray => ['cluster']); + if (defined($result->{cluster})) { + foreach my $entry (@{$result->{cluster}}) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $entry->{properties}->{applianceName} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $entry->{properties}->{applianceName} . "': no matching filter.", debug => 1); + next; + } + + $self->{cluster}->{$entry->{properties}->{serialNumber}} = { + display => $entry->{properties}->{applianceName}, + health => $mapping_health_level{$entry->{properties}->{healthLevel}}, + total => $entry->{properties}->{capacity} * 1024 * 1024 * 1024, # GB + used => ($entry->{properties}->{capacity} - $entry->{properties}->{freeSpace}) * 1024 * 1024 * 1024, # GB + dedup => $entry->{properties}->{dedupeRatio} }; + } + } + + if (scalar(keys %{$self->{cluster}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No cluster found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check cluster usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter cluster name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{health} =~ /warning/). +Can used special variables like: %{health}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{health} =~ /critical/'). +Can used special variables like: %{health}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage', 'dedup'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage', 'dedup'. + +=item B<--units> + +Units of thresholds (Default: '%') ('%', 'B'). + +=item B<--free> + +Thresholds are on free space left. + +=back + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/restapi/mode/fcsusage.pm b/centreon-plugins/storage/hp/storeonce/restapi/mode/fcsusage.pm new file mode 100644 index 000000000..621fd26c9 --- /dev/null +++ b/centreon-plugins/storage/hp/storeonce/restapi/mode/fcsusage.pm @@ -0,0 +1,235 @@ +# +# Copyright 2016 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::hp::storeonce::restapi::mode::fcsusage; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_status_output { + my ($self, %options) = @_; + + my $msg = 'status : ' . $self->{result_values}->{health}; + return $msg; +} + +sub custom_status_calc { + my ($self, %options) = @_; + + $self->{result_values}->{health} = $options{new_datas}->{$self->{instance} . '_health'}; + $self->{result_values}->{is_online} = $options{new_datas}->{$self->{instance} . '_is_online'}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'fcs', type => 1, cb_prefix_output => 'prefix_fcs_output', message_multiple => 'All federated catalyst stores are ok' } + ]; + + $self->{maps_counters}->{fcs} = [ + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'is_online' }, { name => 'health' }, { name => 'display' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + { label => 'usage', set => { + key_values => [ { name => 'used' }, { name => 'display' } ], + output_template => 'Used : %s %s', + output_change_bytes => 1, + perfdatas => [ + { label => 'used', value => 'used_absolute', template => '%s', + unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'dedup', set => { + key_values => [ { name => 'dedup' }, { name => 'display' } ], + output_template => 'Dedup Ratio : %.2f', + perfdatas => [ + { label => 'dedup_ratio', value => 'dedup_absolute', template => '%.2f', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + { label => 'items', set => { + key_values => [ { name => 'num_items' }, { name => 'display' } ], + output_template => 'Num Items : %s', + perfdatas => [ + { label => 'items', value => 'num_items_absolute', template => '%s', + min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, + ], + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' }, + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub prefix_fcs_output { + my ($self, %options) = @_; + + return "Federated catalyst store '" . $options{instance_value}->{display} . "' "; +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } +} + +my %mapping_health_level = ( + 0 => 'unknown', + 1 => 'ok', + 2 => 'information', + 3 => 'warning', + 4 => 'critical', +); + +sub manage_selection { + my ($self, %options) = @_; + + $self->{fcs} = {}; + my $result = $options{custom}->get(path => '/cluster/servicesets/*all*/teaming/services/cat/stores', ForceArray => ['store']); + if (defined($result->{stores}->{store})) { + foreach my $entry (@{$result->{stores}->{store}}) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $entry->{properties}->{name} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $entry->{properties}->{name} . "': no matching filter.", debug => 1); + next; + } + + $self->{fcs}->{$entry->{properties}->{id}} = { + display => $entry->{properties}->{name}, + health => $mapping_health_level{$entry->{properties}->{healthLevel}}, + is_online => $entry->{properties}->{isOnline} eq 'true' ? 1 : 0, + used => $entry->{properties}->{diskBytes}, + dedup => $entry->{properties}->{dedupeRatio}, + num_items => $entry->{properties}->{numItems} }; + } + } + + if (scalar(keys %{$self->{fcs}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No federated catalyst store found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check federated catalyst store usages. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--filter-name> + +Filter name (can be a regexp). + +=item B<--warning-status> + +Set warning threshold for status (Default: '%{is_online} == 1 and %{health} =~ /warning/i'). +Can used special variables like: %{health}, %{is_online}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{is_online} == 1 and %{health} =~ /critical/i'). +Can used special variables like: %{health}, %{is_online}, %{display} + +=item B<--warning-*> + +Threshold warning. +Can be: 'usage', 'dedup', 'items'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'usage', 'dedup', 'items'. + +=back + +=cut diff --git a/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm b/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm index 680c5729b..f18079799 100644 --- a/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm +++ b/centreon-plugins/storage/hp/storeonce/restapi/mode/servicesetusage.pm @@ -54,14 +54,15 @@ sub custom_status_threshold { sub custom_status_output { my ($self, %options) = @_; - my $msg = 'status : ' . $self->{result_values}->{status}; + my $msg = 'status : ' . $self->{result_values}->{health}; return $msg; } sub custom_status_calc { my ($self, %options) = @_; - - $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; + + $self->{result_values}->{health} = $options{new_datas}->{$self->{instance} . '_health'}; + $self->{result_values}->{housekeeping_health} = $options{new_datas}->{$self->{instance} . '_housekeeping_health'}; $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; return 0; } @@ -139,7 +140,7 @@ sub set_counters { $self->{maps_counters}->{scs} = [ { label => 'status', threshold => 0, set => { - key_values => [ { name => 'status' }, { name => 'display' } ], + key_values => [ { name => 'health' }, { name => 'housekeeping_health' }, { name => 'display' } ], closure_custom_calc => $self->can('custom_status_calc'), closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, @@ -176,8 +177,8 @@ sub new { $options{options}->add_options(arguments => { "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /^(?!(running)$)/i' }, + "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, + "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, "units:s" => { name => 'units', default => '%' }, "free" => { name => 'free' }, }); @@ -209,11 +210,19 @@ sub change_macros { } } +my %mapping_health_level = ( + 0 => 'unknown', + 1 => 'ok', + 2 => 'information', + 3 => 'warning', + 4 => 'critical', +); + sub manage_selection { my ($self, %options) = @_; $self->{scs} = {}; - my $result = $options{custom}->get(path => '/cluster/servicesets'); + my $result = $options{custom}->get(path => '/cluster/servicesets', ForceArray => ['serviceset']); if (defined($result->{servicesets}->{serviceset})) { foreach my $entry (@{$result->{servicesets}->{serviceset}}) { if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && @@ -224,7 +233,8 @@ sub manage_selection { $self->{scs}->{$entry->{properties}->{ssid}} = { display => $entry->{properties}->{alias}, - status => $entry->{properties}->{status}, + health => $mapping_health_level{$entry->{properties}->{healthLevel}}, + housekeeping_health => $mapping_health_level{$entry->{properties}->{housekeepingHealthLevel}}, total => $entry->{properties}->{capacityBytes}, used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes}, dedup => $entry->{properties}->{dedupeRatio} }; @@ -258,13 +268,13 @@ Filter service set name (can be a regexp). =item B<--warning-status> -Set warning threshold for status (Default: -). -Can used special variables like: %{status}, %{display} +Set warning threshold for status (Default: '%{health} =~ /warning/). +Can used special variables like: %{health}, %{housekeeping_health}, %{display} =item B<--critical-status> -Set critical threshold for status (Default: '%{status} =~ /^(?!(running)$)/'). -Can used special variables like: %{status}, %{display} +Set critical threshold for status (Default: '%{health} =~ /critical/'). +Can used special variables like: %{health}, %{housekeeping_health}, %{display} =item B<--warning-*> diff --git a/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm b/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm index 3cc9e4817..9ed7fa1d3 100644 --- a/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm +++ b/centreon-plugins/storage/hp/storeonce/restapi/plugin.pm @@ -31,6 +31,8 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( + 'cluster-usage' => 'storage::hp::storeonce::restapi::mode::clusterusage', + 'fcs-usage' => 'storage::hp::storeonce::restapi::mode::fcsusage', 'serviceset-usage' => 'storage::hp::storeonce::restapi::mode::servicesetusage', ); From 0c5b6ae8b8302fdf307f50ae2b93e8663b754e04 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 16:40:38 +0200 Subject: [PATCH 344/346] + update regex --- .../centreon/common/emc/navisphere/mode/hbastate.pm | 2 +- .../centreon/common/emc/navisphere/mode/portstate.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm index 3870a8cf3..4cb719d17 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/hbastate.pm @@ -98,7 +98,7 @@ sub check_hba { my $not_logged = 0; my $logged = 0; - while ($hba_infos =~ /(SP Name:.*?)\n\n/msig) { + while ($hba_infos =~ /(SP Name:.*?)(\n\n|\Z)/msig) { my $port_infos = $1; # Not in good section diff --git a/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm b/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm index 517f3c340..6a01c8327 100644 --- a/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm +++ b/centreon-plugins/centreon/common/emc/navisphere/mode/portstate.pm @@ -52,7 +52,7 @@ sub check_port { if ($self->{response} =~ /Information about each SPPORT:(.*)/msi) { my $port_infos = $1; - while ($port_infos =~ /(SP Name:.*?)\n\n/msig) { + while ($port_infos =~ /(SP Name:.*?)(\n\n|\Z)/msig) { my $port_infos = $1; # Not in good section From 61465484418af80b905377f99f641871b036a4d3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 14 Sep 2016 14:58:36 +0200 Subject: [PATCH 345/346] + enhance cisco asa failover mode (WIP) --- .../network/cisco/asa/mode/failover.pm | 188 +++++++++++++++--- 1 file changed, 157 insertions(+), 31 deletions(-) diff --git a/centreon-plugins/network/cisco/asa/mode/failover.pm b/centreon-plugins/network/cisco/asa/mode/failover.pm index 48df71ae8..b38fe66d3 100644 --- a/centreon-plugins/network/cisco/asa/mode/failover.pm +++ b/centreon-plugins/network/cisco/asa/mode/failover.pm @@ -20,33 +20,97 @@ package network::cisco::asa::mode::failover; -use base qw(centreon::plugins::mode); +use base qw(centreon::plugins::templates::counter); use strict; use warnings; +use Digest::MD5 qw(md5_hex); -my %map_failover = ( - 1 => 'other', - 2 => 'up', # for '.4' index - 3 => 'down', # can be - 4 => 'error', # maybe - 5 => 'overTemp', - 6 => 'busy', - 7 => 'noMedia', - 8 => 'backup', - 9 => 'active', # can be - 10 => 'standby' # can be -); +my $instance_mode; + +sub custom_status_threshold { + my ($self, %options) = @_; + my $status = 'ok'; + my $message; + + eval { + local $SIG{__WARN__} = sub { $message = $_[0]; }; + local $SIG{__DIE__} = sub { $message = $_[0]; }; + + if (defined($instance_mode->{option_results}->{critical_status}) && $instance_mode->{option_results}->{critical_status} ne '' && + eval "$instance_mode->{option_results}->{critical_status}") { + $status = 'critical'; + } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && + eval "$instance_mode->{option_results}->{warning_status}") { + $status = 'warning'; + } + }; + if (defined($message)) { + $self->{output}->output_add(long_msg => 'filter status issue: ' . $message); + } + + return $status; +} + +sub custom_change_output { + my ($self, %options) = @_; + + my $msg = sprintf("Primary unit is '%s' [details: '%s'], Secondary unit is '%s' [details : '%s']", + $self->{result_values}->{primaryState}, $self->{result_values}->{primaryDetails}, + $self->{result_values}->{secondaryState}, $self->{result_values}->{secondaryDetails}); + return $msg; +} + +sub custom_change_calc { + my ($self, %options) = @_; + + $self->{result_values}->{primaryStateLast} = $options{old_datas}->{$self->{instance} . '_primary_state'}; + $self->{result_values}->{primaryState} = $options{new_datas}->{$self->{instance} . '_primary_state'}; + $self->{result_values}->{secondaryStateLast} = $options{old_datas}->{$self->{instance} . '_secondary_state'}; + $self->{result_values}->{secondaryState} = $options{new_datas}->{$self->{instance} . '_secondary_state'}; + $self->{result_values}->{primaryDetails} = $options{new_datas}->{$self->{instance} . '_primary_details'}; + $self->{result_values}->{secondaryDetails} = $options{new_datas}->{$self->{instance} . '_secondary_details'}; + return 0; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'global', type => 0, message_separator => ' - ' }, + ]; + + $self->{maps_counters}->{global} = [ + { label => 'active-units', set => { + key_values => [ { name => 'active_units' } ], + output_template => 'Active units : %s', + perfdatas => [ + { label => 'active_units', value => 'active_units_absolute', template => '%s', + min => 0, max => 2 }, + ], + } + }, + { label => 'status', threshold => 0, set => { + key_values => [ { name => 'primary_state', diff => 1 }, { name => 'secondary_state', diff => 1 }, { name => 'primary_details' }, { name => 'secondary_details' } ], + closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_output => $self->can('custom_status_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => $self->can('custom_status_threshold'), + } + }, + ]; +} sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "dont-warn-notstandby" => { name => 'dont_warn_notstandby' }, + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '' }, }); return $self; @@ -54,7 +118,20 @@ sub new { sub check_options { my ($self, %options) = @_; - $self->SUPER::init(%options); + $self->SUPER::check_options(%options); + + $instance_mode = $self; + $self->change_macros(); +} + +sub change_macros { + my ($self, %options) = @_; + + foreach (('warning_status', 'critical_status')) { + if (defined($self->{option_results}->{$_})) { + $self->{option_results}->{$_} =~ s/%\{(.*?)\}/\$self->{result_values}->{$1}/g; + } + } } sub run { @@ -63,20 +140,9 @@ sub run { my $active_units = 0; my $exit = 'ok'; - # primary is '.6' index and secondary is '.7' index (it's like that. '.4' is the global interface) - my $oid_cfwHardwareStatusValue_primary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.3.6'; - my $oid_cfwHardwareStatusValue_secondary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.3.7'; - my $oid_cfwHardwareStatusDetail_primary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.4.6'; - my $oid_cfwHardwareStatusDetail_secondary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.4.7'; - my $result = $self->{snmp}->get_leef(oids => [$oid_cfwHardwareStatusValue_primary, $oid_cfwHardwareStatusValue_secondary, - $oid_cfwHardwareStatusDetail_primary, $oid_cfwHardwareStatusDetail_secondary], nothing_quit => 1); - if ($result->{$oid_cfwHardwareStatusValue_primary} == 9 || $result->{$oid_cfwHardwareStatusValue_primary} == 10 ) { - $active_units++; - } - if ($result->{$oid_cfwHardwareStatusValue_secondary} == 9 || $result->{$oid_cfwHardwareStatusValue_secondary} == 10 ) { - $active_units++; - } + + if ($active_units == 0) { $exit = 'critical'; } elsif ($active_units == 1 && !defined($self->{option_results}->{dont_warn_notstandby})) { @@ -97,6 +163,45 @@ sub run { $self->{output}->exit(); } +my %map_failover = ( + 1 => 'other', + 2 => 'up', # for '.4' index + 3 => 'down', # can be + 4 => 'error', # maybe + 5 => 'overTemp', + 6 => 'busy', + 7 => 'noMedia', + 8 => 'backup', + 9 => 'active', # can be + 10 => 'standby' # can be +); + +sub manage_selection { + my ($self, %options) = @_; + + $self->{global} = {}; + + # primary is '.6' index and secondary is '.7' index (it's like that. '.4' is the global interface) + my $oid_cfwHardwareStatusValue_primary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.3.6'; + my $oid_cfwHardwareStatusValue_secondary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.3.7'; + my $oid_cfwHardwareStatusDetail_primary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.4.6'; + my $oid_cfwHardwareStatusDetail_secondary = '.1.3.6.1.4.1.9.9.147.1.2.1.1.1.4.7'; + my $result = $options{snmp}->get_leef(oids => [$oid_cfwHardwareStatusValue_primary, $oid_cfwHardwareStatusValue_secondary, + $oid_cfwHardwareStatusDetail_primary, $oid_cfwHardwareStatusDetail_secondary], nothing_quit => 1); + + $self->{global}->{primary_state} = $map_failover{$result->{$oid_cfwHardwareStatusValue_primary}}; + $self->{global}->{primary_details} = $result->{$oid_cfwHardwareStatusDetail_primary}; + $self->{global}->{secondary_state} = $map_failover{$result->{$oid_cfwHardwareStatusValue_secondary}}; + $self->{global}->{secondary_details} = $result->{$oid_cfwHardwareStatusDetail_secondary}; + my $active_units = 0; + $active_units++ if ($result->{$oid_cfwHardwareStatusValue_primary} == 9 || $result->{$oid_cfwHardwareStatusValue_primary} == 10); + $active_units++ if ($result->{$oid_cfwHardwareStatusValue_secondary} == 9 || $result->{$oid_cfwHardwareStatusValue_secondary} == 10); + $self->{global}->{active_units} = $active_units; + + $self->{cache_name} = "cisco_asa_" . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); +} + 1; __END__ @@ -107,9 +212,30 @@ Check failover status on Cisco ASA (CISCO-UNIFIED-FIREWALL-MIB). =over 8 -=item B<--dont-warn-notstandby> +=item B<--filter-counters> -Don't return warning if a unit is active and the other unit is not in standby status. +Only display some counters (regexp can be used). +Example: --filter-counters='^status$' + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} + +=item B<--critical-status> + +Set critical threshold for status. +Can used special variables like: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} + +=item B<--warning-*> + +Threshold warning. +Can be: 'active-units'. + +=item B<--critical-*> + +Threshold critical. +Can be: 'active-units'. =back From cdcd68c43efaa78bf6cef2ae5f2d97b0bac72355 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 14 Sep 2016 16:26:52 +0200 Subject: [PATCH 346/346] + Fix failover asa mode --- .../network/cisco/asa/mode/failover.pm | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/centreon-plugins/network/cisco/asa/mode/failover.pm b/centreon-plugins/network/cisco/asa/mode/failover.pm index b38fe66d3..74e5ad9ff 100644 --- a/centreon-plugins/network/cisco/asa/mode/failover.pm +++ b/centreon-plugins/network/cisco/asa/mode/failover.pm @@ -52,7 +52,7 @@ sub custom_status_threshold { return $status; } -sub custom_change_output { +sub custom_status_output { my ($self, %options) = @_; my $msg = sprintf("Primary unit is '%s' [details: '%s'], Secondary unit is '%s' [details : '%s']", @@ -61,7 +61,7 @@ sub custom_change_output { return $msg; } -sub custom_change_calc { +sub custom_status_calc { my ($self, %options) = @_; $self->{result_values}->{primaryStateLast} = $options{old_datas}->{$self->{instance} . '_primary_state'}; @@ -91,7 +91,7 @@ sub set_counters { } }, { label => 'status', threshold => 0, set => { - key_values => [ { name => 'primary_state', diff => 1 }, { name => 'secondary_state', diff => 1 }, { name => 'primary_details' }, { name => 'secondary_details' } ], + key_values => [ { name => 'primary_state' }, { name => 'secondary_state' }, { name => 'primary_details' }, { name => 'secondary_details' } ], closure_custom_calc => $self->can('custom_status_calc'), closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, @@ -134,35 +134,6 @@ sub change_macros { } } -sub run { - my ($self, %options) = @_; - $self->{snmp} = $options{snmp}; - - my $active_units = 0; - my $exit = 'ok'; - - - - if ($active_units == 0) { - $exit = 'critical'; - } elsif ($active_units == 1 && !defined($self->{option_results}->{dont_warn_notstandby})) { - # No redundant interface - $exit = 'warning'; - } - - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Primary unit is '%s' [details: '%s'], Secondary unit is '%s' [details : '%s']", - $map_failover{$result->{$oid_cfwHardwareStatusValue_primary}}, $result->{$oid_cfwHardwareStatusDetail_primary}, - $map_failover{$result->{$oid_cfwHardwareStatusValue_secondary}}, $result->{$oid_cfwHardwareStatusDetail_secondary})); - - $self->{output}->perfdata_add(label => "active_units", - value => $active_units, - min => 0, max => 2); - - $self->{output}->display(); - $self->{output}->exit(); -} - my %map_failover = ( 1 => 'other', 2 => 'up', # for '.4' index